Class JDPList

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----JDPTreePicker
                                   |
                                   +----JDPList

public class JDPList
extends JDPTreePicker
Class JDPList represents an extended list class that allows for auto loading from a database and also tracks key values for dsiplayed values.


Constructor Index

 o JDPList(JDPUser)
Creates a JDPList component.
 o JDPList(JDPUser, Panel)
Creates a JDPList component.
 o JDPList(JDPUser, Panel, JDPDragItem)
Creates a JDPList component.

Method Index

 o addItem(String)
Add an item to the list.
 o addItem(String, int)
Add an item to the list.
 o addItem(String, String)
Add an item to the list.
 o addItem(String, String, int)
Add an item to the list.
 o addItem(String, String, int, Object[])
Add an item to the list.
 o addItem(String[])
Add an item to the list.
 o addItem(String[], int)
Add an item to the list.
 o addItem(String[], String)
Add an item to the list.
 o addItem(String[], String, int)
Add an item to the list.
 o addItem(String[], String, int, Object[])
Add an item to the list.
 o allowMultipleSelections(boolean)
Allow multiple selections to be made on the list
 o clear()
Remove all the entries from the List.
 o countItems()
Get the number of items in the List.
 o delItem(int)
Remove an item from the List.
 o deselect(int)
Select the requested item.
 o getAllowChangeOrder()
Check whether the order of items can be changed in the list.
 o getDragKey()
Get the drag and drop key that allows list items to be dragged.
 o getDropMessage()
Get the drag and drop message that allows list items to be dropped on.
 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 getItemKeys(int)
Get all the items in the list with the specified icon.
 o getItems(int)
Get all the items in the list with the specified icon.
 o getKeyItem(String)
Get the item number of this key value.
 o getMultipleSelections()
Allow multiple selections to be made on the list
 o getSelectedKey()
Get the currently selected key value.
 o getSelectedKeys()
Get the currently selected key values.
 o getSelectedKeyValue()
Get an array containing all the key values for the currently selected item.
 o handleEvent(Event)
 o isSelected(int)
Check is the requested item is selected.
 o loadList(JDPUser, JDPJagg, String, String, String, String)
Load values into the choice from a database table.
 o loadList(String[], String[])
Load values into the choice from a set of arrays.
 o remove(int)
Remove an item from the List.
 o remove(String)
Remove an item from the List.
 o removeAll()
Remove all the entries from the List.
 o replaceItemKey(int, String)
Replace the key value for the selected item.
 o select(String)
Select the requested item.
 o setAllowChangeOrder(boolean)
Allow the order of items to be changed in the list.
 o setDragKey(String)
Set the drag and drop key to allow list items to be dragged.
 o setDropMessage(String)
Set the drag and drop message that allows list items to be dropped on.
 o setIcon(int)
Set the icon value for all subseuqently added list items
 o setIcon(int, int)
Set the icon value for the request list item
 o setMultipleSelections(boolean)
Allow multiple selections to be made on the list
 o sortList()
Sort the entries in the List ignoring the case
 o sortList(boolean, int)
Sort the entries in the List
 o sortList(int)
Sort the entries in the List ignoring the case

Constructors

 o JDPList
 public JDPList(JDPUser user)
Creates a JDPList component.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
 o JDPList
 public JDPList(JDPUser user,
                Panel targetPanel)
Creates a JDPList component.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
targetPanel - the parent panel that this one will be added to.
 o JDPList
 public JDPList(JDPUser user,
                Panel targetPanel,
                JDPDragItem dragPanel)
Creates a JDPList component.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
targetPanel - the parent panel that this one will be added to.
dragPanel - the panel that implements the drag and drop class.

