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


public interface IToolContext

A set of tools that is provided to Tool extensions.

In addition to the references available in the Toolkit class, ToolContext provides access to command factories and and to sendCommand methods.

Responsibilities:

Since:
0.5
Author:
Jesse

Method Summary
 IToolContext copy()
           
 IActionBars2 getActionBars()
          Gets an instance of the ActionsBars from the current editor or null if there is no editor open.
 BasicCommandFactory getBasicCommandFactory()
          Returns a BasicCommandFactory.
 DrawCommandFactory getDrawFactory()
          Returns a DrawCommandFactory.
 EditCommandFactory getEditFactory()
          Returns a EditCommandFactory.
 NavigationCommandFactory getNavigationFactory()
          Deprecated. Please use navigation commands directly
 SelectionCommandFactory getSelectionFactory()
          Returns a SelectionCommandFactory.
 IStatusLineManager getStatusBar()
          Deprecated. use getActionBars().getStatusLineManager()
 ViewportPane getViewportPane()
          Casts getDisplay to ViewportPane;
 void sendASyncCommand(Command command)
          Dispatches a command.
 void sendSyncCommand(Command command)
          Dispatches a command and blocks until the command has executed.
 void updateUI(java.lang.Runnable runnable)
          Run a code block in the UI thread.
 

Method Detail

getViewportPane

ViewportPane getViewportPane()
Casts getDisplay to ViewportPane;

Returns:
getDisplay cast to ViewportPane
See Also:
ViewportPane

getDrawFactory

DrawCommandFactory getDrawFactory()
Returns a DrawCommandFactory. Used to create commands that draw on the display.

Returns:
a DrawCommandFactory
See Also:
DrawCommandFactory

getEditFactory

EditCommandFactory getEditFactory()
Returns a EditCommandFactory. Used to create commands that edit the data model.

Returns:
a EditCommandFactory
See Also:
EditCommandFactory

getNavigationFactory

NavigationCommandFactory getNavigationFactory()
Deprecated. Please use navigation commands directly

Returns a NavigationCommandFactory. Used to create commands that change the current view of the map.

Returns:
a NavigationCommandFactory
See Also:
NavigationCommandFactory

getSelectionFactory

SelectionCommandFactory getSelectionFactory()
Returns a SelectionCommandFactory. Used to create commands that changes the current selection.

Returns:
a SelectionCommandFactory

getBasicCommandFactory

BasicCommandFactory getBasicCommandFactory()
Returns a BasicCommandFactory.

Returns:
a BasicCommandFactory

sendASyncCommand

void sendASyncCommand(Command command)
Dispatches a command. If the command is a IDrawCommand the command will be added to the ViewportPane and the ViewportPane will be refreshed.

Parameters:
command - The command to execute.
See Also:
MapCommand

sendSyncCommand

void sendSyncCommand(Command command)
Dispatches a command and blocks until the command has executed.

Parameters:
command - The command to execute.
See Also:
MapCommand

getStatusBar

IStatusLineManager getStatusBar()
Deprecated. use getActionBars().getStatusLineManager()

Gets an instance of the status bar from the current editor or null if there is no editor open.

Returns:
an instance of the status bar from the current editor or null if there is no editor open.

getActionBars

IActionBars2 getActionBars()
Gets an instance of the ActionsBars from the current editor or null if there is no editor open.

Returns:
an instance of the ActionsBars from the current editor or null if there is no editor open.

updateUI

void updateUI(java.lang.Runnable runnable)
Run a code block in the UI thread. This method should always be used when modifying the ui.

Parameters:
runnable - the code block to execute in the ui thread.

copy

IToolContext copy()