|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- the type of node the controller exposesM
- the type of modifiable node the controller exposespublic interface ModelController<T,M extends Modifiable>
This interface provides a controller for models. Updates are scoped to the
controller and appear in the model the controller bases on only after it is
successfully committed (see Committable.commit()
). The
modifiable nodes the controller exposes are part of the model and can be used
as input to the read-only model methods of the controller.
Modifiable nodes implement only interfaces for which the corresponding resource may be modified with regards to the programming model. If such interface is implemented, the corresponding resource may still not be modifiable due to other constraints, e.g. access control. To determine if a certain modification is possible the appropriate methods on the modifiable interfaces can be used, which are prefixed 'confirm'.
For symmetry reasons, the method to delete nodes from a model (a method
called delete(...)
) is available on the controller interface
which also provides the appropriate insert(...)
method - as is
the case for TreeModelController
and
ListModelController
.
Method Summary | |
---|---|
boolean |
confirmCreate(java.lang.Class<?> aNodeClass,
CreationContext aContext)
Indicates if a modifiable node of the specified class and with the specified creation context may be created. |
boolean |
confirmGetModifiableNode(T aNode)
Indicates if a modifiable node of the specified node may be created. |
M |
create(java.lang.Class<?> aNodeClass,
CreationContext aContext)
Creates a modifiable node. |
M |
getModifiableNode(T aNode)
Returns a modifiable instance of the specified node. |
T |
resolve(java.lang.Object aNode)
Resolves the specified node of the model to its most recent representation. |
Method Detail |
---|
boolean confirmCreate(java.lang.Class<?> aNodeClass, CreationContext aContext)
aNodeClass
- interface class for which to indicate if the creation of a
node can be performedaContext
- creation context for which to indicate if the creation of a
node can be performed, may be null
.
true
if the creation can be performed,
false
otherwiseM create(java.lang.Class<?> aNodeClass, CreationContext aContext) throws CannotInstantiateModifiableNodeException
insert
method defined
on a subinterface of this interface. The node will not appear in the
model unless it is inserted.
aNodeClass
- interface class of node to insertaContext
- a context specifying information about the node to create, may
be null
CannotInstantiateModifiableNodeException
- in case the modifiable node cannot be instantiatedboolean confirmGetModifiableNode(T aNode)
aNode
- the node that shall be tested
true
if a modifiable instance can be created,
false
otherwiseM getModifiableNode(T aNode) throws CannotInstantiateModifiableNodeException
aNode
- node to retrieve a modifiable node for
CannotInstantiateModifiableNodeException
- in case the modifiable node cannot be instantiatedT resolve(java.lang.Object aNode)
aNode
- node to resolve
null
, if the node cannot be resolved, e.g if the
specified node is not contained in, or has been deleted from the
model.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |