本文整理了Java中org.zkoss.zk.ui.Desktop.getWebApp()
方法的一些代码示例,展示了Desktop.getWebApp()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Desktop.getWebApp()
方法的具体详情如下:
包路径:org.zkoss.zk.ui.Desktop
类名称:Desktop
方法名:getWebApp
[英]Returns the Web application this desktop belongs to.
[中]返回此桌面所属的Web应用程序。
代码示例来源:origin: org.zkoss.zk/zk
public void log(String msg) {
if (_desktop != null)
_desktop.getWebApp().log(msg);
else
_zklog.info(msg);
}
代码示例来源:origin: org.zkoss.zk/zk
private static final UiEngine getUiEngine(Desktop desktop) {
if (desktop == null)
throw new IllegalArgumentException("desktop cannot be null");
return ((WebAppCtrl) desktop.getWebApp()).getUiEngine();
}
代码示例来源:origin: org.zkoss.zk/zk
public void log(String msg, Throwable ex) {
if (_desktop != null)
_desktop.getWebApp().log(msg, ex);
else
_zklog.error(msg, ex);
}
代码示例来源:origin: org.zkoss.zk/zk
/** Returns the UI engine based on {@link #_page}'s getDesktop().
* Don't call this method when _page is null.
*/
private UiEngine getAttachedUiEngine() {
return ((WebAppCtrl) _page.getDesktop().getWebApp()).getUiEngine();
}
代码示例来源:origin: org.zkoss.zk/zkplus
private static WebApp getWebApp() {
WebApp app = null;
final Execution exec = Executions.getCurrent();
if (exec != null) {
final Desktop desktop = exec.getDesktop();
if (desktop != null) {
app = desktop.getWebApp();
}
}
return app;
}
代码示例来源:origin: org.zkoss.zk/zk
private static final UiEngine getUiEngine() {
final Execution exec = getCurrent();
if (exec == null)
throw new IllegalStateException("This method can be called only under an event listener");
return ((WebAppCtrl) exec.getDesktop().getWebApp()).getUiEngine();
}
}
代码示例来源:origin: org.zkoss.zk/zk
public void preInit() {
if (_desktop != null)
throw new IllegalStateException("init twice");
final Execution exec = Executions.getCurrent();
_desktop = exec.getDesktop();
if (_desktop == null)
throw new IllegalArgumentException("null desktop");
_desktop.getWebApp().getConfiguration().init(this);
}
代码示例来源:origin: org.zkoss.zk/zk
/** Returns the UI engine of the current execution, or null
* if no current execution.
*/
private UiEngine getCurrentUiEngine() {
final Execution exec = Executions.getCurrent();
return exec != null ? ((WebAppCtrl) exec.getDesktop().getWebApp()).getUiEngine() : null;
}
代码示例来源:origin: org.zkoss.zk/zkplus
/** Constructor.
* Don't invoke this directly. Rather, use {@link #start} instead.
*/
protected Bridge(ServletContext svlctx, HttpServletRequest request, HttpServletResponse response, Desktop desktop,
Object locale) throws Exception {
_exec = new ExecutionImpl(svlctx, request, response, desktop, null);
_updctx = ((WebAppCtrl) desktop.getWebApp()).getUiEngine().startUpdate(_exec);
_locale = locale;
}
代码示例来源:origin: org.zkoss.zk/zk
public void call(Component host) {
host.getDesktop().getWebApp().getConfiguration().afterShadowDetached(se, host);
}
});
代码示例来源:origin: org.zkoss.zk/zul
private String getRealUpload() {
Desktop desktop = getDesktop();
String upload = getUpload();
if (desktop != null && !Strings.isEmpty(upload) && !upload.contains("maxsize="))
upload = upload.concat(",maxsize=" + desktop.getWebApp().getConfiguration().getMaxUploadSize());
return upload;
}
代码示例来源:origin: org.zkoss.zk/zk
/** Returns the JavaScript codes to disable (a.k.a., stop) the server push.
* It is called by {@link #stopClientPush} to prepare the script
* of {@link AuScript} that will be sent to the client.
*/
protected String getStopScript() {
final String stop = _desktop.getWebApp().getConfiguration().getPreference("PollingServerPush.stop", null);
return stop != null ? stop : "zk.cpsp.stop('" + _desktop.getId() + "');";
}
代码示例来源:origin: org.zkoss.zk/zk
public void init(Page owner, String zslang) {
super.init(owner, zslang);
if (System.getProperty("python.home") == null)
System.setProperty("python.home", System.getProperty("java.io.tmpdir"));
PySystemState.initialize();
PySystemState.add_extdir(owner.getDesktop().getWebApp().getRealPath("/WEB-INF/lib"), true);
PySystemState.add_classdir(owner.getDesktop().getWebApp().getRealPath("/WEB-INF/classes"));
_ip = new PythonInterpreter(new Variables());
}
代码示例来源:origin: org.zkoss.zk/zk
public PageDefinition getPageDefinitionDirectly(String content, String ext) {
//Note: we have to go thru UiFactory (so user can override it)
return ((WebAppCtrl) getDesktop().getWebApp()).getUiFactory().getPageDefinitionDirectly(newRequestInfo(null),
content, ext);
}
代码示例来源:origin: org.zkoss.zk/zk
public PageDefinition getPageDefinitionDirectly(Reader reader, String ext) throws IOException {
//Note: we have to go thru UiFactory (so user can override it)
return ((WebAppCtrl) getDesktop().getWebApp()).getUiFactory().getPageDefinitionDirectly(newRequestInfo(null),
reader, ext);
}
代码示例来源:origin: org.zkoss.zk/zkplus
public HibernateSessionContextListener() {
final WebApp app = Executions.getCurrent().getDesktop().getWebApp();
_enabled = app.getConfiguration().isEventThreadEnabled();
}
代码示例来源:origin: org.zkoss.zk/zk
protected String getSpecialRendererOutput(Component comp) throws IOException {
if (_page != null) {
final JsContentRenderer renderer = new JsContentRenderer();
PropertiesRenderer[] prs = _page.getDesktop().getWebApp().getConfiguration().getPropertiesRenderers();
for (int j = 0; j < prs.length; j++)
prs[j].renderProperties(comp, renderer);
return renderer.getBuffer().toString();
}
return "";
}
代码示例来源:origin: org.zkoss.zk/zk
public void beginUpdate(Execution exec) {
final UiVisualizer uv = doActivate(exec, true, false, null, -1);
final Desktop desktop = exec.getDesktop();
desktop.getWebApp().getConfiguration().invokeExecutionInits(exec, null);
((DesktopCtrl) desktop).invokeExecutionInits(exec, null);
}
代码示例来源:origin: org.zkoss.zk/zul
private boolean isEventThreadEnabled(boolean attachedRequired) {
Desktop desktop = getDesktop();
if (desktop == null) {
if (attachedRequired)
throw new SuspendNotAllowedException("Not attached, " + this);
final Execution exec = Executions.getCurrent();
if (exec == null || (desktop = exec.getDesktop()) == null)
return true; //assume enabled (safer)
}
return desktop.getWebApp().getConfiguration().isEventThreadEnabled();
}
代码示例来源:origin: org.zkoss.zk/zk
public Object startUpdate(Execution exec) throws IOException {
final Desktop desktop = exec.getDesktop();
UiVisualizer uv = doActivate(exec, true, false, null, -1);
desktop.getWebApp().getConfiguration().invokeExecutionInits(exec, null);
((DesktopCtrl) desktop).invokeExecutionInits(exec, null);
return new UpdateInfo(uv);
}
内容来源于网络,如有侵权,请联系作者删除!