Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.Desktop


* @author tomyeh
*/
public class MyExecCleanup implements ExecutionCleanup {
  public void cleanup(Execution exec,
  Execution parent, List errs) throws Exception {
    Desktop desktop = exec.getDesktop();
    desktop.removeAttribute("test");
  }
View Full Code Here


*/
public class Embed extends HttpServlet {
  private int cnt = 0;
  public void service(HttpServletRequest request, HttpServletResponse response)
  throws javax.servlet.ServletException, java.io.IOException {
    final Desktop desktop = getDesktop(request);
    Bridge bridge = Bridge.start(getServletContext(), request, response, desktop);
    try {
      final Listbox listbox = (Listbox) ((Page)desktop.getPages().iterator().next()).getRoots().iterator().next();
      listbox.appendChild(new Listitem("Ajax " + ++cnt));
      response.getWriter().write(bridge.getResult());
    } finally {
      bridge.close();
    }
View Full Code Here

*/
public class CometServerPush {

  public static void start(Component info, Component listbox)
      throws InterruptedException {
    final Desktop desktop = Executions.getCurrent().getDesktop();
    if (desktop.isServerPushEnabled()) {
      Messagebox.show("Already started");
    } else {
      desktop.enableServerPush(true);
      new WorkingThread(info, listbox).start();
    }
  }
View Full Code Here

      new WorkingThread(info, listbox).start();
    }
  }

  public static void stop() throws InterruptedException {
    final Desktop desktop = Executions.getCurrent().getDesktop();
    if (desktop.isServerPushEnabled()) {
      desktop.enableServerPush(false);
    } else {
      Messagebox.show("Already stopped");
    }
  }
View Full Code Here

   */
  public EventProcessor(Desktop desktop, Component comp, Event event) {
    if (desktop == null || comp == null || event == null)
      throw new IllegalArgumentException("null");

    final Desktop dt = comp.getDesktop();
    if (dt != null && desktop != dt)
      throw new IllegalStateException("Process events for another desktop? "+comp);

    _desktop = desktop;
    _comp = comp;
View Full Code Here

    if (_factory == null) {
      //read hibernate.config preference
      if (app == null) {
        final Execution exec = Executions.getCurrent();
        if (exec != null) {
          final Desktop desktop = exec.getDesktop();
          if (desktop != null) {
            app = desktop.getWebApp();
          }
        }
      }
      String resource = null;
      if (app != null) {
View Full Code Here

   * @param media the media to download
   * @param flnm the suggested file name, e.g., myfile.pdf.
   * If null, {@link Media#getName} is assumed.
   */
  public static void save(Media media, String flnm) {
    final Desktop desktop = Executions.getCurrent().getDesktop();
    ((WebAppCtrl)desktop.getWebApp())
      .getUiEngine().addResponse(
        new AuDownload(new DownloadURL(media, flnm))); //Bug 2114380
  }
View Full Code Here

    //Note: we have to go thru UiFactory (so user can override it)
    return ((WebAppCtrl)getDesktop().getWebApp()).getUiFactory()
      .getPageDefinitionDirectly(newRequestInfo(null), reader, ext);
  }
  private RequestInfo newRequestInfo(String uri) {
    final Desktop dt = getDesktop();
    return new RequestInfoImpl(
      dt, _request, PageDefinitions.getLocator(getDesktop().getWebApp(), uri));
  }
View Full Code Here

  HttpServletRequest request, HttpServletResponse response,
  PageDefinition pagedef, String path) throws ServletException, IOException {
    final WebApp wapp = sess.getWebApp();
    final WebAppCtrl wappc = (WebAppCtrl)wapp;

    final Desktop desktop =
      getWebManager().getDesktop(sess, request, response, path, true);
    if (desktop == null) //forward or redirect
      return;

    final RequestInfo ri = new RequestInfoImpl(
View Full Code Here

  private static WebApp getWebApp() {
    WebApp app = null;
    final Execution exec = Executions.getCurrent();
    if (exec != null) {
      final Desktop desktop = exec.getDesktop();
      if (desktop != null) {
        app = desktop.getWebApp();
      }
    }
    return app;
  }
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.