public class HistoricizingDomain extends java.lang.Object implements IDomain
HistoricizingDomain is an IDomain that uses an
IOperationHistory for executing ITransactionalOperations.| Type | Property and Description |
|---|---|
javafx.beans.property.ReadOnlyBooleanProperty |
active |
javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> |
adapters |
IAdaptable.Bound<A extends IAdaptable>CONTENT_VIEWER_ROLEADAPTERS_PROPERTYACTIVE_PROPERTY| Constructor and Description |
|---|
HistoricizingDomain()
Creates a new
HistoricizingDomain instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
protected void |
activateAdapters()
Activates the adapters registered at this
HistoricizingDomain. |
javafx.beans.property.ReadOnlyBooleanProperty |
activeProperty() |
javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> |
adaptersProperty() |
protected void |
applyUndoContext(ITransactionalOperation operation)
Applies the undo context to the given operation.
|
void |
closeExecutionTransaction(org.eclipse.gef.mvc.fx.gestures.IGesture gesture)
Closes the active execution transaction, removes the given
IGesture from the transaction context, and opens a new execution
transaction if there are any gestures remaining in the context. |
protected AbstractCompositeOperation |
createExecutionTransaction()
Creates a
ForwardUndoCompositeOperation which is used to store
the operations within an execution transaction. |
void |
deactivate() |
protected void |
deactivateAdapters()
Deactivates the adapters registered at this
HistoricizingDomain. |
void |
dispose() |
protected void |
doActivate()
Activates this
HistoricizingDomain, which activates its adapters. |
protected void |
doDeactivate()
Deactivates this
HistoricizingDomain, which deactivates its
adapters. |
void |
execute(ITransactionalOperation operation,
IProgressMonitor monitor)
Executes the given
IUndoableOperation. |
<T> T |
getAdapter(AdapterKey<T> key) |
<T> T |
getAdapter(java.lang.Class<T> classKey) |
<T> T |
getAdapter(com.google.common.reflect.TypeToken<T> key) |
<T> AdapterKey<T> |
getAdapterKey(T adapter) |
javafx.collections.ObservableMap<AdapterKey<?>,java.lang.Object> |
getAdapters()
Gets the value of the property adapters.
|
<T> java.util.Map<AdapterKey<? extends T>,T> |
getAdapters(java.lang.Class<? super T> classKey) |
<T> java.util.Map<AdapterKey<? extends T>,T> |
getAdapters(com.google.common.reflect.TypeToken<? super T> key) |
java.util.Map<AdapterKey<? extends org.eclipse.gef.mvc.fx.gestures.IGesture>,org.eclipse.gef.mvc.fx.gestures.IGesture> |
getGestures()
Returns the
IGestures registered at this IDomain (via
IAdaptable.setAdapter(TypeToken, Object)) with the AdapterKeys used
for registration. |
IOperationHistory |
getOperationHistory()
Returns the
IOperationHistory used by this
HistoricizingDomain to execute transactions. |
java.util.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 use
getGestures()
instead. |
IUndoContext |
getUndoContext()
Returns the
UndoContext that is used by this domain to execute
transactions. |
java.util.Map<AdapterKey<? extends IViewer>,IViewer> |
getViewers()
Returns the
IViewers registered at this IDomain (via
IAdaptable.setAdapter(TypeToken, Object)) with the AdapterKeys used
for registration. |
boolean |
isActive()
Gets the value of the property active.
|
protected boolean |
isExecutionTransactionOpen()
Returns
true if an execution transaction is currently open. |
boolean |
isExecutionTransactionOpen(org.eclipse.gef.mvc.fx.gestures.IGesture gesture)
Returns
true if the given IGesture is taking part in
the currently open execution transaction. |
void |
openExecutionTransaction(org.eclipse.gef.mvc.fx.gestures.IGesture gesture)
Opens a new transaction or adds the given
IGesture to the
currently opened transaction for executing operations (via
IDomain.execute(ITransactionalOperation, IProgressMonitor)) on the
IOperationHistory used by this IDomain. |
<T> void |
setAdapter(T adapter) |
<T> void |
setAdapter(T adapter,
java.lang.String role) |
<T> void |
setAdapter(com.google.common.reflect.TypeToken<T> adapterType,
T adapter) |
<T> void |
setAdapter(com.google.common.reflect.TypeToken<T> adapterType,
T adapter,
java.lang.String role) |
void |
setOperationHistory(IOperationHistory operationHistory)
Sets the
IOperationHistory that is used by this
HistoricizingDomain to the given value. |
void |
setUndoContext(IUndoContext undoContext)
Sets the
IUndoContext that is used by this
HistoricizingDomain to the given value. |
<T> void |
unsetAdapter(T adapter) |
public final javafx.beans.property.ReadOnlyBooleanProperty activeProperty
activeProperty in interface IActivatableisActive()public javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> adaptersProperty
adaptersProperty in interface IAdaptablegetAdapters()public HistoricizingDomain()
HistoricizingDomain instance.public final void activate()
activate in interface IActivatableprotected void activateAdapters()
HistoricizingDomain.public final javafx.beans.property.ReadOnlyBooleanProperty activeProperty()
activeProperty in interface IActivatableisActive()public javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> adaptersProperty()
adaptersProperty in interface IAdaptablegetAdapters()protected void applyUndoContext(ITransactionalOperation operation)
operation - The ITransactionalOperation to apply the
getUndoContext() to.public void closeExecutionTransaction(org.eclipse.gef.mvc.fx.gestures.IGesture gesture)
IDomainIGesture from the transaction context, and opens a new execution
transaction if there are any gestures remaining in the context.closeExecutionTransaction in interface IDomaingesture - The IGesture that should be removed from the
transaction context.IDomain.openExecutionTransaction(IGesture)protected AbstractCompositeOperation createExecutionTransaction()
ForwardUndoCompositeOperation which is used to store
the operations within an execution transaction. The operation is opened
on the operation history.ForwardUndoCompositeOperation which is configured
to store the operations within an execution transaction.public final void deactivate()
deactivate in interface IActivatableprotected void deactivateAdapters()
HistoricizingDomain.public void dispose()
dispose in interface IDisposableprotected void doActivate()
HistoricizingDomain, which activates its adapters.protected void doDeactivate()
HistoricizingDomain, which deactivates its
adapters.public void execute(ITransactionalOperation operation, IProgressMonitor monitor) throws ExecutionException
IUndoableOperation.
In case an execution transaction is currently open (see
openExecutionTransaction(IGesture),
closeExecutionTransaction(IGesture)) the enclosing transaction
will refer to the IUndoContext used by this IDomain) (so
that no specific IUndoContext is set on the passed in
IUndoableOperation). If no transaction is currently open, the
IUndoContext of this IDomain will be set on the passed in
IUndoableOperation.execute in interface IDomainoperation - The IUndoableOperation to be executed on the
IOperationHistory of this IDomain.monitor - An IProgressMonitor used to indicate progress. May be
null.ExecutionException - In case an exception occurred during the execution of the
operation.public <T> T getAdapter(AdapterKey<T> key)
getAdapter in interface IAdaptablepublic <T> T getAdapter(java.lang.Class<T> classKey)
getAdapter in interface IAdaptablepublic <T> T getAdapter(com.google.common.reflect.TypeToken<T> key)
getAdapter in interface IAdaptablepublic <T> AdapterKey<T> getAdapterKey(T adapter)
getAdapterKey in interface IAdaptablepublic javafx.collections.ObservableMap<AdapterKey<?>,java.lang.Object> getAdapters()
getAdapters in interface IAdaptablepublic <T> java.util.Map<AdapterKey<? extends T>,T> getAdapters(java.lang.Class<? super T> classKey)
getAdapters in interface IAdaptablepublic <T> java.util.Map<AdapterKey<? extends T>,T> getAdapters(com.google.common.reflect.TypeToken<? super T> key)
getAdapters in interface IAdaptablepublic java.util.Map<AdapterKey<? extends org.eclipse.gef.mvc.fx.gestures.IGesture>,org.eclipse.gef.mvc.fx.gestures.IGesture> getGestures()
IDomainIGestures registered at this IDomain (via
IAdaptable.setAdapter(TypeToken, Object)) with the AdapterKeys used
for registration.getGestures in interface IDomainMap containing the registered IGestures mapped
to their respective AdapterKeys.IAdaptable.setAdapter(TypeToken, Object)public IOperationHistory getOperationHistory()
IOperationHistory used by this
HistoricizingDomain to execute transactions.IOperationHistory.@Deprecated public java.util.Map<AdapterKey<? extends org.eclipse.gef.mvc.fx.gestures.IGesture>,org.eclipse.gef.mvc.fx.gestures.IGesture> getTools()
getGestures()
instead.IGestures registered at this IDomain (via
IAdaptable.setAdapter(TypeToken, Object)) with the AdapterKeys used
for registration.getTools in interface IDomainMap containing the registered IGestures mapped
to their respective AdapterKeys.IAdaptable.setAdapter(TypeToken, Object)public IUndoContext getUndoContext()
UndoContext that is used by this domain to execute
transactions.UndoContext.public java.util.Map<AdapterKey<? extends IViewer>,IViewer> getViewers()
IDomainIViewers registered at this IDomain (via
IAdaptable.setAdapter(TypeToken, Object)) with the AdapterKeys used
for registration.getViewers in interface IDomainMap containing the registered IViewers mapped
to their respective AdapterKeys.IAdaptable.setAdapter(TypeToken, Object)public final boolean isActive()
isActive in interface IActivatableprotected boolean isExecutionTransactionOpen()
true if an execution transaction is currently open.
Otherwise returns false.true if an execution transaction is currently open,
otherwise false.public boolean isExecutionTransactionOpen(org.eclipse.gef.mvc.fx.gestures.IGesture gesture)
IDomaintrue if the given IGesture is taking part in
the currently open execution transaction. Otherwise returns
false.isExecutionTransactionOpen in interface IDomaingesture - The IGesture that is checked.true if the given IGesture is taking part in
the currently open execution transaction, otherwise
false.public void openExecutionTransaction(org.eclipse.gef.mvc.fx.gestures.IGesture gesture)
IDomainIGesture to the
currently opened transaction for executing operations (via
IDomain.execute(ITransactionalOperation, IProgressMonitor)) on the
IOperationHistory used by this IDomain.openExecutionTransaction in interface IDomaingesture - The IGesture starting/joining the transaction.public <T> void setAdapter(T adapter)
setAdapter in interface IAdaptablepublic <T> void setAdapter(T adapter,
java.lang.String role)
setAdapter in interface IAdaptablepublic <T> void setAdapter(com.google.common.reflect.TypeToken<T> adapterType,
T adapter)
setAdapter in interface IAdaptable@InjectAdapters public <T> void setAdapter(com.google.common.reflect.TypeToken<T> adapterType, T adapter, java.lang.String role)
setAdapter in interface IAdaptable@Inject public void setOperationHistory(IOperationHistory operationHistory)
IOperationHistory that is used by this
HistoricizingDomain to the given value. Operation history
listeners are un-/registered accordingly.operationHistory - The new IOperationHistory for this domain.@Inject public void setUndoContext(IUndoContext undoContext)
IUndoContext that is used by this
HistoricizingDomain to the given value.undoContext - The new IUndoContext for this domain.public <T> void unsetAdapter(T adapter)
unsetAdapter in interface IAdaptableCopyright (c) 2014, 2016 itemis AG and others. All rights reserved.