org.zkoss.zk.ui.event.Events.postEvent()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(177)

本文整理了Java中org.zkoss.zk.ui.event.Events.postEvent()方法的一些代码示例,展示了Events.postEvent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Events.postEvent()方法的具体详情如下:
包路径:org.zkoss.zk.ui.event.Events
类名称:Events
方法名:postEvent

Events.postEvent介绍

[英]Posts an instance of Event to the current execution with the specified priority.

The posted events are processed from the higher priority to the lower one. If two events are posted with the same priority, the earlier the event being posted is processed earlier (first-in-first-out).

The priority posted by posted by #postEvent(Event) is 0. Applications shall not use the priority higher than 10,000 and lower than -10,000 since they are reserved for component development.
[中]以指定的优先级将事件实例发布到当前执行。
已发布的事件从较高优先级处理到较低优先级。如果以相同优先级发布两个事件,则越早处理被发布的事件(先进先出)。
Post by#postEvent(事件)发布的优先级为0。应用程序不得使用高于10000和低于-10000的优先级,因为它们是为组件开发保留的。

代码示例

代码示例来源:origin: org.zkoss.zk/zul

/**
 * mark a draw flag to inform that this Chart needs update.
 */
protected void smartDrawChart() {
  if (_smartDrawChart) { //already mark smart draw
    return;
  }
  _smartDrawChart = true;
  Events.postEvent("onSmartDrawChart", this, null);
}

代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.documents

/**
 * Triggers document view mode.
 */
public void onClick$btnView() {
  Events.postEvent("onViewOpen", root, true);
}

代码示例来源:origin: org.zkoss.zk/zul

public void onPageAttached(Page newpage, Page oldpage) {
  if (newpage != null)
    Events.postEvent("onAfterCompose", this, null);
  super.onPageAttached(newpage, oldpage);
}

代码示例来源:origin: org.zkoss.zk/zul

private void postOnInitRender(String idx) {
  //20080724, Henri Chen: optimize to avoid postOnInitRender twice
  if (getAttribute(ZUL_RADIOGROUP_ON_INITRENDER) == null) {
    //Bug #2010389
    setAttribute(ZUL_RADIOGROUP_ON_INITRENDER, Boolean.TRUE); //flag syncModel
    Events.postEvent("onInitRender", this, idx);
  }
}

代码示例来源:origin: org.zkoss.zk/zul

private void postOnInitRender() {
  //20080724, Henri Chen: optimize to avoid postOnInitRender twice
  if (getAttribute(ATTR_ON_INIT_RENDER_POSTED) == null) {
    setAttribute(ATTR_ON_INIT_RENDER_POSTED, Boolean.TRUE);
    Events.postEvent("onInitRender", this, null);
  }
}

代码示例来源:origin: org.zkoss.zk/zkbind

public void postCommand(String command, Map<String, Object> args) {
  checkInit();
  final Event evt = new Event(ON_POST_COMMAND, _dummyTarget, new Object[] { command, args });
  Events.postEvent(evt);
}

代码示例来源:origin: org.zkoss.zk/zul

private void postOnInitRender() {
  //20080724, Henri Chen: optimize to avoid postOnInitRender twice
  if (getAttribute(ATTR_ON_INIT_RENDER_POSTED) == null) {
    setAttribute(ATTR_ON_INIT_RENDER_POSTED, Boolean.TRUE);
    Events.postEvent("onInitRender", this, null);
  }
}

代码示例来源:origin: org.zkoss.zk/zul

/**
 * Component internal use only.
 * @since 7.0.0
 */
public void postOnInitRender() {
  if (getAttribute(TabboxEngine.ATTR_ON_INIT_RENDER_POSTED) == null) {
    setAttribute(TabboxEngine.ATTR_ON_INIT_RENDER_POSTED, Boolean.TRUE);
    Events.postEvent("onInitRender", this, null);
  }
}

代码示例来源:origin: org.zkoss.zk/zul

private void postOnInitRender() {
  // 20080724, Henri Chen: optimize to avoid postOnInitRender twice
  if (getAttribute(ATTR_ON_INIT_RENDER_POSTED) == null) {
    setAttribute(ATTR_ON_INIT_RENDER_POSTED, Boolean.TRUE);
    // Bug ZL-1696: manipulate list from api might happen before list 
    // render, use sendEvent instead of postEvent to render list first
    Events.postEvent("onInitRender", this, null);
  }
}

代码示例来源:origin: org.zkoss.zk/zul

