Class BaseAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- com.inductiveautomation.ignition.client.util.action.BaseAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.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
public abstract class BaseAction extends javax.swing.AbstractActionBase action implementation that helps actions hook into the i18n framework.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BaseAction(java.lang.String bundleKey)BaseAction(java.lang.String bundleKey, javax.swing.Icon icon)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BaseActioncreate(java.lang.String bundleKey, javax.swing.Icon icon, java.lang.Runnable action)static javax.swing.JButtoncreateButton(java.lang.String bundleKey)static javax.swing.JButtoncreateButton(java.lang.String bundleKey, javax.swing.Icon icon)Handy static function for when an Action isn't appropriate.protected booleanevaluateEnabled()Evaluates whether or not the action should be enabledvoidlistenTo(javax.swing.AbstractButton button)voidlistenTo(javax.swing.ListSelectionModel model)Sets up a listener so that every time the list selection model changes, the action's enabledness is re-evalutedvoidsetBundleKey(java.lang.String bundleKey)voidsetIcon(javax.swing.Icon icon)voidupdateEnabled()-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
BaseAction
public BaseAction(java.lang.String bundleKey)
-
BaseAction
public BaseAction(java.lang.String bundleKey, javax.swing.Icon icon)- 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 Detail
-
create
public static BaseAction create(java.lang.String bundleKey, javax.swing.Icon icon, java.lang.Runnable action)
-
setBundleKey
public void setBundleKey(java.lang.String bundleKey)
-
setIcon
public void setIcon(javax.swing.Icon icon)
-
createButton
public static javax.swing.JButton createButton(java.lang.String bundleKey)
-
createButton
public static javax.swing.JButton createButton(java.lang.String bundleKey, javax.swing.Icon icon)Handy static function for when an Action isn't appropriate. Uses the same key logic is BaseAction()
-
listenTo
public void listenTo(javax.swing.ListSelectionModel model)
Sets up a listener so that every time the list selection model changes, the action's enabledness is re-evaluted
-
listenTo
public void listenTo(javax.swing.AbstractButton button)
-
updateEnabled
public void updateEnabled()
-
evaluateEnabled
protected boolean evaluateEnabled()
Evaluates whether or not the action should be enabled
-
-