Package org.eclipse.gef.mvc.fx.domain
Class HistoricizingDomain
java.lang.Object
org.eclipse.gef.mvc.fx.domain.HistoricizingDomain
- All Implemented Interfaces:
IActivatable,IAdaptable,IDisposable,IDomain
The
HistoricizingDomain is an IDomain that uses an
IOperationHistory for executing ITransactionalOperations.-
Property Summary
PropertiesTypePropertyDescriptionfinal javafx.beans.property.ReadOnlyBooleanPropertyjavafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,Object> -
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable
IAdaptable.Bound<A extends IAdaptable> -
Field Summary
Fields inherited from interface org.eclipse.gef.common.activate.IActivatable
ACTIVE_PROPERTYFields inherited from interface org.eclipse.gef.common.adapt.IAdaptable
ADAPTERS_PROPERTYFields inherited from interface org.eclipse.gef.mvc.fx.domain.IDomain
CONTENT_VIEWER_ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidactivate()protected voidActivates the adapters registered at thisHistoricizingDomain.final javafx.beans.property.ReadOnlyBooleanPropertyjavafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,Object> protected voidapplyUndoContext(ITransactionalOperation operation) Applies the undo context to the given operation.voidcloseExecutionTransaction(org.eclipse.gef.mvc.fx.gestures.IGesture gesture) Closes the active execution transaction, removes the givenIGesturefrom the transaction context, and opens a new execution transaction if there are any gestures remaining in the context.protected AbstractCompositeOperationCreates aForwardUndoCompositeOperationwhich is used to store the operations within an execution transaction.final voidprotected voidDeactivates the adapters registered at thisHistoricizingDomain.voiddispose()protected voidActivates thisHistoricizingDomain, which activates its adapters.protected voidDeactivates thisHistoricizingDomain, which deactivates its adapters.voidexecute(ITransactionalOperation operation, IProgressMonitor monitor) Executes the givenIUndoableOperation.<T> TgetAdapter(TypeToken<T> key) <T> TgetAdapter(Class<T> classKey) <T> TgetAdapter(AdapterKey<T> key) <T> AdapterKey<T>getAdapterKey(T adapter) javafx.collections.ObservableMap<AdapterKey<?>,Object> Gets the value of the property adapters.<T> Map<AdapterKey<? extends T>,T> getAdapters(TypeToken<? super T> key) <T> Map<AdapterKey<? extends T>,T> getAdapters(Class<? super T> classKey) Map<AdapterKey<? extends org.eclipse.gef.mvc.fx.gestures.IGesture>,org.eclipse.gef.mvc.fx.gestures.IGesture> Returns theIGestures registered at thisIDomain(viaIAdaptable.setAdapter(TypeToken, Object)) with theAdapterKeys used for registration.Returns theIOperationHistoryused by thisHistoricizingDomainto execute transactions.Map<AdapterKey<? extends org.eclipse.gef.mvc.fx.gestures.IGesture>,org.eclipse.gef.mvc.fx.gestures.IGesture> getTools()Deprecated.Will be removed in 6.0.0.Returns theUndoContextthat is used by this domain to execute transactions.Map<AdapterKey<? extends IViewer>,IViewer> Returns theIViewers registered at thisIDomain(viaIAdaptable.setAdapter(TypeToken, Object)) with theAdapterKeys used for registration.final booleanisActive()Gets the value of the property active.protected booleanReturnstrueif an execution transaction is currently open.booleanisExecutionTransactionOpen(org.eclipse.gef.mvc.fx.gestures.IGesture gesture) Returnstrueif the givenIGestureis taking part in the currently open execution transaction.voidopenExecutionTransaction(org.eclipse.gef.mvc.fx.gestures.IGesture gesture) Opens a new transaction or adds the givenIGestureto the currently opened transaction for executing operations (viaIDomain.execute(ITransactionalOperation, IProgressMonitor)) on theIOperationHistoryused by thisIDomain.<T> voidsetAdapter(TypeToken<T> adapterType, T adapter) <T> voidsetAdapter(TypeToken<T> adapterType, T adapter, String role) <T> voidsetAdapter(T adapter) <T> voidsetAdapter(T adapter, String role) voidsetOperationHistory(IOperationHistory operationHistory) Sets theIOperationHistorythat is used by thisHistoricizingDomainto the given value.voidsetUndoContext(IUndoContext undoContext) Sets theIUndoContextthat is used by thisHistoricizingDomainto the given value.<T> voidunsetAdapter(T adapter)
-
Property Details
-
active
public final javafx.beans.property.ReadOnlyBooleanProperty activeProperty- Specified by:
activePropertyin interfaceIActivatable- See Also:
-
adapters
- Specified by:
adaptersPropertyin interfaceIAdaptable- See Also:
-
-
Constructor Details
-
HistoricizingDomain
public HistoricizingDomain()Creates a newHistoricizingDomaininstance.
-
-
Method Details
-
activate
public final void activate()- Specified by:
activatein interfaceIActivatable
-
activateAdapters
protected void activateAdapters()Activates the adapters registered at thisHistoricizingDomain. -
activeProperty
public final javafx.beans.property.ReadOnlyBooleanProperty activeProperty()- Specified by:
activePropertyin interfaceIActivatable- See Also:
-
adaptersProperty
- Specified by:
adaptersPropertyin interfaceIAdaptable- See Also:
-
applyUndoContext
Applies the undo context to the given operation. May be overwritten by clients to filter out operations that should not be undoable in the given context.- Parameters:
operation- TheITransactionalOperationto apply thegetUndoContext()to.
-
closeExecutionTransaction
public void closeExecutionTransaction(org.eclipse.gef.mvc.fx.gestures.IGesture gesture) Description copied from interface:IDomainCloses the active execution transaction, removes the givenIGesturefrom the transaction context, and opens a new execution transaction if there are any gestures remaining in the context.- Specified by:
closeExecutionTransactionin interfaceIDomain- Parameters:
gesture- TheIGesturethat should be removed from the transaction context.- See Also:
-
createExecutionTransaction
Creates aForwardUndoCompositeOperationwhich is used to store the operations within an execution transaction. The operation is opened on theoperation history.- Returns:
- A new
ForwardUndoCompositeOperationwhich is configured to store the operations within an execution transaction.
-
deactivate
public final void deactivate()- Specified by:
deactivatein interfaceIActivatable
-
deactivateAdapters
protected void deactivateAdapters()Deactivates the adapters registered at thisHistoricizingDomain. -
dispose
public void dispose()- Specified by:
disposein interfaceIDisposable
-
doActivate
protected void doActivate()Activates thisHistoricizingDomain, which activates its adapters. -
doDeactivate
protected void doDeactivate()Deactivates thisHistoricizingDomain, which deactivates its adapters. -
execute
public void execute(ITransactionalOperation operation, IProgressMonitor monitor) throws ExecutionException Executes the givenIUndoableOperation. In case an execution transaction is currently open (seeopenExecutionTransaction(IGesture),closeExecutionTransaction(IGesture)) the enclosing transaction will refer to theIUndoContextused by thisIDomain) (so that no specificIUndoContextis set on the passed inIUndoableOperation). If no transaction is currently open, theIUndoContextof thisIDomainwill be set on the passed inIUndoableOperation.- Specified by:
executein interfaceIDomain- Parameters:
operation- TheIUndoableOperationto be executed on theIOperationHistoryof thisIDomain.monitor- AnIProgressMonitorused to indicate progress. May benull.- Throws:
ExecutionException- In case an exception occurred during the execution of the operation.
-
getAdapter
- Specified by:
getAdapterin interfaceIAdaptable
-
getAdapter
- Specified by:
getAdapterin interfaceIAdaptable
-
getAdapter
- Specified by:
getAdapterin interfaceIAdaptable
-
getAdapterKey
- Specified by:
getAdapterKeyin interfaceIAdaptable
-
getAdapters
Gets the value of the property adapters.- Specified by:
getAdaptersin interfaceIAdaptable- Property description:
-
getAdapters
- Specified by:
getAdaptersin interfaceIAdaptable
-
getAdapters
- Specified by:
getAdaptersin interfaceIAdaptable
-
getGestures
public Map<AdapterKey<? extends org.eclipse.gef.mvc.fx.gestures.IGesture>,org.eclipse.gef.mvc.fx.gestures.IGesture> getGestures()Description copied from interface:IDomainReturns theIGestures registered at thisIDomain(viaIAdaptable.setAdapter(TypeToken, Object)) with theAdapterKeys used for registration.- Specified by:
getGesturesin interfaceIDomain- Returns:
- A
Mapcontaining the registeredIGestures mapped to their respectiveAdapterKeys. - See Also:
-
getOperationHistory
Returns theIOperationHistoryused by thisHistoricizingDomainto execute transactions.- Returns:
- The
IOperationHistory.
-
getTools
@Deprecated public Map<AdapterKey<? extends org.eclipse.gef.mvc.fx.gestures.IGesture>,org.eclipse.gef.mvc.fx.gestures.IGesture> getTools()Deprecated.Will be removed in 6.0.0. Please usegetGestures()instead.Returns theIGestures registered at thisIDomain(viaIAdaptable.setAdapter(TypeToken, Object)) with theAdapterKeys used for registration.- Specified by:
getToolsin interfaceIDomain- Returns:
- A
Mapcontaining the registeredIGestures mapped to their respectiveAdapterKeys. - See Also:
-
getUndoContext
Returns theUndoContextthat is used by this domain to execute transactions.- Returns:
- The
UndoContext.
-
getViewers
Description copied from interface:IDomainReturns theIViewers registered at thisIDomain(viaIAdaptable.setAdapter(TypeToken, Object)) with theAdapterKeys used for registration.- Specified by:
getViewersin interfaceIDomain- Returns:
- A
Mapcontaining the registeredIViewers mapped to their respectiveAdapterKeys. - See Also:
-
isActive
public final boolean isActive()Gets the value of the property active.- Specified by:
isActivein interfaceIActivatable- Property description:
-
isExecutionTransactionOpen
protected boolean isExecutionTransactionOpen()Returnstrueif an execution transaction is currently open. Otherwise returnsfalse.- Returns:
trueif an execution transaction is currently open, otherwisefalse.
-
isExecutionTransactionOpen
public boolean isExecutionTransactionOpen(org.eclipse.gef.mvc.fx.gestures.IGesture gesture) Description copied from interface:IDomainReturnstrueif the givenIGestureis taking part in the currently open execution transaction. Otherwise returnsfalse.- Specified by:
isExecutionTransactionOpenin interfaceIDomain- Parameters:
gesture- TheIGesturethat is checked.- Returns:
trueif the givenIGestureis taking part in the currently open execution transaction, otherwisefalse.
-
openExecutionTransaction
public void openExecutionTransaction(org.eclipse.gef.mvc.fx.gestures.IGesture gesture) Description copied from interface:IDomainOpens a new transaction or adds the givenIGestureto the currently opened transaction for executing operations (viaIDomain.execute(ITransactionalOperation, IProgressMonitor)) on theIOperationHistoryused by thisIDomain.- Specified by:
openExecutionTransactionin interfaceIDomain- Parameters:
gesture- TheIGesturestarting/joining the transaction.
-
setAdapter
public <T> void setAdapter(T adapter) - Specified by:
setAdapterin interfaceIAdaptable
-
setAdapter
- Specified by:
setAdapterin interfaceIAdaptable
-
setAdapter
- Specified by:
setAdapterin interfaceIAdaptable
-
setAdapter
- Specified by:
setAdapterin interfaceIAdaptable
-
setOperationHistory
Sets theIOperationHistorythat is used by thisHistoricizingDomainto the given value. Operation history listeners are un-/registered accordingly.- Parameters:
operationHistory- The newIOperationHistoryfor this domain.
-
setUndoContext
Sets theIUndoContextthat is used by thisHistoricizingDomainto the given value.- Parameters:
undoContext- The newIUndoContextfor this domain.
-
unsetAdapter
public <T> void unsetAdapter(T adapter) - Specified by:
unsetAdapterin interfaceIAdaptable
-