GEF v2.0

org.eclipse.gef
Interface Tool

All Known Subinterfaces:
DragTracker
All Known Implementing Classes:
AbstractTool

public interface Tool

Generates Requests or other high-level interpretations of raw event data. Raw event data is sent to Tools from EditPartViewers. Tools may interpret this data in any way appropriate.

Typically, tools will evoke some change on the application's model by executing a Command. This command should be obtained by sending Requests to the EditParts in the viewer.

Tools may also just change some state of the Viewer, such as selection.

Tools may show feedback during the operation and ask the involved EditParts to also show feedback.
All feedback should be erased and temporary changes reverted prior to executing any command.


Method Summary
 void activate()
          Initialize the tool and setup any resources needed.
 void deactivate()
          Called when anothre Tool becomes the active tool for the Editor.
 void focusGained(FocusEvent event, EditPartViewer viewer)
          Called when a viewer that the editor controls gains focus.
 void focusLost(FocusEvent event, EditPartViewer viewer)
          Called when a viewer that the editor controls loses focus.
 void keyDown(KeyEvent keyEvent, EditPartViewer view)
          Called when a key is pressed within a viewer that the editor controls.
 void keyUp(KeyEvent keyEvent, EditPartViewer view)
          Called when a key is released within a viewer that the editor controls.
 void mouseDoubleClick(MouseEvent mouseEvent, EditPartViewer view)
          Called when the mouse button has been double clicked over a viewer that the editor controls.
 void mouseDown(MouseEvent mouseEvent, EditPartViewer view)
          Called when the mouse button has been pressed over a viewer that the editor controls.
 void mouseDrag(MouseEvent mouseEvent, EditPartViewer view)
          Called when the mouse has been dragged within a viewer that the editor controls.
 void mouseHover(MouseEvent mouseEvent, EditPartViewer view)
          Called when the mouse has hovered within a viewer that the editor controls.
 void mouseMove(MouseEvent mouseEvent, EditPartViewer view)
          Called when the mouse has been moved within a based that the editor controls.
 void mouseUp(MouseEvent mouseEvent, EditPartViewer view)
          Called when the mouse button has been released over a viewer that the editor controls.
 void setEditDomain(EditDomain domain)
           
 void setViewer(EditPartViewer view)
           
 void viewerEntered(MouseEvent mouseEvent, EditPartViewer viewer)
           
 void viewerExited(MouseEvent mouseEvent, EditPartViewer viewer)
           
 

Method Detail

activate

public void activate()
Initialize the tool and setup any resources needed.
See Also:
deactivate()

deactivate

public void deactivate()
Called when anothre Tool becomes the active tool for the Editor. implement this method to clean-up any tool state or resources.

focusGained

public void focusGained(FocusEvent event,
                        EditPartViewer viewer)
Called when a viewer that the editor controls gains focus.
Parameters:
event - The SWT focus event
viewer - The viewer that the focus event is over.

focusLost

public void focusLost(FocusEvent event,
                      EditPartViewer viewer)
Called when a viewer that the editor controls loses focus.
Parameters:
event - The SWT focus event
viewer - The viewer that the focus event is over.

keyDown

public void keyDown(KeyEvent keyEvent,
                    EditPartViewer view)
Called when a key is pressed within a viewer that the editor controls.

keyUp

public void keyUp(KeyEvent keyEvent,
                  EditPartViewer view)
Called when a key is released within a viewer that the editor controls.

mouseDoubleClick

public void mouseDoubleClick(MouseEvent mouseEvent,
                             EditPartViewer view)
Called when the mouse button has been double clicked over a viewer that the editor controls.
Parameters:
mouseEvent - org.eclipse.swt.events.MouseEvent The SWT mouse event
viewer - org.eclipse.gef.IViewer The viewer that the mouse event is over.

mouseDown

public void mouseDown(MouseEvent mouseEvent,
                      EditPartViewer view)
Called when the mouse button has been pressed over a viewer that the editor controls.
Parameters:
mouseEvent - org.eclipse.swt.events.MouseEvent The SWT mouse event
viewer - org.eclipse.gef.IViewer The viewer that the mouse event is over.

mouseDrag

public void mouseDrag(MouseEvent mouseEvent,
                      EditPartViewer view)
Called when the mouse has been dragged within a viewer that the editor controls.
Parameters:
mouseEvent - org.eclipse.swt.events.MouseEvent The SWT mouse event
viewer - org.eclipse.gef.IViewer The viewer that the mouse event is over.

mouseHover

public void mouseHover(MouseEvent mouseEvent,
                       EditPartViewer view)
Called when the mouse has hovered within a viewer that the editor controls.
Parameters:
mouseEvent - org.eclipse.swt.events.MouseEvent The SWT mouse event
viewer - org.eclipse.gef.IViewer The viewer that the mouse event is over.

mouseMove

public void mouseMove(MouseEvent mouseEvent,
                      EditPartViewer view)
Called when the mouse has been moved within a based that the editor controls.
Parameters:
mouseEvent - org.eclipse.swt.events.MouseEvent The SWT mouse event
viewer - org.eclipse.gef.IViewer The viewer that the mouse event is over.

mouseUp

public void mouseUp(MouseEvent mouseEvent,
                    EditPartViewer view)
Called when the mouse button has been released over a viewer that the editor controls.
Parameters:
mouseEvent - org.eclipse.swt.events.MouseEvent The SWT mouse event
viewer - org.eclipse.gef.IViewer The viewer that the mouse event is over.

setEditDomain

public void setEditDomain(EditDomain domain)

setViewer

public void setViewer(EditPartViewer view)

viewerEntered

public void viewerEntered(MouseEvent mouseEvent,
                          EditPartViewer viewer)

viewerExited

public void viewerExited(MouseEvent mouseEvent,
                         EditPartViewer viewer)

GEF v2.0