intended to be implemented by clients.
Clients should inherit from org.eclipse.gef.editparts.AbstractEditPolicy
. New
methods may be added in the future.
COMPONENT_ROLE
public static final String COMPONENT_ROLE
- The key used to install a component EditPolicy. A component is defined
as anything in the model. This EditPolicy should handle the fundamental operations that
do not fit under any other EditPolicy role. For example, delete is a fundamental
operation. Generally the component EditPolicy knows only about the model, and can be
used in any type of EditPartViewer.
- See Also:
- Constant Field Values
CONNECTION_ENDPOINTS_ROLE
public static final String CONNECTION_ENDPOINTS_ROLE
- The key used to install a connection endpoint EditPolicy. A connection
endpoint EditPolicy is usually a
SelectionHandlesEditPolicy
subclass. Besides rendering
selection by displaying Handle
s at then ends of the connection, the
EditPolicy also understands how to move the endpoints of the connection. If the
endpoints are moveable, the EditPolicy will show feedback and provide
Commands
to perform the move.
- See Also:
- Constant Field Values
CONNECTION_BENDPOINTS_ROLE
public static final String CONNECTION_BENDPOINTS_ROLE
- The key used to install a bendpoint EditPolicy. A bendpoint EditPolicy
is an optional EditPolicy for connections that are visibile. As with
endpoints
, bendpoint EditPolicies are porbably SelectionHandlesEditPolicy
.
- See Also:
- Constant Field Values
CONNECTION_ROLE
public static final String CONNECTION_ROLE
- The key used to install a connection EditPolicy. The behavior of a
ConnectionEditPart
may be implemented in its component EditPolicy,
- See Also:
- Constant Field Values
CONTAINER_ROLE
public static final String CONTAINER_ROLE
- The key used to install a container EditPolicy.
- See Also:
- Constant Field Values
DIRECT_EDIT_ROLE
public static final String DIRECT_EDIT_ROLE
- The key used to install a direct edit EditPolicy.
- See Also:
- Constant Field Values
GRAPHICAL_NODE_ROLE
public static final String GRAPHICAL_NODE_ROLE
- The key used to install a graphical node EditPolicy.
- See Also:
- Constant Field Values
LAYOUT_ROLE
public static final String LAYOUT_ROLE
- The key used to install a layout EditPolicy.
- See Also:
- Constant Field Values
NODE_ROLE
public static final String NODE_ROLE
- The key used to install a node EditPolicy.
- See Also:
- Constant Field Values
PRIMARY_DRAG_ROLE
public static final String PRIMARY_DRAG_ROLE
- The key used to install a primary drag EditPolicy.
- See Also:
- Constant Field Values
SELECTION_FEEDBACK_ROLE
public static final String SELECTION_FEEDBACK_ROLE
- The key used to install a selection feedback EditPolicy.
- See Also:
- Constant Field Values
TREE_CONTAINER_ROLE
public static final String TREE_CONTAINER_ROLE
- The key used to install a tree container EditPolicy.
- See Also:
- Constant Field Values
activate
public void activate()
- Activates this EditPolicy. The EditPolicy might need to hook listeners. These
listeners should be unhooked in
deactivate()
. The EditPolicy might
also contribute feedback/visuals immediately, such as selection handles
if the EditPart was selected at the time of activation.
Activate is called after the host has been set, and that host has been
activated.
- See Also:
EditPart.activate()
,
deactivate()
,
EditPart.installEditPolicy(Object, EditPolicy)
deactivate
public void deactivate()
- Deactivates the EditPolicy, the inverse of
activate()
. Deactivate is called
when the host is deactivated, or when the EditPolicy is uninstalled from an
active host. Deactivate unhooks any listeners, and removes all feedback.
- See Also:
EditPart.deactivate()
,
activate()
,
EditPart.removeEditPolicy(Object)
eraseSourceFeedback
public void eraseSourceFeedback(Request request)
- Erases source feedback based on the given
Request
. Does nothing if the
EditPolicy does not apply to the given Request.
This method is declared on EditPart
, and
is redeclared here so that EditPart can delegate its implementation to each of its
EditPolicies.
- Parameters:
request
- the Request
eraseTargetFeedback
public void eraseTargetFeedback(Request request)
- Erases target feedback based on the given
Request
. Does nothing if the
EditPolicy does not apply to the given Request.
This method is declared on EditPart
, and
is redeclared here so that EditPart can delegate its implementation to each of its
EditPolicies.
- Parameters:
request
- the Request
getCommand
public Command getCommand(Request request)
- Returns the
Command
contribution for the given Request
, or
null
. null
is treated as a no-op by the caller, or an empty
contribution. The EditPolicy must return an UnexecutableCommand
if it wishes to disallow the Request.
This method is declared on EditPart
, and is
redeclared here so that EditPart can delegate its implementation to each of its
EditPolicies. The EditPart will combine each EditPolicy's contribution into a
CompoundCommand
.
- Parameters:
request
- the Request
- Returns:
null
or a Command contribution
getHost
public EditPart getHost()
- Returns:
- the host EditPart on which this policy is installed.
getTargetEditPart
public EditPart getTargetEditPart(Request request)
- Returns
null
or the appropriate EditPart for the specified
Request
. In general, this EditPolicy will return its host EditPart
if it understands the Request. Otherwise, it will return null
.
This method is declared on EditPart
, and is
redeclared here so that EditPart can delegate its implementation to each of its
EditPolicies. The first non-null
result returned by an EditPolicy is
returned by the EditPart.
- Parameters:
request
- the Request
- Returns:
null
or the appropriate target EditPart
setHost
public void setHost(EditPart editpart)
- Sets the host in which this EditPolicy is installed.
- Parameters:
editpart
- the host EditPart
showSourceFeedback
public void showSourceFeedback(Request request)
- Shows or updates source feedback for the specified
Request
. This
method may be called repeatedly for the purpose of updating feedback based on changes
to the Request.
Does nothing if the EditPolicy does not recognize the given Request.
This method is declared on EditPart
, and
is redeclared here so that EditPart can delegate its implementation to each of its
EditPolicies.
- Parameters:
request
- the Request
showTargetFeedback
public void showTargetFeedback(Request request)
- Shows or updates target feedback for the specified
Request
. This
method may be called repeatedly for the purpose of updating feedback based on changes
to the Request.
Does nothing if the EditPolicy does not recognize the given request.
This method is declared on EditPart
, and
is redeclared here so that EditPart can delegate its implementation to each of its
EditPolicies.
- Parameters:
request
- the Request
understandsRequest
public boolean understandsRequest(Request request)
- Returns
true
if this EditPolicy understand the specified request.
This method is declared on EditPart
, and
is redeclared here so that EditPart can delegate its implementation to each of its
EditPolicies. EditPart
returns true
if any of its
EditPolicies returns true
. In other words, it performs a logical OR.
- Parameters:
request
- the Request
* @return boolean true
if the EditPolicy- See Also:
EditPart.understandsRequest(Request)
Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.