Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.Desktop


    if (_invalidated.add(comp))
      _smartUpdated.remove(comp);
  }
  /** Ensure the use of component is correct. */
  private void checkDesktop(Component comp) {
    final Desktop dt = comp.getDesktop();
    if (dt != null && dt != _exec.getDesktop())
      throw new IllegalStateException("Access denied: component, "+comp+", belongs to another desktop: "+dt);
  }
View Full Code Here


  /** Prepares {@link #_pgRemoved} to contain set of pages that will
   * be removed.
   */
  private void checkPageRemoved(Set removed) {
    //1. scan once
    final Desktop desktop = _exec.getDesktop();
    Set pages = null;
    for (Iterator it = desktop.getPages().iterator(); it.hasNext();) {
      final Page page = (Page)it.next();
      final Component owner = ((PageCtrl)page).getOwner();
      if (owner != null) { //included
        final Page ownerPage = owner.getPage();
        if (ownerPage == null //detached
View Full Code Here

    final WebAppCtrl wappc = (WebAppCtrl)wapp;
    final Object old = I18Ns.setup(sess, request, response,
      wapp.getConfiguration().getResponseCharset());
    Execution exec = null;
    try {
      final Desktop desktop = webman.getDesktop(sess, request, response, path, true);
      if (desktop == null) //forward or redirect
        return;

      final RequestInfo ri = new RequestInfoImpl(
        wapp, sess, desktop, request,
View Full Code Here

      _exec = exec;
    }

    //@Override
    public void render(Page page, Writer out) throws IOException {
      final Desktop desktop = _exec.getDesktop();

      out.write(HtmlPageRenders.outLangStyleSheets(_exec, null, null));
      out.write(HtmlPageRenders.outLangJavaScripts(_exec, null, null));

      out.write("<script type=\"text/javascript\">zkpb('");
      out.write(page.getUuid());
      out.write("','");
      out.write(desktop.getId());
      out.write("','");
      out.write(getContextURI());
      out.write("','");
      out.write(desktop.getUpdateURI(null));
      out.write("','");
      out.write(desktop.getRequestPath());
      out.write('\'');

      String style = page.getStyle();
      if (style != null && style.length() > 0) {
        out.write(",{style:'");
View Full Code Here

      _audio = null;
      smartUpdate("src", new EncodedSrc());
    }
  }
  private String getEncodedSrc() {
    final Desktop dt = getDesktop();
    return _audio != null ? getAudioSrc(): //already encoded
      dt != null ? dt.getExecution().encodeURL(
          _src != null ? _src: "~./aud/mute.mid"):
          //mute.mid is required. otherwise, quicktime failed to identify audio
        "";
  }
View Full Code Here

  }

  //-- ExecutionCtrl --//
  public Object getAttribute(String name, boolean recurse) {
    Object val = getAttribute(name);
    Desktop desktop;
    return val != null || !recurse || (desktop=getDesktop()) == null ?
      val: desktop.getAttribute(name, true);
  }
View Full Code Here

    Desktop desktop;
    return val != null || !recurse || (desktop=getDesktop()) == null ?
      val: desktop.getAttribute(name, true);
  }
  public boolean hasAttribute(String name, boolean recurse) {
    Desktop desktop;
    return hasAttribute(name)
    || (recurse && (desktop=getDesktop()) != null && desktop.hasAttribute(name, true));
  }
View Full Code Here

    return hasAttribute(name)
    || (recurse && (desktop=getDesktop()) != null && desktop.hasAttribute(name, true));
  }
  public Object setAttribute(String name, Object value, boolean recurse) {
    if (recurse && !hasAttribute(name)) {
      Desktop desktop = getDesktop();
      if (desktop != null) {
        if (desktop.hasAttribute(name, true))
          return desktop.setAttribute(name, value, true);
      }
    }
    return setAttribute(name, value);
  }
View Full Code Here

    }
    return setAttribute(name, value);
  }
  public Object removeAttribute(String name, boolean recurse) {
    if (recurse && !hasAttribute(name)) {
      Desktop desktop = getDesktop();
      if (desktop != null) {
        if (desktop.hasAttribute(name, true))
          return desktop.removeAttribute(name, true);
      }
      return null;
    }
    return removeAttribute(name);
  }
View Full Code Here

      _curpage = getPage(_desktop);
    return _curpage;
  }
  public final void setCurrentPage(Page curpage) {
    if (_curpage != null && curpage != null && _curpage != curpage) {
      Desktop _curdt = _curpage.getDesktop(),
        curdt = curpage.getDesktop();
      if (_curdt != null && curdt != null && _curdt != curdt)
        throw new IllegalStateException("Change current page to another desktop? "+curpage);
    }
    _curpage = curpage;
View Full Code Here

TOP

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

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.