Class JDPComboBox

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----JDPComboBox

public class JDPComboBox
extends Panel
Class JDPComboBox represents a textfield with pulldown ability.


Constructor Index

 o JDPComboBox(JDPUser)
 o JDPComboBox(JDPUser, int)
 o JDPComboBox(JDPUser, String, int)

Method Index

 o addItem(String)
Add an item to the choice.
 o addItem(String, String)
Add an item to the choice.
 o clear()
Remove all the entries from the Choice pulldown.
 o countItems()
Get the number of items in the Choice pulldown.
 o disable()
Disable the combo box
 o enable()
Enable the combo box
 o getBackground()
 o getEditable()
Get the editable setting of the combo box
 o getEnabled()
Get the enabled setting of the combo box
 o getFont()
 o getForeground()
 o getItem(int)
Get the text value of a specific item.
 o getItem(String)
Get the item number of a specific item.
 o getItemCount()
Get the number of items in the Choice pulldown.
 o getMaximumHeight()
Get the maximum height of the combo
 o getMaximumWidth()
Get the maximum width of the combo
 o getMinimumHeight()
Get the minimum height of the grid
 o getMinimumWidth()
Get the minimum width of the grid
 o getSelectedIndex()
Get the currently selected index.
 o getSelectedItem()
Get the currently selected value.
 o getText()
Get the value of the combo box
 o handleEvent(Event)
 o layoutChoice()
Redraw the choice after items have been added or removed.
 o loadChoice(JDPUser, JDPJagg, String, String, String)
Load values into the choice from a database table.
 o loadChoice(JDPUser, JDPJagg, String, String, String, String)
Load values into the choice from a database table.
 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 minimumSize()
 o preferredSize()
 o remove(int)
Remove a specific item from the Choice pulldown.
 o remove(String)
Remove a specific item from the Choice pulldown.
 o select(int)
Select a specific item.
 o select(String)
Select a specific item.
 o setBackground(Color)
 o setEditable(boolean)
Set the editable setting of the combo box
 o setEnabled(boolean)
Set the enabled setting of the combo box
 o setFont(Font)
 o setForeground(Color)
 o setMaximumHeight(int)
Set the maximum height of the combo
 o setMaximumWidth(int)
Set the maximum width of the combo
 o setMinimumHeight(int)
Set the minimum height of the grid
 o setMinimumWidth(int)
Set the minimum width of the grid
 o setText(String)
Set the value of the combo box
 o sortItems()
Sort the entries in the List ignoring the case
 o sortItems(boolean, boolean)
Sort the entries in the List

Constructors

 o JDPComboBox
 public JDPComboBox(JDPUser user)
 o JDPComboBox
 public JDPComboBox(JDPUser user,
                    int width)
 o JDPComboBox
 public JDPComboBox(JDPUser user,
                    String initValue,
                    int width)

Methods

 o setText
 public void setText(String newText)
Set the value of the combo box

Parameters:
newValue - the new value for the combo box
 o getText
 public String getText()
Get the value of the combo box

Returns:
the current value for the combo box
 o 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
 o loadChoice
 public void loadChoice(JDPUser user,
                        JDPJagg jaggSQL,
                        String choiceName,
                        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
tableName - the database table data from
whereClause - the where clause to use when selecting rows from the table
 o loadChoice
 public void loadChoice(String choiceName[])
Load values into the choice from a set of arrays.

Parameters:
choiceName - the array containing the names to load choice values from
 o 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
 o addItem
 public void addItem(String displayItem)
Add an item to the choice.

Parameters:
displayItem - the text of the item.
 o 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.
 o select
 public void select(int selection)
Select a specific item.

Parameters:
selection - the item number to select.
 o select
 public void select(String selection)
Select a specific item.

Parameters:
selection - the item value to select.
 o getItemCount
 public int getItemCount()
Get the number of items in the Choice pulldown.

Returns:
the number of items.
 o countItems
 public int countItems()
Get the number of items in the Choice pulldown.

Returns:
the number of items.
 o clear
 public void clear()
Remove all the entries from the Choice pulldown.

 o 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
 o remove
 public void remove(String item)
Remove a specific item from the Choice pulldown.

Parameters:
itemName - the item to remove.
 o getItem
 public String getItem(int selection)
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 item number of a specific item.

Parameters:
itemValue - the item.
Returns:
the item number.
 o getSelectedItem
 public String getSelectedItem()
Get the currently selected value.

Returns:
the item value.
 o getSelectedIndex
 public int getSelectedIndex()
Get the currently selected index.

Returns:
the item index.
 o setBackground
 public void setBackground(Color thisColor)
Overrides:
setBackground in class Component
 o getBackground
 public Color getBackground()
Overrides:
getBackground in class Component
 o setForeground
 public void setForeground(Color thisColor)
Overrides:
setForeground in class Component
 o getForeground
 public Color getForeground()
Overrides:
getForeground in class Component
 o setFont
 public void setFont(Font thisFont)
Overrides:
setFont in class Component
 o getFont
 public Font getFont()
Overrides:
getFont in class Component
 o layoutChoice
 public void layoutChoice()
Redraw the choice after items have been added or removed.

 o setEditable
 public void setEditable(boolean editable)
Set the editable setting of the combo box

Parameters:
editable - the editable setting for the combo box
 o getEditable
 public boolean getEditable()
Get the editable setting of the combo box

Returns:
the editable setting for the combo box
 o enable
 public void enable()
Enable the combo box

Overrides:
enable in class Component
 o disable
 public void disable()
Disable the combo box

Overrides:
disable in class Component
 o setEnabled
 public void setEnabled(boolean enabled)
Set the enabled setting of the combo box

Parameters:
enabled - the enabled setting for the combo box
Overrides:
setEnabled in class Component
 o getEnabled
 public boolean getEnabled()
Get the enabled setting of the combo box

Returns:
the enabled setting for the combo box
 o sortItems
 public void sortItems()
Sort the entries in the List ignoring the case

 o sortItems
 public void sortItems(boolean ignoreCase,
                       boolean sortAscending)
Sort the entries in the List

Parameters:
ignoreCase - choose whether case will be taken into account when sorting
sortAscending - sort in ascending order
 o handleEvent
 public boolean handleEvent(Event e)
Overrides:
handleEvent in class Component
 o preferredSize
 public Dimension preferredSize()
Overrides:
preferredSize in class Container
 o minimumSize
 public Dimension minimumSize()
Overrides:
minimumSize in class Container
 o setMinimumWidth
 public void setMinimumWidth(int width)
Set the minimum width of the grid

Parameters:
the - width in pixels.
 o getMinimumWidth
 public int getMinimumWidth()
Get the minimum width of the grid

Returns:
the width in pixels.
 o setMinimumHeight
 public void setMinimumHeight(int height)
Set the minimum height of the grid

Parameters:
the - height in pixels.
 o getMinimumHeight
 public int getMinimumHeight()
Get the minimum height of the grid

Returns:
the height in pixels.
 o setMaximumWidth
 public void setMaximumWidth(int width)
Set the maximum width of the combo

Parameters:
the - width in pixels.
 o getMaximumWidth
 public int getMaximumWidth()
Get the maximum width of the combo

Returns:
the width in pixels.
 o setMaximumHeight
 public void setMaximumHeight(int height)
Set the maximum height of the combo

Parameters:
the - height in pixels.
 o getMaximumHeight
 public int getMaximumHeight()
Get the maximum height of the combo

Returns:
the height in pixels.