org.jdesktop.swingx.action
public class BoundAction extends AbstractActionExt
The command invocation of this action may be delegated to another action or item state listener. If there isn't an explicit binding then the command is forwarded to the TargetManager.
GROUP, IS_STATE, LARGE_ICON
Constructor and Description |
---|
BoundAction() |
BoundAction(java.lang.String name) |
BoundAction(java.lang.String name,
javax.swing.Icon icon) |
BoundAction(java.lang.String name,
java.lang.String command) |
BoundAction(java.lang.String name,
java.lang.String command,
javax.swing.Icon icon) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
Callback for command actions.
|
void |
addActionListener(java.awt.event.ActionListener listener)
Add an action listener which will be invoked when this action is invoked.
|
void |
addItemListener(java.awt.event.ItemListener listener)
Add an item listener which will be invoked for toggle actions.
|
java.awt.event.ActionListener[] |
getActionListeners() |
java.awt.event.ItemListener[] |
getItemListeners() |
void |
itemStateChanged(java.awt.event.ItemEvent evt)
Callback for toggle actions.
|
void |
registerCallback(java.lang.Object handler,
java.lang.String method)
Registers a callback method when the Action corresponding to
the action id is invoked.
|
void |
removeActionListener(java.awt.event.ActionListener listener) |
void |
removeItemListener(java.awt.event.ItemListener listener) |
void |
setCallback(java.lang.String callback)
The callback string will be called to register the action callback.
|
dispose, getAccelerator, getActionCommand, getGroup, getLargeIcon, getLongDescription, getMnemonic, getName, getShortDescription, getSmallIcon, isSelected, isStateAction, setAccelerator, setActionCommand, setGroup, setLargeIcon, setLongDescription, setMnemonic, setMnemonic, setName, setSelected, setShortDescription, setSmallIcon, setStateAction, setStateAction, toString
public BoundAction()
public BoundAction(java.lang.String name)
public BoundAction(java.lang.String name, java.lang.String command)
name
- display name of the actioncommand
- the value of the action command keypublic BoundAction(java.lang.String name, javax.swing.Icon icon)
public BoundAction(java.lang.String name, java.lang.String command, javax.swing.Icon icon)
name
- display name of the actioncommand
- the value of the action command keyicon
- icon to displaypublic void setCallback(java.lang.String callback)
<exec>com.sun.foo.FubarHandler#handleBar</exec>will register
registerCallback(com.sun.foo.FubarHandler(), "handleBar");
public void registerCallback(java.lang.Object handler, java.lang.String method)
If the Action represented by the action id is a StateChangeAction, then the method passed should take an int as an argument. The value of getStateChange() on the ItemEvent object will be passed as the parameter.
handler
- the object which will be perform the actionmethod
- the name of the method on the handler which will be called.public void addActionListener(java.awt.event.ActionListener listener)
public void removeActionListener(java.awt.event.ActionListener listener)
public java.awt.event.ActionListener[] getActionListeners()
public void addItemListener(java.awt.event.ItemListener listener)
public void removeItemListener(java.awt.event.ItemListener listener)
public java.awt.event.ItemListener[] getItemListeners()
public void actionPerformed(java.awt.event.ActionEvent evt)
public void itemStateChanged(java.awt.event.ItemEvent evt)
itemStateChanged
in interface java.awt.event.ItemListener
itemStateChanged
in class AbstractActionExt
evt
- the ItemEvent fired by a ItemSelectable on changing the selected
state.