Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.Page


      // TODO: get component instance from bean manager
      // try EL resolver or check any api/spi interface
      Object srccomp = xcomp.getAttributeOrFellow(srccompid, true);
      if (srccomp == null) {
        Page page = xcomp.getPage();
        if (page != null)
          srccomp = page.getXelVariable(null, null, srccompid, true);
      }
      if (srccomp == null || !(srccomp instanceof Component)) {
        log.debug("Cannot find the associated component to forward event: "
                + mdname);
      } else {
View Full Code Here


 
  /**VariableResolver to handle model's variable **/
  private class InnerVariableResolver implements VariableResolver,Serializable{
    private static final long serialVersionUID = 1L;
    public Object resolveVariable(String name) throws XelException {
      Page page = getPage();
      Object result = null;
      if(page!=null){
        result = page.getZScriptVariable(Spreadsheet.this, name);
      }
      if(result==null){
        result = Spreadsheet.this.getVariable(name, false);
      }
     
View Full Code Here

  }
 
  private class InnerFunctionMapper implements FunctionMapper,Serializable{
    private static final long serialVersionUID = 1L;
    public Collection getClassNames() {
      Page page = getPage();
      if(page!=null){
        return page.getFunctionMapper().getClassNames();
      }
      return null;
    }
View Full Code Here

        return page.getFunctionMapper().getClassNames();
      }
      return null;
    }
    public Class resolveClass(String name) throws XelException {
      Page page = getPage();
      if(page!=null){
        return page.getFunctionMapper().resolveClass(name);
      }
      return null;
    }
View Full Code Here

        return page.getFunctionMapper().resolveClass(name);
      }
      return null;
    }
    public Function resolveFunction(String prefix, String name) throws XelException {
      Page page = getPage();
      if(page!=null){
        return page.getFunctionMapper().resolveFunction(prefix,name);
      }
      return null;
    }
View Full Code Here

  /** Returns the main page of the desktop.
   * It assumes there is at most one main page (that is, a page without owner)
   */
  /*package*/ static Page getMainPage(Desktop desktop) {
    for (Iterator it = desktop.getPages().iterator(); it.hasNext();) {
      final Page page = (Page)it.next();
      if (((PageCtrl)page).getOwner() == null)
        return page;
    }
    return null;
  }
View Full Code Here

public class ShowWindowEventListener implements EventListener {
  public void onEvent(Event event) {
    //fetch old Event stored in Session and post again
    final Component comp = event.getTarget();
   
    final Page page = comp.getPage();
    final String url = (String) event.getData();
    final Execution exec = Executions.getCurrent();
    try {
      doModal(page, url);
      } finally {
View Full Code Here

public class ShowWindowEventListener implements EventListener {
  public void onEvent(Event event) {
    //fetch old Event stored in Session and post again
    final Component comp = event.getTarget();
   
    final Page page = comp.getPage();
    final String url = (String) event.getData();
    final Execution exec = Executions.getCurrent();
    try {
      doModal(page, url);
      } finally {
View Full Code Here

    } finally {
      Scopes.afterInterpret();
    }
  }
  private void process0(Scope scope) throws Exception {
    final Page page = getPage();
    if (page == null || !page.isAlive()) {
      String msg = (page == null ? "No page is available in "+_desktop: "Page "+page+" was destroyed");
      if (_desktop.isAlive())
        msg += " (but desktop is alive)";
      else
        msg += " because desktop was destroyed.\n"
        +"It is usually caused by invalidating the native session directly. "
        +"If it is required, please set Attributes.RENEW_NATIVE_SESSION first.";
      log.warning(msg);
    }

    final String evtnm = _event.getName();
    final Set listenerCalled = new HashSet();
      //OK to use Set since the same listener cannot be added twice
    boolean retry = false;
    for (Iterator it = _comp.getListenerIterator(evtnm);;) {
      final EventListener el = nextListener(it);
      if (el == null) {
        break; //done

      } else if (el == RETRY) {
        retry = true;
        it = _comp.getListenerIterator(evtnm);

      } else if ((el instanceof Express)
      && (!retry || !listenerCalled.contains(el))) {
        listenerCalled.add(el);

        el.onEvent(_event);
        if (!_event.isPropagatable())
          return; //done
      }
    }

    final ZScript zscript = ((ComponentCtrl)_comp).getEventHandler(evtnm);
    if (zscript != null && page != null) {
      page.interpret(
        zscript.getLanguage(), zscript.getContent(page, _comp), scope);
      if (!_event.isPropagatable())
        return; //done
    }

    retry = false;
    listenerCalled.clear();
    for (Iterator it = _comp.getListenerIterator(evtnm);;) {
      final EventListener el = nextListener(it);
      if (el == null) {
        break; //done

      } else if (el == RETRY) {
        retry = true;
        it = _comp.getListenerIterator(evtnm);

      } else if (!(el instanceof Express)
      && (!retry || !listenerCalled.contains(el))) {
        listenerCalled.add(el);

        el.onEvent(_event);
        if (!_event.isPropagatable())
          return; //done
      }
    }

    final Method mtd =
      ComponentsCtrl.getEventMethod(_comp.getClass(), evtnm);
    if (mtd != null) {
//      if (log.finerable()) log.finer("Method for event="+evtnm+" comp="+_comp+" method="+mtd);

      if (mtd.getParameterTypes().length == 0)
        mtd.invoke(_comp, null);
      else
        mtd.invoke(_comp, new Object[] {_event});
      if (!_event.isPropagatable())
        return; //done
    }

    retry = false;
    listenerCalled.clear();
    if (page != null)
      for (Iterator it = page.getListenerIterator(evtnm);;) {
        final EventListener el = nextListener(it);
        if (el == null) {
          break; //done
        } else if (el == RETRY) {
          retry = true;
          it = page.getListenerIterator(evtnm);
        } else if (!retry || !listenerCalled.contains(el)) {
          listenerCalled.add(el);

          el.onEvent(_event);
          if (!_event.isPropagatable())
View Full Code Here

    ExecutionsCtrl.setCurrent(null);
    SessionsCtrl.setCurrent((Session)null);
  }

  private Page getPage() {
    final Page page = _comp.getPage();
    if (page != null)
      return page;

    return _desktop.getFirstPage();
  }
View Full Code Here

TOP

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

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.