|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
javax.faces.component Interface ActionSource
- All Known Subinterfaces:
- ActionSource2
- All Known Implementing Classes:
- HtmlCommandButton, HtmlCommandLink, UICommand
public interface ActionSource
ActionSource 是一个接口,可以由要作为 ActionEvent 源(包括要具有通过默认 ActionListener 机制调用应用程序操作的能力)的任何具体 UIComponent 实现。
ActionSource is an interface that may be implemented
by any concrete UIComponent that wishes to be a source of
ActionEvents, including the ability to invoke application
actions via the default ActionListener mechanism.
| Method Summary | |
|---|---|
void |
addActionListener(ActionListener listener)
Add a new ActionListener to the set of listeners interested
in being notified when ActionEvents occur. |
MethodBinding |
getAction()
Deprecated. This has been replaced by ActionSource2.getActionExpression(). |
MethodBinding |
getActionListener()
Deprecated. Use getActionListeners() instead. |
ActionListener[] |
getActionListeners()
Return the set of registered ActionListeners for this
ActionSource instance. |
boolean |
isImmediate()
Return a flag indicating that the default ActionListener
provided by the JavaServer Faces implementation should be executed
immediately (that is, during Apply Request Values phase
of the request processing lifecycle), rather than waiting until the
Invoke Application phase. |
void |
removeActionListener(ActionListener listener)
Remove an existing ActionListener (if any) from the set of
listeners interested in being notified when ActionEvents
occur. |
void |
setAction(MethodBinding action)
Deprecated. This has been replaced by ActionSource2.setActionExpression(javax.el.MethodExpression). |
void |
setActionListener(MethodBinding actionListener)
Deprecated. This has been replaced by addActionListener(javax.faces.event.ActionListener). |
void |
setImmediate(boolean immediate)
Set the "immediate execution" flag for this UIComponent. |
| Method Detail |
|---|
public MethodBinding
getAction()
如果实现类还实现了 ActionSource2,则此方法的实现必须调用 ActionSource2#getActionExpression 并检查该结果。如果结果来自以前对 #setAction 的调用,则从结果中提取 MethodBinding 并将其返回。否则,包装返回的 MethodBinding 实现中的 javax.el.MethodExpression 并将其返回。
如果实现类没有实现 ActionSource2,则返回一个 MethodBinding,该 MethodBinding 指向用户激活此 UIComponent 时要在请求处理生命周期的应用请求值 或调用应用程序 阶段(取决于 immediate 属性的值)调用的应用程序操作。
| deprecated |
此方法已由 ActionSource2#getActionExpression 取代。 |
getAction
MethodBinding getAction()
- Deprecated. This has been replaced by
ActionSource2.getActionExpression(). If the implementing class also implements
ActionSource2, the implementation of this method must call through toActionSource2.getActionExpression()and examine the result. If the result came from a previous call tosetAction(javax.faces.el.MethodBinding), extract theMethodBindingfrom it and return it. Otherwise, wrap the returnedMethodExpressionin aMethodBindingimplementation, and return it.If the implementing class does not implement
ActionSource2, return theMethodBindingpointing at the application action to be invoked, if thisUIComponentis activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of theimmediateproperty.
public void
setAction(MethodBinding action)
如果实现类还实现了 ActionSource2,则此方法的实现必须在实现 javax.el.MethodExpression 的类中包装参数 action,并调用 ActionSource2#setActionExpression,同时传递包装的 action。
如果实现类没有实现 ActionSource2,则设置一个 MethodBinding,该 MethodBinding 指向用户激活此 UIComponent 时要在请求处理生命周期的应用请求值 或调用应用程序 阶段(取决于 immediate 属性的值)调用的应用程序操作。
此表达式所引用的任何方法都必须是公共的,返回类型为 String,并且不接受任何参数。
| action | 新的 MethodBinding 表达式 |
| deprecated |
此方法已由 setActionExpression(javax.el.MethodExpression) 替代。 |
setAction
void setAction(MethodBinding action)
- Deprecated. This has been replaced by
ActionSource2.setActionExpression(javax.el.MethodExpression). If the implementing class also implements
ActionSource2, the implementation of this method must wrap the argumentactionin a class that implementsMethodExpressionand call through toActionSource2.setActionExpression(javax.el.MethodExpression), passing the wrappedaction.If the implementing class does not implement
ActionSource2, set theMethodBindingpointing at the appication action to be invoked, if thisUIComponentis activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of theimmediateproperty.Any method referenced by such an expression must be public, with a return type of
String, and accept no parameters.- Parameters:
action- The new MethodBinding expression
public MethodBinding
getActionListener()
如果以前没有为此实例调用过 #setActionListener,则此方法必须返回 null。如果调用过 #setActionListener,则此方法必须返回原先传递给 #setActionListener 的那个 MethodBinding 实例。
用户激活此 UIComponent 时要调用的方法将在请求处理生命周期的应用请求值 或调用应用程序 阶段(取决于 immediate 属性的值)调用。
| deprecated |
请改用 #getActionListeners。 |
getActionListener
MethodBinding getActionListener()
- Deprecated. Use
getActionListeners()instead. If
setActionListener(javax.faces.el.MethodBinding)was not previously called for this instance, this method must returnnull. If it was called, this method must return the exactMethodBindinginstance that was passed tosetActionListener(javax.faces.el.MethodBinding).The method to be invoked, if this
UIComponentis activated by the user, will be called during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending upon the value of theimmediateproperty.
public void
setActionListener(MethodBinding actionListener)
在 ActionListener 的实现中包装参数 actionListener,并将其存储在支持 #getActionListeners 方法的内部数据结构中,小心地重写通过以前调用 setActionListener 存储的任何实例。
此表达式所引用的任何方法都必须是公共的,返回类型为 void,并接受类型为 ActionEvent 的单个参数。
| actionListener | 新的方法绑定表达式 |
| deprecated |
此方法已由 #addActionListener(javax.faces.event.ActionListener) 替代。 |
setActionListener
void setActionListener(MethodBinding actionListener)
- Deprecated. This has been replaced by
addActionListener(javax.faces.event.ActionListener). Wrap the argument
actionListenerin an implementation ofActionListenerand store it in the internal data structure that backs thegetActionListeners()method, taking care to over-write any instance that was stored by a previous call tosetActionListener.Any method referenced by such an expression must be public, with a return type of
void, and accept a single parameter of typeActionEvent.- Parameters:
actionListener- The new method binding expression
public boolean
isImmediate()
返回一个标志,指示 JavaServer Faces 实现提供的默认 ActionListener 应立即执行(即在请求处理生命周期的应用请求值 阶段),而不是等到调用应用程序 阶段执行。此属性的默认值必须为 false。
isImmediate
boolean isImmediate()
Return a flag indicating that the default
ActionListenerprovided by the JavaServer Faces implementation should be executed immediately (that is, during Apply Request Values phase of the request processing lifecycle), rather than waiting until the Invoke Application phase. The default value for this property must befalse.
public void
setImmediate(boolean immediate)
设置此 UIComponent 的 "immediate execution" 标志。
| immediate | 新的立即执行标志 |
setImmediate
void setImmediate(boolean immediate)
Set the "immediate execution" flag for this
UIComponent.- Parameters:
immediate- The new immediate execution flag
public void
addActionListener(ActionListener listener)
向希望在发生 ActionEvent 时获得通知的侦听器集合中添加一个新的 ActionListener。
| listener |
要添加的 ActionListener |
| Throws | NullPointerException:
如果 listener 为 null |
addActionListener
void addActionListener(ActionListener listener)
Add a new
ActionListenerto the set of listeners interested in being notified whenActionEvents occur.- Parameters:
listener- TheActionListenerto be added- Throws:
NullPointerException- iflistenerisnull
public ActionListener[]
getActionListeners()
返回此 ActionSource 实例已注册的 ActionListener 的集合。如果不存在任何已注册侦听器,则返回一个长度为 0 的数组。
getActionListeners
ActionListener[] getActionListeners()
Return the set of registered
ActionListeners for thisActionSourceinstance. If there are no registered listeners, a zero-length array is returned.
public void
removeActionListener(ActionListener listener)
从希望在发生 ActionEvent 时获得通知的侦听器集合中移除现有的 ActionListener(如果有)。
| listener |
要移除的 ActionListener |
| Throws | NullPointerException:
如果 listener 为 null |
removeActionListener
void removeActionListener(ActionListener listener)
Remove an existing
ActionListener(if any) from the set of listeners interested in being notified whenActionEvents occur.- Parameters:
listener- TheActionListenerto be removed- Throws:
NullPointerException- iflistenerisnull
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!