public abstract class TreeContainerEditPolicy extends AbstractEditPolicy
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.
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_ROLEREQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CLONE, 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 and Description |
|---|
TreeContainerEditPolicy() |
| Modifier and Type | Method and Description |
|---|---|
void |
eraseTargetFeedback(Request req)
Does nothing by default.
|
protected int |
findIndexOfTreeItemAt(Point pt)
Calculates the index of the TreeItem at given 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.
|
activate, deactivate, debugFeedback, eraseSourceFeedback, getHost, setHost, showSourceFeedback, toString, understandsRequestprotected 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 CreateRequestnull or a Command to perform the createprotected abstract Command getMoveChildrenCommand(ChangeBoundsRequest request)
request - the Request to movenull or a Command to perform the movepublic void eraseTargetFeedback(Request req)
AbstractEditPolicyeraseTargetFeedback in interface EditPolicyeraseTargetFeedback in class AbstractEditPolicyreq - the RequestEditPolicy.eraseTargetFeedback(Request)protected final int findIndexOfTreeItemAt(Point pt)
pt - the Point in the Viewerprotected final TreeItem findTreeItemAt(Point pt)
TreeItem at a specified
Point.pt - the draw2d Pointnull or the TreeItempublic Command getCommand(Request req)
AbstractEditPolicynull by default. null is used to
indicate that the EditPolicy does not contribute to the specified
Request.getCommand in interface EditPolicygetCommand in class AbstractEditPolicyreq - the Requestnull or a Command contributionEditPolicy.getCommand(Request)public EditPart getTargetEditPart(Request req)
getTargetEditPart in interface EditPolicygetTargetEditPart in class AbstractEditPolicyreq - the Requestnull or the appropriate target EditPartEditPolicy.getTargetEditPart(Request)public void showTargetFeedback(Request req)
AbstractEditPolicyshowTargetFeedback in interface EditPolicyshowTargetFeedback in class AbstractEditPolicyreq - the RequestEditPolicy.showTargetFeedback(Request)Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.