Class JDPChoice
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----JDPChoice
- public class JDPChoice
- extends Panel
Class JDPChoice represents an extended pulldown choice class that allows for
auto loading from a database and also tracks key values for dsiplayed values.
-
JDPChoice()
- Creates an extended Choice component.
-
JDPChoice(JDPUser)
- Creates an extended Choice component.
-
addItem(String)
- Add an item to the choice.
-
addItem(String, String)
- Add an item to the choice.
-
clear()
- Remove all the entries from the Choice pulldown.
-
countItems()
- Get the number of items in the Choice pulldown.
-
disable()
- Disable the choice box
-
enable()
- Enable the choice box
-
getBackground()
-
-
getEnabled()
- Get the enabled setting of the choice box
-
getFont()
-
-
getForeground()
-
-
getItem(int)
- Get the text value of a specific item.
-
getItem(String)
- Get the item number of a specific item.
-
getItemCount()
- Get the number of items in the Choice pulldown.
-
getItemForKey(String)
- Get the matching item value of a specific key.
-
getItemKey(String)
- Get the matching key value of a specific item.
-
getMaximumHeight()
- Get the maximum height of the combo
-
getMaximumWidth()
- Get the maximum width of the combo
-
getMinimumHeight()
- Get the minimum height of the grid
-
getMinimumWidth()
- Get the minimum width of the grid
-
getSelectedIndex()
- Get the currently selected index.
-
getSelectedItem()
- Get the currently selected value.
-
getSelectedKey()
- Get the currently selected key value.
-
getSelectedKeyValue()
- Get an array containing all the key values for the currently selected item.
-
handleEvent(Event)
-
-
layoutChoice()
- Redraw the choice after items have been added or removed.
-
loadChoice(JDPUser, JDPJagg, String, String, String, String)
- Load values into the choice from a database table.
-
loadChoice(String[], String[])
- Load values into the choice from a set of arrays.
-
minimumSize()
-
-
preferredSize()
-
-
remove(int)
- Remove a specific item from the Choice pulldown.
-
remove(String)
- Remove a specific item from the Choice pulldown.
-
select(int)
- Select a specific item.
-
select(String)
- Select a specific item.
-
selectKey(String)
- Select a specific item.
-
setBackground(Color)
-
-
setEnabled(boolean)
- Set the enabled setting of the choice box
-
setFont(Font)
-
-
setForeground(Color)
-
-
setMaximumHeight(int)
- Set the maximum height of the combo
-
setMaximumWidth(int)
- Set the maximum width of the combo
-
setMinimumHeight(int)
- Set the minimum height of the grid
-
setMinimumWidth(int)
- Set the minimum width of the grid
-
sortItems()
- Sort the items in the pulldown.
JDPChoice
public JDPChoice()
- Creates an extended Choice component.
JDPChoice
public JDPChoice(JDPUser user)
- Creates an extended Choice component.
loadChoice
public void loadChoice(JDPUser user,
JDPJagg jaggSQL,
String choiceName,
String actualName,
String tableName,
String whereClause)
- Load values into the choice from a database table.
- Parameters:
- JDPUser - the global user parameter used to pass handles in JDP.
- JDPJagg - 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
loadChoice
public void loadChoice(String choiceName[],
String actualName[])
- Load values into the choice from a set of arrays.
- Parameters:
- choiceName - the array containing the names to load choice values from
- actualName - the array containing the keys to load the key values
enable
public void enable()
- Enable the choice box
- Overrides:
- enable in class Component
disable
public void disable()
- Disable the choice box
- Overrides:
- disable in class Component
setEnabled
public void setEnabled(boolean enabled)
- Set the enabled setting of the choice box
- Parameters:
- enabled - the enabled setting for the choice box
- Overrides:
- setEnabled in class Component
getEnabled
public boolean getEnabled()
- Get the enabled setting of the choice box
- Returns:
- the enabled setting for the choice box
addItem
public void addItem(String displayItem)
- Add an item to the choice.
- Parameters:
- displayItem - the text of the item.
addItem
public void addItem(String displayItem,
String actualItem)
- Add an item to the choice.
- Parameters:
- displayItem - the text of the item.
- actualItem - the matching key value.
select
public void select(int selection)
- Select a specific item.
- Parameters:
- selection - the item number to select.
select
public void select(String selection)
- Select a specific item.
- Parameters:
- selection - the item value to select.
selectKey
public void selectKey(String selection)
- Select a specific item.
- Parameters:
- selection - the item value to select.
getItemCount
public int getItemCount()
- Get the number of items in the Choice pulldown.
- Returns:
- the number of items.
countItems
public int countItems()
- Get the number of items in the Choice pulldown.
- Returns:
- the number of items.
sortItems
public void sortItems()
- Sort the items in the pulldown.
clear
public void clear()
- Remove all the entries from the Choice pulldown.
remove
public void remove(int item)
- Remove a specific item from the Choice pulldown.
- Parameters:
- itemNumber - the item number to remove.
- Overrides:
- remove in class Container
remove
public void remove(String item)
- Remove a specific item from the Choice pulldown.
- Parameters:
- itemName - the item to remove.
getItem
public String getItem(int selection)
- Get the text value of a specific item.
- Parameters:
- itemNumber - the item number.
- Returns:
- the item.
getItem
public int getItem(String item)
- Get the item number of a specific item.
- Parameters:
- itemValue - the item.
- Returns:
- the item number.
getItemKey
public String getItemKey(String item)
- Get the matching key value of a specific item.
- Parameters:
- itemValue - the item.
- Returns:
- the item key value.
getItemForKey
public String getItemForKey(String key)
- Get the matching item value of a specific key.
- Parameters:
- keyValue - the item key.
- Returns:
- the item value.
getSelectedItem
public String getSelectedItem()
- Get the currently selected value.
- Returns:
- the item value.
getSelectedIndex
public int getSelectedIndex()
- Get the currently selected index.
- Returns:
- the item index.
getSelectedKey
public String getSelectedKey()
- Get the currently selected key value.
- Returns:
- the item key value.
getSelectedKeyValue
public String[] getSelectedKeyValue()
- Get an array containing all the key values for the currently selected item.
(presently this only returns a one dimensional array as keys can only be
one dimension).
- Returns:
- the item key values.
setBackground
public void setBackground(Color thisColor)
- Overrides:
- setBackground in class Component
getBackground
public Color getBackground()
- Overrides:
- getBackground in class Component
setForeground
public void setForeground(Color thisColor)
- Overrides:
- setForeground in class Component
getForeground
public Color getForeground()
- Overrides:
- getForeground in class Component
setFont
public void setFont(Font thisFont)
- Overrides:
- setFont in class Component
getFont
public Font getFont()
- Overrides:
- getFont in class Component
handleEvent
public boolean handleEvent(Event e)
- Overrides:
- handleEvent in class Component
layoutChoice
public void layoutChoice()
- Redraw the choice after items have been added or removed.
preferredSize
public Dimension preferredSize()
- Overrides:
- preferredSize in class Container
minimumSize
public Dimension minimumSize()
- Overrides:
- minimumSize in class Container
setMinimumWidth
public void setMinimumWidth(int width)
- Set the minimum width of the grid
- Parameters:
- the - width in pixels.
getMinimumWidth
public int getMinimumWidth()
- Get the minimum width of the grid
- Returns:
- the width in pixels.
setMinimumHeight
public void setMinimumHeight(int height)
- Set the minimum height of the grid
- Parameters:
- the - height in pixels.
getMinimumHeight
public int getMinimumHeight()
- Get the minimum height of the grid
- Returns:
- the height in pixels.
setMaximumWidth
public void setMaximumWidth(int width)
- Set the maximum width of the combo
- Parameters:
- the - width in pixels.
getMaximumWidth
public int getMaximumWidth()
- Get the maximum width of the combo
- Returns:
- the width in pixels.
setMaximumHeight
public void setMaximumHeight(int height)
- Set the maximum height of the combo
- Parameters:
- the - height in pixels.
getMaximumHeight
public int getMaximumHeight()
- Get the maximum height of the combo
- Returns:
- the height in pixels.