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.
-
JDPComboBox(JDPUser)
-
-
JDPComboBox(JDPUser, int)
-
-
JDPComboBox(JDPUser, String, int)
-
-
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 combo box
-
enable()
- Enable the combo box
-
getBackground()
-
-
getEditable()
- Get the editable setting of the combo box
-
getEnabled()
- Get the enabled setting of the combo 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.
-
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.
-
getText()
- Get the value of the combo box
-
handleEvent(Event)
-
-
layoutChoice()
- Redraw the choice after items have been added or removed.
-
loadChoice(JDPUser, JDPJagg, String, String, String)
- Load values into the choice from a database table.
-
loadChoice(JDPUser, JDPJagg, String, String, String, String)
- Load values into the choice from a database table.
-
loadChoice(String[])
- Load values into the choice from a set of arrays.
-
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.
-
setBackground(Color)
-
-
setEditable(boolean)
- Set the editable setting of the combo box
-
setEnabled(boolean)
- Set the enabled setting of the combo 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
-
setText(String)
- Set the value of the combo box
-
sortItems()
- Sort the entries in the List ignoring the case
-
sortItems(boolean, boolean)
- Sort the entries in the List
JDPComboBox
public JDPComboBox(JDPUser user)
JDPComboBox
public JDPComboBox(JDPUser user,
int width)
JDPComboBox
public JDPComboBox(JDPUser user,
String initValue,
int width)
setText
public void setText(String newText)
- Set the value of the combo box
- Parameters:
- newValue - the new value for the combo box
getText
public String getText()
- Get the value of the combo box
- Returns:
- the current value for the combo box
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(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
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
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
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.
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.
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.
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.
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
layoutChoice
public void layoutChoice()
- Redraw the choice after items have been added or removed.
setEditable
public void setEditable(boolean editable)
- Set the editable setting of the combo box
- Parameters:
- editable - the editable setting for the combo box
getEditable
public boolean getEditable()
- Get the editable setting of the combo box
- Returns:
- the editable setting for the combo box
enable
public void enable()
- Enable the combo box
- Overrides:
- enable in class Component
disable
public void disable()
- Disable the combo box
- Overrides:
- disable in class Component
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
getEnabled
public boolean getEnabled()
- Get the enabled setting of the combo box
- Returns:
- the enabled setting for the combo box
sortItems
public void sortItems()
- Sort the entries in the List ignoring the case
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
handleEvent
public boolean handleEvent(Event e)
- Overrides:
- handleEvent in class Component
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.