Examples of ExecutionCtrl


Examples of org.zkoss.zk.ui.sys.ExecutionCtrl

  /** Returns the component definition of the specified class, or null
   * if not found.
   */
  private static ComponentDefinition getDefinition(Execution exec, Class cls) {
    if (exec != null) {
      final ExecutionCtrl execCtrl = (ExecutionCtrl)exec;
      final PageDefinition pgdef = execCtrl.getCurrentPageDefinition();
      final Page page = execCtrl.getCurrentPage();

      final ComponentDefinition compdef =
        pgdef != null ? pgdef.getComponentDefinition(cls, true):
        page != null ?   page.getComponentDefinition(cls, true): null;
      if (compdef != null && compdef.getLanguageDefinition() != null)
View Full Code Here

Examples of org.zkoss.zk.ui.sys.ExecutionCtrl

    _def = compdef;
  }
  public void setDefinition(String name) {
    final Execution exec = Executions.getCurrent();
    if (exec != null) {
      final ExecutionCtrl execCtrl = (ExecutionCtrl)exec;
      final PageDefinition pgdef = execCtrl.getCurrentPageDefinition();
      final Page page = execCtrl.getCurrentPage();

      ComponentDefinition compdef =
        pgdef != null ? pgdef.getComponentDefinition(name, true):
        page != null ?   page.getComponentDefinition(name, true): null;
      if (compdef == null)
View Full Code Here

Examples of org.zkoss.zk.ui.sys.ExecutionCtrl

          }
        }
      }
      if (_id2uuidPrefix != null) {
        if (_id2uuidPageOfs >= 0) {
          final ExecutionCtrl execCtrl = (ExecutionCtrl)Executions.getCurrent();
          if (execCtrl != null) {
            final Page page = execCtrl.getCurrentPage();
            if (page != null)
              return _id2uuidPrefix + page.getId() + _id2uuidPrefix2 + id;
          }
        }
        return _id2uuidPrefix + id;
View Full Code Here

Examples of org.zkoss.zk.ui.sys.ExecutionCtrl

      return; //done

    final Thread thd = (Thread)Thread.currentThread();
    if (!(thd instanceof EventProcessingThread)) {
      if (!desktop.getWebApp().getConfiguration().isEventThreadEnabled()) {
        final ExecutionCtrl execCtrl = (ExecutionCtrl)exec;
        final Page page = execCtrl.getCurrentPage();
        final EventProcessor proc =
          new EventProcessor(desktop, comp, event);
        proc.setup();
        try {
          proc.process();
        } catch (Exception ex) {
          throw UiException.Aide.wrap(ex);
        } finally {
          execCtrl.setCurrentPage(page);
        }
        return; //done
      }

      throw new UiException("Callable only in the event listener");
View Full Code Here

Examples of org.zkoss.zk.ui.sys.ExecutionCtrl

  /** Carry over the info stored in the constructor to
   * the current thread.
   */
  public void carryOver() {
    ExecutionsCtrl.setCurrent(_exec);
    final ExecutionCtrl execCtrl = (ExecutionCtrl)_exec;
    execCtrl.onActivate();

    if (Locales.getThreadLocal() == null)
      Locales.setThreadLocal(_locale);
    else
      _locale = null;

    if (TimeZones.getThreadLocal() == null)
      TimeZones.setThreadLocal(_timeZone);
    else
      _timeZone = null;

    final Page page = _exec.getDesktop().getFirstPage();
    if (page != null)
      execCtrl.setCurrentPage(page);
  }
View Full Code Here

Examples of org.zkoss.zk.ui.sys.ExecutionCtrl

   */
  public FunctionMapper getFunctionMapper(Object ref) {
    if (ref instanceof Component)
      ref = ((Component)ref).getPage();
    if (ref == null) {
      ExecutionCtrl execCtrl = ExecutionsCtrl.getCurrentCtrl();
      if (execCtrl != null)
        ref = execCtrl.getCurrentPage();
    }
    return DualFunctionMapper.combine(
      ref instanceof Page ? ((Page)ref).getFunctionMapper(): null,
      _mapper);
  }
View Full Code Here

Examples of org.zkoss.zk.ui.sys.ExecutionCtrl

      if (ex != null) {
        errs.clear(); //to avoid ZK handle it
       
        //pop all left events away, so they will not be processed
        ExecutionCtrl exectrl = (ExecutionCtrl) Executions.getCurrent();
        List evts = new ArrayList();
        do {
          evts.add(evt);
          evt = exectrl.getNextEvent();
        } while(evt != null);
        ZKProxy.getProxy().setAttribute((Execution)exectrl, ZkAuthenticationEntryPoint.EVENTS, evts);
        doExceptionTranslationFiltering(ex);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.