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.
Modifier and Type | Class and Description |
---|---|
private class |
BoundAction.BooleanInvocationHandler
The callback for the toggle/state changed action that invokes a method
with a boolean argument on a target.
|
Modifier and Type | Field and Description |
---|---|
private EventListenerList |
listeners |
private static Logger |
LOG |
GROUP, IS_STATE, LARGE_ICON
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
BoundAction() |
BoundAction(String name) |
BoundAction(String name,
Icon icon) |
BoundAction(String name,
String command) |
BoundAction(String name,
String command,
Icon icon) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent evt)
Callback for command actions.
|
void |
addActionListener(ActionListener listener)
Add an action listener which will be invoked when this action is invoked.
|
void |
addItemListener(ItemListener listener)
Add an item listener which will be invoked for toggle actions.
|
private <T extends EventListener> |
addListener(Class<T> clz,
T listener) |
ActionListener[] |
getActionListeners() |
ItemListener[] |
getItemListeners() |
private EventListener[] |
getListeners(Class<? extends EventListener> clz) |
void |
itemStateChanged(ItemEvent evt)
Callback for toggle actions.
|
private void |
readObject(ObjectInputStream s) |
void |
registerCallback(Object handler,
String method)
Registers a callback method when the Action corresponding to
the action id is invoked.
|
void |
removeActionListener(ActionListener listener) |
void |
removeItemListener(ItemListener listener) |
private <T extends EventListener> |
removeListener(Class<T> clz,
T listener) |
void |
setCallback(String callback)
The callback string will be called to register the action callback.
|
private void |
writeObject(ObjectOutputStream s) |
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
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
private transient EventListenerList listeners
public BoundAction()
public BoundAction(String name)
public BoundAction(String name, String command)
name
- display name of the actioncommand
- the value of the action command keypublic BoundAction(String name, Icon icon)
public BoundAction(String name, String command, Icon icon)
name
- display name of the actioncommand
- the value of the action command keyicon
- icon to displaypublic void setCallback(String callback)
<exec>com.sun.foo.FubarHandler#handleBar</exec>will register
registerCallback(com.sun.foo.FubarHandler(), "handleBar");
public void registerCallback(Object handler, 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.private <T extends EventListener> void addListener(Class<T> clz, T listener)
private <T extends EventListener> void removeListener(Class<T> clz, T listener)
private EventListener[] getListeners(Class<? extends EventListener> clz)
public void addActionListener(ActionListener listener)
public void removeActionListener(ActionListener listener)
public ActionListener[] getActionListeners()
public void addItemListener(ItemListener listener)
public void removeItemListener(ItemListener listener)
public ItemListener[] getItemListeners()
public void actionPerformed(ActionEvent evt)
public void itemStateChanged(ItemEvent evt)
itemStateChanged
in interface ItemListener
itemStateChanged
in class AbstractActionExt
evt
- the ItemEvent fired by a ItemSelectable on changing the selected
state.private void writeObject(ObjectOutputStream s) throws IOException
IOException
private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException
ClassNotFoundException
IOException
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses