All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.bulletproof.gui.Choice

java.lang.Object
   |
   +----com.bulletproof.gui.Component
           |
           +----com.bulletproof.gui.Choice

public class Choice
extends Component
implements ActionListener, ItemListener
Choice is a component that implements a pulldown.


Constructor Index

 o Choice()
Constructs a new Choice.
 o Choice(int)
Constructs a new Choice.

Method Index

 o actionPerformed(ActionEvent)
 o addActionListener(ActionListener)
 o addItem(String)
Add an item to the list.
 o addItem(String, String)
Add an item to the list.
 o clear()
Remove all the entries from the List.
 o deselect(int)
Select the requested item.
 o displayPopup()
 o getItem(int)
Get the text value of a specific item.
 o getItem(String)
Get the index value of a specific item.
 o getItemCount()
Get the number of items in the List.
 o getItemKey(int)
Get the key value of the selected item.
 o getKeyForItem(String)
Get the key value of the selected item.
 o getKeyItem(String)
Get the item number of this key value.
 o getMinimumSize()
Gets the minimum size of this component.
 o getSelectedIndex()
Get the selected indexes in the List.
 o getSelectedItem()
Get the selected indexes in the List.
 o getSelectedKey()
Get the key value of the selected item.
 o itemStateChanged(ItemEvent)
 o loadChoice(String[])
Load values into the choice from a set of arrays.
 o loadChoice(String[], String[])
Load values into the choice from a set of arrays.
 o loadChoice(User, Jagg, String, String, String, String, String, String, String)
Load values into the choice from a database table.
 o paint(Graphics)
Paints the component.
 o processMouseEvent(MouseEvent)
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.
 o remove(int)
Remove an item from the List.
 o remove(String)
Remove an item from the List.
 o removeActionListener(ActionListener)
 o select(int)
Select the requested item.
 o select(String)
Select the requested item.
 o selectKey(String)
Select the requested item using the key value.
 o showSelectedItem()
Display the selected item
 o validate()
Sort the entries in the List

Constructors

 o Choice
 public Choice()
Constructs a new Choice.

 o Choice
 public Choice(int minWidth)
Constructs a new Choice.

Parameters:
minWidth - the minimum width in pixels of this ComboBox

Methods

 o addActionListener
 public void addActionListener(ActionListener al)
 o removeActionListener
 public void removeActionListener(ActionListener al)
 o loadChoice
 public void loadChoice(String displayName[])
Load values into the choice from a set of arrays.

Parameters:
displayName - the array containing the names to load display values from
actualName - the array containing the keys to load the key values
 o loadChoice
 public void loadChoice(String displayName[],
                        String actualName[])
Load values into the choice from a set of arrays.

Parameters:
displayName - the array containing the names to load display values from
actualName - the array containing the keys to load the key values
 o loadChoice
 public void loadChoice(User user,
                        Jagg jaggSQL,
                        String choiceName,
                        String actualName,
                        String tableName,
                        String whereClause,
                        String orderByClause,
                        String blankItem,
                        String cacheName)
Load values into the choice from a database table.

Parameters:
user - a handle to an instance of User.
Jagg - a handle to an instance of JDPJagg. DSN and CSTR must already be intialized.
choiceName - the database column name to retrieve the choice values from
actualName - the database column name to retrieve the key values from
tableName - the database table data from
whereClause - the where clause to use when selecting rows from the table
orderByClause - the order by clause to use when selecting rows from the table
blankItem - (N/A, blank, null) whether a blank item is required on the pulldown.
cacheName - the unique name to use when caching the data in this list
 o addItem
 public void addItem(String displayItem)
Add an item to the list.

Parameters:
displayItem - the text of the item.
 o addItem
 public void addItem(String displayItem,
                     String actualItem)
Add an item to the list.

Parameters:
displayItem - the text of the item.
actualItem - the matching key value.
 o select
 public void select(int item)
Select the requested item.

Parameters:
item - the item to select.
 o select
 public void select(String item)
Select the requested item.

Parameters:
item - the item to select.
 o selectKey
 public void selectKey(String item)
Select the requested item using the key value.

Parameters:
key - the key value of the item to select.
 o deselect
 public void deselect(int item)
Select the requested item.

Parameters:
item - the item to select.
 o getItemCount
 public int getItemCount()
Get the number of items in the List.

Returns:
the number of items.
 o getItem
 public String getItem(int item)
Get the text value of a specific item.

Parameters:
itemNumber - the item number.
Returns:
the item.
 o getItem
 public int getItem(String item)
Get the index value of a specific item.

Parameters:
item - the item.
Returns:
the index of the item.
 o getKeyItem
 public int getKeyItem(String itemKey)
Get the item number of this key value.

Parameters:
the - item key value.
Returns:
the item number.
 o getItemKey
 public String getItemKey(int item)
Get the key value of the selected item.

Parameters:
the - item number.
Returns:
the item key value.
 o getKeyForItem
 public String getKeyForItem(String item)
Get the key value of the selected item.

Parameters:
the - item number.
Returns:
the item key value.
 o getSelectedItem
 public String getSelectedItem()
Get the selected indexes in the List. Presently multiple selections are not supported so this function only returns one item.

Returns:
the list indexes that are selected.
 o getSelectedIndex
 public int getSelectedIndex()
Get the selected indexes in the List. Presently multiple selections are not supported so this function only returns one item.

Returns:
the list indexes that are selected.
 o getSelectedKey
 public String getSelectedKey()
Get the key value of the selected item.

Returns:
the item key value.
 o clear
 public void clear()
Remove all the entries from the List.

 o remove
 public void remove(int item)
Remove an item from the List.

Parameters:
itemNumber - the item.
 o remove
 public void remove(String item)
Remove an item from the List.

Parameters:
itemValue - the item.
 o validate
 public void validate()
Sort the entries in the List

Parameters:
ignoreCase - choose whether case will be taken into account when sorting
Overrides:
validate in class Component
 o paint
 public synchronized void paint(Graphics g)
Paints the component.

Overrides:
paint in class Component
 o processMouseEvent
 public synchronized void processMouseEvent(MouseEvent me)
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.

Overrides:
processMouseEvent in class Component
 o actionPerformed
 public void actionPerformed(ActionEvent e)
 o itemStateChanged
 public void itemStateChanged(ItemEvent e)
 o showSelectedItem
 public void showSelectedItem()
Display the selected item

 o displayPopup
 public void displayPopup()
 o getMinimumSize
 public Dimension getMinimumSize()
Gets the minimum size of this component.

Overrides:
getMinimumSize in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index