com.tivoli.twg.engine
Class TWGTaskMenuList

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGTaskMenuList

public class TWGTaskMenuList
extends java.lang.Object

This class is used to hold the keys and weights that make up the labels in the various levels of a pull-down or fly-out menu for tasks and their subtasks.


Constructor Summary
TWGTaskMenuList()
          Default constructor.
TWGTaskMenuList(java.lang.String list)
          Constructor accepting a string which is a key/sort factor pair list for pull-down or fly-out menu entries.
TWGTaskMenuList(TWGByteArrayInputStream buffer)
          Constructor for creating a MenuList from an input byte stream.
 
Method Summary
 void flatten(TWGByteArrayOutputStream data, MultiLocaleBundle bundle, java.util.Locale locale)
          Save the contents of this TWGTaskMenuList to an output byte stream.
 java.lang.String getKeyAt(int index)
          Obtain the menu text key for the nth level of this TWGTaskMenuList.
 int getNestedCount()
          Obtain a count of the number of list entries for this TWGTaskMenuList.
 int getWeightAt(int index)
          Obtain the menu weight for the nth level of this TWGTaskMenuList.
 java.lang.String toString()
          Obtain a string representation of this TWGTaskMenuList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TWGTaskMenuList

public TWGTaskMenuList()
Default constructor.


TWGTaskMenuList

public TWGTaskMenuList(java.lang.String list)
                throws TWGTaskException
Constructor accepting a string which is a key/sort factor pair list for pull-down or fly-out menu entries. If the key is not found in the property file or if the property file is not specified, the key gets used as the text. If there are multiple levels being specified, each key/sort factor pair is delimeted by a vertical bar.

See Also:
TWGTask#setLabel

TWGTaskMenuList

public TWGTaskMenuList(TWGByteArrayInputStream buffer)
                throws TWGPersistentObjectRestoreException
Constructor for creating a MenuList from an input byte stream. This is primarily used for restoring from persistent storage.

Parameters:
buffer - input byte stream from which to read this Subtasks data
Method Detail

flatten

public void flatten(TWGByteArrayOutputStream data,
                    MultiLocaleBundle bundle,
                    java.util.Locale locale)
Save the contents of this TWGTaskMenuList to an output byte stream. This is primarily used for saving to persistant storage or for shaddowing up to the console.

Parameters:
data - the output byte stream where data should be written
locale - the locale to use for retrieving the label text. For persistant object saves, this is null, for shadow images, this is the requested locale.

toString

public java.lang.String toString()
Obtain a string representation of this TWGTaskMenuList.

Returns:
A string representation of this TWGTaskMenuList.

getNestedCount

public int getNestedCount()
Obtain a count of the number of list entries for this TWGTaskMenuList.

Returns:
A count of the number of list entries for this TWGTaskMenuList. This represents the number of nesting levels of the menu.

getKeyAt

public java.lang.String getKeyAt(int index)
Obtain the menu text key for the nth level of this TWGTaskMenuList.

Returns:
A string representing the menu key for the requested level. This key is used to locate the actual menu text from the resource bundle. NOTE: For shadow objects, this call returns the actual menu text.

getWeightAt

public int getWeightAt(int index)
Obtain the menu weight for the nth level of this TWGTaskMenuList.

Returns:
A value representing the weight of the menu key for the requested level. This weight is used to position this menu item relative to other menu items.