Methods

 o loadList
 public void loadList(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 loadList
 public void loadList(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 allowMultipleSelections
 public void allowMultipleSelections(boolean allowMultiple)
Allow multiple selections to be made on the list

Parameters:
allowMultiple - Allow multiple selections to be made on the list
 o setMultipleSelections
 public void setMultipleSelections(boolean allowMultiple)
Allow multiple selections to be made on the list

Parameters:
allowMultiple - Allow multiple selections to be made on the list
Overrides:
setMultipleSelections in class JDPTreePicker
 o getMultipleSelections
 public boolean getMultipleSelections()
Allow multiple selections to be made on the list

Returns:
Allow multiple selections to be made on the list
Overrides:
getMultipleSelections in class JDPTreePicker
 o setAllowChangeOrder
 public void setAllowChangeOrder(boolean allowChangeOrder)
Allow the order of items to be changed in the list.

Parameters:
allowChangeOrder - Allow the order of items to be changed in the list.
 o getAllowChangeOrder
 public boolean getAllowChangeOrder()
Check whether the order of items can be changed in the list.

Returns:
whether the order of items can be changed in the list.
 o setIcon
 public void setIcon(int icon)
Set the icon value for all subseuqently added list items

Parameters:
iconNumber - the iconNumber from the JDPTreePicker class
See Also:
JDPTreePicker
 o select
 public void select(String item)
Select the requested item.

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

Parameters:
item - the item to deselect.
 o isSelected
 public boolean isSelected(int item)
Check is the requested item is selected.

Parameters:
item - the item to check.
Returns:
true if selected
 o setIcon
 public void setIcon(int index,
                     int icon)
Set the icon value for the request list item

Parameters:
item - number the line item to set the icon on
iconNumber - the iconNumber from the JDPTreePicker class
See Also:
JDPTreePicker
 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[])
Add an item to the list.

Parameters:
displayItem - the text elements of the line 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 addItem
 public void addItem(String displayItem[],
                     String actualItem)
Add an item to the list.

Parameters:
displayItem - the text elements of the line item.
actualItem - the matching key value.
 o addItem
 public void addItem(String displayItem,
                     int icon)
Add an item to the list.

Parameters:
displayItem - the text of the item.
icon - the icon to display.
See Also:
JDPTreePicker
 o addItem
 public void addItem(String displayItem[],
                     int icon)
Add an item to the list.

Parameters:
displayItem - the text elements of the line item.
icon - the icon to display.
See Also:
JDPTreePicker
 o addItem
 public void addItem(String displayItem,
                     String actualItem,
                     int icon)
Add an item to the list.

Parameters:
displayItem - the text of the item.
actualItem - the matching key value.
icon - the icon to display.
See Also:
JDPTreePicker
 o addItem
 public void addItem(String displayItem[],
                     String actualItem,
                     int icon)
Add an item to the list.

Parameters:
displayItem - the text elements of the line item.
actualItem - the matching key value.
icon - the icon to display.
See Also:
JDPTreePicker
 o addItem
 public void addItem(String displayItem,
                     String actualItem,
                     int icon,
                     Object sortKeys[])
Add an item to the list.

Parameters:
displayItem - the text of the item. If multiple items are to be displayed they should be concatenated in the displayItem separated by the '|' character.
actualItem - the matching key value.
icon - the icon to display.
sortKeys - the objects for sorting the columns of the list if multiple columns are present.
See Also:
JDPTreePicker
 o addItem
 public void addItem(String displayItem[],
                     String actualItem,
                     int icon,
                     Object sortKeys[])
Add an item to the list.

Parameters:
displayItem - the text elements of the line item.
actualItem - the matching key value.
icon - the icon to display.
sortKeys - the objects for sorting the columns of the list if multiple columns are present. Use the same as the displayItem if you're not sure. If one of your columns is a date the displayItem would be a string containing the date whereas the sortKey would contain a Long representation of the date so the JDPList can more easilty sort it.
See Also:
JDPTreePicker
 o replaceItemKey
 public void replaceItemKey(int displayItem,
                            String actualItem)
Replace the key value for the selected item.

Parameters:
displayItem - the text of the item.
actualItem - the matching key value.
 o setDragKey
 public void setDragKey(String key)
Set the drag and drop key to allow list items to be dragged.

Parameters:
the - key to the drag item to match with the drop key of another component.
 o getDragKey
 public String getDragKey()
Get the drag and drop key that allows list items to be dragged.

Returns:
the key to the drag item to match with the drop key of another component.
 o setDropMessage
 public void setDropMessage(String message)
Set the drag and drop message that allows list items to be dropped on.

Parameters:
the - message to the drop item that allows list items to be dropped on.
 o getDropMessage
 public String getDropMessage()
Get the drag and drop message that allows list items to be dropped on.

Returns:
the message to the drop item that allows list items to be dropped on.
 o getItemCount
 public int getItemCount()
Get the number of items in the List.

Returns:
the number of items.
 o countItems
 public int countItems()
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 delItem
 public void delItem(int item)
Remove an item from the List.

Parameters:
itemNumber - the item.
 o clear
 public void clear()
Remove all the entries from the List.

Overrides:
clear in class JDPTreePicker
 o removeAll
 public void removeAll()
Remove all the entries from the List.

Overrides:
removeAll in class Container
 o remove
 public void remove(int item)
Remove an item from the List.

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

Parameters:
itemValue - the item.
 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 getKeyItem
 public int getKeyItem(String key)
Get the item number of this key value.

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

Returns:
the item key value.
 o getSelectedKeys
 public String[] getSelectedKeys()
Get the currently selected key values.

Returns:
the item key values.
 o 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.
 o getItems
 public String[] getItems(int icon)
Get all the items in the list with the specified icon.

Parameters:
iconNumber - the icon number.
 o getItemKeys
 public String[] getItemKeys(int icon)
Get all the items in the list with the specified icon.

Parameters:
iconNumber - the icon number.
 o sortList
 public void sortList()
Sort the entries in the List ignoring the case

 o sortList
 public void sortList(int sortColumn)
Sort the entries in the List ignoring the case

 o sortList
 public void sortList(boolean ignoreCase,
                      int sortColumn)
Sort the entries in the List

Parameters:
ignoreCase - choose whether case will be taken into account when sorting
 o handleEvent
 public boolean handleEvent(Event e)
Overrides:
handleEvent in class JDPTreePicker