Package org.eclipse.gef.editpolicies
Class DirectEditPolicy
java.lang.Object
org.eclipse.gef.editpolicies.AbstractEditPolicy
org.eclipse.gef.editpolicies.GraphicalEditPolicy
org.eclipse.gef.editpolicies.DirectEditPolicy
- All Implemented Interfaces:
- EditPolicy,- RequestConstants
Shows DirectEdit feedback and creates the Command to perform a "direct edit".
 Direct Edit is when the User is editing a property of an EditPart
 directly (as opposed to in the Properties View) in the Viewer using a
 
CellEditor. This EditPolicy is typically
 installed using EditPolicy.DIRECT_EDIT_ROLE.- 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 TypeMethodDescriptionprotected voideraseDirectEditFeedback(DirectEditRequest request) If feedback is being shown, this method callsrevertOldEditValue(DirectEditRequest).voideraseSourceFeedback(Request request) Does nothing by default.getCommand(Request request) Returnsnullby default.protected abstract CommandgetDirectEditCommand(DirectEditRequest request) Returns theCommandto perform the direct edit.protected voidrevertOldEditValue(DirectEditRequest request) Helps erase feedback by reverting the original edit value.protected abstract voidshowCurrentEditValue(DirectEditRequest request) Override to show the current direct edit value in the host's Figure.protected voidshowDirectEditFeedback(DirectEditRequest request) Pushes the original edit value if necessary, and shows feedback.voidshowSourceFeedback(Request request) Does nothing by default.protected voidstoreOldEditValue(DirectEditRequest request) Called to remember the old value before direct edit feedback begins.booleanunderstandsRequest(Request request) ReturnstrueforRequestConstants.REQ_DIRECT_EDIT.Methods inherited from class org.eclipse.gef.editpolicies.GraphicalEditPolicyaddFeedback, getFeedbackLayer, getHost, getHostFigure, getLayer, removeFeedbackMethods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicyactivate, deactivate, debugFeedback, eraseTargetFeedback, getTargetEditPart, setHost, showTargetFeedback, toString
- 
Constructor Details- 
DirectEditPolicypublic DirectEditPolicy()
 
- 
- 
Method Details- 
eraseSourceFeedbackDescription copied from class:AbstractEditPolicyDoes nothing by default.- Specified by:
- eraseSourceFeedbackin interface- EditPolicy
- Overrides:
- eraseSourceFeedbackin class- AbstractEditPolicy
- Parameters:
- request- the Request
- See Also:
 
- 
eraseDirectEditFeedbackIf feedback is being shown, this method callsrevertOldEditValue(DirectEditRequest).- Parameters:
- request- the DirectEditRequest
 
- 
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:
- request- the Request
- Returns:
- nullor a Command contribution
- See Also:
 
- 
getDirectEditCommandReturns theCommandto perform the direct edit.- Parameters:
- request- the DirectEditRequest
- Returns:
- the command to perform the direct edit
 
- 
revertOldEditValueHelps erase feedback by reverting the original edit value. The rule when using GEF is that all feedback is removed before changes to the model are made. By default, the host is sentEditPart.refresh(), which should cause it to refresh all properties. Subclasses can override this method to perform a more specific revert.- Parameters:
- request- the DirectEditRequest
- See Also:
 
- 
showSourceFeedbackDescription copied from class:AbstractEditPolicyDoes nothing by default.- Specified by:
- showSourceFeedbackin interface- EditPolicy
- Overrides:
- showSourceFeedbackin class- AbstractEditPolicy
- Parameters:
- request- the Request
- See Also:
 
- 
showDirectEditFeedbackPushes the original edit value if necessary, and shows feedback.- Parameters:
- request- the DirectEditRequest
 
- 
showCurrentEditValueOverride to show the current direct edit value in the host's Figure. Although the CellEditor will probably cover the figure's display of this value, updating the figure will cause its preferred size to reflect the new value.- Parameters:
- request- the DirectEditRequest
 
- 
storeOldEditValueCalled to remember the old value before direct edit feedback begins. After feedback is over,revertOldEditValue(DirectEditRequest)is called to undo the changes done by feedback. By default, this method nothing.- Parameters:
- request- the DirectEditRequest
 
- 
understandsRequestReturnstrueforRequestConstants.REQ_DIRECT_EDIT.DirectEditActionwill determine enablement based on whether the selected EditPart understands "direct edit".- Specified by:
- understandsRequestin interface- EditPolicy
- Overrides:
- understandsRequestin class- AbstractEditPolicy
- Parameters:
- request- the Request
- Returns:
- boolean trueif the EditPolicy understands the specified request
- See Also:
 
 
-