All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tropo.awt.TRChoice

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Choice
                   |
                   +----tropo.awt.TRChoice

public class TRChoice
extends Choice
A simple extension to the Choice widget that so that you can associate user data with each item in the list.


Constructor Index

 o TRChoice()
 o TRChoice(String[])
Convenience - add all the passed items.

Method Index

 o addItem(String, Object)
Add an item to this choice, with user data.
 o getSelectedUserData()
Get the selected item's user data.
 o getUserData(int)
Get the user data at position index.
 o getUserData(String)
Get the user data for the specified item.
 o remove(int)
Remove the item and user data at position index.
 o remove(String)
Remove an item from the list.
 o removeAll()
Remove all items and user data from the list.

Constructors

 o TRChoice
 public TRChoice()
 o TRChoice
 public TRChoice(String items[])
Convenience - add all the passed items.

Methods

 o addItem
 public void addItem(String item,
                     Object userData)
Add an item to this choice, with user data.

Parameters:
item - the item to add to this choice
userData - the associated data
 o removeAll
 public void removeAll()
Remove all items and user data from the list.

Overrides:
removeAll in class Choice
 o remove
 public void remove(String item)
Remove an item from the list.

Parameters:
item - the actual item to remove
Overrides:
remove in class Choice
 o remove
 public void remove(int index)
Remove the item and user data at position index.

Parameters:
index - the item's position
Overrides:
remove in class Choice
 o getUserData
 public Object getUserData(int index)
Get the user data at position index.

Parameters:
index - the position in the list of the user data
Returns:
the associated user data
 o getUserData
 public Object getUserData(String item)
Get the user data for the specified item.

Parameters:
item - the string that's associated with the user data
Returns:
the associated user data
 o getSelectedUserData
 public Object getSelectedUserData()
Get the selected item's user data.

Returns:
the associated user data

All Packages  Class Hierarchy  This Package  Previous  Next  Index