All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dtai.gwt.ListGadget

java.lang.Object
   |
   +----dtai.gwt.Gadget
           |
           +----dtai.gwt.ContainerGadget
                   |
                   +----dtai.gwt.PanelGadget
                           |
                           +----dtai.gwt.BorderGadget
                                   |
                                   +----dtai.gwt.ScrollPaneGadget
                                           |
                                           +----dtai.gwt.ScrollGadgetGadget
                                                   |
                                                   +----dtai.gwt.ScrollListGadget
                                                           |
                                                           +----dtai.gwt.ListGadget

public class ListGadget
extends ScrollListGadget
A scrolling list of text items.


Constructor Index

 o ListGadget()
Creates a new scrolling list initialized with no visible Lines or multiple selections.
 o ListGadget(int)
Creates a new scrolling list initialized with the specified number of visible lines.
 o ListGadget(int, boolean)
Creates a new scrolling list initialized with the specified number of visible lines and a boolean stating whether multiple selections are allowed or not.

Method Index

 o add(String)
Adds the specified item to the end of scrolling list.
 o add(String, int)
Adds the specified item to the scrolling list at the specified position.
 o getItem(int)
Gets the item associated with the specified index.
 o getItemIndex(String)
gets the index of the specified item
 o remove(String)
Remove the first occurrence of item from the list.
 o replaceItem(String, int)
Replaces the item at the given index.
 o setBackground(Color, int)
sets the background color of the gadget
 o setForeground(Color, int)
sets the foreground color of the gadget

Constructors

 o ListGadget
 public ListGadget()
Creates a new scrolling list initialized with no visible Lines or multiple selections.

 o ListGadget
 public ListGadget(int rows)
Creates a new scrolling list initialized with the specified number of visible lines. Multiple selections are not allowed.

Parameters:
rows - - the number of items to show.
 o ListGadget
 public ListGadget(int rows,
                   boolean multipleMode)
Creates a new scrolling list initialized with the specified number of visible lines and a boolean stating whether multiple selections are allowed or not.

Parameters:
rows - - the number of items to show.
multipleMode - - if true then multiple selections are allowed.

Methods

 o setBackground
 public void setBackground(Color color,
                           int index)
sets the background color of the gadget

Parameters:
color - color for background
index - index of gadget whose color is set
 o setForeground
 public void setForeground(Color color,
                           int index)
sets the foreground color of the gadget

Parameters:
color - color for foreground
index - index of gadget whose color is set
 o getItem
 public String getItem(int index)
Gets the item associated with the specified index.

Parameters:
index - - the position of the item
Returns:
the specified LabelGadget
Overrides:
getItem in class ScrollListGadget
See Also:
getItemCount
 o getItemIndex
 public int getItemIndex(String item)
gets the index of the specified item

Parameters:
item - name of gadget whose index is sought
Returns:
index of specified item
 o add
 public void add(String item)
Adds the specified item to the end of scrolling list.

Parameters:
item - - the item to be added
 o add
 public void add(String item,
                 int index)
Adds the specified item to the scrolling list at the specified position.

Parameters:
item - - the item to be added
index - - the position at which to put in the item. The index is zero-based. If index is -1 then the item is added to the end.
 o replaceItem
 public void replaceItem(String newValue,
                         int index)
Replaces the item at the given index.

Parameters:
newValue - - the new value to replace the existing item
index - - the position of the item to replace
 o remove
 public void remove(String item)
Remove the first occurrence of item from the list.

Parameters:
item - - the item to remove from the list Throws: IllegalArgumentException If the item doesn't exist in the list.

All Packages  Class Hierarchy  This Package  Previous  Next  Index