public class DeletionPolicy extends AbstractPolicy
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.
adaptable
adaptable
IAdaptable.Bound.Impl<T extends IAdaptable>
Constructor and Description |
---|
DeletionPolicy() |
Modifier and Type | Method and Description |
---|---|
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. . |
checkInitialized, commit, getOperation, init, isInitialized, locallyExecuteOperation, rollback
adaptableProperty, getAdaptable, setAdaptable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
adaptableProperty, getAdaptable, setAdaptable
protected ITransactionalOperation createOperation()
AbstractPolicy
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.createOperation
in class AbstractPolicy
ITransactionalOperation
to encapsulate all applied
changes.public void delete(IContentPart<? extends javafx.scene.Node> contentPartToDelete)
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.contentPartToDelete
- The IContentPart
to mark for deletion.protected AbstractCompositeOperation getCompositeOperation()
AbstractCompositeOperation
from the operation created
by createOperation()
. The composite operation is used to combine
individual content change operations.AbstractCompositeOperation
that is used to combine
the individual content change operations.protected DeselectOperation getDeselectOperation()
DeselectOperation
used by this DeletionPolicy
to deselect the to be deleted parts.DeselectOperation
that is used.protected ChangeFocusOperation getUnfocusOperation()
ChangeFocusOperation
used by this
DeletionPolicy
to unfocus the to be deleted parts. .ChangeFocusOperation
that is used.Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.