Package org.eclipse.gef.mvc.fx.policies
Class AbstractPolicy
java.lang.Object
org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl<IVisualPart<? extends javafx.scene.Node>>
org.eclipse.gef.mvc.fx.policies.AbstractPolicy
- All Implemented Interfaces:
IAdaptable.Bound<IVisualPart<? extends javafx.scene.Node>>
,IPolicy
- Direct Known Subclasses:
BendConnectionPolicy
,ContentPolicy
,CreationPolicy
,DeletionPolicy
,FocusTraversalPolicy
,ResizePolicy
,TransformPolicy
,ViewportPolicy
public abstract class AbstractPolicy
extends IAdaptable.Bound.Impl<IVisualPart<? extends javafx.scene.Node>>
implements IPolicy
Abstract base implementation of
IPolicy
that is transactional.-
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 void
Checks whether thisAbstractPolicy
is initialized and throws an IllegalStateException if not.commit()
Returns anITransactionalOperation
that performs all manipulations applied by the policy since the previousinit()
call.protected abstract ITransactionalOperation
Creates anITransactionalOperation
that is used to encapsulate the changes that are applied by thisAbstractPolicy
through its "work" methods.protected final ITransactionalOperation
Returns theITransactionalOperation
that is used to encapsulate the changes that are applied by thisAbstractPolicy
through its "work" methods.void
init()
Initializes the policy, so that the policy's "work" methods can be used.protected boolean
Returns whether thisAbstractPolicy
is initialized or not.protected void
Locally executes theITransactionalOperation
that is updated by this policy, i.e. not on the operation history.void
rollback()
Puts back this policy into an uninitialized state, reverting any changes that have been applied via the policy's work methods since the precedinginit()
call.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
-
AbstractPolicy
public AbstractPolicy()
-
-
Method Details
-
checkInitialized
protected void checkInitialized()Checks whether thisAbstractPolicy
is initialized and throws an IllegalStateException if not. -
commit
Returns anITransactionalOperation
that performs all manipulations applied by the policy since the previousinit()
call.- Specified by:
commit
in interfaceIPolicy
- Returns:
- An
ITransactionalOperation
that performs all manipulations applied by the policy since the lastinit()
call.
-
createOperation
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.- Returns:
- A new
ITransactionalOperation
to encapsulate all applied changes.
-
getOperation
Returns theITransactionalOperation
that is used to encapsulate the changes that are applied by thisAbstractPolicy
through its "work" methods.- Returns:
- A new
ITransactionalOperation
to encapsulate all applied changes.
-
init
public void init()Initializes the policy, so that the policy's "work" methods can be used. Calling a "work" method while the policy is not initialized will result in anIllegalStateException
, as well as re-initializing before committing or rolling back. -
isInitialized
protected boolean isInitialized()Returns whether thisAbstractPolicy
is initialized or not.- Returns:
true
if thisAbstractPolicy
is initialized,false
otherwise.
-
locallyExecuteOperation
protected void locallyExecuteOperation()Locally executes theITransactionalOperation
that is updated by this policy, i.e. not on the operation history. Maybe used in the "work" operations of subclasses. -
rollback
public void rollback()Puts back this policy into an uninitialized state, reverting any changes that have been applied via the policy's work methods since the precedinginit()
call.
-