Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.Desktop


      smartUpdate("tabindex", _tabindex);
    }
  }

  private String getEncodedHref() {
    final Desktop dt = getDesktop();
    return _href != null && dt != null ? dt.getExecution().encodeURL(_href): null;
      //if desktop is null, it doesn't belong to any execution
  }
View Full Code Here


   * It is OK to send event to component from another page as long as
   * they are in the same desktop.
   */
  public static void sendEvent(Component comp, Event event) {
    final Execution exec = Executions.getCurrent();
    final Desktop desktop = exec.getDesktop();
      //note: we don't use comp.getDesktop because 1) it may be null
      //2) it may be different from the current desktop

    event = ((DesktopCtrl)desktop).beforeSendEvent(event);
    if (event == null)
      return; //done

    final Thread thd = (Thread)Thread.currentThread();
    if (!(thd instanceof EventProcessingThread)) {
      if (!desktop.getWebApp().getConfiguration().isEventThreadEnabled()) {
        final ExecutionCtrl execCtrl = (ExecutionCtrl)exec;
        final Page page = execCtrl.getCurrentPage();
        final EventProcessor proc =
          new EventProcessor(desktop, comp, event);
        proc.setup();
View Full Code Here

   * @since 5.0.4
   */
  public Component getAreaComponent() {
    if (_areacomp == null && _area != null) {
      final Component target = getTarget();
      Desktop desktop = null;
      if (target != null) {
        _areacomp = target.getFellowIfAny(_area);
        if (_areacomp != null)
          return _areacomp;

        desktop = target.getDesktop();
      }
      if (desktop == null) {
        final Execution exec = Executions.getCurrent();
        if (exec != null)
          desktop = exec.getDesktop();
      }
      if (desktop != null)
        return _areacomp = desktop.getComponentByUuidIfAny(_area);
    }
    return _areacomp;
  }
View Full Code Here

  private String getEncodedURL() {
    if (_image != null)
      return Utils.getDynamicMediaURI( //already encoded
        this, _imgver, "c/" + _image.getName(), _image.getFormat());

    final Desktop dt = getDesktop(); //it might not belong to any desktop
    return dt != null ? dt.getExecution()
      .encodeURL(_src != null ? _src: "~./img/spacer.gif"): "";
  }
View Full Code Here

    if (_hoverimg != null)
      return Utils.getDynamicMediaURI(
        this, _hoverimgver,
        "h/" + _hoverimg.getName(), _hoverimg.getFormat());

    final Desktop dt = getDesktop(); //it might not belong to any desktop
    return dt != null && _hoversrc != null ?
      dt.getExecution().encodeURL(_hoversrc): null;
  }
View Full Code Here

  private String getEncodedSrcURL() {
    if (_src == null)
      return null;

    final Desktop dt = getDesktop(); //it might not belong to any desktop
    return dt != null ? dt.getExecution().encodeURL(_src): null;
  }
View Full Code Here

  /** Converts an AU request to a select event.
   * @since 5.0.0
   */
  public static final SelectEvent getSelectEvent(AuRequest request) {
    final Map data = request.getData();
    final Desktop desktop = request.getDesktop();
    return new SelectEvent(request.getCommand(), request.getComponent(),
      AuRequests.convertToItems(desktop, (List)data.get("items")),
      desktop.getComponentByUuidIfAny((String)data.get("reference")),
      AuRequests.parseKeys(data));
  }
View Full Code Here

   * To tell the difference, check the getMessage method of InterruptedException.
   * @since 3.0.4
   */
  public void doModal()
  throws InterruptedException, SuspendNotAllowedException {
    Desktop desktop = getDesktop();
    if (desktop == null)
      throw new SuspendNotAllowedException("Not attached, "+this);

    if (!desktop.getWebApp().getConfiguration().isEventThreadEnabled()) {
      doHighlighted();
      return;
    }

    checkOverlappable(MODAL);
View Full Code Here

 
  public void onClose(Event evt) {
    if (evt.getData() == null)
      _result.clear();
    else {
      final Desktop desktop = Executions.getCurrent().getDesktop();
      final Configuration config = desktop .getWebApp().getConfiguration();
      if (!config.isEventThreadEnabled())
        Events.postEvent(new UploadEvent(Events.ON_UPLOAD, (Component)desktop.getAttribute(ATTR_FILEUPLOAD_TARGET), getResult()));
    }
    detach();
  }
View Full Code Here

  public Media getContent() {
    return _media;
  }

  private String getEncodedSrc() {
    final Desktop dt = getDesktop();
    return _media != null ? getMediaSrc(): //already encoded
      dt != null && _src != null ?
        dt.getExecution().encodeURL(_src)"";
  }
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.