Class ToolActions

  • All Implemented Interfaces:
    DockingToolActions, java.beans.PropertyChangeListener, java.util.EventListener

    public class ToolActions
    extends java.lang.Object
    implements DockingToolActions, java.beans.PropertyChangeListener
    An class to manage actions registered with the tool
    • Constructor Detail

      • ToolActions

        public ToolActions​(DockingTool tool,
                           ActionToGuiHelper actionToGuiHelper)
        Construct an ActionManager
        Parameters:
        tool - tool using this ActionManager
        actionToGuiHelper - the class that takes actions and maps them to GUI widgets
    • Method Detail

      • dispose

        public void dispose()
      • addLocalAction

        public void addLocalAction​(ComponentProvider provider,
                                   DockingActionIf action)
        Add an action that works specifically with a component provider.
        Specified by:
        addLocalAction in interface DockingToolActions
        Parameters:
        provider - provider associated with the action
        action - local action to the provider
      • removeActions

        public void removeActions​(java.lang.String owner)
        Description copied from interface: DockingToolActions
        Removes all global actions for the given owner
        Specified by:
        removeActions in interface DockingToolActions
        Parameters:
        owner - the owner
      • getActions

        public java.util.Set<DockingActionIf> getActions​(java.lang.String owner)
        Get all actions for the given owner
        Specified by:
        getActions in interface DockingToolActions
        Parameters:
        owner - owner of the actions
        Returns:
        array of actions; zero length array is returned if no action exists with the given name
      • restoreKeyBindings

        public void restoreKeyBindings()
        Get the keybindings for each action so that they are still registered as being used; otherwise the options will be removed because they are noted as not being used.
      • removeLocalAction

        public void removeLocalAction​(ComponentProvider provider,
                                      DockingActionIf action)
        Remove an action that works specifically with a component provider.
        Specified by:
        removeLocalAction in interface DockingToolActions
        Parameters:
        provider - provider associated with the action
        action - local action to the provider
      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent evt)
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener
      • getAction

        public javax.swing.Action getAction​(javax.swing.KeyStroke ks)