All Packages Class Hierarchy This Package Previous Next Index
Class dtai.gwt.ComboBoxGadget
java.lang.Object
|
+----dtai.gwt.Gadget
|
+----dtai.gwt.ContainerGadget
|
+----dtai.gwt.PanelGadget
|
+----dtai.gwt.BorderGadget
|
+----dtai.gwt.ComboBoxGadget
- public class ComboBoxGadget
- extends BorderGadget
- implements ItemSelectable, KeyListener
ComboBoxGadget
-
ComboBoxGadget(int)
- ComboBoxGadget
-
ComboBoxGadget(int, TextFieldGadget)
- ComboBoxGadget
-
add(String)
- Adds the given item to the list.
-
add(String, int)
- Adds the given item to the list at the given index.
-
addActionListener(ActionListener)
- Adds the specified listener to be notified when component
events occur on this component.
-
addItemListener(ItemListener)
- Adds the specified listener to be notified when component
events occur on this component.
-
countItems()
- Returns the number of items in the ListGadget.
-
fillSearchText(KeyEvent)
- Sets the searchText variable to be the text in the
TextFieldGadget (in upper case);
-
getItem(int)
- Gets the item in the list at the specified index.
-
getList()
- Gets the ListGadget.
-
getMinimumSize()
- Calls getPreferredSize().
-
getPreferredSize()
- Returns the preferred width and height, if both >= 0,
else compares the parent's preferred size to the list's,
and returns the Dimension with the larger width.
-
getSelectedIndex()
- Returns the index in the list of the selected item,
or -1 if the selected item is not in the list.
-
getSelectedIndexes()
- Returns an array of integers made up of the indexes of the
selected items from the list.
-
getSelectedItem()
- Gets the text in the TextFieldGadget.
-
getSelectedItems()
- Returns an array of Strings made up of the names of the
selected items from the list.
-
getText()
- Gets the text in the TextFieldGadget.
-
getTextField()
- Gets the TextFieldGadget.
-
getTextFieldGadget()
- Returns the TextFieldGadget.
-
hideList()
- Hides the list
-
insert(String, int)
- Adds the given item to the list at the given index.
-
isAllowedToShrink()
- isAllowedToShrink
-
isSorted()
- Gets the boolean sorted flag.
-
keyPressed(KeyEvent)
- If ComboBox is sorted, get text from the TextFieldGadget, and
find the closest match in the list.
-
keyReleased(KeyEvent)
- keyReleased - empty method.
-
keyTyped(KeyEvent)
- keyTyped - empty method.
-
notifyList()
- Hides the list, if it is showing, and shows
the list if it is hiding.
-
processActionEvent(ActionEvent)
-
-
processActionPerformed(ActionEvent)
- processActionPerformed
-
processEvent(AWTEvent)
- processEvent
-
processItemEvent(ItemEvent)
-
-
remove(int)
- Removes the item at the given position from the list.
-
remove(String)
- Removes the specified item from the list.
-
removeActionListener(ActionListener)
- Removes the specified listener so it no longer receives
action events on this action.
-
removeItemListener(ItemListener)
- Removes the specified listener so it no longer receives
item events on this item.
-
replace(String, int)
- Replace the item at the specified index with the given item.
-
requestFocus()
- Calls text.requestFous().
-
select(int)
- Selects the item at the given index in the list.
-
select(String)
- Makes the given item the selected one, if it is not
already.
-
setAllowedToShrink(boolean)
- Sets the specified boolean to indicate whether or
not this TextComponent should be allowedToShrink.
-
setBackground(Color, int)
- Sets the background color of the LabelGadet at the
specified index.
-
setBackground(Color, String)
- Sets the background color of the LabelGadet with the
specified name.
-
setForeground(Color, int)
- Sets the foreground color of the LabelGadet at the
specified index.
-
setForeground(Color, String)
- Sets the foreground color of the LabelGadet with the
specified name.
-
setNextFocusGadget(Gadget)
- setNextFocusGadget
-
setParent(ContainerGadget, boolean)
- setParent
-
setSorted(boolean)
- Sets the boolean sorted flag.
-
setText(String)
- Sets the text in the TextFieldGadget.
-
setVisible(boolean, boolean)
- Shows or hides the component depending on the boolean flag b.
-
showList()
- Shows the list
ComboBoxGadget
public ComboBoxGadget(int visibleItems)
- ComboBoxGadget
- Parameters:
- visibleItems - number of visible items in this ComboBoxGadget
ComboBoxGadget
public ComboBoxGadget(int visibleItems,
TextFieldGadget text)
- ComboBoxGadget
- Parameters:
- visibleItems - number of visible items in this ComboBoxGadget
- text - the TextFieldGadget for this ComboBox
isAllowedToShrink
public boolean isAllowedToShrink()
- isAllowedToShrink
- Returns:
- the boolean indicating whether this
TextComponent is allowedToShrink or not.
- See Also:
- setEditable
setAllowedToShrink
public void setAllowedToShrink(boolean b)
- Sets the specified boolean to indicate whether or
not this TextComponent should be allowedToShrink.
- Parameters:
- b - the boolean to be set
- See Also:
- isEditable
getTextField
public TextFieldGadget getTextField()
- Gets the TextFieldGadget.
- Returns:
- TextFieldGadget
getList
public ListGadget getList()
- Gets the ListGadget.
- Returns:
- ListGadget
setBackground
public void setBackground(Color color,
int index)
- Sets the background color of the LabelGadet at the
specified index.
- Parameters:
- color - color of new Background
- index - index of the LabelGadget in the list that will
have its background color set.
setBackground
public void setBackground(Color color,
String item)
- Sets the background color of the LabelGadet with the
specified name.
- Parameters:
- color - color of new Background
- item - name of the LabelGadget in the list that
will have its background color set.
setForeground
public void setForeground(Color color,
int index)
- Sets the foreground color of the LabelGadet at the
specified index.
- Parameters:
- color - color of new foreground
- index - index of the LabelGadget in the list that will
have its foreground color set.
setForeground
public void setForeground(Color color,
String item)
- Sets the foreground color of the LabelGadet with the
specified name.
- Parameters:
- color - color of new foreground
- item - name of the LabelGadget in the list that
will have its foreground color set.
setForeground
- color - description
- item - description
setNextFocusGadget
public void setNextFocusGadget(Gadget nextFocusGadget)
- setNextFocusGadget
- Parameters:
- nextFocusGadget - description
- Overrides:
- setNextFocusGadget in class Gadget
setSorted
public void setSorted(boolean in)
- Sets the boolean sorted flag.
- Parameters:
- in - boolean sorted status
isSorted
public boolean isSorted()
- Gets the boolean sorted flag.
- Returns:
- boolean
setText
public void setText(String textval)
- Sets the text in the TextFieldGadget.
- Parameters:
- textval - new text for the TextFieldGadget
getText
public String getText()
- Gets the text in the TextFieldGadget.
- Returns:
- text in the TextFieldGadget
countItems
public int countItems()
- Returns the number of items in the ListGadget.
- Returns:
- number of items in the list
getItem
public String getItem(int index)
- Gets the item in the list at the specified index.
- Parameters:
- index - index of item in the list to be retrieved
- Returns:
- item in the list at the given index
add
public void add(String item)
- Adds the given item to the list.
If the list is currently unsorted, the new item is
simply added to the list. If the list is currently
sorted, the new item is inserted in its properly
sorted spot.
- Parameters:
- item - name of the item to be added to the list
add
public void add(String item,
int index)
- Adds the given item to the list at the given index.
- Parameters:
- item - name of the item to be added to the list
- index - where in the list to insert given item
replace
public void replace(String item,
int index)
- Replace the item at the specified index with the given item.
- Parameters:
- item - new value to replace the existing item
- index - the position of the item to replace
remove
public void remove(String item)
- Removes the specified item from the list.
- Parameters:
- item - item to be removed from the list
remove
public void remove(int pos)
- Removes the item at the given position from the list.
- Parameters:
- pos - index of item to be removed from the list
- Overrides:
- remove in class ContainerGadget
insert
public void insert(String item,
int index)
- Adds the given item to the list at the given index.
- Parameters:
- item - name of the item to be added to the list
- index - where in the list to insert given item
getSelectedItem
public String getSelectedItem()
- Gets the text in the TextFieldGadget.
- Returns:
- the text in the TextFieldGadget
getSelectedIndex
public int getSelectedIndex()
- Returns the index in the list of the selected item,
or -1 if the selected item is not in the list.
- Returns:
- int
getPreferredSize
public Dimension getPreferredSize()
- Returns the preferred width and height, if both >= 0,
else compares the parent's preferred size to the list's,
and returns the Dimension with the larger width.
- Returns:
- a Dimension object
- Overrides:
- getPreferredSize in class ContainerGadget
getMinimumSize
public Dimension getMinimumSize()
- Calls getPreferredSize().
- Returns:
- Dimension
- Overrides:
- getMinimumSize in class ContainerGadget
setParent
public void setParent(ContainerGadget parent,
boolean notifyParent)
- setParent
- Parameters:
- parent - description
- notifyParent - description
- Overrides:
- setParent in class Gadget
getTextFieldGadget
public TextFieldGadget getTextFieldGadget()
- Returns the TextFieldGadget.
- Returns:
- TextFieldGadget
getSelectedIndexes
public int[] getSelectedIndexes()
- Returns an array of integers made up of the indexes of the
selected items from the list.
- Returns:
- int[]
getSelectedItems
public String[] getSelectedItems()
- Returns an array of Strings made up of the names of the
selected items from the list.
- Returns:
- String[]
requestFocus
public void requestFocus()
- Calls text.requestFous().
- Overrides:
- requestFocus in class Gadget
- See Also:
- requestFocus
select
public void select(String item)
- Makes the given item the selected one, if it is not
already.
- Parameters:
- item - name of the item to select
select
public void select(int pos)
- Selects the item at the given index in the list.
- Parameters:
- pos - index of item in list to select
processActionPerformed
protected void processActionPerformed(ActionEvent e)
- processActionPerformed
- Parameters:
- e - the firing ActionEvent
notifyList
protected void notifyList()
- Hides the list, if it is showing, and shows
the list if it is hiding.
- See Also:
- showList, hideList
showList
protected void showList()
- Shows the list
setVisible
public void setVisible(boolean in,
boolean invalidateParent)
- Shows or hides the component depending on the boolean flag b.
- Overrides:
- setVisible in class Gadget
hideList
protected void hideList()
- Hides the list
addItemListener
public synchronized void addItemListener(ItemListener l)
- Adds the specified listener to be notified when component
events occur on this component.
- Parameters:
- l - the listener to receive the events
removeItemListener
public synchronized void removeItemListener(ItemListener l)
- Removes the specified listener so it no longer receives
item events on this item.
- Parameters:
- l - the listener to remove
addActionListener
public synchronized void addActionListener(ActionListener l)
- Adds the specified listener to be notified when component
events occur on this component.
- Parameters:
- l - the listener to receive the events
removeActionListener
public synchronized void removeActionListener(ActionListener l)
- Removes the specified listener so it no longer receives
action events on this action.
- Parameters:
- l - the listener to remove
processEvent
protected void processEvent(AWTEvent e)
- processEvent
- Parameters:
- e - a ItemEvent
- Returns:
- boolean result
- Overrides:
- processEvent in class ContainerGadget
processActionEvent
protected void processActionEvent(ActionEvent e)
processItemEvent
protected void processItemEvent(ItemEvent e)
keyTyped
public void keyTyped(KeyEvent e)
- keyTyped - empty method.
- Parameters:
- e - the firing KeyEvent
keyPressed
public void keyPressed(KeyEvent e)
- If ComboBox is sorted, get text from the TextFieldGadget, and
find the closest match in the list. If ComboBox isn't sorted,
handle appropriate key-press possibilities: ESCAPE, UP, DOWN,
ENTER, or TAB.
- Parameters:
- e - the firing KeyEvent
fillSearchText
public void fillSearchText(KeyEvent e)
- Sets the searchText variable to be the text in the
TextFieldGadget (in upper case);
- Parameters:
- e - firing KeyEvent
keyReleased
public void keyReleased(KeyEvent e)
- keyReleased - empty method.
- Parameters:
- e - firing KeyEvent
All Packages Class Hierarchy This Package Previous Next Index