|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.gef.util.FlagSupport | +--org.eclipse.gef.tools.AbstractTool | +--org.eclipse.gef.tools.TargetingTool | +--org.eclipse.gef.tools.SelectEditPartTracker
DragTracker used to select EditParts
.
Nested Class Summary |
Nested classes inherited from class org.eclipse.gef.tools.AbstractTool |
AbstractTool.Input |
Field Summary | |
protected static int |
FLAG_SELECTION_PERFORMED
Flag to indicate selection has been performed. |
protected static int |
MAX_FLAG
Max flag |
Fields inherited from class org.eclipse.gef.tools.AbstractTool |
MAX_STATE, MOUSE_BUTTON_ANY, MOUSE_BUTTON1, MOUSE_BUTTON2, MOUSE_BUTTON3, STATE_ACCESSIBLE_DRAG, STATE_ACCESSIBLE_DRAG_IN_PROGRESS, STATE_DRAG, STATE_DRAG_IN_PROGRESS, STATE_INITIAL, STATE_INVALID, STATE_TERMINAL |
Fields inherited from interface org.eclipse.gef.RequestConstants |
REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILDREN, REQ_OPEN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_SOURCE, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER |
Constructor Summary | |
SelectEditPartTracker(EditPart owner)
Constructs a new SelectEditPartTracker with the given edit part as the source. |
Method Summary | |
protected Cursor |
calculateCursor()
Returns the appropriate cursor for the tools current state. |
protected String |
getCommandName()
Returns the identifier of the command that is being sought. |
protected String |
getDebugName()
Returns the debug name for this tool. |
protected EditPart |
getSourceEditPart()
Returns the source edit part. |
protected boolean |
handleButtonDown(int button)
Performs a conditional selection if needed (if right or left mouse button have been pressed) and goes into the drag state. |
protected boolean |
handleButtonUp(int button)
If in the drag state, the tool selects the source edit part. |
protected boolean |
handleDoubleClick(int button)
Calls performOpen() if the double click was with mouse button 1. |
protected boolean |
handleDragStarted()
Called only one time during a drag when the drag threshold has been exceeded. |
protected boolean |
hasSelectionOccurred()
Returns true if selection has already occured. |
protected void |
performConditionalSelection()
Calls performSelection() if the source is not selected. |
protected void |
performDirectEdit()
Creates a DirectEditRequest and sends it to a DelayedDirectEditHelper
to allow the user to directly edit the edit part. |
protected void |
performOpen()
Creates a SelectionRequest and sends it to the source edit part via
EditPart.performRequest(Request) . |
protected void |
performSelection()
Performs the appropriate selection action based on the selection state of the source and the modifiers (CTRL and SHIFT). |
protected void |
resetFlags()
Resets all flags to their initial values. |
protected void |
setSourceEditPart(EditPart part)
Sets the source edit part. |
Methods inherited from class org.eclipse.gef.util.FlagSupport |
getFlag, setFlag |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.gef.DragTracker |
commitDrag |
Methods inherited from interface org.eclipse.gef.Tool |
activate, deactivate, focusGained, focusLost, keyDown, keyUp, mouseDoubleClick, mouseDown, mouseDrag, mouseHover, mouseMove, mouseUp, nativeDragFinished, nativeDragStarted, setEditDomain, setViewer, viewerEntered, viewerExited |
Field Detail |
protected static final int FLAG_SELECTION_PERFORMED
protected static final int MAX_FLAG
Constructor Detail |
public SelectEditPartTracker(EditPart owner)
owner
- the source edit partMethod Detail |
protected Cursor calculateCursor()
AbstractTool
null
is returned. Otherwise, either the default or
disabled cursor is returned, based on the existence of a current command, and whether
that current command is executable.
Subclasses may override or extend this method to calculate the appropriate cursor based on other conditions.
calculateCursor
in class AbstractTool
null
or a cursor to be displayed.AbstractTool.calculateCursor()
protected String getCommandName()
AbstractTool
getCommandName
in class AbstractTool
AbstractTool.getCommandName()
protected String getDebugName()
AbstractTool
getDebugName
in class AbstractTool
AbstractTool.getDebugName()
protected EditPart getSourceEditPart()
protected boolean handleButtonDown(int button)
handleButtonDown
in class AbstractTool
button
- which button went down
true
if the buttonDown was handledAbstractTool.handleButtonDown(int)
protected boolean handleButtonUp(int button)
performDirectEdit()
is called. If the edit part is newly
selected and not completely visible, EditPartViewer.reveal(EditPart)
is
called to show the selected edit part.
handleButtonUp
in class AbstractTool
button
- the button being released
true
if the button up was handledAbstractTool.handleButtonUp(int)
protected boolean handleDoubleClick(int button)
performOpen()
if the double click was with mouse button 1.
handleDoubleClick
in class AbstractTool
button
- which button was double-clicked
true
if the event was handledAbstractTool.handleDoubleClick(int)
protected boolean handleDragStarted()
AbstractTool
false
is returned. Subclasses may override
to interpret the drag starting. Returning true
indicates that the event
was handled.
handleDragStarted
in class AbstractTool
AbstractTool.handleDragStarted()
protected boolean hasSelectionOccurred()
true
if selection has already occured.
true
if selection has occuredprotected void performConditionalSelection()
performSelection()
if the source is not selected. If the source is
selected and there are no modifier keys pressed (i.e. the user isn't selecting
multiple edit parts or deselecting edit parts), sets the direct edit flag so that when
the mouse is released, a direct edit will be performed.
protected void performDirectEdit()
DirectEditRequest
and sends it to a DelayedDirectEditHelper
to allow the user to directly edit the edit part.
protected void performOpen()
SelectionRequest
and sends it to the source edit part via
EditPart.performRequest(Request)
. Possible uses are to open the selected item
in another editor or replace the current editor's contents based on the selected item.
protected void performSelection()
protected void resetFlags()
AbstractTool
resetFlags
in class AbstractTool
AbstractTool.resetFlags()
protected void setSourceEditPart(EditPart part)
part
- the source edit part
|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |