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

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

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

Event.getName介绍

[英]Returns the event name.
[中]

代码示例

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

private void doLoadEvent(Component comp, Event evt) {
  if (_log.isDebugEnabled()) {
    _log.debug("doLoadEvent comp=[{}],evtnm=[{}]", comp, evt.getName());
  }
  final BindingKey bkey = getBindingKey(comp, evt.getName());
  _propertyBindingHandler.doLoadEvent(bkey, comp, evt);
}

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

protected boolean requiresAuthentication(HttpServletRequest request, HttpServletResponse response) {
  final Event evt = (Event) request.getAttribute(CURRENT_EVENT);
  return Objects.equals(getFilterProcessesUrl(), request.getAttribute("j_loginurl"))
      && ZkAuthenticationEntryPoint.ON_ACEGILOGIN.equals(evt.getName());
  //must check the event name otherwise authentication would be called twice. 
  //1st the login model window's button click event
  //2nd the resumed onAcegiLogin thread resume and "cleanup".
  //we now check only on 2nd event
}

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

private boolean doSaveEvent(Component comp, Event evt, Set<Property> notifys) {
  final String evtnm = evt == null ? null : evt.getName();
  if (_log.isDebugEnabled()) {
    _log.debug("doSaveEvent comp=[{}],evtnm=[{}],notifys=[{}]", comp, evtnm, notifys);
  }
  final BindingKey bkey = getBindingKey(comp, evtnm);
  return _propertyBindingHandler.doSaveEvent(bkey, comp, evt, notifys);
}

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

private String getConditionString(BindContext ctx) {
  StringBuilder condition = new StringBuilder();
  if (getConditionType() == ConditionType.BEFORE_COMMAND) {
    condition.append("before = '").append(getCommandName()).append("'");
  } else if (getConditionType() == ConditionType.AFTER_COMMAND) {
    condition.append("after = '").append(getCommandName()).append("'");
  } else {
    condition.append(ctx.getTriggerEvent() == null ? "" : "event = " + ctx.getTriggerEvent().getName());
  }
  return condition.length() == 0 ? null : condition.toString();
}

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

private String getConditionString(BindContext ctx) {
  StringBuilder condition = new StringBuilder();
  if (getConditionType() == ConditionType.BEFORE_COMMAND) {
    condition.append("before = '").append(getCommandName()).append("'");
  } else if (getConditionType() == ConditionType.AFTER_COMMAND) {
    condition.append("after = '").append(getCommandName()).append("'");
  } else {
    condition.append(ctx.getTriggerEvent() == null ? "" : "event = " + ctx.getTriggerEvent().getName());
  }
  return condition.length() == 0 ? null : condition.toString();
}

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

private String getConditionString(BindContext ctx) {
  StringBuilder condition = new StringBuilder();
  if (getConditionType() == ConditionType.BEFORE_COMMAND) {
    condition.append("before = '").append(getCommandName()).append("'");
  } else if (getConditionType() == ConditionType.AFTER_COMMAND) {
    condition.append("after = '").append(getCommandName()).append("'");
  } else {
    condition.append(ctx.getTriggerEvent() == null ? "" : "event = " + ctx.getTriggerEvent().getName());
  }
  return condition.length() == 0 ? null : condition.toString();
}

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

private String getConditionString(BindContext ctx) {
  StringBuilder condition = new StringBuilder();
  if (getConditionType() == ConditionType.BEFORE_COMMAND) {
    condition.append("before = '").append(getCommandName()).append("'");
  } else if (getConditionType() == ConditionType.AFTER_COMMAND) {
    condition.append("after = '").append(getCommandName()).append("'");
  } else {
    condition.append(ctx.getTriggerEvent() == null ? "" : "event = " + ctx.getTriggerEvent().getName());
  }
  return condition.length() == 0 ? null : condition.toString();
}

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

private String getConditionString(BindContext ctx) {
  StringBuilder condition = new StringBuilder();
  if (getConditionType() == ConditionType.BEFORE_COMMAND) {
    condition.append("before = '").append(getCommandName()).append("'");
  } else if (getConditionType() == ConditionType.AFTER_COMMAND) {
    condition.append("after = '").append(getCommandName()).append("'");
  } else {
    condition.append(ctx.getTriggerEvent() == null ? "" : "event = " + ctx.getTriggerEvent().getName());
  }
  return condition.toString();
}

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

/**
 * Returns the event log for the given event.
 * 
 * @param event event.
 * @return the event log for the given event.
 */
public EventLog getEventLog(Event event) {
  return getEventLog(event.getTarget(), event.getName(), null, true, false);
}

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

/** Constructor.
 *
 * <p>Notice that {@link #getTarget} is the same as the target of the given
 * event. To retrieve the real target (passed thru the argument), please
 * use {@link #getRealTarget} instead.
 *
 * @param realTarget the real target. If null, it means broadcast.
 * @param event the proxied event.
 */
public ProxyEvent(Component realTarget, Event event) {
  super(event.getName(), event.getTarget(), event.getData());
  _realTarget = realTarget;
  _event = event;
}

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

