Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.Execution


   * @since 5.0.0
   */
  public static final String outDeviceJavaScripts(ServletContext ctx,
   HttpServletRequest request, HttpServletResponse response,
   String deviceType) {
     Execution old = Executions.getCurrent();
     Execution exec = new ExecutionImpl(ctx, request, response, null, null);
    ExecutionsCtrl.setCurrent(exec);
     ((ExecutionCtrl)exec).onActivate();
    try {
      return HtmlPageRenders.outLangJavaScripts(exec,
        WebManager.getWebManager(ctx).getWebApp(),
View Full Code Here


   *
   * @return the string holding the HTML tags, or null if already generated.
   * @param deviceType the device type. If null, ajax is assumed.
   */
   public static String outZkHtmlTags(String deviceType) {
     Execution exec = Executions.getCurrent();
     if (exec != null)
       return HtmlPageRenders.outZkTags(exec, null, null);

     return JspFns.outZkHtmlTags(
      ServletFns.getCurrentServletContext(),
View Full Code Here

   *
   * <p>This method is used for DSP pages.
   * @param deviceType the device type. If null, ajax is assumed.
   */
  public static final String outDeviceStyleSheets(String deviceType) {
    final Execution exec = Executions.getCurrent();
     if (exec != null)
      return HtmlPageRenders.outLangStyleSheets(exec, null, null);

     return JspFns.outDeviceStyleSheets(
      ServletFns.getCurrentServletContext(),
View Full Code Here

  /** Returns HTML tags to include JavaScript files of the specified
   * device for the current application (never null).
   * @since 5.0.0
   */
  public static final String outDeviceJavaScripts(String deviceType) {
    final Execution exec = Executions.getCurrent();
     if (exec != null)
      return HtmlPageRenders.outLangJavaScripts(exec, null, null);

     return JspFns.outDeviceJavaScripts(
      ServletFns.getCurrentServletContext(),
View Full Code Here

      if (getCurrent() == null) //no scope allowed
        return getImplicit(name);

      if (_firstGet) {
        _firstGet = false;
        final Execution exec = Executions.getCurrent();
        if (exec != null) {
          Object val = exec.getAttribute(name);
          if (val != null /*||exec.hasAttribute(name)*/) //exec not support hasAttribute
            return val;
        }
      }

View Full Code Here

      if (curr== null)
        return getImplicit(name); //ignore scope

      if (_firstGet) {
        _firstGet = false;
        final Execution exec = Executions.getCurrent();
        if (exec != null && exec != curr) {
          Object val = exec.getAttribute(name);
          if (val != null /*||exec.hasAttribute(name)*/) //exec not support hasAttribute
            return val;
        }

        //_scope is the nearest IdSpace so it might not be curr
View Full Code Here

      locale = Locales.getCurrent();

    final StringBuffer sb = new StringBuffer(4096);
    final Locale oldl = Locales.setThreadLocal(locale);
    try {
      final Execution exec = Executions.getCurrent();
      sb.append(loadJS(exec, "~./js/zk/lang/msgzk*.js"));
      sb.append(Wpds.outLocaleJavaScript());
      sb.append(loadJS(exec, "~./js/zul/lang/msgzul*.js"));
    } finally {
      Locales.setThreadLocal(oldl);
View Full Code Here

    subscribe(listener, null, async);
  }
  private void
  subscribe(EventListener listener, EventListener callback, boolean async) {
    if (async && _nAsync++ == 0) {
      final Execution exec = Executions.getCurrent();
      if (exec == null)
        throw new IllegalStateException("Execution required");
      _serverPushEnabled = !exec.getDesktop().enableServerPush(true);
    }
    _listeners.add(new ListenerInfo(listener, callback, async));
  }
View Full Code Here

    subscribe(listener, null, async);
  }
  private void subscribe(EventListener listener, EventListener callback, boolean async) {
    if (listener == null)
      throw new IllegalArgumentException();
    final Execution exec = Executions.getCurrent();
    if (exec == null)
      throw new IllegalStateException("execution required");

    final Desktop desktop = exec.getDesktop();
    synchronized (_dts) {
      boolean startRequired = false;
      DesktopThread dtthd = (DesktopThread)_dts.get(desktop);
      if (dtthd == null) {
        desktop.addListener(new EQCleanup());
View Full Code Here

  }
  public boolean isSubscribed(EventListener listener) {
    if (listener == null)
      return false;

    final Execution exec = Executions.getCurrent();
    if (exec == null)
      throw new IllegalStateException("execution required");

    final Desktop desktop = exec.getDesktop();
    synchronized (_dts) {
      DesktopThread dtthd = (DesktopThread)_dts.get(desktop);
      return dtthd != null && dtthd.isSubscribed(listener);
    }
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zk.ui.Execution

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.