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
IViewers and related ITools to interact
with these. It also holds a reference to the IOperationHistory and
UndoContext used by all ITool as well as IPolicys (in
the IViewers) to execute IUndoableOperations.AbstractDomain should be sub-classed.adaptersactiveIAdaptable.Bound<A extends IAdaptable>ADAPTERS_PROPERTYACTIVE_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(ITransactionalOperation 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
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 |
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(ITransactionalOperation)) on the
IOperationHistory used by this IDomain (see
getOperationHistory()), using the IUndoContext of this
IDomain. |
adaptersProperty, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, setAdapter, setAdapter, setAdapter, setAdapter, unsetAdapteractivate, activeProperty, deactivate, isActivedisposevoid 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(ITransactionalOperation 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()
ITools registered at this IDomain (via
IAdaptable.setAdapter(TypeToken, Object)) with the AdapterKeys used
for registration.Map containing the registered ITools mapped to
their respective AdapterKeys.IAdaptable.setAdapter(TypeToken, Object)IUndoContext getUndoContext()
UndoContext that is used by this domain.UndoContext.java.util.Map<AdapterKey<? extends IViewer<VR>>,IViewer<VR>> getViewers()
IViewers registered at this IDomain (via
IAdaptable.setAdapter(TypeToken, Object)) with the AdapterKeys used
for registration.Map containing the registered IViewers mapped
to their respective AdapterKeys.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(ITransactionalOperation)) 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.