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_PROPERTY
ACTIVE_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() |
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(IUndoableOperation 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
ITool s registered at this IDomain (via
IAdaptable.setAdapter(TypeToken, Object) ) with the AdapterKey s 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
IViewer s registered at this IDomain (via
IAdaptable.setAdapter(TypeToken, Object) ) with the AdapterKey s 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(IUndoableOperation) ) 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 IActivatable
isActive()
public javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> adaptersProperty
adaptersProperty
in interface IAdaptable
getAdapters()
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 IActivatable
public javafx.beans.property.ReadOnlyBooleanProperty activeProperty()
activeProperty
in interface IActivatable
isActive()
public javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> adaptersProperty()
adaptersProperty
in interface IAdaptable
getAdapters()
public void closeExecutionTransaction(ITool<VR> tool)
IDomain
ITool
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 IActivatable
public void dispose()
dispose
in interface IDisposable
public void execute(IUndoableOperation operation) throws ExecutionException
IDomain
IUndoableOperation
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 IAdaptable
public <T> T getAdapter(java.lang.Class<T> classKey)
getAdapter
in interface IAdaptable
public <T> T getAdapter(com.google.common.reflect.TypeToken<T> key)
getAdapter
in interface IAdaptable
public <T> AdapterKey<T> getAdapterKey(T adapter)
getAdapterKey
in interface IAdaptable
public javafx.collections.ObservableMap<AdapterKey<?>,java.lang.Object> getAdapters()
getAdapters
in interface IAdaptable
public <T> java.util.Map<AdapterKey<? extends T>,T> getAdapters(java.lang.Class<? super T> classKey)
getAdapters
in interface IAdaptable
public <T> java.util.Map<AdapterKey<? extends T>,T> getAdapters(com.google.common.reflect.TypeToken<? super T> key)
getAdapters
in interface IAdaptable
public IOperationHistory getOperationHistory()
IDomain
IOperationHistory
that is used by this domain.getOperationHistory
in interface IDomain<VR>
IOperationHistory
.public java.util.Map<AdapterKey<? extends ITool<VR>>,ITool<VR>> getTools()
IDomain
ITool
s registered at this IDomain
(via
IAdaptable.setAdapter(TypeToken, Object)
) with the AdapterKey
s used
for registration.getTools
in interface IDomain<VR>
Map
containing the registered ITool
s mapped to
their respective AdapterKey
s.IAdaptable.setAdapter(TypeToken, Object)
public IUndoContext getUndoContext()
IDomain
UndoContext
that is used by this domain.getUndoContext
in interface IDomain<VR>
UndoContext
.public java.util.Map<AdapterKey<? extends IViewer<VR>>,IViewer<VR>> getViewers()
IDomain
IViewer
s registered at this IDomain
(via
IAdaptable.setAdapter(TypeToken, Object)
) with the AdapterKey
s used
for registration.getViewers
in interface IDomain<VR>
Map
containing the registered IViewer
s mapped
to their respective AdapterKey
s.IAdaptable.setAdapter(TypeToken, Object)
public boolean isActive()
isActive
in interface IActivatable
protected 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)
IDomain
true
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)
IDomain
ITool
to the currently
opened transaction for executing operations (via
IDomain.execute(IUndoableOperation)
) 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 IAdaptable
public <T> void setAdapter(T adapter, java.lang.String role)
setAdapter
in interface IAdaptable
public <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 IAdaptable
Copyright (c) 2014 itemis AG and others. All rights reserved.