Class BaseAction
java.lang.Object
javax.swing.AbstractAction
com.inductiveautomation.ignition.client.util.action.BaseAction
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
- Direct Known Subclasses:
AbstractLayoutTool.AbstractAlignmentAction
,AbstractLayoutTool.AbstractZOrderAction
,AbstractLayoutTool.Rotate90Action
,AbstractNavTreeNode.PopupAction
,BaseAction
,CustomMenuPopupAction
,DesignerMenu.MenuActionHandler.ReportMenuAction
,FolderNode.NewFolderAction
,PerspectiveUrlAction
,ReportingResourceWorkspace.ZoomAction
,SelectComponentPropertyAction
,SfcFolderNode.NewChartAction
,StateChangeAction
,TagBrowserPanel.MultiInstanceAction
,TagReferenceAction
,TagStructurePanel.TagAction
,ViewWorkspaceActions.ModifySourceAction
Base action implementation that helps actions hook into the i18n framework.
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
Fields 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 TypeMethodDescriptionstatic BaseAction
static JButton
createButton
(String bundleKey) static JButton
createButton
(String bundleKey, Icon icon) Handy static function for when an Action isn't appropriate.protected boolean
Evaluates whether or not the action should be enabledvoid
listenTo
(AbstractButton button) void
listenTo
(ListSelectionModel model) Sets up a listener so that every time the list selection model changes, the action's enabledness is re-evalutedvoid
setBundleKey
(String bundleKey) void
void
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
-
Constructor Details
-
BaseAction
-
BaseAction
- Parameters:
bundleKey
- A base key for looking up this action's name, description, mnemonic, and accelerator.- bundleKey Will be used for the action's command value
- bundleKey + ".Name" Will be used for the action's name
- bundleKey + ".Desc" Will be used for the action's short and long description
- bundleKey + ".Mnemonic" Will be used for the action's mnemonic. Must be 1 character long. Optional.
- bundleKey + ".Accel" Will be used for the action's accelerator. See
KeyStroke.getKeyStroke(String)
. Optional.
icon
- An icon to display for this action.
-
-
Method Details
-
create
-
setBundleKey
-
setIcon
-
createButton
-
createButton
Handy static function for when an Action isn't appropriate. Uses the same key logic is BaseAction() -
listenTo
Sets up a listener so that every time the list selection model changes, the action's enabledness is re-evaluted -
listenTo
-
updateEnabled
public void updateEnabled() -
evaluateEnabled
protected boolean evaluateEnabled()Evaluates whether or not the action should be enabled
-