com.ibm.mashups.enabler
Interface TreeModelController

All Superinterfaces:
Locator, Model, TreeModel

public TreeModelController
extends TreeModel

This modifiable interface provides a generic tree model acting as a base class for all concrete tree models


Method Summary
 Object create(JSON context)
           creates a new model object.
 Boolean confirmCreate(JSON context)
           Confirms whether creating the node is possible.
 void insert(Object node, Object parentNode, Object nextNode)
           Inserts a node into the tree model at the specified location; the node must either be created with the create method of the concrete tree model before, or must exist in the tree model; in this case the existing node is moved to the specified location
 Boolean confirmInsert(Object node, Object parentNode, Object nextNode)
           Confirms whether inserting the node is possible.
 void remove(Object node)
           Deletes a node from the model.
 Boolean confirmRemove(Object node)
           Confirms whether removing the node is possible.
 
Methods inherited from interface com.ibm.mashups.enabler.TreeModel
getRoot, hasChildren, getChildren, getParent
 
Methods inherited from interface com.ibm.mashups.enabler.model.Model
setStrategy, getStrategies, getStrategy, addStrategy, removeStrategy
 
Methods inherited from interface com.ibm.mashups.enabler.Locator
find
 

Method Detail

create

Object create(JSON context)
creates a new model object. The created node can be inserted into the model using an appropriate insert method defined on a subinterface of this interface. The node will not appear in the model unless it is inserted.

Parameters:
context - array of predefined information used for the creation of the node. May be null. Accepted names are defined in the appropriate subinterfaces
Returns:
the created node

confirmCreate

Boolean confirmCreate(JSON context)
Confirms whether creating the node is possible.

Parameters:
context - array of predefined information used for the creation of the node. May be null. Accepted names are defined in the appropriate subinterfaces
Returns:
true if the node can be created, otherwise false.

insert

void insert(Object node,
            Object parentNode,
            Object nextNode)
Inserts a node into the tree model at the specified location; the node must either be created with the create method of the concrete tree model before, or must exist in the tree model; in this case the existing node is moved to the specified location

Parameters:
node - node to insert or move. Must not be null.
parentNode - node object or node uri (without any scope) of the parent node. The given node is inserted/moved underneath the parent node; must not be null.
nextNode - node object or node uri (without any scope) of the successor node before which the node is to be inserted; if null is specified, the node is appended at the end of the existing nodes

confirmInsert

Boolean confirmInsert(Object node,
                      Object parentNode,
                      Object nextNode)
Confirms whether inserting the node is possible.

Parameters:
node - node to insert or move. Must not be null.
parentNode - node object or node uri (without any scope) of the parent node. The given node is inserted/moved underneath the parent node; must not be null.
nextNode - node object or node uri (without any scope) of the successor node before which the node is to be inserted; if null is specified, the node is appended at the end of the existing nodes
Returns:
true if the node can be inserted, otherwise false.

remove

void remove(Object node)
Deletes a node from the model. All its children are deleted as well.

Parameters:
node - node object or node uri (without any scope) to delete from the model. Must not be null.

confirmRemove

Boolean confirmRemove(Object node)
Confirms whether removing the node is possible.

Parameters:
node - node object or node uri (without any scope). Must not be null
Returns:
true if the node can be removed, otherwise false.


Copyright IBM Corp. 2010 All Rights Reserved.