?? window.java
字號:
package com.ejsun.entapps.presentation.components.window;
import java.util.HashMap;
import java.util.Map;
import org.apache.tapestry.ApplicationRuntimeException;
import org.apache.tapestry.BaseComponent;
import org.apache.tapestry.IEngine;
import org.apache.tapestry.IMarkupWriter;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.IResourceLocation;
import org.apache.tapestry.IScript;
import org.apache.tapestry.engine.IScriptSource;
import org.apache.tapestry.html.Body;
/**
* @author Quake Wang
* @since 2004-4-8
* @version $Revision: 1.1 $
*
**/
public abstract class Window extends BaseComponent {
private Map _symbols;
private IScript _script;
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) {
// Don't do any additional work if rewinding
// (some other action or form on the page).
if (!cycle.isRewinding()) {
_symbols = new HashMap(1);
runScript(cycle);
}
super.renderComponent(writer, cycle);
}
private void runScript(IRequestCycle cycle) {
// Get the script, if not already gotten. Scripts are re-entrant, so it is
// safe to share this between instances of Window.
if (_script == null) {
IEngine engine = getPage().getEngine();
IScriptSource source = engine.getScriptSource();
IResourceLocation scriptLocation =
getSpecification()
.getSpecificationLocation()
.getRelativeLocation(
"Window.script");
_script = source.getScript(scriptLocation);
}
Body body = Body.get(cycle);
if (body == null)
throw new ApplicationRuntimeException(
"Window component must be wrapped by a Body.",
this,
null,
null);
_symbols.put("id", this.getId());
_script.execute(cycle, body, _symbols);
}
protected void cleanupAfterRender(IRequestCycle cycle) {
_symbols = null;
super.cleanupAfterRender(cycle);
}
public Map getSymbols() {
return _symbols;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -