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
TheDeletionPolicy
is anAbstractPolicy
that handles the deletion of content.It handles the deletion of a
IContentPart
's content by initiating the removal from the content parent via theContentPolicy
of the parentIContentPart
, as well as the detachment of anchored content elements via theContentPolicy
s of anchoredIContentPart
s.This policy should be registered at an
IRootPart
. It depends onContentPolicy
s being registered on allIContentPart
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 Constructor Description DeletionPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ITransactionalOperation
createOperation()
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
getCompositeOperation()
Extracts aAbstractCompositeOperation
from the operation created bycreateOperation()
.protected DeselectOperation
getDeselectOperation()
Returns theDeselectOperation
used by thisDeletionPolicy
to deselect the to be deleted parts.protected ChangeFocusOperation
getUnfocusOperation()
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
-
-
-
-
Method Detail
-
createOperation
protected ITransactionalOperation 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
public 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.- Parameters:
contentPartToDelete
- TheIContentPart
to mark for deletion.
-
getCompositeOperation
protected AbstractCompositeOperation 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
protected DeselectOperation getDeselectOperation()
Returns theDeselectOperation
used by thisDeletionPolicy
to deselect the to be deleted parts.- Returns:
- The
DeselectOperation
that is used.
-
getUnfocusOperation
protected ChangeFocusOperation getUnfocusOperation()
Returns theChangeFocusOperation
used by thisDeletionPolicy
to unfocus the to be deleted parts. .- Returns:
- The
ChangeFocusOperation
that is used.
-
-