net.refractions.udig.project.ui.tool
Interface IToolManager


public interface IToolManager


Field Summary
static java.lang.String ATTR_CLASS
          Points to class field of extension point attribute
static java.lang.String ATTR_ID
          Points to id field of extension point attribute
static java.lang.String P_TOOL_MANAGER
          Preference constant that can used to set and look up the default IToolManager.
static java.lang.String XPID
           
 
Method Summary
 void addToolAction(IAction action)
          Adds an Action that executes a tool to the toolbar.
 void contributeActionTools(IToolBarManager toolBarManager, IActionBars bars)
          Adds action tools contribution items to the toolbar.
 void contributeActiveModalTool(IMenuManager manager)
          Contributes items from current active modal tool to the context menu if the modal tool implements IContextMenuContributionTool interface.
 void contributeGlobalActions(IWorkbenchPart part, IActionBars bars)
          Contributes the common global actions.
 void contributeModalTools(IToolBarManager toolBarManager, IActionBars bars)
          Adds modal tools contribution items to the toolbar.
 void contributeToCoolBar(SubCoolBarManager cbmanager, IActionBars bars)
          Deprecated.  
 void contributeToMenu(IMenuManager manager)
           
 MenuManager createOperationsContextMenu(ISelection selection)
          This allows for customized operation menus that are based on the currently selected tool.
 IAction createToolAction(java.lang.String toolID, java.lang.String categoryID)
          Creates a action that acts as a proxy for the tool in the editor toolbar.
 ActionToolCategory findActionCategory(java.lang.String id)
           
 Tool findTool(java.lang.String toolID)
          Finds tool proxy and returns the actual tool implementation object.
 Cursor findToolCursor(java.lang.String cursorID)
          Searches for the Cursor object by ID.
 ToolCategory getActiveCategory()
          Returns the tool category that is currently active.
 Tool getActiveTool()
          Returns current active tool implementation object.
 IAction getBACKWARD_HISTORYAction()
          Retrieves the backward navigation action that is used by much of the map components such as the MapEditor and the LayersView.
 IAction getCOPYAction(IWorkbenchPart part)
           
 IAction getCUTAction(IWorkbenchPart part)
           
 IAction getDELETEAction()
           
 IAction getFORWARD_HISTORYAction()
          Retrieves the forward navigation action that is used by much of the map components such as the MapEditor and the LayersView.
 java.util.List<ModalToolCategory> getModalToolCategories()
          Returns the list of categories containing modal tools.
 IAction getPASTEAction(IWorkbenchPart part)
           
 IAction getREDOAction()
          Retrieves the redo action that is used by much of the map components such as the MapEditor and the LayersView.
 IAction getTool(java.lang.String toolID, java.lang.String categoryID)
          Deprecated. since 1.1, use getToolAction()
 IAction getToolAction(java.lang.String toolID, java.lang.String categoryID)
          Returns the tool identified by an id and a category.
 IAction getUNDOAction()
          Retrieves the undo action that is used by much of the map components such as the MapEditor and the LayersView.
 void registerActionsWithPart(IWorkbenchPart part)
          Registers keybindings for tools and cut/paste with the workbench part
 void setBACKAction(IAction action, IWorkbenchPart part)
           
 void setCOPYAction(IAction action, IWorkbenchPart part)
           
 void setCurrentEditor(MapPart editor)
           
 void setCUTAction(IAction action, IWorkbenchPart part)
           
 void setDELETEAction(IAction action, IWorkbenchPart part)
           
 void setFORWARDAction(IAction action, IWorkbenchPart part)
           
 void setPASTEAction(IAction action, IWorkbenchPart part)
           
 void setREDOAction(IAction action, IWorkbenchPart part)
           
 void setUNDOAction(IAction action, IWorkbenchPart part)
           
 void unregisterActions(IWorkbenchPart part)
          Unregisters keybindings for tools and cut/paste with the workbench part
 

Field Detail

XPID

static final java.lang.String XPID
See Also:
Constant Field Values

ATTR_ID

static final java.lang.String ATTR_ID
Points to id field of extension point attribute

See Also:
Constant Field Values

ATTR_CLASS

static final java.lang.String ATTR_CLASS
Points to class field of extension point attribute

See Also:
Constant Field Values

P_TOOL_MANAGER

static final java.lang.String P_TOOL_MANAGER
Preference constant that can used to set and look up the default IToolManager. This can be set in plugin_customization.ini with the key "net.refractions.udig.project.ui/toolManager".

See Also:
Constant Field Values
Method Detail

setCurrentEditor

void setCurrentEditor(MapPart editor)

addToolAction

void addToolAction(IAction action)
Adds an Action that executes a tool to the toolbar.

Parameters:
action -

createToolAction

IAction createToolAction(java.lang.String toolID,
                         java.lang.String categoryID)
Creates a action that acts as a proxy for the tool in the editor toolbar.

The client code must set the name image descriptor etc... of the Action

Parameters:
toolID - the id of the tool
categoryID - the category the tool is part of
Returns:
a proxy action that can be put in other toolbars

findActionCategory

ActionToolCategory findActionCategory(java.lang.String id)

contributeToMenu

void contributeToMenu(IMenuManager manager)

contributeActiveModalTool

void contributeActiveModalTool(IMenuManager manager)
Contributes items from current active modal tool to the context menu if the modal tool implements IContextMenuContributionTool interface.

