IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.dojo.model
Class TreeModel

java.lang.Object
  extended by com.ibm.btt.base.DataElement
      extended by com.ibm.btt.base.DataCollection
          extended by com.ibm.btt.base.KeyedCollection
              extended by com.ibm.btt.dojo.model.TreeModel
All Implemented Interfaces:
DSECloneable, TypedData, java.io.Externalizable, java.io.Serializable, java.lang.Cloneable

@EXTEND(value="NOT")
@ATTR(value={"id#String#REQUIRED","value#String#IMPLIED","label#String#IMPLIED","description#String#IMPLIED"})
public class TreeModel
extends KeyedCollection

Wrapper data model for tree widget. Tree item need id, value, NLS label and children information which is exceed current KeyedCollection's capability, so this wrapper model is used to compose a pre-defined BTT model structure to present tree model and offers user friendly API to access the model.

See Also:
Serialized Form

Field Summary
static java.lang.String CHILDREN
           
static java.lang.String LABEL
           
 
Fields inherited from class com.ibm.btt.base.KeyedCollection
bufferSize, DEFAULT_BUFFER_SIZE, DEFAULT_COMPRESSION, elements, nestedElements, order
 
Fields inherited from class com.ibm.btt.base.DataElement
description, name, parameters, state
 
Constructor Summary
TreeModel()
          Default constructor which should be only used by BTT Externalier internally.
TreeModel(java.lang.String id, java.lang.String value, java.lang.String label)
          Enhanced constructor which will be used by programming create instance.
 
Method Summary
 void addChild(TreeModel treeModel)
          Add tree item to current object.
protected  void addField(java.lang.String key, java.lang.String value)
          Used internally.
 TreeModel getChild(int index)
          Get model of tree item from desired index.
 KeyedCollection getChildren()
          Get the IndexedCollection which contains the children tree items.
 java.lang.String getItemValue()
          Get the value of this tree item, this method is deficient from super.getValue() method.
 java.lang.String getLabel()
          Get the label of this tree item which will be display to end user.
 java.lang.Object initializeFrom(Tag aTag)
          Initialize a keyedCollection from its tag in XML.
 DataElement removeChild(java.lang.String aName)
          Remove tree item from desired name.
 void setItemValue(java.lang.String value)
          Set the value of this tree item, this method is deficient from super.setValue() method.
 void setLabel(java.lang.String label)
          Set the label of this tree item which will be display to end user.
 Vector toStrings()
          Returns a visual representation of the keyedCollection.
 
Methods inherited from class com.ibm.btt.base.KeyedCollection
addElement, addElement, calculeNestedElements, calculeNestedQualifiedElements, clone, getDynamic, getElementAt, getElementAt, getElementAtAnyLevel, getElementAtFirstLevel, getElements, getEnumeration, getIndexOf, getIndexOf, getNestedElements, getOrder, getOrderVector, getValue, isCompressable, isDynamic, readExternal, readFromStream, removeAll, removeElementAt, removeElementAt, removeElementAtFirstLevel, reorderElements, setCompressable, setDynamic, setDynamic, setElements, setOrder, setOrder, setValue, setValueAt, setValueAt, size, stringValueOf, toString, tryGetElementAt, tryGetElementAtAnyLevel, tryGetElementAtFirstLevel, tryGetValueAt, trySetValueAt, writeExternal, writeToStream
 
Methods inherited from class com.ibm.btt.base.DataCollection
getValueAt, nestedElements, nestedElements, nestedFields, nestedKeyedCollections, nestedQualifiedElements, validate
 
Methods inherited from class com.ibm.btt.base.DataElement
externalizer, getCompositeKey, getDescription, getDescriptor, getErrorInfo, getExternalizer, getKey, getName, getParameter, getParameters, getState, getTagName, isAmended, isCached, isSerializable, readExternal, readObject, removeExternal, setAmended, setCompositeKey, setDescription, setDescriptor, setErrorInfo, setExternalizer, setIsCached, setName, setParameter, setParameters, setSerializable, setState, toTags, validate, validateObject, writeExternal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LABEL

public static final java.lang.String LABEL
See Also:
Constant Field Values

CHILDREN

public static final java.lang.String CHILDREN
See Also:
Constant Field Values
Constructor Detail

TreeModel

public TreeModel()
Default constructor which should be only used by BTT Externalier internally.


TreeModel

public TreeModel(java.lang.String id,
                 java.lang.String value,
                 java.lang.String label)
Enhanced constructor which will be used by programming create instance.

Parameters:
id -
value -
label -
Method Detail

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException
Description copied from class: KeyedCollection
Initialize a keyedCollection from its tag in XML.

Overrides:
initializeFrom in class KeyedCollection
Parameters:
aTag - Tag
Returns:
java.lang.Object
Throws:
java.io.IOException

addChild

public void addChild(TreeModel treeModel)
Add tree item to current object.

Parameters:
treeModel -

removeChild

public DataElement removeChild(java.lang.String aName)
Remove tree item from desired name.

Parameters:
aName - the name of removed element
Returns:
the removed element instance, should be another TreeModel

getChildren

public KeyedCollection getChildren()
Get the IndexedCollection which contains the children tree items.

Returns:

getChild

public TreeModel getChild(int index)
Get model of tree item from desired index.

Parameters:
index -
Returns:

setLabel

public void setLabel(java.lang.String label)
Set the label of this tree item which will be display to end user.

Parameters:
label -

setItemValue

public void setItemValue(java.lang.String value)
Set the value of this tree item, this method is deficient from super.setValue() method.

Parameters:
value -

getLabel

public java.lang.String getLabel()
Get the label of this tree item which will be display to end user.

Returns:

getItemValue

public java.lang.String getItemValue()
Get the value of this tree item, this method is deficient from super.getValue() method.

Returns:

addField

protected final void addField(java.lang.String key,
                              java.lang.String value)
Used internally. Add structured data field to TreeModel.

Parameters:
key -
value -

toStrings

public Vector toStrings()
Description copied from class: KeyedCollection
Returns a visual representation of the keyedCollection.

Overrides:
toStrings in class KeyedCollection
Returns:
Vector

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011