Package org.eclipse.gef.editpolicies
Class AbstractEditPolicy
- java.lang.Object
-
- org.eclipse.gef.editpolicies.AbstractEditPolicy
-
- All Implemented Interfaces:
EditPolicy
,RequestConstants
- Direct Known Subclasses:
ComponentEditPolicy
,ConnectionEditPolicy
,ContainerEditPolicy
,GraphicalEditPolicy
,TreeContainerEditPolicy
public abstract class AbstractEditPolicy extends java.lang.Object implements EditPolicy, RequestConstants
The default implementation ofEditPolicy
.Since this is the default implementation of an interface, this document deals with proper sub-classing. This class is not the API. For documentation on proper usage of the public API, see the documentation for the interface itself:
EditPolicy
.
-
-
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_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 Summary
Constructors Constructor Description AbstractEditPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
activate()
Does nothing by default.void
deactivate()
Does nothing by default.protected void
debugFeedback(java.lang.String message)
Deprecated.in 3.1 This method will be removed in future releases.void
eraseSourceFeedback(Request request)
Does nothing by default.void
eraseTargetFeedback(Request request)
Does nothing by default.Command
getCommand(Request request)
Returnsnull
by default.EditPart
getHost()
EditPart
getTargetEditPart(Request request)
Returnsnull
by default.void
setHost(EditPart host)
Sets the host in which this EditPolicy is installed.void
showSourceFeedback(Request request)
Does nothing by default.void
showTargetFeedback(Request request)
Does nothing by default.java.lang.String
toString()
boolean
understandsRequest(Request req)
Returnsfalse
by default.
-
-
-
Method Detail
-
activate
public void activate()
Does nothing by default.- Specified by:
activate
in interfaceEditPolicy
- See Also:
EditPolicy.activate()
-
deactivate
public void deactivate()
Does nothing by default.- Specified by:
deactivate
in interfaceEditPolicy
- See Also:
EditPolicy.deactivate()
-
debugFeedback
protected final void debugFeedback(java.lang.String message)
Deprecated.in 3.1 This method will be removed in future releases.This method will log the message to GEF's trace/debug system if the corrseponding flag for FEEDBACK is set to true.- Parameters:
message
- the String to log
-
eraseSourceFeedback
public void eraseSourceFeedback(Request request)
Does nothing by default.- Specified by:
eraseSourceFeedback
in interfaceEditPolicy
- Parameters:
request
- the Request- See Also:
EditPolicy.eraseSourceFeedback(Request)
-
eraseTargetFeedback
public void eraseTargetFeedback(Request request)
Does nothing by default.- Specified by:
eraseTargetFeedback
in interfaceEditPolicy
- Parameters:
request
- the Request- See Also:
EditPolicy.eraseTargetFeedback(Request)
-
getCommand
public Command getCommand(Request request)
Returnsnull
by default.null
is used to indicate that the EditPolicy does not contribute to the specifiedRequest
.- Specified by:
getCommand
in interfaceEditPolicy
- Parameters:
request
- the Request- Returns:
null
or a Command contribution- See Also:
EditPolicy.getCommand(Request)
-
getHost
public EditPart getHost()
- Specified by:
getHost
in interfaceEditPolicy
- Returns:
- the host EditPart on which this policy is installed.
- See Also:
EditPolicy.getHost()
-
getTargetEditPart
public EditPart getTargetEditPart(Request request)
Returnsnull
by default.null
indicates that this policy is unable to determine the target for the specifiedRequest
.- Specified by:
getTargetEditPart
in interfaceEditPolicy
- Parameters:
request
- the Request- Returns:
null
or the appropriate targetEditPart
- See Also:
EditPolicy.getTargetEditPart(Request)
-
setHost
public void setHost(EditPart host)
Description copied from interface:EditPolicy
Sets the host in which this EditPolicy is installed.- Specified by:
setHost
in interfaceEditPolicy
- Parameters:
host
- the host EditPart- See Also:
EditPolicy.setHost(EditPart)
-
showSourceFeedback
public void showSourceFeedback(Request request)
Does nothing by default.- Specified by:
showSourceFeedback
in interfaceEditPolicy
- Parameters:
request
- the Request- See Also:
EditPolicy.showSourceFeedback(Request)
-
showTargetFeedback
public void showTargetFeedback(Request request)
Does nothing by default.- Specified by:
showTargetFeedback
in interfaceEditPolicy
- Parameters:
request
- the Request- See Also:
EditPolicy.showTargetFeedback(Request)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
understandsRequest
public boolean understandsRequest(Request req)
Returnsfalse
by default.- Specified by:
understandsRequest
in interfaceEditPolicy
- Parameters:
req
- the Request- Returns:
- boolean
true
if the EditPolicy understands the specified request - See Also:
EditPolicy.understandsRequest(Request)
-
-