javax.faces.event.ActionEvent.<init>()方法的使用及代码示例

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

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

ActionEvent.<init>介绍

[英]Construct a new event object from the specified source component and action command.
[中]从指定的源组件和操作命令构造新的事件对象。

代码示例

代码示例来源:origin: primefaces/primefaces

@Override
public void decode(FacesContext facesContext, UIComponent component) {
  Map<String, String> params = facesContext.getExternalContext().getRequestParameterMap();
  Hotkey hotkey = (Hotkey) component;
  if (params.containsKey(hotkey.getClientId(facesContext))) {
    hotkey.queueEvent(new ActionEvent(hotkey));
  }
}

代码示例来源:origin: primefaces/primefaces

@Override
public void decode(FacesContext facesContext) {
  Map<String, String> params = facesContext.getExternalContext().getRequestParameterMap();
  String clientId = getClientId(facesContext);
  if (params.containsKey(clientId)) {
    queueEvent(new ActionEvent(this));
  }
}

代码示例来源:origin: primefaces/primefaces

@Override
public void decode(FacesContext context, UIComponent component) {
  CommandButton button = (CommandButton) component;
  if (button.isDisabled()) {
    return;
  }
  String param = component.getClientId(context);
  if (context.getExternalContext().getRequestParameterMap().containsKey(param)) {
    component.queueEvent(new ActionEvent(component));
  }
  decodeBehaviors(context, component);
}

代码示例来源:origin: primefaces/primefaces

@Override
public void decode(FacesContext context, UIComponent component) {
  CommandLink link = (CommandLink) component;
  if (link.isDisabled()) {
    return;
  }
  String param = component.getClientId(context);
  if (context.getExternalContext().getRequestParameterMap().containsKey(param)) {
    component.queueEvent(new ActionEvent(component));
  }
  decodeBehaviors(context, component);
}

代码示例来源:origin: primefaces/primefaces

@Override
public void decode(FacesContext context, UIComponent component) {
  RemoteCommand command = (RemoteCommand) component;
  if (context.getExternalContext().getRequestParameterMap().containsKey(command.getClientId(context))) {
    ActionEvent event = new ActionEvent(command);
    if (command.isImmediate()) {
      event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
    }
    else {
      event.setPhaseId(PhaseId.INVOKE_APPLICATION);
    }
    command.queueEvent(event);
  }
}

代码示例来源:origin: primefaces/primefaces

@Override
public void decode(FacesContext context, UIComponent component) {
  Poll poll = (Poll) component;
  if (context.getExternalContext().getRequestParameterMap().containsKey(poll.getClientId(context))) {
    ActionEvent event = new ActionEvent(poll);
    if (poll.isImmediate()) {
      event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
    }
    else {
      event.setPhaseId(PhaseId.INVOKE_APPLICATION);
    }
    poll.queueEvent(event);
  }
}

代码示例来源:origin: primefaces/primefaces

@Override
public void decode(FacesContext context, UIComponent component) {
  SplitButton button = (SplitButton) component;
  if (button.isDisabled()) {
    return;
  }
  String clientId = button.getClientId(context);
  Map<String, String> params = context.getExternalContext().getRequestParameterMap();
  String param = button.isAjax() ? clientId : clientId + "_button";
  String itemParam = clientId + "_menuid";
  if (params.containsKey(itemParam)) {
    String menuid = params.get(clientId + "_menuid");
    MenuItem menuitem = button.findMenuitem(button.getElements(), menuid);
    MenuActionEvent event = new MenuActionEvent(button, menuitem);
    if (menuitem.isImmediate()) {
      event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
    }
    else {
      event.setPhaseId(PhaseId.INVOKE_APPLICATION);
    }
    component.queueEvent(event);
  }
  else if (params.containsKey(param)) {
    component.queueEvent(new ActionEvent(component));
  }
}

代码示例来源:origin: org.richfaces.ui/richfaces-components-ui

@Override
protected void queueComponentEventForBehaviorEvent(FacesContext context, UIComponent component, String eventName) {
  super.queueComponentEventForBehaviorEvent(context, component, eventName);
  if ("action".equals(eventName) || "click".equals(eventName)) {
    new ActionEvent(component).queue();
  }
}

代码示例来源:origin: org.richfaces.ui.core/richfaces-ui-core-ui

@Override
protected void queueComponentEventForBehaviorEvent(FacesContext context, UIComponent component, String eventName) {
  super.queueComponentEventForBehaviorEvent(context, component, eventName);
  if ("action".equals(eventName) || "click".equals(eventName)) {
    new ActionEvent(component).queue();
  }
}

代码示例来源:origin: org.icefaces/icefaces

public void decode(FacesContext context) {
  final ExternalContext externalContext = context.getExternalContext();
  Map requestParameterMap = externalContext.getRequestParameterMap();
  String source = String.valueOf(requestParameterMap.get("javax.faces.source"));
  String clientId = getClientId();
  if (clientId.equals(source)) {
    queueEvent(new ActionEvent(this));
  }
}