private void postOnInitRender() {
  if (getAttribute(ATTR_ON_INIT_RENDER_POSTED) == null) {
    setAttribute(ATTR_ON_INIT_RENDER_POSTED, Boolean.TRUE);
    Events.postEvent("onInitRender", this, null);
  }
}

代码示例来源:origin: org.zkoss.zk/zkplus

/*package*/ static void postOnCreateEvents(Component item) {
    for (final Iterator it = item.getChildren().iterator(); it.hasNext();) {
      final Component child = (Component) it.next();
      postOnCreateEvents(child); //recursive
    }
    if (Events.isListened(item, Events.ON_CREATE, false)) {
      Events.postEvent(new CreateEvent(Events.ON_CREATE, item, null));
    }
  }
}

代码示例来源:origin: org.zkoss.zk/zul

@Override
public void service(AuRequest request, boolean everError) {
  String cmd = request.getCommand();
  if (Events.ON_UPLOAD.equals(cmd)) {
    Events.postEvent(UploadEvent.getLatestUploadEvent(cmd, this));
  } else
    super.service(request, everError);
}

代码示例来源:origin: org.zkoss.zk/zul

private void doInitRenderer() {
  if (disableFeature())
    throw new IllegalAccessError("ZK EE version only!");
  getEngine().doInitRenderer(this);
  Events.postEvent(ZulEvents.ON_AFTER_RENDER, this, null); // notify the tabbox when items have been rendered.
}

代码示例来源:origin: org.zkoss.zk/zk

/** Post event to the non-stub ancestor. */
  /*package*/ void postToNonStubAncestor(StubEvent event) {
    Component target = event.getTarget();
    for (; target != null
        && (target instanceof Native || target instanceof StubComponent); target = target.getParent())
      ;
    if (target != null)
      Events.postEvent(new StubEvent(event, target));
  }
}

代码示例来源:origin: org.zkoss.zk/zul

public void service(AuRequest request, boolean everError) {
  final String cmd = request.getCommand();
  if (cmd.equals(Events.ON_CHECK)) {
    CheckEvent evt = CheckEvent.getCheckEvent(request);
    _checked = evt.isChecked();
    Events.postEvent(evt);
  } else
    super.service(request, everError);
}

代码示例来源:origin: org.zkoss.zk/zul

private void postOnPagingInitRender() {
  if (getAttribute(ATTR_ON_PAGING_INIT_RENDERER_POSTED) == null
      && getAttribute(ATTR_ON_INIT_RENDER_POSTED) == null) { // B50-ZK-345
    setAttribute(ATTR_ON_PAGING_INIT_RENDERER_POSTED, Boolean.TRUE);
    Events.postEvent("onPagingInitRender", this, null);
  }
}

代码示例来源:origin: org.zkoss.zk/zul

private void postOnPagingInitRender() {
  if (getAttribute(ATTR_ON_PAGING_INIT_RENDERER_POSTED) == null
      && getAttribute(ATTR_ON_INIT_RENDER_POSTED) == null) { // B50-ZK-345
    setAttribute(ATTR_ON_PAGING_INIT_RENDERER_POSTED, Boolean.TRUE);
    Events.postEvent("onPagingInitRender", this, null);
  }
}

代码示例来源:origin: org.carewebframework/org.carewebframework.rpms.ui.anticoag

@Override
public void doAfterCompose(Component comp) throws Exception {
  super.doAfterCompose(comp);
  record = (AntiCoagRecord) arg.get("record");
  inputs = new Component[] { rgIndicated, cboGoal, cboMin, cboMax, cboDuration, datStart, wbProvider, txtComment };
  loadComboValues();
  Window win = (Window) root;
  win.setTitle(StrUtil.formatMessage(win.getTitle(), record == null ? "Add" : "Edit"));
  Events.postEvent("onInitDialog", comp, null);
}

代码示例来源:origin: org.zkoss.zk/zkplus

public void onEvent(Event event) {
    if (event instanceof AfterEvent) {
      handleEvent((Event) event.getData());
    } else { //post AfterEvent to make sure it is called after
      //enforce the event is the last processed
      Events.postEvent(-10100, new AfterEvent(event.getName() + "SaveAfter", event));
    }
  }
}

代码示例来源:origin: org.zkoss.zk/zkplus

public void onEvent(Event event) {
    if (event instanceof AfterEvent) {
      handleEvent((Event) event.getData());
    } else { //post AfterEvent to make sure it is called after
      //enforce the event is the last processed
      Events.postEvent(-10100, new AfterEvent(event.getName() + "LoadAfter", event));
    }
  }
}

相关文章