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
TheDeletionPolicyis anAbstractPolicythat handles the deletion of content.It handles the deletion of a
IContentPart's content by initiating the removal from the content parent via theContentPolicyof the parentIContentPart, as well as the detachment of anchored content elements via theContentPolicys of anchoredIContentParts.This policy should be registered at an
IRootPart. It depends onContentPolicys being registered on allIContentParts 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 ITransactionalOperationcreateOperation()Creates anITransactionalOperationthat is used to encapsulate the changes that are applied by thisAbstractPolicythrough its "work" methods.voiddelete(IContentPart<? extends javafx.scene.Node> contentPartToDelete)Deletes the givenIContentPartby removing theIContentPart's content from the parentIContentPart' content and by detaching the contents of all anchoredIContentParts from theIContentPart's content.protected AbstractCompositeOperationgetCompositeOperation()Extracts aAbstractCompositeOperationfrom the operation created bycreateOperation().protected DeselectOperationgetDeselectOperation()Returns theDeselectOperationused by thisDeletionPolicyto deselect the to be deleted parts.protected ChangeFocusOperationgetUnfocusOperation()Returns theChangeFocusOperationused by thisDeletionPolicyto 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:AbstractPolicyCreates anITransactionalOperationthat is used to encapsulate the changes that are applied by thisAbstractPolicythrough its "work" methods. The created operation should allow forlocal executionat each time.- Specified by:
createOperationin classAbstractPolicy- Returns:
- A new
ITransactionalOperationto encapsulate all applied changes.
-
delete
public void delete(IContentPart<? extends javafx.scene.Node> contentPartToDelete)
Deletes the givenIContentPartby removing theIContentPart's content from the parentIContentPart' content and by detaching the contents of all anchoredIContentParts from theIContentPart's content.- Parameters:
contentPartToDelete- TheIContentPartto mark for deletion.
-
getCompositeOperation
protected AbstractCompositeOperation getCompositeOperation()
Extracts aAbstractCompositeOperationfrom the operation created bycreateOperation(). The composite operation is used to combine individual content change operations.- Returns:
- The
AbstractCompositeOperationthat is used to combine the individual content change operations.
-
getDeselectOperation
protected DeselectOperation getDeselectOperation()
Returns theDeselectOperationused by thisDeletionPolicyto deselect the to be deleted parts.- Returns:
- The
DeselectOperationthat is used.
-
getUnfocusOperation
protected ChangeFocusOperation getUnfocusOperation()
Returns theChangeFocusOperationused by thisDeletionPolicyto unfocus the to be deleted parts. .- Returns:
- The
ChangeFocusOperationthat is used.
-
-