代码示例来源:origin: org.icefaces/icefaces-compat

public void decode(FacesContext facesContext, UIComponent uiComponent) {
  Map requestMap =
    facesContext.getExternalContext().getRequestParameterMap();
  String clientId = uiComponent.getClientId(facesContext);
  if (requestMap.containsKey("ice.event.captured")) {
    if (clientId.equals(requestMap.get("ice.event.captured"))) {
      uiComponent.queueEvent(new ActionEvent(uiComponent));
    }
  }
}

代码示例来源:origin: org.springframework.webflow/org.springframework.faces

public void decode(FacesContext context, UIComponent component) {
    if (context.getExternalContext().getRequestParameterMap().containsKey("ajaxSource")
        && context.getExternalContext().getRequestParameterMap().get("ajaxSource").equals(
            component.getClientId(context))) {
      component.queueEvent(new ActionEvent(component));
    }
  }
}

代码示例来源:origin: org.primefaces/primefaces

@Override
public void decode(FacesContext facesContext, UIComponent component) {
  Map<String, String> params = facesContext.getExternalContext().getRequestParameterMap();
  Hotkey hotkey = (Hotkey) component;
  if (params.containsKey(hotkey.getClientId(facesContext))) {
    hotkey.queueEvent(new ActionEvent(hotkey));
  }
}

代码示例来源:origin: org.springframework.webflow/org.springframework.faces

public void decode(FacesContext context, UIComponent component) {
  if (context.getExternalContext().getRequestParameterMap().containsKey(component.getClientId(context))) {
    component.queueEvent(new ActionEvent(component));
  }
}

代码示例来源:origin: org.icefaces/icefaces-compat

public void queueEventIfEnterKeyPressed(FacesContext facesContext,
                    UIComponent uiComponent) {
  try {
    KeyEvent keyEvent =
        new KeyEvent(uiComponent, facesContext.getExternalContext().getRequestParameterMap());
    if (keyEvent.getKeyCode() == KeyEvent.CARRIAGE_RETURN) {
      uiComponent.queueEvent(new ActionEvent(uiComponent));
    }
  } catch (Exception e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: org.primefaces/primefaces

@Override
public void decode(FacesContext context, UIComponent component) {
  CommandButton button = (CommandButton) component;
  if (button.isDisabled()) {
    return;
  }
  String param = component.getClientId(context);
  if (context.getExternalContext().getRequestParameterMap().containsKey(param)) {
    component.queueEvent(new ActionEvent(component));
  }
  decodeBehaviors(context, component);
}

代码示例来源:origin: org.primefaces/primefaces

@Override
public void decode(FacesContext context, UIComponent component) {
  CommandLink link = (CommandLink) component;
  if (link.isDisabled()) {
    return;
  }
  String param = component.getClientId(context);
  if (context.getExternalContext().getRequestParameterMap().containsKey(param)) {
    component.queueEvent(new ActionEvent(component));
  }
  decodeBehaviors(context, component);
}

代码示例来源:origin: org.apache.myfaces.tomahawk/tomahawk

public void decode(FacesContext facesContext, UIComponent uiComponent) {
  org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.checkParamValidity(facesContext, uiComponent, UICommand.class);
  //super.decode must not be called, because value is handled here
  if (!isReset(uiComponent) && isSubmitted(facesContext, uiComponent)) {
    uiComponent.queueEvent(new ActionEvent(uiComponent));
    org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.initPartialValidationAndModelUpdate(uiComponent, facesContext);
  }
}

代码示例来源:origin: org.apache.myfaces/com.springsource.org.apache.myfaces

public void decode(FacesContext facesContext, UIComponent uiComponent)
{
  org.apache.myfaces.shared_impl.renderkit.RendererUtils.checkParamValidity(facesContext, uiComponent, UICommand.class);
  //super.decode must not be called, because value is handled here
  if (!isReset(uiComponent) && isSubmitted(facesContext, uiComponent))
  {
    uiComponent.queueEvent(new ActionEvent(uiComponent));
    org.apache.myfaces.shared_impl.renderkit.RendererUtils.initPartialValidationAndModelUpdate(uiComponent, facesContext);
  }
}

代码示例来源:origin: spring-projects/spring-webflow

public final void testProcessAction_NullOutcome() {
  String outcome = null;
  MethodExpression expression = new MethodExpressionStub(outcome);
  UICommand commandButton = new UICommand();
  commandButton.setActionExpression(expression);
  ActionEvent event = new ActionEvent(commandButton);
  this.listener.processAction(event);
  assertFalse("An unexpected event was signaled",
      this.jsfMock.externalContext().getRequestMap().containsKey(JsfView.EVENT_KEY));
}

相关文章