当前位置: 首页>>代码示例>>Java>>正文


Java FacesEvent类代码示例

本文整理汇总了Java中javax.faces.event.FacesEvent的典型用法代码示例。如果您正苦于以下问题:Java FacesEvent类的具体用法?Java FacesEvent怎么用?Java FacesEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FacesEvent类属于javax.faces.event包,在下文中一共展示了FacesEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: __handleQueueEvent

import javax.faces.event.FacesEvent; //导入依赖的package包/类
/**
 * This method sets the phaseID of the event
 * according to the "immediate" property of this
 * component.
 * If "immediate" is set to true, this calls
 * {@link FacesContext#renderResponse}
 */
static void __handleQueueEvent(UIComponent comp, FacesEvent event)
{
  if (_isImmediateEvent(comp, event))
  {
    String immediateAttr = UIXTree.IMMEDIATE_KEY.getName();
    Object isImmediate = comp.getAttributes().get(immediateAttr);
    if (Boolean.TRUE.equals(isImmediate))
    {
      event.setPhaseId(PhaseId.ANY_PHASE);
      FacesContext context = FacesContext.getCurrentInstance();
      context.renderResponse();
    }
    else
    {
      // the event should not execute before model updates are done. 
      // otherwise, the updates will be done to the wrong rows.

      // we can't do this at the end of the UPDATE_MODEL phase because
      // if there are errors during that phase, then we want to immediately render
      // the response, and not deliver this ui event:
      event.setPhaseId(PhaseId.INVOKE_APPLICATION);
    }
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:32,代码来源:TableUtils.java

示例2: broadcastToMethodExpression

import javax.faces.event.FacesEvent; //导入依赖的package包/类
/**
 * Broadcast an event to a MethodExpression.
 * This can be used to support MethodBindings such as the "actionListener"
 * binding on ActionSource components:
 * <tr:commandButton actionListener="#{mybean.myActionListener}">
 */
protected final void broadcastToMethodExpression(
  FacesEvent event,
  MethodExpression method) throws AbortProcessingException
{
  if (method != null)
  {
    try
    {
      FacesContext context = getFacesContext();
      method.invoke(context.getELContext(), new Object[] { event });
    }
    catch (ELException ee)
    {
      Throwable t = ee.getCause();
      // Unwrap AbortProcessingExceptions
      if (t instanceof AbortProcessingException)
        throw ((AbortProcessingException) t);
      throw ee;
    }
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:28,代码来源:UIXComponentBase.java

示例3: queueEvent

import javax.faces.event.FacesEvent; //导入依赖的package包/类
/**
 * Queues an event. If there is a currency set on this table, then
 * the event will be wrapped so that when it is finally delivered, the correct
 * currency will be restored.
 * @param event a FacesEvent
 */
@Override
public void queueEvent(FacesEvent event)
{
  if (event.getSource() == this)
  {
    // Remember non-SelectionEvents on ourselves.  This
    // is a hack to support validation in tableSelectXyz.
    if (!(event instanceof SelectionEvent))
    {
      InternalState iState = _getInternalState(true);
      iState._hasEvent = true;
    }
  }

  // we want to wrap up
  // the event so we can execute it in the correct context (with the correct
  // rowKey/rowData):
  Object currencyKey = getRowKey();
  event = new TableRowEvent(this, event, currencyKey);

  // Queue a CollectionContextEvent in order to allow this class to setup the component change
  // before sub-classes attempt to process the table row event instance.
  super.queueEvent(new CollectionContextEvent(this, event));
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:31,代码来源:UIXCollection.java

示例4: __handleBroadcast

import javax.faces.event.FacesEvent; //导入依赖的package包/类
static void __handleBroadcast(
  UIXHierarchy  comp,
  FacesEvent    event,
  RowKeySet     state,
  MethodExpression method) throws AbortProcessingException
{
  // Notify the specified disclosure listener method (if any)
  if (event instanceof RowDisclosureEvent)
  {
    RowDisclosureEvent dEvent = (RowDisclosureEvent) event;
    state.removeAll(dEvent.getRemovedSet());
    state.addAll(dEvent.getAddedSet());
    //pu: Implicitly record a Change for 'disclosedRowKeys' attribute
    comp.addAttributeChange("disclosedRowKeys", state);
    comp.broadcastToMethodExpression(event, method);
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:18,代码来源:HierarchyUtils.java

示例5: UndisclosureCallbackState

import javax.faces.event.FacesEvent; //导入依赖的package包/类
public UndisclosureCallbackState(
  FacesEvent facesEvent,
  String     clientIdBeingDisclosed)
{
  this.facesEvent = facesEvent;
  this.clientIdBeingDisclosed = clientIdBeingDisclosed;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:8,代码来源:UIXShowOneTemplate.java

示例6: broadcast

import javax.faces.event.FacesEvent; //导入依赖的package包/类
@Override
public void broadcast(FacesEvent event) throws AbortProcessingException
{
  super.broadcast(event);

  // Notify the specified action listener method (if any),
  // and the default action listener
  if (event instanceof ActionEvent)
  {
    FacesContext context = getFacesContext();
    MethodBinding mb = getActionListener();
    if (mb != null)
      mb.invoke(context, new Object[] { event });

    ActionListener defaultActionListener =
      context.getApplication().getActionListener();
    if (defaultActionListener != null)
    {
      defaultActionListener.processAction((ActionEvent) event);
    }
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:23,代码来源:UIXProgressTemplate.java

示例7: broadcast

import javax.faces.event.FacesEvent; //导入依赖的package包/类
@Override
public void broadcast(FacesEvent event)
  throws AbortProcessingException
{
  if (event instanceof WrapperEvent)
  {
    final WrapperEvent wrapper = (WrapperEvent) event;
    final FacesContext context = FacesContext.getCurrentInstance();
    Runnable runner = new Runnable()
    {
      public void run()
      {
        wrapper.broadcastWrappedEvent(context);
      }
    };
    _processPhase(context, runner);
  }
  else
  {
    super.broadcast(event);
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:23,代码来源:UIXComponentRefTemplate.java

示例8: broadcast

import javax.faces.event.FacesEvent; //导入依赖的package包/类
/**
 * Delivers an event.
 * @param event
 * @throws javax.faces.event.AbortProcessingException
 */
@Override
public void broadcast(FacesEvent event) throws AbortProcessingException
{
  if (event instanceof SelectionEvent)
  {
    //pu: Implicitly record a Change for 'selectionState' attribute
    //=-=pu: This ain't getting restored. Check with Arj or file a bug.
    addAttributeChange("selectedRowKeys",
                       getSelectedRowKeys());
    broadcastToMethodExpression(event, getSelectionListener());
  }

  HierarchyUtils.__handleBroadcast(this,
                                    event,
                                    getDisclosedRowKeys(),
                                    getRowDisclosureListener());
  super.broadcast(event);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:24,代码来源:UIXTreeTemplate.java

示例9: queueEvent

import javax.faces.event.FacesEvent; //导入依赖的package包/类
@Override
public void queueEvent(FacesEvent e)
{
  if ((e instanceof PollEvent) && (e.getSource() == this))
  {
    if (isImmediate())
    {
      e.setPhaseId(PhaseId.ANY_PHASE);
    }
    else
    {
      e.setPhaseId(PhaseId.INVOKE_APPLICATION);
    }
  }

  super.queueEvent(e);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:18,代码来源:UIXPollTemplate.java

示例10: broadcast

import javax.faces.event.FacesEvent; //导入依赖的package包/类
@Override
public void broadcast(FacesEvent event) throws AbortProcessingException
{
  // Notify the specified RangeChanged listener method (if any)
  if (event instanceof RangeChangeEvent)
  {
    RangeChangeEvent gtEvent = (RangeChangeEvent)event;
    // update first when the event is delivered
    setFirst(gtEvent.getNewStart());

    broadcastToMethodExpression(event, getRangeChangeListener());
  }

  // Perform standard superclass processing
  super.broadcast(event);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:17,代码来源:UIXSelectRangeTemplate.java

示例11: queueEvent

import javax.faces.event.FacesEvent; //导入依赖的package包/类
/**
 * * We don't want to update model if we have validation errors
 * on the page, so if not immediate, queue the event in
 * INVOKE_APPLICATION phase.
 */
@Override
public void queueEvent(FacesEvent e)
{
  if ((e instanceof RangeChangeEvent) && (e.getSource() == this))
  {
    if (isImmediate())
    {
      e.setPhaseId(PhaseId.ANY_PHASE);
    }
    else
    {
      e.setPhaseId(PhaseId.INVOKE_APPLICATION);
    }
  }

  super.queueEvent(e);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:23,代码来源:UIXSelectRangeTemplate.java

示例12: broadcast

import javax.faces.event.FacesEvent; //导入依赖的package包/类
/**
 * {@inheritDoc}
 *
 * Overridden to handle broadcast of the selection and the row disclosure events
 */

@Override
public void broadcast(FacesEvent event)
  throws AbortProcessingException
{
  if (event instanceof SelectionEvent)
  {
    //vg: Implicitly record a Change for 'selectionState' attribute
    addAttributeChange("selectedRowKeys", getSelectedRowKeys());
    broadcastToMethodExpression(event, getSelectionListener());
  }
  else if (event instanceof RowDisclosureEvent)
  {
    RowDisclosureEvent dEvent = (RowDisclosureEvent) event;
    RowKeySet          state = getGroupDisclosedRowKeys();

    state.removeAll(dEvent.getRemovedSet());
    state.addAll(dEvent.getAddedSet());
    //vg: Implicitly record a Change for 'groupDisclosedRowKeys' attribute
    addAttributeChange("groupDisclosedRowKeys", state);
    broadcastToMethodExpression(event, getGroupDisclosureListener());
  }
  super.broadcast(event);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:30,代码来源:UIXListViewTemplate.java

示例13: queueEvent

import javax.faces.event.FacesEvent; //导入依赖的package包/类
@Override
public void queueEvent(FacesEvent e)
{
  if ((e instanceof DisclosureEvent) && (e.getSource() == this))
  {
    if (isImmediate())
    {
      e.setPhaseId(PhaseId.ANY_PHASE);
    }
    else
    {
      e.setPhaseId(PhaseId.INVOKE_APPLICATION);
    }
  }

  super.queueEvent(e);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:18,代码来源:UIXShowDetailTemplate.java

示例14: queueEvent

import javax.faces.event.FacesEvent; //导入依赖的package包/类
/**
 * <p>Intercept <code>queueEvent</code> and mark the phaseId for the
 * event to be <code>PhaseId.APPLY_REQUEST_VALUES</code> if the
 * <code>immediate</code> flag is true,
 * <code>PhaseId.INVOKE_APPLICATION</code> otherwise.</p>
 */
@Override
public void queueEvent(FacesEvent e)
{
  if (this == e.getComponent() && ((e instanceof ActionEvent) || (e instanceof ReturnEvent)))
  {
    if (isImmediate())
    {
      e.setPhaseId(PhaseId.ANY_PHASE);
    }
    else
    {
      e.setPhaseId(PhaseId.INVOKE_APPLICATION);
    }
  }

  super.queueEvent(e);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:24,代码来源:UIXCommandTemplate.java

示例15: broadcast

import javax.faces.event.FacesEvent; //导入依赖的package包/类
@Override
public void broadcast(FacesEvent event) throws AbortProcessingException
{
  // Notify the specified disclosure listener method (if any)
  if (event instanceof FocusEvent)
  {
    setFocusRowKey(getRowKey());
    //pu: Implicitly record a Change for 'focusPath' attribute
    addAttributeChange("focusPath",
                       getFocusRowKey());
    // it is nice to expand the focused item:
    getDisclosedRowKeys().add();

    broadcastToMethodExpression(event, getFocusListener());
  }
  else if (event instanceof RangeChangeEvent)
  {
    RangeChangeEvent rce = (RangeChangeEvent) event;
    setFirst(rce.getNewStart());
    broadcastToMethodExpression(event, getRangeChangeListener());
  }

  // Perform standard superclass processing
  super.broadcast(event);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:26,代码来源:UIXTreeTableTemplate.java


注:本文中的javax.faces.event.FacesEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。