Package docking

Interface Tool

    • Method Detail

      • getName

        java.lang.String getName()
        Returns a combination of the tool name and the instance name of the form tool name(instance name), e.g., SomeTool(2)
        Returns:
        the tool name
      • isVisible

        boolean isVisible()
        Returns true if tool is visible
        Returns:
        true if tool is visible
      • setVisible

        void setVisible​(boolean visibility)
        Sets the tool visible or invisible. This method is used by the Project to make it's tools visible or invisible depending on whether this tool is in is the active workspace.
        Parameters:
        visibility - true specifies that the tool should be visible
      • toFront

        void toFront()
        Brings this tool to the front. Places this tool at the top of the stacking order and shows it in front of any other tools.
      • getIcon

        javax.swing.ImageIcon getIcon()
        Get the icon that the tool is using
        Returns:
        the icon that the tool is using
      • addComponentProvider

        void addComponentProvider​(ComponentProvider componentProvider,
                                  boolean show)
        Adds the ComponentProvider to the tool, optionally making it visible.
        Parameters:
        componentProvider - the provider to add to the tool
        show - if true, the component is made visible.
      • removeComponentProvider

        void removeComponentProvider​(ComponentProvider componentProvider)
        Removes the given ComponentProvider from the tool. When a provider has been removed from the tool it is considered disposed and should not be reused.
        Parameters:
        componentProvider - the provider to remove from the tool
      • getComponentProvider

        ComponentProvider getComponentProvider​(java.lang.String name)
        Gets the ComponentProvider with the given name.
        Parameters:
        name - the name of the provider to get
        Returns:
        the provider
      • setStatusInfo

        void setStatusInfo​(java.lang.String text)
        Set the status information
        Parameters:
        text - non-html string to be displayed in the Status display area
      • setStatusInfo

        void setStatusInfo​(java.lang.String text,
                           boolean beep)
        Set the status information
        Parameters:
        text - string to be displayed in the Status display area
        beep - whether to be or not
      • clearStatusInfo

        void clearStatusInfo()
        Clear the status information
      • setMenuGroup

        void setMenuGroup​(java.lang.String[] menuPath,
                          java.lang.String group,
                          java.lang.String menuSubGroup)
        Set the menu group associated with a cascaded submenu. This allows a cascading menu item to be grouped with a specific set of actions.

        The default group for a cascaded submenu is the name of the submenu.

        Parameters:
        menuPath - menu name path where the last element corresponds to the specified group name.
        group - group name
        menuSubGroup - the name used to sort the cascaded menu within other menu items at its level
      • addAction

        void addAction​(DockingActionIf action)
        Adds the action to the tool.
        Parameters:
        action - the action to be added.
      • removeAction

        void removeAction​(DockingActionIf action)
        Removes the given action from the tool. When an action is removed from the tool it will be disposed and should not be reused.
        Parameters:
        action - the action to be removed.
      • addLocalAction

        void addLocalAction​(ComponentProvider componentProvider,
                            DockingActionIf action)
        Adds the action to the given provider as a local action.
        Parameters:
        componentProvider - the provider to add the action to.
        action - the DockingAction to add to the componentProvider.
      • removeLocalAction

        void removeLocalAction​(ComponentProvider componentProvider,
                               DockingActionIf action)
        Removes the action from the provider
        Parameters:
        componentProvider - the component provider from which to remove the action.
        action - the action to remove.
      • addPopupActionProvider

        void addPopupActionProvider​(PopupActionProvider provider)
        Adds the given popup action provider to this tool. This provider will be called each time the popup menu is about to be shown.
        Parameters:
        provider - the provider
      • removePopupActionProvider

        void removePopupActionProvider​(PopupActionProvider provider)
        Removes the given popup action provider
        Parameters:
        provider - the provider
      • getAllActions

        java.util.Set<DockingActionIf> getAllActions()
        Return a set of all actions in the tool.

        Note: the result may contain conceptually duplicate actions, which is when multiple actions exist that share the same full name (the full name is the action name with the owner name, such as "My Action (MyPlugin)".

        Returns:
        set of all actions
      • getDockingActionsByOwnerName

        java.util.Set<DockingActionIf> getDockingActionsByOwnerName​(java.lang.String owner)
        Returns all actions for the given owner

        Note: the result may contain conceptually duplicate actions, which is when multiple actions exist that share the same full name (the full name is the action name with the owner name, such as "My Action (MyPlugin)".

        Parameters:
        owner - the action owner's name
        Returns:
        the actions
      • getActiveComponentProvider

        ComponentProvider getActiveComponentProvider()
        Returns the active component provider, that which has focus
        Returns:
        the active provider
      • showComponentProvider

        void showComponentProvider​(ComponentProvider componentProvider,
                                   boolean visible)
        Shows or hides the component provider in the tool
        Parameters:
        componentProvider - the provider to either show or hide.
        visible - true to show the provider, false to hide it.
      • showDialog

        void showDialog​(DialogComponentProvider dialogComponent)
        Shows the dialog using the tool's root frame as a parent. Also, remembers any size and location adjustments made by the user for the next time the dialog is shown.
        Parameters:
        dialogComponent - the DialogComponentProvider object to be shown in a dialog.
      • getProviderWindow

        java.awt.Window getProviderWindow​(ComponentProvider componentProvider)
        Returns the parent window for the given provider
        Parameters:
        componentProvider - the provider
        Returns:
        the window
      • toFront

        void toFront​(ComponentProvider componentProvider)
        Makes the given ComponentProvider move to the front if it is tabbed with other components.
        Parameters:
        componentProvider - the provider to move to the top of its stacking order.
      • isVisible

        boolean isVisible​(ComponentProvider componentProvider)
        Returns true if the given ComponentProvider is currently visible.
        Parameters:
        componentProvider - the provider to check for visibility.
        Returns:
        true if the given ComponentProvider is currently visible.
      • isActive

        boolean isActive​(ComponentProvider componentProvider)
        Returns true if the ComponentProvider is the currently active provider. The active provider is the provider that has keyboard focus and provides the current action context.
        Parameters:
        componentProvider - the provider to check for active.
        Returns:
        true if the ComponentProvider is the currently active provider.
      • updateTitle

        void updateTitle​(ComponentProvider componentProvider)
        Indicates to the tool that the given componentProvider's title has changed.
        Parameters:
        componentProvider - the componentProvider whose title has changed.
      • contextChanged

        void contextChanged​(ComponentProvider provider)
        Signals to the tool that the provider's context has changed. This lets toolbar and menu actions update enablement based on current context.

        Pass null to signal that the entire tool's context has changed

        Parameters:
        provider - the provider whose context changed; null to signal the tool's context
      • addContextListener

        void addContextListener​(DockingContextListener listener)
        Adds the given context listener to this tool
        Parameters:
        listener - the listener to add
      • removeContextListener

        void removeContextListener​(DockingContextListener listener)
        Removes the given context listener to this tool
        Parameters:
        listener - the listener to add
      • getWindowManager

        DockingWindowManager getWindowManager()
        Returns the DockingWindowManger for this tool.
        Returns:
        the DockingWindowManger for this tool.
      • getOptions

        ToolOptions getOptions​(java.lang.String categoryName)
        Get the options for the given category name; if no options exist with the given name, then one is created.
        Parameters:
        categoryName - the category name
        Returns:
        the options
      • setConfigChanged

        void setConfigChanged​(boolean changed)
        Toggles the "change" state of the tool...
        Parameters:
        changed - true indicates that the tool config has changed.
      • hasConfigChanged

        boolean hasConfigChanged()
        Return true if the tool's configuration has changed
        Returns:
        true if the tool's configuration has changed
      • close

        void close()
        Suggests the tool to attempt to close(). This will be as though the user selected the close menu option on the tool or hit the closeWindow x button in the upper corner (Windows systems).
      • getDefaultToolContext

        ActionContext getDefaultToolContext()
        Returns the default ActionContext for the tool. The default context is the context the default ComponentProvider for the tool.
        Returns:
        the default ActionContext for the tool