|
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.editpolicies.AbstractEditPolicy | +--org.eclipse.gef.editpolicies.TreeContainerEditPolicy
An EditPolicy for handling ADDS, MOVES, and CREATES on a TreeEditPart
.
This EditPolicy is responsible for displaying the insertion feedback in the Tree during the appropriate interactions.
This EditPolicy factors the getCommand(Request)
into three different abstract
methods which subclasses must implement.
Field Summary |
Fields inherited from interface org.eclipse.gef.EditPolicy |
COMPONENT_ROLE, CONNECTION_BENDPOINTS_ROLE, CONNECTION_ENDPOINTS_ROLE, CONNECTION_ROLE, CONTAINER_ROLE, DIRECT_EDIT_ROLE, GRAPHICAL_NODE_ROLE, LAYOUT_ROLE, NODE_ROLE, PRIMARY_DRAG_ROLE, SELECTION_FEEDBACK_ROLE, TREE_CONTAINER_ROLE |
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 | |
TreeContainerEditPolicy()
|
Method Summary | |
void |
eraseTargetFeedback(Request req)
Does nothing by default. |
protected int |
findIndexOfTreeItemAt(Point pt)
Calculates the index of the TreeItem ata agiven point. |
protected TreeItem |
findTreeItemAt(Point pt)
Calculates the TreeItem at a specified Point . |
protected abstract Command |
getAddCommand(ChangeBoundsRequest request)
Returns a Command for adding the children to the container. |
Command |
getCommand(Request req)
Returns null by default. |
protected abstract Command |
getCreateCommand(CreateRequest request)
Returns a Command for creating the object inside the container. |
protected abstract Command |
getMoveChildrenCommand(ChangeBoundsRequest request)
Returns a Command for moving the children within the container. |
EditPart |
getTargetEditPart(Request req)
Returns the host EditPart when appropriate. |
void |
showTargetFeedback(Request req)
Does nothing by default. |
Methods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicy |
activate, deactivate, debugFeedback, eraseSourceFeedback, getHost, setHost, showSourceFeedback, toString, understandsRequest |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TreeContainerEditPolicy()
Method Detail |
protected abstract Command getAddCommand(ChangeBoundsRequest request)
request
- the Request to add.
null
or a Command to perform the addprotected abstract Command getCreateCommand(CreateRequest request)
request
- the CreateRequest
null
or a Command to perform the createprotected abstract Command getMoveChildrenCommand(ChangeBoundsRequest request)
request
- the Request to move
null
or a Command to perform the movepublic void eraseTargetFeedback(Request req)
AbstractEditPolicy
eraseTargetFeedback
in interface EditPolicy
eraseTargetFeedback
in class AbstractEditPolicy
EditPolicy.eraseTargetFeedback(Request)
protected final int findIndexOfTreeItemAt(Point pt)
pt
- the Point in the Viewer
protected final TreeItem findTreeItemAt(Point pt)
TreeItem
at a specified Point
.
pt
- the draw2d Point
null
or the TreeItempublic Command getCommand(Request req)
AbstractEditPolicy
null
by default. null
is used to indicate that the
EditPolicy does not contribute to the specified Request
.
getCommand
in interface EditPolicy
getCommand
in class AbstractEditPolicy
EditPolicy.getCommand(Request)
public EditPart getTargetEditPart(Request req)
getTargetEditPart
in interface EditPolicy
getTargetEditPart
in class AbstractEditPolicy
EditPolicy.getTargetEditPart(Request)
public void showTargetFeedback(Request req)
AbstractEditPolicy
showTargetFeedback
in interface EditPolicy
showTargetFeedback
in class AbstractEditPolicy
EditPolicy.showTargetFeedback(Request)
|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |