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

public abstract class BaseAction extends AbstractAction
Base action implementation that helps actions hook into the i18n framework.
See Also:
  • Constructor Details

    • BaseAction

      public BaseAction(String bundleKey)
    • BaseAction

      public BaseAction(String bundleKey, 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 Details

    • create

      public static BaseAction create(String bundleKey, Icon icon, Runnable action)
    • setBundleKey

      public void setBundleKey(String bundleKey)
    • setIcon

      public void setIcon(Icon icon)
    • createButton

      public static JButton createButton(String bundleKey)
    • createButton

      public static JButton createButton(String bundleKey, Icon icon)
      Handy static function for when an Action isn't appropriate. Uses the same key logic is BaseAction()
    • listenTo

      public void listenTo(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(AbstractButton button)
    • updateEnabled

      public void updateEnabled()
    • evaluateEnabled

      protected boolean evaluateEnabled()
      Evaluates whether or not the action should be enabled