Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.Page


  }

  public Page newPage(RequestInfo ri, Richlet richlet, String path) {
    final ServletRequest request = (ServletRequest) ri.getNativeRequest();
    if (request.getAttribute(DESKTOP_REUSE) != null) {
      final Page page = (Page) ri.getDesktop().getPages().iterator().next();
      if (page instanceof ReusablePage) {
        ((ReusablePage)page).setReuse(true);
        return page;
      } else {
        throw new IllegalStateException("Should be a ReuseablePage: "+page);
View Full Code Here


public class TypePropertyEditor extends ClassEditor {
  public void setAsText(String text) {
    if (text.indexOf('.') < 0 && Character.isLowerCase(text.charAt(0))) {
      final Execution exec = Executions.getCurrent();
      if (exec != null) {
        final Page page = ((ExecutionCtrl)exec).getCurrentPage();
        final ComponentDefinition cd = page.getComponentDefinition(text, true);
        if (cd != null) {
          setAsText0(cd);
          return;
        }
      } else {
View Full Code Here

 
  private static void storeFlowContextInPages(Execution exec) {
    final Desktop desktop = exec.getDesktop();
    final Collection pages= desktop.getPages();
    for (final Iterator it = pages.iterator(); it.hasNext();) {
      final Page page = (Page) it.next();
      page.setAttribute(FLOW_ID, exec.getAttribute(FLOW_ID));
      page.setAttribute(FLOW_EXECUTION_KEY, exec.getAttribute(FLOW_EXECUTION_KEY));
      page.setAttribute(FLOW_REQUEST_URI, exec.getAttribute(FLOW_REQUEST_URI));
      page.setAttribute(RequestContextELResolver.REQUEST_CONTEXT_VARIABLE_NAME,
          exec.getAttributes().get(RequestContextELResolver.REQUEST_CONTEXT_VARIABLE_NAME));
    }
  }
View Full Code Here

      String eventName = srcevt + "." + srccompid;
      Object srcCompBean = SpringUtil.getBean(srccompid);
      if(srcCompBean == null) {
        srcCompBean  = comp.getAttributeOrFellow(srccompid, true);
        if (srcCompBean == null) {
          Page page = comp.getPage();
          if (page != null)
            srcCompBean = page.getXelVariable(null, null, srccompid, true);
        }
      }
      if(srcCompBean == null || !(srcCompBean instanceof Component))
        continue;
     
View Full Code Here

      public void removeAttribute(Session session, String name) {
        session.removeAttribute(name);
      }

      public Component getSelf(ExecutionCtrl exec) {
                final Page page = exec.getCurrentPage();
                final Scope scope = Scopes.getCurrent(page);
                if (scope != null) {
                        Object o = scope.getAttribute("self", false);
                        if(o instanceof Component) {
                                Component self = (Component) o;
View Full Code Here

        ((ServletRequest)exec.getNativeRequest()).setAttribute(name, value);
        //can't access setAttribute directly, since signature of ZK 5 changed
      }

      public Component getSelf(ExecutionCtrl exec) {
        final Page page = exec.getCurrentPage();
        final Scope scope = Scopes.getCurrent(page);
        if (scope != null) {
          Component self = (Component) scope.getAttribute("self", true);
          //since ZK 3.6.1, event handling, use getImplicit()
          if (self == null) {
View Full Code Here

    if (exec != null) {
      final String path = getPath();
      if (path != null && path.startsWith("/")) { //absolute path
        return Path.getComponent(path);
      } else {
        final Page page = ((ExecutionCtrl)exec).getCurrentPage();
        if (page != null){
          final Component self = (Component) page.getAttribute("self");
          if (self != null) { //loading page
            if (Components.isImplicit(getBeanName())) {
              return Components.getImplicit(self, getBeanName());
            }
            if (path == null) {
View Full Code Here

    return _afterCompose;
  }

  private boolean hasBoundListeners(Object applied) {
    if (applied instanceof Page) {
      final Page applied0 = (Page) applied;
      if (applied0.getAttribute(BIND_EVENTLISTNERS) == null) {
        applied0.setAttribute(BIND_EVENTLISTNERS, Boolean.TRUE);
        return false;
      }
    } else if (applied instanceof Component) {
      final Component applied0 = (Component) applied;
      if (applied0.getAttribute(BIND_EVENTLISTNERS) == null) {
        applied0.setAttribute(BIND_EVENTLISTNERS, Boolean.TRUE);
        return false;
      }
    }
    return true;
  }
View Full Code Here

      for (final Iterator it = listeners.iterator(); it.hasNext();) {
        final EventListener listener = (EventListener) it.next();
        target0.addEventListener(evtname, listener);
      }
    } else if (target instanceof Page) {
      final Page target0 = (Page) target;
      for (final Iterator it = listeners.iterator(); it.hasNext();) {
        final EventListener listener = (EventListener) it.next();
        target0.addEventListener(evtname, listener);
      }
    }
  }
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.getAttributeOrFellow(name, true);
      }
      if (result == null && page != null) {
        result = page.getXelVariable(null, null, name, true);
      }

      return result;
    }
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.