| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public 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. |
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 |
---|
M 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.
null
M getModifiableNode(T aNode) throws CannotInstantiateModifiableNodeException
T resolve(java.lang.Object aNode)
null
, if the node cannot be resolved, e.g if the
specified node is not contained in, or has been deleted from the
model.boolean confirmCreate(java.lang.Class aNodeClass, CreationContext aContext)
null
.
true
if the creation can be performed,
false
otherwise
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |