public abstract class DirectEditPolicy extends GraphicalEditPolicy
CellEditor. This EditPolicy is typically
installed using EditPolicy.DIRECT_EDIT_ROLE.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 |
|---|
DirectEditPolicy() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
eraseDirectEditFeedback(DirectEditRequest request)
If feedback is being shown, this method calls
revertOldEditValue(DirectEditRequest). |
void |
eraseSourceFeedback(Request request)
Does nothing by default.
|
Command |
getCommand(Request request)
Returns
null by default. |
protected abstract Command |
getDirectEditCommand(DirectEditRequest request)
Returns the
Command to perform the direct edit. |
protected void |
revertOldEditValue(DirectEditRequest request)
Helps erase feedback by reverting the original edit value.
|
protected abstract void |
showCurrentEditValue(DirectEditRequest request)
Override to show the current direct edit value in the host's Figure.
|
protected void |
showDirectEditFeedback(DirectEditRequest request)
Pushes the original edit value if necessary, and shows feedback.
|
void |
showSourceFeedback(Request request)
Does nothing by default.
|
protected void |
storeOldEditValue(DirectEditRequest request)
Called to remember the old value before direct edit feedback begins.
|
boolean |
understandsRequest(Request request)
Returns
true for RequestConstants.REQ_DIRECT_EDIT. |
addFeedback, getFeedbackLayer, getHostFigure, getLayer, removeFeedbackactivate, deactivate, debugFeedback, eraseTargetFeedback, getHost, getTargetEditPart, setHost, showTargetFeedback, toStringpublic void eraseSourceFeedback(Request request)
AbstractEditPolicyeraseSourceFeedback in interface EditPolicyeraseSourceFeedback in class AbstractEditPolicyrequest - the RequestEditPolicy.eraseSourceFeedback(Request)protected void eraseDirectEditFeedback(DirectEditRequest request)
revertOldEditValue(DirectEditRequest).request - the DirectEditRequestpublic Command getCommand(Request request)
AbstractEditPolicynull by default. null is used to
indicate that the EditPolicy does not contribute to the specified
Request.getCommand in interface EditPolicygetCommand in class AbstractEditPolicyrequest - the Requestnull or a Command contributionEditPolicy.getCommand(Request)protected abstract Command getDirectEditCommand(DirectEditRequest request)
Command to perform the direct edit.request - the DirectEditRequestprotected void revertOldEditValue(DirectEditRequest request)
EditPart.refresh(), which should cause it to
refresh all properties.
Subclasses can override this method to perform a more specific revert.request - the DirectEditRequeststoreOldEditValue(DirectEditRequest)public void showSourceFeedback(Request request)
AbstractEditPolicyshowSourceFeedback in interface EditPolicyshowSourceFeedback in class AbstractEditPolicyrequest - the RequestEditPolicy.showSourceFeedback(Request)protected void showDirectEditFeedback(DirectEditRequest request)
request - the DirectEditRequestprotected abstract void showCurrentEditValue(DirectEditRequest request)
request - the DirectEditRequestprotected void storeOldEditValue(DirectEditRequest request)
revertOldEditValue(DirectEditRequest) is
called to undo the changes done by feedback. By default, this method
nothing.request - the DirectEditRequestpublic boolean understandsRequest(Request request)
true for RequestConstants.REQ_DIRECT_EDIT.
DirectEditAction will determine
enablement based on whether the selected EditPart understands
"direct edit".understandsRequest in interface EditPolicyunderstandsRequest in class AbstractEditPolicyrequest - the Requesttrue if the EditPolicy understands the
specified requestEditPolicy.understandsRequest(Request)Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.