Parameters:
manager - a context menu manager from MapEditor.

getREDOAction

IAction getREDOAction()
Retrieves the redo action that is used by much of the map components such as the MapEditor and the LayersView. redoes the last undone command sent to the currently active map.


setREDOAction

void setREDOAction(IAction action,
                   IWorkbenchPart part)

getUNDOAction

IAction getUNDOAction()
Retrieves the undo action that is used by much of the map components such as the MapEditor and the LayersView. Undoes the last command sent to the currently active map.

Parameters:
part -

setUNDOAction

void setUNDOAction(IAction action,
                   IWorkbenchPart part)

getFORWARD_HISTORYAction

IAction getFORWARD_HISTORYAction()
Retrieves the forward navigation action that is used by much of the map components such as the MapEditor and the LayersView. Executes the last undone Nav command on the current map.


setFORWARDAction

void setFORWARDAction(IAction action,
                      IWorkbenchPart part)

registerActionsWithPart

void registerActionsWithPart(IWorkbenchPart part)
Registers keybindings for tools and cut/paste with the workbench part

Parameters:
part -

unregisterActions

void unregisterActions(IWorkbenchPart part)
Unregisters keybindings for tools and cut/paste with the workbench part

Parameters:
part -

getBACKWARD_HISTORYAction

IAction getBACKWARD_HISTORYAction()
Retrieves the backward navigation action that is used by much of the map components such as the MapEditor and the LayersView. Undoes the last Nav command set to the current map.

Parameters:
part -

setBACKAction

void setBACKAction(IAction action,
                   IWorkbenchPart part)

getCUTAction

IAction getCUTAction(IWorkbenchPart part)

setCUTAction

void setCUTAction(IAction action,
                  IWorkbenchPart part)

getCOPYAction

IAction getCOPYAction(IWorkbenchPart part)

setCOPYAction

void setCOPYAction(IAction action,
                   IWorkbenchPart part)

getPASTEAction

IAction getPASTEAction(IWorkbenchPart part)

setPASTEAction

void setPASTEAction(IAction action,
                    IWorkbenchPart part)

getDELETEAction

IAction getDELETEAction()

setDELETEAction

void setDELETEAction(IAction action,
                     IWorkbenchPart part)

contributeToCoolBar

void contributeToCoolBar(SubCoolBarManager cbmanager,
                         IActionBars bars)
Deprecated. 

Adds both action tools and modal tools to the manager

Parameters:
cbmanager -
bars -
See Also:
ModalTool, ActionTool

contributeActionTools

void contributeActionTools(IToolBarManager toolBarManager,
                           IActionBars bars)
Adds action tools contribution items to the toolbar.

The actual toolbar UI elements are created and managed by the framework, IToolManager just adds action tools as contributions to the specified IToolBarManager.

Parameters:
toolManager -
bars -

contributeModalTools

void contributeModalTools(IToolBarManager toolBarManager,
                          IActionBars bars)
Adds modal tools contribution items to the toolbar.

The actual toolbar UI elements are created and managed by the framework, IToolManager just adds action tools as contributions to the specified IToolBarManager.

Parameters:
toolManager -
bars -

contributeGlobalActions

void contributeGlobalActions(IWorkbenchPart part,
                             IActionBars bars)
Contributes the common global actions.

Parameters:
bars -

getTool

IAction getTool(java.lang.String toolID,
                java.lang.String categoryID)
Deprecated. since 1.1, use getToolAction()

Returns the tool identified by an id and a category. This action cannot be modified in any way or it will throw an UnsupportedOperationException, but it can be ran with either IAction#run() or IAction#runWithEvent(org.eclipse.swt.widgets.Event).

Parameters:
toolID - the id of the tool to find
categoryID - the id of the category the tool is part of
Returns:
the tool identified or null if the tool does not exist.

getToolAction

IAction getToolAction(java.lang.String toolID,
                      java.lang.String categoryID)
Returns the tool identified by an id and a category. This action cannot be modified in any way or it will throw an UnsupportedOperationException, but it can be ran with either IAction#run() or IAction#runWithEvent(org.eclipse.swt.widgets.Event).

Parameters:
toolID - the id of the tool to find
categoryID - the id of the category the tool is part of
Returns:
the tool identified or null if the tool does not exist.

getModalToolCategories

java.util.List<ModalToolCategory> getModalToolCategories()
Returns the list of categories containing modal tools.

Returns:
the list of categories containing modal tools.

getActiveCategory

ToolCategory getActiveCategory()
Returns the tool category that is currently active.

Returns:
the tool category that is currently active.

createOperationsContextMenu

MenuManager createOperationsContextMenu(ISelection selection)
This allows for customized operation menus that are based on the currently selected tool.

Parameters:
selection - the selection to find operations for.

getActiveTool

Tool getActiveTool()
Returns current active tool implementation object.

Returns:

findTool

Tool findTool(java.lang.String toolID)
Finds tool proxy and returns the actual tool implementation object. If the tool has not been loaded yet, it is done immediatly by tool proxy and the implementation is returned.

Parameters:
toolID - the tool ID from extension registry.
Returns:

findToolCursor

Cursor findToolCursor(java.lang.String cursorID)
Searches for the Cursor object by ID. The cursorID is a custom ID from extension registry or a constant from ModatTool interface for systems cursors.

Parameters:
cursorID -
Returns: