Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.Desktop


   *
   * @since 3.6.1
   * @return the encoded src where to find the flash source
   */
  public String getEncodedSrc() {
    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().encodeURL(_src) : "";
  }
View Full Code Here


   *
   * @since 3.6.1
   * @return the encoded js path where to find the scripts
   */
  public String getEncodedJsPath() {
    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().encodeURL(_jspath) : "";
  }
View Full Code Here

    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().encodeURL(_jspath) : "";
  }

  public String getEncodedJs() {
    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().encodeURL(_js) : "";
  }
View Full Code Here

    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().encodeURL(_js) : "";
  }

  public boolean isExplorer() {
    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().isExplorer() : true;
  }
View Full Code Here

    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().isExplorer() : true;
  }

  public boolean isFirefox() {
    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().isGecko() : false;
  }
View Full Code Here

  /** Returns the encoded URL for the dynamic generated content, or empty
   * the component doesn't belong to any desktop.
   */
  private static String getDynamicMediaURI(AbstractComponent comp,
  int version, String name, String format) {
    final Desktop desktop = comp.getDesktop();
    if (desktop == null) return ""; //no avail at client

    final StringBuffer sb = new StringBuffer(64).append('/');
    Strings.encode(sb, version);
    if (name != null || format != null) {
      sb.append('/');
      boolean bExtRequired = true;
      if (name != null && name.length() != 0) {
        sb.append(name.replace('\\', '/'));
        bExtRequired = name.lastIndexOf('.') < 0;
      } else {
        sb.append(comp.getId());
      }
      if (bExtRequired && format != null)
        sb.append('.').append(format);
    }
    return desktop.getDynamicMediaURI(comp, sb.toString()); //already encoded
  }
View Full Code Here

  }
 
  // desktop attribute
  private final static String THEME_INITED_DESKTOP = "org.zkoss.theme.desktop.inited";
  public void render(Page page, Writer out) throws IOException {
    final Desktop desktop = page.getDesktop();
    boolean inited = Boolean.TRUE.equals(desktop.getAttribute(THEME_INITED_DESKTOP));
   
    if (!inited) {
      desktop.setAttribute(THEME_INITED_DESKTOP, Boolean.TRUE);
      String name = Themes.getCurrentTheme();
      if (!Themes.CLASSICBLUE_NAME.equals(name))
        out.write("<script src='" +
          Executions.encodeURL("~./js/zul." + name + ".wpd") + "'></script>");
    }
View Full Code Here

  }
 
  // desktop attribute
  private final static String THEME_INITED_DESKTOP = "org.zkoss.theme.desktop.inited";
  public void render(Page page, Writer out) throws IOException {
    final Desktop desktop = page.getDesktop();
    boolean inited = Boolean.TRUE.equals(desktop.getAttribute(THEME_INITED_DESKTOP));
   
    if (!inited) {
      desktop.setAttribute(THEME_INITED_DESKTOP, Boolean.TRUE);
      String name = Themes.getCurrentTheme();
      if (!Themes.CLASSICBLUE_NAME.equals(name))
        out.write("<script src='" +
          Executions.encodeURL("~./js/zul." + name + ".wpd") + "'></script>");
    }
View Full Code Here

  }
 
  // desktop attribute
  private final static String THEME_INITED_DESKTOP = "org.zkoss.theme.desktop.inited";
  public void render(Page page, Writer out) throws IOException {
    final Desktop desktop = page.getDesktop();
    boolean inited = Boolean.TRUE.equals(desktop.getAttribute(THEME_INITED_DESKTOP));
   
    if (!inited) {
      desktop.setAttribute(THEME_INITED_DESKTOP, Boolean.TRUE);
      String name = Themes.getCurrentTheme();
      if (!Themes.CLASSICBLUE_NAME.equals(name))
        out.write("<script src='" +
          Executions.encodeURL("~./js/zul." + name + ".wpd") + "'></script>");
    }
View Full Code Here

public class CometServerPush
{

    public static void start(Plotinfo plotinfo, Component comp) throws InterruptedException
    {
        final Desktop desktop = Executions.getCurrent().getDesktop();
        if (desktop.isServerPushEnabled())
        {
            Messagebox.show("Already started");
        }
        else
        {
            desktop.enableServerPush(true);
            new WorkingThread(plotinfo, comp).start();
        }
    }
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.