Class DynamicAction
java.lang.Object
javax.swing.AbstractAction
uk.theretiredprogrammer.actionssupport.DynamicAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action
- Direct Known Subclasses:
DynamicAsyncAction
A DynamicAction is an Action which can be enabled or disabled, it is not
displayed when disabled.
Methods return the object - allowing the builder style of method chaining during construction, if required.
A DynamicAction is an implementation of the Netbeans AbstractAction class.
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidenable(boolean enable) Enable/Disable this Action.Set the Action method.Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
DynamicAction
Construct a DynamicAction which is enabled- Parameters:
label- The label used when this DynamicAction is displayed.
-
-
Method Details
-
onAction
Set the Action method.- Parameters:
action- the method to be run when this action is selected.- Returns:
- this object
-
enable
Enable/Disable this Action.- Parameters:
enable- true if enable, false if disable.- Returns:
- this object
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-