public void service(Event event, Scope scope) throws Exception {
  final String evtnm = event.getName();
  final Method mtd = ComponentsCtrl.getEventMethod(getClass(), evtnm);
  if (_auxinf != null)
    service(event, scope, _auxinf.listeners != null ? _auxinf.listeners.get(evtnm) : null,
        _auxinf.evthds != null ? _auxinf.evthds.get(this, evtnm) : null, mtd, false);
  else
    service(event, scope, null, null, mtd, false);
}

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

/** Echos an event.
 * By echo we mean the event is fired after the client receives the AU
 * responses and then echoes back.
 * In other words, the event won't be processed in the current execution.
 * Rather, it executes after the client receives the AU responses
 * and then echoes back the event back.
 *
 * <p>It is usually if you want to prompt the user before doing a long
 * operation. A typical case is to open a highlighted window to
 * prevent the user from clicking any button before the operation gets done.
 *
 * @since 5.0.4
 * @see #sendEvent
 */
public static final void echoEvent(Event event) {
  echoEvent(event.getName(), event.getTarget(), event.getData());
}

代码示例来源: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));
    }
  }
}

代码示例来源: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/zkbind

public void onEvent(Event event) throws Exception {
  BindingExecutionInfoCollector collector = getBindingExecutionInfoCollector();
  try {
    if (collector != null) {
      collector.pushStack("ON_EVENT");
      collector.addInfo(new EventInfo(event.getTarget(), event.getName(), null));
    }
    onEvent0(event);
  } catch (Exception x) {
    _log.error(x.getMessage(), x);
    throw x;
  } finally {
    if (collector != null) {
      collector.popStack();
    }
  }
}

代码示例来源:origin: org.zkoss.zats/zats-mimic

public void select() {
    ComponentAgent parent = AuUtility.lookupEventTarget(target, Events.ON_SELECT);
    Set<String> items = new HashSet<String>();
    items.add(target.getUuid());
    String desktopId = target.getDesktop().getId();
    Event event = new SelectEvent(Events.ON_SELECT, (Component)parent.getDelegatee(), items, (Component)target.getDelegatee());
    Map<String, Object> data = EventDataManager.getInstance().build(event);
    ((ClientCtrl) target.getClient()).postUpdate(desktopId, parent.getUuid(), event.getName(), data, false);
    ((ClientCtrl) getClient()).flush(desktopId);
  }
}

代码示例来源:origin: org.zkoss.zats/zats-mimic

public void select() {
  Set<String> items = new HashSet<String>();
  items.add(target.getUuid());
  Component ancestry = getEventTarget();
  Event event = new SelectEvent(Events.ON_SELECT, ancestry, items, (Component)target.getDelegatee());
  Map<String, Object> data = EventDataManager.getInstance().build(event);
  contributeExtraInfo(data);
  String desktopId = target.getDesktop().getId();
  ((ClientCtrl) getClient()).postUpdate(desktopId, ancestry.getUuid(), event.getName(), data, false);
  ((ClientCtrl) getClient()).flush(desktopId);
}

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

public void onEvent(Event event) {
  if (event instanceof PagingEvent) {
    PagingEvent pe = (PagingEvent) event;
    int pgsz = pe.getPageable().getPageSize();
    int actpg = pe.getActivePage();
    if (PageableModel.INTERNAL_EVENT.equals(pe.getName())) {
      if (pgsz > 0) //min page size is 1
        _pgi.setPageSize(pgsz);
      if (actpg >= 0) //min page index is 0
        _pgi.setActivePage(actpg);
    } else if (_model instanceof Pageable) {
      //Bug ZK-1696: model also preserves paging information
      ((Pageable) _model).setActivePage(actpg);
    }
    Events.postEvent(new PagingEvent(event.getName(), Grid.this, pe.getPageable(), actpg));
  }
}

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

public void afterProcessEvent(Event event) throws Exception {
  _eis.afterProcessEvent(event);
  _wapp.getConfiguration().afterProcessEvent(event);
  if (Events.ON_DESKTOP_RECYCLE.equals(event.getName())) {
    if (_bookmark.length() > 0)
      addResponse(new AuBookmark(_bookmark));
    l_out: for (Page page : _pages)
      for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling())
        if (Events.isListened(root, Events.ON_CLIENT_INFO, false)) {
          setAttribute("org.zkoss.desktop.clientinfo.enabled", true);
          addResponse(new AuClientInfo(this));
          break l_out;
        }
    l_out: for (Page page : _pages)
      for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling())
        if (Events.isListened(root, Events.ON_VISIBILITY_CHANGE, false)) {
          setAttribute("org.zkoss.desktop.visibilitychange.enabled", true);
          break l_out;
        }
  }
}

代码示例来源:origin: org.zkoss.zats/zats-mimic

private void postUpdate(Component component, Set<String> selected) {
  String desktopId = target.getDesktop().getId();
  Event event = new SelectEvent(Events.ON_SELECT, component, selected, (Component)target.getDelegatee());
  Map<String, Object> data = EventDataManager.getInstance().build(event);
  ClientCtrl ctrl = (ClientCtrl) target.getClient();
  ctrl.postUpdate(desktopId, component.getUuid(), event.getName(), data, false);
  ctrl.flush(desktopId);
}

相关文章