VR
- The visual root node of the UI toolkit used, e.g.
javafx.scene.Node in case of JavaFX.public interface IDomain<VR> extends IAdaptable, IActivatable, IDisposable
IViewer
s and related ITool
s to interact
with these. It also holds a reference to the IOperationHistory
and
UndoContext
used by all ITool
as well as IPolicy
s (in
the IViewer
s) to execute IUndoableOperation
s.AbstractDomain
should be sub-classed.adapters
active
IAdaptable.Bound<A extends IAdaptable>
ADAPTERS_PROPERTY
ACTIVE_PROPERTY
Modifier and Type | Method and Description |
---|---|
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. |
void |
execute(IUndoableOperation operation)
Will execute the given
IUndoableOperation on the
IOperationHistory used by this IDomain (see
getOperationHistory() ), using the IUndoContext of this
IDomain . |
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 |
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
execute(IUndoableOperation) ) on the IOperationHistory
used by this IDomain (see getOperationHistory() ), using
the IUndoContext of this IDomain . |
adaptersProperty, getAdapter, getAdapter, getAdapter, getAdapters, getAdapters, getAdapters, setAdapter, setAdapter, setAdapter, setAdapter, unsetAdapter
activate, activeProperty, deactivate, isActive
dispose
void closeExecutionTransaction(ITool<VR> tool)
ITool
from the transaction context, and opens a new execution transaction if
there are any tools remaining in the context.tool
- The ITool
that should be removed from the transaction
context.openExecutionTransaction(ITool)
void execute(IUndoableOperation operation) throws ExecutionException
IUndoableOperation
on the
IOperationHistory
used by this IDomain
(see
getOperationHistory()
), using the IUndoContext
of this
IDomain
.
In case an execution transaction is currently open (see
openExecutionTransaction(ITool)
,
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
.operation
- The IUndoableOperation
to be executed on the
IOperationHistory
of this IDomain
.ExecutionException
- In case an exception occurred during the execution of the
operation.IOperationHistory getOperationHistory()
IOperationHistory
that is used by this domain.IOperationHistory
.java.util.Map<AdapterKey<? extends ITool<VR>>,ITool<VR>> getTools()
ITool
s registered at this IDomain
(via
IAdaptable.setAdapter(TypeToken, Object)
) with the AdapterKey
s used
for registration.Map
containing the registered ITool
s mapped to
their respective AdapterKey
s.IAdaptable.setAdapter(TypeToken, Object)
IUndoContext getUndoContext()
UndoContext
that is used by this domain.UndoContext
.java.util.Map<AdapterKey<? extends IViewer<VR>>,IViewer<VR>> getViewers()
IViewer
s registered at this IDomain
(via
IAdaptable.setAdapter(TypeToken, Object)
) with the AdapterKey
s used
for registration.Map
containing the registered IViewer
s mapped
to their respective AdapterKey
s.IAdaptable.setAdapter(TypeToken, Object)
boolean isExecutionTransactionOpen(ITool<VR> tool)
true
if the given ITool
is taking part in
the currently open execution transaction. Otherwise returns
false
.void openExecutionTransaction(ITool<VR> tool)
ITool
to the currently
opened transaction for executing operations (via
execute(IUndoableOperation)
) on the IOperationHistory
used by this IDomain
(see getOperationHistory()
), using
the IUndoContext
of this IDomain
.tool
- The ITool
starting/joining the transaction.Copyright (c) 2014 itemis AG and others. All rights reserved.