VR - The visual root node of the UI toolkit used, e.g.
javafx.scene.Node in case of JavaFX.public class DeletionPolicy<VR> extends AbstractPolicy<VR> implements ITransactional
DeletionPolicy is an ITransactional
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 ContentPolicys of anchored IContentParts.
This policy should be registered at an IRootPart. It depends on
ContentPolicys being registered on all IContentParts that are
affected by the deletion.
ITransactional.NoOperation, ITransactional.UnexecutableOperation| Modifier and Type | Field and Description |
|---|---|
protected boolean |
initialized
Stores the initialized flag for this policy, i.e.
|
NOOP, UNEXECUTABLE| Constructor and Description |
|---|
DeletionPolicy() |
| Modifier and Type | Method and Description |
|---|---|
ITransactionalOperation |
commit()
Returns an
ITransactionalOperation that performs all
manipulations applied by the policy since the last ITransactional.init() call. |
protected ITransactionalOperation |
createDeselectOperation(IContentPart<VR,? extends VR> part)
Returns an
ITransactionalOperation that removes the given
IContentPart from the SelectionModel of the corresponding
IViewer. |
protected ITransactionalOperation |
createUnfocusOperation(IContentPart<VR,? extends VR> part)
Returns an
ITransactionalOperation that removes the given
IContentPart from the FocusModel of the corresponding
IViewer. |
void |
delete(IContentPart<VR,? extends VR> contentPartToDelete)
Deletes the given
IContentPart by removing the
IContentPart's content from the parent IContentPart'
content and by detaching the contents of all anchored
IContentParts from the IContentPart's content. |
void |
init()
Initializes the policy, so that the policy's "work" methods can be used.
|
commit, getAdaptable, getHost, init, restoreRefreshVisuals, setAdaptable, storeAndDisableRefreshVisualspublic ITransactionalOperation commit()
ITransactionalITransactionalOperation that performs all
manipulations applied by the policy since the last ITransactional.init() call.
When called multiple times in sequence, only the first call will yield an
operation, the subsequent calls will yield null.
You can return ITransactional.NOOP if no changes have to be applied. The domain
will filter out all ITransactional.NOOPs before their execution.
You can return ITransactional.UNEXECUTABLE to prevent any composite operation
that contains the ITransactional.UNEXECUTABLE from execution.
commit in interface ITransactionalITransactionalOperation that performs all
manipulations applied by the policy since the last
ITransactional.init() call.protected ITransactionalOperation createDeselectOperation(IContentPart<VR,? extends VR> part)
ITransactionalOperation that removes the given
IContentPart from the SelectionModel of the corresponding
IViewer.part - The IContentPart that is removed from the
SelectionModel.ITransactionalOperation that changes the
SelectionModel.protected ITransactionalOperation createUnfocusOperation(IContentPart<VR,? extends VR> part)
ITransactionalOperation that removes the given
IContentPart from the FocusModel of the corresponding
IViewer.part - The IContentPart that is removed from the
FocusModel.ITransactionalOperation that changes the
FocusModel.public void delete(IContentPart<VR,? extends VR> contentPartToDelete)
IContentPart by removing the
IContentPart's content from the parent IContentPart'
content and by detaching the contents of all anchored
IContentParts from the IContentPart's content.contentPartToDelete - The IContentPart to mark for deletion.public void init()
ITransactionalIllegalStateException. It is safe to call ITransactional.init()
multiple times in sequence.init in interface ITransactionalCopyright (c) 2014 itemis AG and others. All rights reserved.