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

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

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

Events.sendEvent介绍

[英]Sends the event to the target, and processes it immediately.
[中]将事件发送到目标,并立即进行处理。

代码示例

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

public void onEvent(Event event) {
  Events.sendEvent(Tabbox.this, event);
}

代码示例来源:origin: org.carewebframework/org.carewebframework.cal.ui.patientselection.v1

@Override
  public Patient select() {
    Events.sendEvent("onShow", dlg, null);
    return (Patient) dlg.getAttribute(Constants.SELECTED_PATIENT_ATTRIB);
  }
};

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

/** Sends the event to the target specified in the event, and processes it immediately.
 *
 * <p>Note: {@link Event#getTarget} cannot be null.
 */
public static void sendEvent(Event event) {
  sendEvent(event.getTarget(), event);
}

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

/** Sends the event to the target, and processes it immediately.
 * @param target the target of the event (never null)
 * @since 5.0.4
 */
public static void sendEvent(String name, Component target, Object data) {
  sendEvent(new Event(name, target, data));
}

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

private static void doBindChildrenInFilter(Component[] shadows) {
    for (Component shadow : shadows) {
      if (shadow instanceof ShadowElement) {
        ShadowElement se = (ShadowElement) shadow;
        if (!se.getDistributedChildren().isEmpty() || !((ShadowElementCtrl) se).isDynamicValue())
          continue;
        List<Component> children = shadow.getChildren();
        if (children.size() == 0) {
          Events.sendEvent(new Event("onBindInit", (Component) se));
          Events.sendEvent(new Event("onBindingReady", (Component) se));
          children = shadow.getChildren();
        }
        if (children.size() > 0) 
          doBindChildrenInFilter(children.toArray(new Component[children.size()]));
      }
    }
  }
}

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

public void onEvent(Event event) {
  final ForwardInfo info = _auxinf.forwards.get(_orgEvent);
  if (info != null)
    for (TargetInfo ti : new ArrayList<TargetInfo>(info.targets)) {
      Component target = resolveForwardTarget(ti.target);
      if (target == null) {
        final IdSpace owner = getSpaceOwner();
        if (owner instanceof Component) {
          target = (Component) owner;
        } else {
          //Use the root component instead
          for (target = AbstractComponent.this;;) {
            final Component p = target.getParent();
            if (p == null)
              break;
            target = p;
          }
        }
      }
      //bug #2790393 Forward event listener shall be called immediately
      //(since 3.6.2) change from postEvent to sendEvent to
      //make forward event deterministic
      Events.sendEvent(new ForwardEvent(ti.event, target, event, ti.data));
    }
}

代码示例来源:origin: org.carewebframework/org.carewebframework.security.spring.core

/**
 * Cancel the password change request.
 */
private void doCancel() {
  if (!forced) {
    panel.getRoot().detach();
  } else {
    Events.sendEvent(Events.ON_CLOSE, panel.getRoot(),
      StrUtil.getLabel("password.change.dialog.password.change.canceled"));
  }
}

代码示例来源:origin: org.carewebframework/org.carewebframework.vista.security.impl

/**
 * Cancel the password change request.
 */
private void doCancel() {
  if (!forced) {
    panel.getRoot().detach();
  } else {
    Events.sendEvent(Events.ON_CLOSE, panel.getRoot(),
      Labels.getLabel("change.password.dialog.password.change.canceled"));
  }
}

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

private boolean checkShadowElementAndCreateSubChildren(Component parent) {
  boolean hasShadow = false;
  if (parent instanceof ComponentCtrl) {
    ComponentCtrl pCtrl = (ComponentCtrl) parent;
    for (ShadowElement se : pCtrl.getShadowRoots()) {
      if (se instanceof HtmlShadowElement) {
        HtmlShadowElement hse = (HtmlShadowElement) se;
        if (hse.hasBindingAnnotation() || hse.hasSubBindingAnnotation()) {
          // used for shadow addon to be rendered directly
          hse.setAttribute(BinderCtrl.BINDRENDERING, true);
          try {
            Events.sendEvent(new Event(BinderCtrl.ON_BIND_INIT, hse));
            // fixed for @ref case
            Events.sendEvent(new Event("onBindingReady", hse));
          } finally {
            hse.removeAttribute(BinderCtrl.BINDRENDERING);
          }
        }
      }
      hasShadow = true;
    }
  }
  return hasShadow;
}

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

refs.add(dataTarget);
      bindings.add(binding);
      Events.sendEvent(new BindingSaveEvent("onBindingSave", dataTarget, target, binding, vals[0]));
        refs.add(dataTarget1);
        bindings.add(binding);
        Events.sendEvent(
            new BindingSaveEvent("onBindingSave", dataTarget1, target, binding, vals[0]));
Events.sendEvent(new BindingValidateEvent("onBindingValidate", target, refs, bindings, values));

代码示例来源:origin: org.carewebframework/org.carewebframework.vista.security.impl

/**
 * Submits the authentication request.
 */
