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 Object implements EditPolicy, RequestConstants
The default implementation of `EditPolicy`.

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

Modifier and Type
Method
Description
`void`
`activate()`
Does nothing by default.
`void`
`deactivate()`
Does nothing by default.
`protected final void`
`debugFeedback(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)`
Returns `null` by default.
`EditPart`
`getHost()`
`EditPart`
`getTargetEditPart(Request request)`
Returns `null` 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.
`String`
`toString()`
`boolean`
`understandsRequest(Request req)`
Returns `false` by default.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### AbstractEditPolicy

public AbstractEditPolicy()

## Method Details

### activate

public void activate()
Does nothing by default.

Specified by:
  `activate` in interface `EditPolicy`
See Also:
  - `EditPolicy.activate()`

### deactivate

public void deactivate()
Does nothing by default.

Specified by:
  `deactivate` in interface `EditPolicy`
See Also:
  - `EditPolicy.deactivate()`

### debugFeedback

@Deprecated protected final void debugFeedback(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 interface `EditPolicy`
Parameters:
  `request` - the Request
See Also:
  - `EditPolicy.eraseSourceFeedback(Request)`

### eraseTargetFeedback

public void eraseTargetFeedback(Request request)
Does nothing by default.

Specified by:
  `eraseTargetFeedback` in interface `EditPolicy`
Parameters:
  `request` - the Request
See Also:
  - `EditPolicy.eraseTargetFeedback(Request)`

### getCommand

public Command getCommand(Request request)
Returns `null` by default. `null` is used to indicate that the EditPolicy does not contribute to the specified `Request`.

Specified by:
  `getCommand` in interface `EditPolicy`
Parameters:
  `request` - the Request
Returns:
  `null` or a Command contribution
See Also:
  - `EditPolicy.getCommand(Request)`

### getHost

public EditPart getHost()

Specified by:
  `getHost` in interface `EditPolicy`
Returns:
  the host EditPart on which this policy is installed.
See Also:
  - `EditPolicy.getHost()`

### getTargetEditPart

public EditPart getTargetEditPart(Request request)
Returns `null` by default. `null` indicates that this policy is unable to determine the target for the specified `Request`.

Specified by:
  `getTargetEditPart` in interface `EditPolicy`
Parameters:
  `request` - the Request
Returns:
  `null` or the appropriate target `EditPart`
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 interface `EditPolicy`
Parameters:
  `host` - the host EditPart
See Also:
  - `EditPolicy.setHost(EditPart)`

### showSourceFeedback

public void showSourceFeedback(Request request)
Does nothing by default.

Specified by:
  `showSourceFeedback` in interface `EditPolicy`
Parameters:
  `request` - the Request
See Also:
  - `EditPolicy.showSourceFeedback(Request)`

### showTargetFeedback

public void showTargetFeedback(Request request)
Does nothing by default.

Specified by:
  `showTargetFeedback` in interface `EditPolicy`
Parameters:
  `request` - the Request
See Also:
  - `EditPolicy.showTargetFeedback(Request)`

### toString

public String toString()

Overrides:
  `toString` in class `Object`
See Also:
  - `Object.toString()`

### understandsRequest

public boolean understandsRequest(Request req)
Returns `false` by default.

Specified by:
  `understandsRequest` in interface `EditPolicy`
Parameters:
  `req` - the Request
Returns:
  boolean `true` if the EditPolicy understands the specified request
See Also:
  - `EditPolicy.understandsRequest(Request)`