VR - The visual root node of the UI toolkit used, e.g.
javafx.scene.Node in case of JavaFX.public abstract class AbstractDomain<VR> extends java.lang.Object implements IDomain<VR>
| Type | Property and Description |
|---|---|
javafx.beans.property.ReadOnlyBooleanProperty |
active |
javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> |
adapters |
IAdaptable.Bound<A extends IAdaptable>ADAPTERS_PROPERTYACTIVE_PROPERTY| Constructor and Description |
|---|
AbstractDomain()
Creates a new
AbstractDomain instance, setting the
AdaptableScope for each of its IAdaptable-compliant types
(super classes implementing IAdaptable and super-interfaces
extending IAdaptable) to the newly created instance (see
AdaptableScopes#scopeTo(IAdaptable)). |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
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(ITool<VR> tool)
Closes the active execution transaction, removes the given
ITool
from the transaction context, and opens a new execution transaction if
there are any tools remaining in the context. |
protected AbstractCompositeOperation |
createExecutionTransaction()
Creates a
ForwardUndoCompositeOperation which is used to store
the operations within an execution transaction. |
void |
deactivate() |
void |
dispose() |
void |
execute(ITransactionalOperation operation)
Will execute the given
IUndoableOperation on the
IOperationHistory used by this IDomain (see
IDomain.getOperationHistory()), using the IUndoContext of this
IDomain. |
<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) |
IOperationHistory |
getOperationHistory()
Returns the
IOperationHistory that is used by this domain. |
java.util.Map<AdapterKey<? extends ITool<VR>>,ITool<VR>> |
getTools()
Returns the
ITools registered at this IDomain (via
IAdaptable.setAdapter(TypeToken, Object)) with the AdapterKeys used
for registration. |
IUndoContext |
getUndoContext()
Returns the
UndoContext that is used by this domain. |
java.util.Map<AdapterKey<? extends IViewer<VR>>,IViewer<VR>> |
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(ITool<VR> tool)
Returns
true if the given ITool is taking part in
the currently open execution transaction. |
void |
openExecutionTransaction(ITool<VR> tool)
Opens a new transaction or adds the given
ITool to the currently
opened transaction for executing operations (via
IDomain.execute(ITransactionalOperation)) on the
IOperationHistory used by this IDomain (see
IDomain.getOperationHistory()), using the IUndoContext of 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
AbstractDomain to the given value. |
void |
setUndoContext(IUndoContext undoContext)
Sets the
IUndoContext that is used by this AbstractDomain
to the given value. |
<T> void |
unsetAdapter(T adapter) |
public javafx.beans.property.ReadOnlyBooleanProperty activeProperty
activeProperty in interface IActivatableisActive()public javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> adaptersProperty
adaptersProperty in interface IAdaptablegetAdapters()public AbstractDomain()
AbstractDomain instance, setting the
AdaptableScope for each of its IAdaptable-compliant types
(super classes implementing IAdaptable and super-interfaces
extending IAdaptable) to the newly created instance (see
AdaptableScopes#scopeTo(IAdaptable)).public void activate()
activate in interface IActivatablepublic 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(ITool<VR> tool)
IDomainITool
from the transaction context, and opens a new execution transaction if
there are any tools remaining in the context.closeExecutionTransaction in interface IDomain<VR>tool - The ITool that should be removed from the transaction
context.IDomain.openExecutionTransaction(ITool)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 void deactivate()
deactivate in interface IActivatablepublic void dispose()
dispose in interface IDisposablepublic void execute(ITransactionalOperation operation) throws ExecutionException
IDomainIUndoableOperation on the
IOperationHistory used by this IDomain (see
IDomain.getOperationHistory()), using the IUndoContext of this
IDomain.
In case an execution transaction is currently open (see
IDomain.openExecutionTransaction(ITool),
IDomain.closeExecutionTransaction(ITool)) 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 IDomain<VR>operation - The IUndoableOperation to be executed on the
IOperationHistory of this IDomain.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 IOperationHistory getOperationHistory()
IDomainIOperationHistory that is used by this domain.getOperationHistory in interface IDomain<VR>IOperationHistory.public java.util.Map<AdapterKey<? extends ITool<VR>>,ITool<VR>> getTools()
IDomainITools registered at this IDomain (via
IAdaptable.setAdapter(TypeToken, Object)) with the AdapterKeys used
for registration.getTools in interface IDomain<VR>Map containing the registered ITools mapped to
their respective AdapterKeys.IAdaptable.setAdapter(TypeToken, Object)public IUndoContext getUndoContext()
IDomainUndoContext that is used by this domain.getUndoContext in interface IDomain<VR>UndoContext.public java.util.Map<AdapterKey<? extends IViewer<VR>>,IViewer<VR>> getViewers()
IDomainIViewers registered at this IDomain (via
IAdaptable.setAdapter(TypeToken, Object)) with the AdapterKeys used
for registration.getViewers in interface IDomain<VR>Map containing the registered IViewers mapped
to their respective AdapterKeys.IAdaptable.setAdapter(TypeToken, Object)public 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(ITool<VR> tool)
IDomaintrue if the given ITool is taking part in
the currently open execution transaction. Otherwise returns
false.isExecutionTransactionOpen in interface IDomain<VR>tool - The ITool that is checked.true if the given ITool is taking part in
the currently open execution transaction, otherwise
false.public void openExecutionTransaction(ITool<VR> tool)
IDomainITool to the currently
opened transaction for executing operations (via
IDomain.execute(ITransactionalOperation)) on the
IOperationHistory used by this IDomain (see
IDomain.getOperationHistory()), using the IUndoContext of this
IDomain.openExecutionTransaction in interface IDomain<VR>tool - The ITool 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
AbstractDomain 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 AbstractDomain
to the given value.undoContext - The new IUndoContext for this domain.public <T> void unsetAdapter(T adapter)
unsetAdapter in interface IAdaptableCopyright (c) 2014 itemis AG and others. All rights reserved.