com.ibm.mashups.enabler
Interface ListModelController

All Superinterfaces:
ListModel, Locator, Model

public ListModelController
extends ListModel

A modifiable model representing a list. Acting as a base class for all concrete list 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 nextNode)
           Inserts the specified node into the list model at the specified position; the node must be created with the create method of the concrete ListModel
 Boolean confirmInsert(Object node, Object nextNode)
           Confirms whether inserting the node is possible.
 void remove(Object node)
           Removes the specified node from the list model
 Boolean confirmRemove(Object node)
           Confirms whether removing the node is possible.
 
Methods inherited from interface com.ibm.mashups.enabler.ListModel
iterator
 
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 nextNode)
Inserts the specified node into the list model at the specified position; the node must be created with the create method of the concrete ListModel

Parameters:
node - node or node uri (without any scope) to insert into the list model. 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 nextNode)
Confirms whether inserting the node is possible.

Parameters:
node - node or node uri (without any scope) to insert into the list model. 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)
Removes the specified node from the list model

Parameters:
node - node object or node uri (without any scope). 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.