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
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.
-
Property Summary
Properties inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl
adaptable
Properties inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
adaptable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
IAdaptable.Bound.Impl<T extends IAdaptable>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ITransactionalOperation
Creates anITransactionalOperation
that is used to encapsulate the changes that are applied by thisAbstractPolicy
through its "work" methods.void
delete
(IContentPart<? extends javafx.scene.Node> contentPartToDelete) Deletes the givenIContentPart
by removing theIContentPart
's content from the parentIContentPart
' content and by detaching the contents of all anchoredIContentPart
s from theIContentPart
's content.protected AbstractCompositeOperation
Extracts aAbstractCompositeOperation
from the operation created bycreateOperation()
.protected DeselectOperation
Returns theDeselectOperation
used by thisDeletionPolicy
to deselect the to be deleted parts.protected ChangeFocusOperation
Returns theChangeFocusOperation
used by thisDeletionPolicy
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
-
Constructor Details
-
DeletionPolicy
public DeletionPolicy()
-
-
Method Details
-
createOperation
Description copied from class:AbstractPolicy
Creates anITransactionalOperation
that is used to encapsulate the changes that are applied by thisAbstractPolicy
through its "work" methods. The created operation should allow forlocal execution
at each time.- Specified by:
createOperation
in classAbstractPolicy
- Returns:
- A new
ITransactionalOperation
to encapsulate all applied changes.
-
delete
Deletes the givenIContentPart
by removing theIContentPart
's content from the parentIContentPart
' content and by detaching the contents of all anchoredIContentPart
s from theIContentPart
's content.- Parameters:
contentPartToDelete
- TheIContentPart
to mark for deletion.
-
getCompositeOperation
Extracts aAbstractCompositeOperation
from the operation created bycreateOperation()
. 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
Returns theDeselectOperation
used by thisDeletionPolicy
to deselect the to be deleted parts.- Returns:
- The
DeselectOperation
that is used.
-
getUnfocusOperation
Returns theChangeFocusOperation
used by thisDeletionPolicy
to unfocus the to be deleted parts. .- Returns:
- The
ChangeFocusOperation
that is used.
-