Class DockingToolActionManager

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

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

      • DockingToolActionManager

        public DockingToolActionManager​(DockingTool tool,
                                        DockingWindowManager windowManager)
        Construct an ActionManager.
        Parameters:
        tool - tool using this ActionManager
        windowManager - manager of the "Docking" arrangement of a set of components and actions in the tool
    • Method Detail

      • dispose

        public void dispose()
      • addToolAction

        public void addToolAction​(DockingActionIf action)
        Adds the action to the tool.
        Parameters:
        action - the action to be added.
      • removeToolAction

        public void removeToolAction​(DockingActionIf action)
        Removes the given action from the tool
        Parameters:
        action - the action to be removed.
      • removeToolActions

        public void removeToolActions​(java.lang.String owner)
        Remove all actions that have the given owner.
        Parameters:
        owner - owner of the actions to remove
      • addLocalAction

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

        public void removeProviderAction​(ComponentProvider provider,
                                         DockingActionIf action)
        Remove an action that works specifically with a component provider.
        Parameters:
        provider - provider associated with the action
        action - local action to the provider
      • getDockingActionsByFullActionName

        public java.util.List<DockingActionIf> getDockingActionsByFullActionName​(java.lang.String fullActionName)
        Get all actions that have the action name which includes the action owner's name.
        Parameters:
        fullName - full name for the action, e.g., "My Action (My Plugin)"
        Returns:
        list of actions; empty if no action exists with the given name
      • getActions

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

        public java.util.List<DockingActionIf> getAllActions()
        Get a list of all actions in the tool.
        Returns:
        list of PluginAction objects
      • 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.
      • removeComponent

        public void removeComponent​(ComponentProvider provider)
        Get the actions for the given provider and remove them from the actionMap; call the window manager to remove the provider.
        Parameters:
        provider - provider to be removed
      • propertyChange

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