Package org.eclipse.gef.mvc.fx.policies

## Class DeletionPolicy

- java.lang.Object
- - org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl<IVisualPart<? extends javafx.scene.Node>>
  - - org.eclipse.gef.mvc.fx.policies.AbstractPolicy
    - - org.eclipse.gef.mvc.fx.policies.DeletionPolicy

All Implemented Interfaces:
  `IAdaptable.Bound<IVisualPart<? extends javafx.scene.Node>>`, `IPolicy`

    public class DeletionPolicy
    extends AbstractPolicy

The `DeletionPolicy` is an `AbstractPolicy` that handles the deletion of content.

It handles the deletion of a `IContentPart`'s content by initiating the removal from the content parent via the `ContentPolicy` of the parent `IContentPart`, as well as the detachment of anchored content elements via the `ContentPolicy`s of anchored `IContentPart`s.

This policy should be registered at an `IRootPart`. It depends on `ContentPolicy`s being registered on all `IContentPart`s that are affected by the deletion.

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound

`IAdaptable.Bound.Impl<T extends IAdaptable>`

### Constructor Summary

Constructors
`DeletionPolicy()`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected ITransactionalOperation` `createOperation()` Creates an `ITransactionalOperation` that is used to encapsulate the changes that are applied by this `AbstractPolicy` through its "work" methods.
`void` `delete​(IContentPart<? extends javafx.scene.Node> contentPartToDelete)` Deletes the given `IContentPart` by removing the `IContentPart`'s content from the parent `IContentPart`' content and by detaching the contents of all anchored `IContentPart`s from the `IContentPart`'s content.
`protected AbstractCompositeOperation` `getCompositeOperation()` Extracts a `AbstractCompositeOperation` from the operation created by `createOperation()`.
`protected DeselectOperation` `getDeselectOperation()` Returns the `DeselectOperation` used by this `DeletionPolicy` to deselect the to be deleted parts.
`protected ChangeFocusOperation` `getUnfocusOperation()` Returns the `ChangeFocusOperation` used by this `DeletionPolicy` to unfocus the to be deleted parts. .

### Methods inherited from class org.eclipse.gef.mvc.fx.policies.AbstractPolicy

`checkInitialized, commit, getOperation, init, isInitialized, locallyExecuteOperation, rollback`

### Methods inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl

`adaptableProperty, getAdaptable, setAdaptable`

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

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

### Methods inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound

`adaptableProperty, getAdaptable, setAdaptable`

### Methods inherited from interface org.eclipse.gef.mvc.fx.policies.IPolicy

`getHost`

### Constructor Detail

#### DeletionPolicy

    public DeletionPolicy()

### Method Detail

#### createOperation

    protected ITransactionalOperation createOperation()

Description copied from class: `AbstractPolicy`
Creates an `ITransactionalOperation` that is used to encapsulate the changes that are applied by this `AbstractPolicy` through its "work" methods. The created operation should allow for `local execution` at each time.

Specified by:
  `createOperation` in class `AbstractPolicy`
Returns:
  A new `ITransactionalOperation` to encapsulate all applied changes.

#### delete

    public void delete​(IContentPart<? extends javafx.scene.Node> contentPartToDelete)

Deletes the given `IContentPart` by removing the `IContentPart`'s content from the parent `IContentPart`' content and by detaching the contents of all anchored `IContentPart`s from the `IContentPart`'s content.

Parameters:
  `contentPartToDelete` - The `IContentPart` to mark for deletion.

#### getCompositeOperation

    protected AbstractCompositeOperation getCompositeOperation()

Extracts a `AbstractCompositeOperation` from the operation created by `createOperation()`. The composite operation is used to combine individual content change operations.

Returns:
  The `AbstractCompositeOperation` that is used to combine the individual content change operations.

#### getDeselectOperation

    protected DeselectOperation getDeselectOperation()

Returns the `DeselectOperation` used by this `DeletionPolicy` to deselect the to be deleted parts.

Returns:
  The `DeselectOperation` that is used.

#### getUnfocusOperation

    protected ChangeFocusOperation getUnfocusOperation()

Returns the `ChangeFocusOperation` used by this `DeletionPolicy` to unfocus the to be deleted parts. .

Returns:
  The `ChangeFocusOperation` that is used.