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, 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 TypeMethodDescriptionstatic BaseActionstatic JButtoncreateButton(String bundleKey) static JButtoncreateButton(String bundleKey, Icon icon) Handy static function for when an Action isn't appropriate.protected booleanEvaluates whether or not the action should be enabledvoidlistenTo(AbstractButton button) voidlistenTo(ListSelectionModel model) Sets up a listener so that every time the list selection model changes, the action's enabledness is re-evalutedvoidsetBundleKey(String bundleKey) voidvoidMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-