private void doSubmit() {
  showMessage("");
  final Organization organization = getSelectedOrganization();
  String instId = organization == null ? null : organization.getId().getIdPart();
  String username = j_username.getValue().trim();
  final String password = j_password.getValue();
  
  if (username.contains("\\")) {
    String[] pcs = username.split("\\\\", 2);
    instId = pcs[0];
    username = pcs[1];
  }
  
  if (!username.isEmpty() && !password.isEmpty() && !instId.isEmpty()) {
    session.setAttribute(Constants.DEFAULT_INSTITUTION, instId);
    FrameworkWebSupport.setCookie(Constants.DEFAULT_INSTITUTION, instId);
    session.setAttribute(Constants.DEFAULT_USERNAME, username);
    //FrameworkWebSupport.setCookie(Constants.DEFAULT_USERNAME, username);
    j_username.setValue(instId + "\\" + username);
    showState(Labels.getLabel(Constants.LBL_LOGIN_PROGRESS));
    session.setAttribute(org.carewebframework.security.spring.Constants.SAVED_REQUEST, savedRequest);
    Events.sendEvent("onSubmit", loginRoot.getRoot(), null);
  } else {
    showMessage(Labels.getLabel(Constants.LBL_LOGIN_REQUIRED_FIELDS));
  }
}

代码示例来源:origin: org.carewebframework/org.carewebframework.security.spring.core

/**
 * Submits the authentication request.
 */
public void onSubmit() {
  showMessage("");
  ISecurityDomain securityDomain = getSelectedSecurityDomain();
  String securityDomainId = securityDomain == null ? null : securityDomain.getLogicalId();
  String username = txtUsername.getValue().trim();
  String password = txtPassword.getValue();
  
  if (username.contains("\\")) {
    String[] pcs = username.split("\\\\", 2);
    securityDomainId = pcs[0];
    username = pcs[1];
  }
  
  if (!username.isEmpty() && !password.isEmpty() && !securityDomainId.isEmpty()) {
    session.setAttribute(Constants.DEFAULT_SECURITY_DOMAIN, securityDomainId);
    FrameworkWebSupport.setCookie(Constants.DEFAULT_SECURITY_DOMAIN, securityDomainId);
    session.setAttribute(Constants.DEFAULT_USERNAME, username);
    txtUsername.setValue(securityDomainId + "\\" + username);
    showStatus(StrUtil.getLabel(Constants.LBL_LOGIN_PROGRESS));
    session.setAttribute(org.carewebframework.security.spring.Constants.SAVED_REQUEST, savedRequest);
    Events.sendEvent("onSubmit", loginRoot.getRoot(), null);
  } else {
    showMessage(StrUtil.getLabel(Constants.LBL_LOGIN_REQUIRED_FIELDS));
    pane.setVisible(true);
  }
}

代码示例来源:origin: org.carewebframework/org.carewebframework.security.spring.core

String inst = user.getSecurityDomain().getLogicalId();
  txtUsername.setValue(inst + "\\" + user.getLoginName());
  Events.sendEvent("onSubmit", panel.getRoot(), null);
} else {
  doCancel();

代码示例来源:origin: org.carewebframework/org.carewebframework.vista.security.impl

String inst = user.getOrganization().getId().getIdPart();
  j_username.setValue(inst + "\\" + user.getLogin());
  Events.sendEvent("onSubmit", panel.getRoot(), null);
} else {
  doCancel();

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

/**
 * First, posts any pending echo requests to the event queue. Then empties the event queue,
 * sending each queued event to its target. Finally, processes any events on the server push
 * event queue.
 * 
 * @return True if events were flushed.
 */
public boolean flushEvents() {
  Event event;
  boolean result = false;
  
  for (AuEcho echo : execution.getEchoedEvents()) {
    Events.postEvent(toEvent(echo));
  }
  
  execution.getEchoedEvents().clear();
  
  while ((event = execution.getNextEvent()) != null) {
    Events.sendEvent(event);
    result = true;
  }
  
  result |= serverPush.flush();
  return result;
}

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

public void onEvent(Event evt) throws Exception {
  for (int j = _targets.length; --j >= 0;)
    _targets[j].removeEventListener(_evtnms[j], this); //one shot only
  final Execution exec = Executions.getCurrent();
  execCreate0(
      new CreateInfo(((WebAppCtrl) exec.getDesktop().getWebApp()).getUiFactory(), exec, _comp.getPage(),
          null), //technically sys composer can be used but we don't (to simplify it)
      _compInfo, _comp, null);
  if (_uri != null) {
    final String uri = (String) Evaluators.evaluate(_compInfo.getEvaluator(), _comp, _uri, String.class);
    if (uri != null)
      exec.createComponents(uri, _comp, null);
  }
  Events.sendEvent(new FulfillEvent(Events.ON_FULFILL, _comp, evt));
  //Use sendEvent so onFulfill will be processed before
  //the event triggers the fulfill (i.e., evt)
}

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

Events.sendEvent(new Event(BinderCtrl.ON_BIND_CLEAN, comp));

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

Events.sendEvent(new Event(BinderCtrl.ON_BIND_INIT, comp));

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

Events.sendEvent(new Event(BinderImpl.ON_BIND_INIT, lbl));
lbl.detach();
return lbl.getValue();

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

Events.sendEvent(new Event(BinderCtrl.ON_BIND_INIT, nci));

相关文章