/** Default constructor. * It is the same as <code>PageRenderer(Executions.getCurrent())</code>. */ public PageRenderer() { this(Executions.getCurrent(), false); }
activate(desktop, 0);
final Map<String, Object> arg = new HashMap<String, Object>(); arg.put("message", message); arg.put("title", title != null ? title : Executions.getCurrent().getDesktop().getWebApp().getAppName()); arg.put("icon", icon); arg.putAll(params); final MessageboxDlg dlg = (MessageboxDlg) Executions.createComponents(_templ, null, arg); dlg.setEventListener(listener); dlg.setButtons(buttons, btnLabels);
public void run() { try { _inf.listener.onEvent(_event); if (_inf.callback != null || _pendingEvents != null) { Executions.activate(_desktop); try { if (_pendingEvents != null) for (T evt : _pendingEvents) _que.publish(evt); if (_inf.callback != null) _inf.callback.onEvent(_event); } finally { Executions.deactivate(_desktop); } } } catch (DesktopUnavailableException ex) { log.warn("", ex); //ignore } catch (Throwable ex) { log.error("", ex); throw UiException.Aide.wrap(ex); } } }
/** * Create the dialog. * * @param parent The parent component. * @param dataObject The data object. * @param title The dialog title. */ public DrillDownDisplay(Component parent, Object dataObject, String title) { super(parent, title); setDataObject(dataObject); setWidth("600px"); try { Executions.createComponents(ZKUtil.loadCachedPageDefinition(Constants.RESOURCE_PREFIX + "drillDownDisplay.zul"), this, null); ZKUtil.wireController(this); adjustGrid(); } catch (Exception e) { log.error("Error creating drilldown display dialog.", e); } }
boolean r = false; try { r = Executions.activate(_desktop, _activateTimeout); } catch (InterruptedException e) { Executions.deactivate(_desktop);
private static int getExecId() { final Execution exec = Executions.getCurrent(); return exec != null ? System.identityHashCode(exec) : 0; }
/** * Returns the render context, or null if not available. The render context is available only if * the ZHTML page is rendered directly (rather than via inclusion). * * @param exec * the execution. If null, Executions.getCurrent() is assumed. */ public static TagRenderContext getTagRenderContext(Execution exec) { if (exec == null) exec = Executions.getCurrent(); return exec != null ? (TagRenderContext) exec.getAttribute(ATTR_RENDER_CONTEXT) : null; }
/** Sends an AU response ({@link AuResponse}) to the client. * It is the same as <code>response(response.getOverrideKey(), response)</code>. * * @since 3.0.0 */ public static final void response(AuResponse response) { Executions.getCurrent().addAuResponse(response); }
/** Queues the give event for the specified target to this execution. * The target could be different from {@link Event#getTarget}. * @param realTarget the target component that will receive the event. * If null, it means broadcast, i.e., all root components will receive * this event. * <br/>Notice that postEvent(n, event) is the same as postEvent(n, event.getTarget(), event), * but different from postEvent(n, 0, event). * @since 5.0.7 */ public static final void postEvent(Component realTarget, Event event) { Executions.getCurrent().postEvent(0, realTarget, event); }
@SuppressWarnings("unchecked") private static Map<String, EntityManager> getEmMap() { Execution current = Executions.getCurrent(); Map map = (Map) current.getAttribute(JPA_EM_MAP); if (map == null) { map = new HashMap(); Executions.getCurrent().setAttribute(JPA_EM_MAP, map); } return map; }
/** Converts the specified URI to absolute if necessary. * Refer to {@link org.zkoss.zk.ui.Execution#toAbsoluteURI}. * * @param skipInclude whether not to convert to an absolute URI if * the current page is included by another page. * When use the include directive, skipInclude shall be true. */ public static String toAbsoluteURI(String uri, boolean skipInclude) { return Executions.getCurrent().toAbsoluteURI(uri, skipInclude); }
public String getLocalName() { Execution execution = Executions.getCurrent(); if (execution != null) return execution.getLocalName(); return null; }
/** Returns the current page. * @since 5.0.10 */ protected Page getPage() { final Execution exec = Executions.getCurrent(); return exec != null ? ((ExecutionCtrl) exec).getCurrentPage() : null; }
public String getRemoteAddr() { Execution execution = Executions.getCurrent(); if (execution != null) return execution.getRemoteAddr(); return null; }
public String getRemoteHost() { Execution execution = Executions.getCurrent(); if (execution != null) return execution.getRemoteHost(); return null; }
public String getLocalAddr() { Execution execution = Executions.getCurrent(); if (execution != null) return execution.getLocalAddr(); return null; }
/** Returns the render context, or null if not available. * It is used to render the content that will appear before the content * generated by {@link ContentRenderer}, such as crawlable content. * * @param exec the execution. If null, {@link Executions#getCurrent} * is assumed. */ public static final RenderContext getRenderContext(Execution exec) { if (exec == null) exec = Executions.getCurrent(); return exec != null ? (RenderContext) exec.getAttribute(ATTR_RENDER_CONTEXT) : null; }
/** Returns whether a component can directly generate HTML tags * to the output. * This flag is used by components that can generate the content * directly, such as {@link org.zkoss.zk.ui.HtmlNativeComponent} * @see #setDirectContent */ public static boolean isDirectContent(Execution exec) { if (exec == null) exec = Executions.getCurrent(); return exec != null && exec.getAttribute(ATTR_DIRECT_CONTENT) != null; }
/** Returns the evaluator of the current execution. * It is a shortcut of getEvaluator(comp != null ? comp.getPage(): null) * * @param comp the component to retrieve the page for the evaluator * @param expfcls the implementation of {@link ExpressionFactory}, * or null to use the default ({@link org.zkoss.zk.ui.util.Configuration#getExpressionFactoryClass}. * @since 3.0.0 */ public static final Evaluator getEvaluator(Component comp, Class<? extends ExpressionFactory> expfcls) { return getCurrent().getEvaluator(comp, expfcls); }