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.
-
ListGadget()
- Creates a new scrolling list initialized with no visible Lines or
multiple selections.
-
ListGadget(int)
- Creates a new scrolling list initialized with the specified number of
visible lines.
-
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.
-
add(String)
- Adds the specified item to the end of scrolling list.
-
add(String, int)
- Adds the specified item to the scrolling list at the specified position.
-
getItem(int)
- Gets the item associated with the specified index.
-
getItemIndex(String)
- gets the index of the specified item
-
remove(String)
- Remove the first occurrence of item from the list.
-
replaceItem(String, int)
- Replaces the item at the given index.
-
setBackground(Color, int)
- sets the background color of the gadget
-
setForeground(Color, int)
- sets the foreground color of the gadget
ListGadget
public ListGadget()
- Creates a new scrolling list initialized with no visible Lines or
multiple selections.
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.
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.
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
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
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
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
add
public void add(String item)
- Adds the specified item to the end of scrolling list.
- Parameters:
- item - - the item to be added
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.
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
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