Package org.eclipse.gef.editpolicies
Class TreeContainerEditPolicy
java.lang.Object
org.eclipse.gef.editpolicies.AbstractEditPolicy
org.eclipse.gef.editpolicies.TreeContainerEditPolicy
- All Implemented Interfaces:
- EditPolicy,- RequestConstants
- Direct Known Subclasses:
- AbstractTreeContainerEditPolicy
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.
- Since:
- 2.0
- 
Field SummaryFields inherited from interface org.eclipse.gef.EditPolicyCOMPONENT_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_ROLEFields inherited from interface org.eclipse.gef.RequestConstantsREQ_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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidDoes nothing by default.protected final intCalculates the index of the TreeItem at given point.protected final TreeItemfindTreeItemAt(Point pt) Calculates theTreeItemat a specifiedPoint.protected abstract CommandgetAddCommand(ChangeBoundsRequest request) Returns a Command for adding the children to the container.getCommand(Request req) Returnsnullby default.protected abstract CommandgetCreateCommand(CreateRequest request) Returns a Command for creating the object inside the container.protected abstract CommandReturns a Command for moving the children within the container.getTargetEditPart(Request req) Returns the host EditPart when appropriate.voidDoes nothing by default.Methods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicyactivate, deactivate, debugFeedback, eraseSourceFeedback, getHost, setHost, showSourceFeedback, toString, understandsRequest
- 
Constructor Details- 
TreeContainerEditPolicypublic TreeContainerEditPolicy()
 
- 
- 
Method Details- 
getAddCommandReturns a Command for adding the children to the container.- Parameters:
- request- the Request to add.
- Returns:
- Command nullor a Command to perform the add
 
- 
getCreateCommandReturns a Command for creating the object inside the container.- Parameters:
- request- the CreateRequest
- Returns:
- Command nullor a Command to perform the create
 
- 
getMoveChildrenCommandReturns a Command for moving the children within the container.- Parameters:
- request- the Request to move
- Returns:
- Command nullor a Command to perform the move
 
- 
eraseTargetFeedbackDescription copied from class:AbstractEditPolicyDoes nothing by default.- Specified by:
- eraseTargetFeedbackin interface- EditPolicy
- Overrides:
- eraseTargetFeedbackin class- AbstractEditPolicy
- Parameters:
- req- the Request
- See Also:
 
- 
findIndexOfTreeItemAtCalculates the index of the TreeItem at given point.- Parameters:
- pt- the Point in the Viewer
- Returns:
- the index of the TreeItem
 
- 
findTreeItemAtCalculates theTreeItemat a specifiedPoint.- Parameters:
- pt- the draw2d Point
- Returns:
- nullor the TreeItem
 
- 
getCommandDescription copied from class:AbstractEditPolicyReturnsnullby default.nullis used to indicate that the EditPolicy does not contribute to the specifiedRequest.- Specified by:
- getCommandin interface- EditPolicy
- Overrides:
- getCommandin class- AbstractEditPolicy
- Parameters:
- req- the Request
- Returns:
- nullor a Command contribution
- See Also:
 
- 
getTargetEditPartReturns the host EditPart when appropriate. Targeting is done by checking if the mouse is clearly over the host's TreeItem.- Specified by:
- getTargetEditPartin interface- EditPolicy
- Overrides:
- getTargetEditPartin class- AbstractEditPolicy
- Parameters:
- req- the Request
- Returns:
- nullor the appropriate target- EditPart
- See Also:
 
- 
showTargetFeedbackDescription copied from class:AbstractEditPolicyDoes nothing by default.- Specified by:
- showTargetFeedbackin interface- EditPolicy
- Overrides:
- showTargetFeedbackin class- AbstractEditPolicy
- Parameters:
- req- the Request
- See Also:
 
 
-