|
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.GraphicalEditPolicy | +--org.eclipse.gef.editpolicies.DirectEditPolicy
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
.
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 | |
DirectEditPolicy()
|
Method Summary | |
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 . |
Methods inherited from class org.eclipse.gef.editpolicies.GraphicalEditPolicy |
addFeedback, getHostFigure, getLayer, removeFeedback |
Methods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicy |
activate, deactivate, debugFeedback, eraseTargetFeedback, getHost, getTargetEditPart, setHost, showTargetFeedback, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DirectEditPolicy()
Method Detail |
public void eraseSourceFeedback(Request request)
AbstractEditPolicy
eraseSourceFeedback
in interface EditPolicy
eraseSourceFeedback
in class AbstractEditPolicy
EditPolicy.eraseSourceFeedback(Request)
protected void eraseDirectEditFeedback(DirectEditRequest request)
revertOldEditValue(DirectEditRequest)
.
request
- the DirectEditRequestpublic Command getCommand(Request request)
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)
protected abstract Command getDirectEditCommand(DirectEditRequest request)
Command
to perform the direct edit.
request
- the DirectEditRequest
protected 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)
AbstractEditPolicy
showSourceFeedback
in interface EditPolicy
showSourceFeedback
in class AbstractEditPolicy
EditPolicy.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 EditPolicy
understandsRequest
in class AbstractEditPolicy
EditPolicy.understandsRequest(Request)
|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |