Package docking
Class AbstractDockingTool
- java.lang.Object
-
- docking.AbstractDockingTool
-
- All Implemented Interfaces:
DockingTool
- Direct Known Subclasses:
PluginTool
public abstract class AbstractDockingTool extends java.lang.Object implements DockingTool
A partial implementation ofDockingToolthat serves as a place to share common functionality
-
-
Field Summary
Fields Modifier and Type Field Description protected DockingToolActionManageractionMgrprotected booleanconfigChangedFlagprotected java.util.Map<java.lang.String,ToolOptions>optionsMapprotected DockingWindowManagerwinMgr
-
Constructor Summary
Constructors Constructor Description AbstractDockingTool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAction(DockingActionIf action)Adds the action to the tool.voidaddComponentProvider(ComponentProvider provider, boolean show)Adds the ComponentProvider to the tool, optionally making it visible.voidaddLocalAction(ComponentProvider provider, DockingActionIf action)Adds the action to the given provider as a local action.voidcontextChanged(ComponentProvider provider)Signals to the tool that the provider's context has changed.java.util.List<DockingActionIf>getAllActions()Return a list of all actions in the tool.ComponentProvidergetComponentProvider(java.lang.String name)Gets the ComponentProvider with the given name.java.util.List<DockingActionIf>getDockingActionsByFullActionName(java.lang.String fullActionName)Return an list of actions with the given full namejava.util.List<DockingActionIf>getDockingActionsByOwnerName(java.lang.String owner)Returns all actions for the given ownerjava.awt.WindowgetProviderWindow(ComponentProvider provider)Returns the parent window for the given providerjavax.swing.JFramegetToolFrame()DockingWindowManagergetWindowManager()Returns the DockingWindowManger for this tool.booleanhasConfigChanged()Return true if the tool's configuration has changed.booleanisActive(ComponentProvider provider)Returns true if the ComponentProvider is the currently active provider.booleanisVisible()Returns true if tool is visible.booleanisVisible(ComponentProvider provider)Returns true if the given ComponentProvider is currently visible.voidremoveAction(DockingActionIf action)Removes the given action from the toolvoidremoveComponentProvider(ComponentProvider provider)Removes the given ComponentProvider from the tool.voidremoveLocalAction(ComponentProvider provider, DockingActionIf action)Removes the action from the providervoidsetConfigChanged(boolean changed)Toggles the "change" state of the tool...voidsetStatusInfo(java.lang.String text)Set the status informationvoidsetVisible(boolean visibility)Sets the tool visible or invisible.voidshowComponentProvider(ComponentProvider provider, boolean visible)Shows or hides the component provider in the toolvoidshowDialog(DialogComponentProvider dialogComponent)Shows the dialog using the tool's root frame as a parent.voidtoFront()Brings this tool to the front.voidtoFront(ComponentProvider provider)Makes the given ComponentProvider move to the front if it is tabbed with other components.voidupdateTitle(ComponentProvider provider)Indicates to the tool that the given componentProvider's title has changed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface docking.DockingTool
getIcon, getName, getOptions
-
-
-
-
Field Detail
-
winMgr
protected DockingWindowManager winMgr
-
actionMgr
protected DockingToolActionManager actionMgr
-
optionsMap
protected java.util.Map<java.lang.String,ToolOptions> optionsMap
-
configChangedFlag
protected boolean configChangedFlag
-
-
Method Detail
-
isVisible
public boolean isVisible()
Description copied from interface:DockingToolReturns true if tool is visible.- Specified by:
isVisiblein interfaceDockingTool
-
setVisible
public void setVisible(boolean visibility)
Description copied from interface:DockingToolSets 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.- Specified by:
setVisiblein interfaceDockingTool- Parameters:
visibility- true specifies that the tool should be visible
-
toFront
public void toFront()
Description copied from interface:DockingToolBrings this tool to the front. Places this tool at the top of the stacking order and shows it in front of any other tools.- Specified by:
toFrontin interfaceDockingTool
-
addComponentProvider
public void addComponentProvider(ComponentProvider provider, boolean show)
Description copied from interface:DockingToolAdds the ComponentProvider to the tool, optionally making it visible.- Specified by:
addComponentProviderin interfaceDockingTool- Parameters:
provider- the provider to add to the toolshow- if true, the component is made visible.
-
removeComponentProvider
public void removeComponentProvider(ComponentProvider provider)
Description copied from interface:DockingToolRemoves the given ComponentProvider from the tool.- Specified by:
removeComponentProviderin interfaceDockingTool
-
getComponentProvider
public ComponentProvider getComponentProvider(java.lang.String name)
Description copied from interface:DockingToolGets the ComponentProvider with the given name.- Specified by:
getComponentProviderin interfaceDockingTool- Parameters:
name- the name of the provider to get- Returns:
- the provider
-
setStatusInfo
public void setStatusInfo(java.lang.String text)
Description copied from interface:DockingToolSet the status information- Specified by:
setStatusInfoin interfaceDockingTool- Parameters:
text- string to be displayed in the Status display area
-
addAction
public void addAction(DockingActionIf action)
Description copied from interface:DockingToolAdds the action to the tool.- Specified by:
addActionin interfaceDockingTool- Parameters:
action- the action to be added.
-
removeAction
public void removeAction(DockingActionIf action)
Description copied from interface:DockingToolRemoves the given action from the tool- Specified by:
removeActionin interfaceDockingTool- Parameters:
action- the action to be removed.
-
addLocalAction
public void addLocalAction(ComponentProvider provider, DockingActionIf action)
Description copied from interface:DockingToolAdds the action to the given provider as a local action.- Specified by:
addLocalActionin interfaceDockingTool- Parameters:
provider- the provider to add the action to.action- the DockingAction to add to the componentProvider.
-
removeLocalAction
public void removeLocalAction(ComponentProvider provider, DockingActionIf action)
Description copied from interface:DockingToolRemoves the action from the provider- Specified by:
removeLocalActionin interfaceDockingTool- Parameters:
provider- the component provider from which to remove the action.action- the action to remove.
-
getAllActions
public java.util.List<DockingActionIf> getAllActions()
Description copied from interface:DockingToolReturn a list of all actions in the tool.- Specified by:
getAllActionsin interfaceDockingTool- Returns:
- list of all actions
-
getDockingActionsByOwnerName
public java.util.List<DockingActionIf> getDockingActionsByOwnerName(java.lang.String owner)
Description copied from interface:DockingToolReturns all actions for the given owner- Specified by:
getDockingActionsByOwnerNamein interfaceDockingTool- Parameters:
owner- the action owner's name- Returns:
- the actions
-
getDockingActionsByFullActionName
public java.util.List<DockingActionIf> getDockingActionsByFullActionName(java.lang.String fullActionName)
Description copied from interface:DockingToolReturn an list of actions with the given full name- Specified by:
getDockingActionsByFullActionNamein interfaceDockingTool- Parameters:
fullActionName- action name that includes the owner's name in parentheses, e.g. "MyAction (MyPlugin)"- Returns:
- the actions
-
showComponentProvider
public void showComponentProvider(ComponentProvider provider, boolean visible)
Description copied from interface:DockingToolShows or hides the component provider in the tool- Specified by:
showComponentProviderin interfaceDockingTool- Parameters:
provider- the provider to either show or hide.visible- true to show the provider, false to hide it.
-
showDialog
public void showDialog(DialogComponentProvider dialogComponent)
Description copied from interface:DockingToolShows 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.- Specified by:
showDialogin interfaceDockingTool- Parameters:
dialogComponent- the DialogComponentProvider object to be shown in a dialog.
-
getToolFrame
public javax.swing.JFrame getToolFrame()
-
getProviderWindow
public java.awt.Window getProviderWindow(ComponentProvider provider)
Description copied from interface:DockingToolReturns the parent window for the given provider- Specified by:
getProviderWindowin interfaceDockingTool- Parameters:
provider- the provider- Returns:
- the window
-
toFront
public void toFront(ComponentProvider provider)
Description copied from interface:DockingToolMakes the given ComponentProvider move to the front if it is tabbed with other components.- Specified by:
toFrontin interfaceDockingTool- Parameters:
provider- the provider to move to the top of its stacking order.
-
isVisible
public boolean isVisible(ComponentProvider provider)
Description copied from interface:DockingToolReturns true if the given ComponentProvider is currently visible.- Specified by:
isVisiblein interfaceDockingTool- Parameters:
provider- the provider to check for visibility.- Returns:
- true if the given ComponentProvider is currently visible.
-
isActive
public boolean isActive(ComponentProvider provider)
Description copied from interface:DockingToolReturns 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.- Specified by:
isActivein interfaceDockingTool- Parameters:
provider- the provider to check for active.- Returns:
- true if the ComponentProvider is the currently active provider.
-
updateTitle
public void updateTitle(ComponentProvider provider)
Description copied from interface:DockingToolIndicates to the tool that the given componentProvider's title has changed.- Specified by:
updateTitlein interfaceDockingTool- Parameters:
provider- the componentProvider whose title has changed.
-
contextChanged
public void contextChanged(ComponentProvider provider)
Description copied from interface:DockingToolSignals to the tool that the provider's context has changed. This lets toolbar actions update enablement based on current context.- Specified by:
contextChangedin interfaceDockingTool- Parameters:
provider- the provider whose context changed.
-
getWindowManager
public DockingWindowManager getWindowManager()
Description copied from interface:DockingToolReturns the DockingWindowManger for this tool.- Specified by:
getWindowManagerin interfaceDockingTool- Returns:
- the DockingWindowManger for this tool.
-
setConfigChanged
public void setConfigChanged(boolean changed)
Description copied from interface:DockingToolToggles the "change" state of the tool...- Specified by:
setConfigChangedin interfaceDockingTool- Parameters:
changed- true indicates that the tool config has changed.
-
hasConfigChanged
public boolean hasConfigChanged()
Description copied from interface:DockingToolReturn true if the tool's configuration has changed.- Specified by:
hasConfigChangedin interfaceDockingTool
-
-