Package docking

Interface Tool

All Superinterfaces:
ServiceProvider
All Known Implementing Classes:
AbstractDockingTool, FrontEndTool, GhidraTool, ModalPluginTool, PluginTool, StandAlonePluginTool, TestFrontEndTool, TestTool

public interface Tool extends ServiceProvider
Generic tool interface for managing ComponentProviders and actions
  • Method Details

    • getName

      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

      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(String name)
      Gets the ComponentProvider with the given name.
      Parameters:
      name - the name of the provider to get
      Returns:
      the provider
    • setStatusInfo

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

      void setStatusInfo(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
    • getStatusInfo

      String getStatusInfo()
      Get the status information
      Returns:
      the string displayed in the Status area
    • clearStatusInfo

      void clearStatusInfo()
      Clear the status information
    • setMenuGroup

      void setMenuGroup(String[] menuPath, String group, 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

      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
    • getGlobalActions

      Set<DockingActionIf> getGlobalActions()
      Return a set of all global 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 global actions
    • getLocalActions

      Set<DockingActionIf> getLocalActions(ComponentProvider componentProvider)
      Return a set of all local actions for the given ComponentProvider.
      Parameters:
      componentProvider - the component provider from which to get local actions
      Returns:
      set of all local actions for the given provider
    • getDockingActionsByOwnerName

      Set<DockingActionIf> getDockingActionsByOwnerName(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

      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(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
    • getToolActions

      DockingToolActions getToolActions()
      Returns the class that manages actions for the tool.

      Most clients will not need to use this methods. Instead, actions should be added to the tool via addAction(DockingActionIf) and addLocalAction(ComponentProvider, DockingActionIf).

      Returns:
      the action manager
    • 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).