Class TargetableAction
java.lang.Object
javax.swing.AbstractAction
org.jdesktop.swingx.action.AbstractActionExt
org.jdesktop.swingx.action.TargetableAction
- All Implemented Interfaces:
ActionListener, ItemListener, Serializable, Cloneable, EventListener, Action
A class that represents a dynamically targetable action. The invocation of this
action will be dispatched to the
TargetManager instance.
You would create instances of this class to let the TargetManager handle the action invocations from the ui components constructed with this action. The TargetManager could be configured depending on application state to handle these actions.
- See Also:
-
Field Summary
FieldsFields inherited from class AbstractActionExt
GROUP, IS_STATE, LARGE_ICONFields inherited from class AbstractAction
changeSupport, enabledFields inherited from interface Action
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 Summary
ConstructorsConstructorDescriptionTargetableAction(String name) TargetableAction(String name, String command) TargetableAction(String name, String command, Icon icon) TargetableAction(String name, Icon icon) -
Method Summary
Modifier and TypeMethodDescriptionvoidCallback for command actions.Returns the target manager instance which will be used for action dispatch.voidCallback for toggle actions.voidSet target manager which will handle this command.toString()Methods inherited from class AbstractActionExt
dispose, getAccelerator, getActionCommand, getGroup, getLargeIcon, getLongDescription, getMnemonic, getName, getShortDescription, getSmallIcon, isSelected, isStateAction, setAccelerator, setActionCommand, setGroup, setLargeIcon, setLongDescription, setMnemonic, setMnemonic, setName, setSelected, setShortDescription, setSmallIcon, setStateAction, setStateActionMethods inherited from class AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
targetManager
-
-
Constructor Details
-
TargetableAction
public TargetableAction() -
TargetableAction
-
TargetableAction
-
TargetableAction
-
TargetableAction
-
-
Method Details
-
setTargetManager
Set target manager which will handle this command. This action may be reset to use the singleton instance if set to null.- Parameters:
tm- the target manager instance to dispatch the actions
-
getTargetManager
Returns the target manager instance which will be used for action dispatch. If the target manager has not previously been set then the singleton instance will be returned.- Returns:
- a non null target manager
-
actionPerformed
Callback for command actions. This event will be redispatched to the target manager along with the value of the Action.ACTION_COMMAND_KEY- Parameters:
evt- event which will be forwarded to the TargetManager- See Also:
-
itemStateChanged
Callback for toggle actions. This event will be redispatched to the target manager along with value of the the Action.ACTION_COMMAND_KEY- Specified by:
itemStateChangedin interfaceItemListener- Overrides:
itemStateChangedin classAbstractActionExt- Parameters:
evt- event which will be forwarded to the TargetManager- See Also:
-
toString
- Overrides:
toStringin classAbstractActionExt
-