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.
-
JDPList(JDPUser)
- Creates a JDPList component.
-
JDPList(JDPUser, Panel)
- Creates a JDPList component.
-
JDPList(JDPUser, Panel, JDPDragItem)
- Creates a JDPList component.
-
addItem(String)
- Add an item to the list.
-
addItem(String, int)
- Add an item to the list.
-
addItem(String, String)
- Add an item to the list.
-
addItem(String, String, int)
- Add an item to the list.
-
addItem(String, String, int, Object[])
- Add an item to the list.
-
addItem(String[])
- Add an item to the list.
-
addItem(String[], int)
- Add an item to the list.
-
addItem(String[], String)
- Add an item to the list.
-
addItem(String[], String, int)
- Add an item to the list.
-
addItem(String[], String, int, Object[])
- Add an item to the list.
-
allowMultipleSelections(boolean)
- Allow multiple selections to be made on the list
-
clear()
- Remove all the entries from the List.
-
countItems()
- Get the number of items in the List.
-
delItem(int)
- Remove an item from the List.
-
deselect(int)
- Select the requested item.
-
getAllowChangeOrder()
- Check whether the order of items can be changed in the list.
-
getDragKey()
- Get the drag and drop key that allows list items to be dragged.
-
getDropMessage()
- Get the drag and drop message that allows list items to be dropped on.
-
getItem(int)
- Get the text value of a specific item.
-
getItem(String)
- Get the index value of a specific item.
-
getItemCount()
- Get the number of items in the List.
-
getItemKey(int)
- Get the key value of the selected item.
-
getItemKeys(int)
- Get all the items in the list with the specified icon.
-
getItems(int)
- Get all the items in the list with the specified icon.
-
getKeyItem(String)
- Get the item number of this key value.
-
getMultipleSelections()
- Allow multiple selections to be made on the list
-
getSelectedKey()
- Get the currently selected key value.
-
getSelectedKeys()
- Get the currently selected key values.
-
getSelectedKeyValue()
- Get an array containing all the key values for the currently selected item.
-
handleEvent(Event)
-
-
isSelected(int)
- Check is the requested item is selected.
-
loadList(JDPUser, JDPJagg, String, String, String, String)
- Load values into the choice from a database table.
-
loadList(String[], String[])
- Load values into the choice from a set of arrays.
-
remove(int)
- Remove an item from the List.
-
remove(String)
- Remove an item from the List.
-
removeAll()
- Remove all the entries from the List.
-
replaceItemKey(int, String)
- Replace the key value for the selected item.
-
select(String)
- Select the requested item.
-
setAllowChangeOrder(boolean)
- Allow the order of items to be changed in the list.
-
setDragKey(String)
- Set the drag and drop key to allow list items to be dragged.
-
setDropMessage(String)
- Set the drag and drop message that allows list items to be dropped on.
-
setIcon(int)
- Set the icon value for all subseuqently added list items
-
setIcon(int, int)
- Set the icon value for the request list item
-
setMultipleSelections(boolean)
- Allow multiple selections to be made on the list
-
sortList()
- Sort the entries in the List ignoring the case
-
sortList(boolean, int)
- Sort the entries in the List
-
sortList(int)
- Sort the entries in the List ignoring the case
JDPList
public JDPList(JDPUser user)
- Creates a JDPList component.
- Parameters:
- JDPUser - the global user parameter used to pass handles in JDP.
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.
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.
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
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
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
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
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
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.
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.
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
select
public void select(String item)
- Select the requested item.
- Parameters:
- item - the item to select.
deselect
public void deselect(int item)
- Select the requested item.
- Parameters:
- item - the item to deselect.
isSelected
public boolean isSelected(int item)
- Check is the requested item is selected.
- Parameters:
- item - the item to check.
- Returns:
- true if selected
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
addItem
public void addItem(String displayItem)
- Add an item to the list.
- Parameters:
- displayItem - the text of the item.
addItem
public void addItem(String displayItem[])
- Add an item to the list.
- Parameters:
- displayItem - the text elements of the line item.
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.
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.
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
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
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
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
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
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
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.
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.
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.
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.
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.
getItemCount
public int getItemCount()
- Get the number of items in the List.
- Returns:
- the number of items.
countItems
public int countItems()
- Get the number of items in the List.
- Returns:
- the number of items.
getItem
public String getItem(int item)
- Get the text value of a specific item.
- Parameters:
- itemNumber - the item number.
- Returns:
- the item.
getItem
public int getItem(String item)
- Get the index value of a specific item.
- Parameters:
- item - the item.
- Returns:
- the index of the item.
delItem
public void delItem(int item)
- Remove an item from the List.
- Parameters:
- itemNumber - the item.
clear
public void clear()
- Remove all the entries from the List.
- Overrides:
- clear in class JDPTreePicker
removeAll
public void removeAll()
- Remove all the entries from the List.
- Overrides:
- removeAll in class Container
remove
public void remove(int item)
- Remove an item from the List.
- Parameters:
- itemNumber - the item.
- Overrides:
- remove in class Container
remove
public void remove(String item)
- Remove an item from the List.
- Parameters:
- itemValue - the item.
getItemKey
public String getItemKey(int item)
- Get the key value of the selected item.
- Parameters:
- the - item number.
- Returns:
- the item key value.
getKeyItem
public int getKeyItem(String key)
- Get the item number of this key value.
- Parameters:
- the - item key value.
- Returns:
- the item number.
getSelectedKey
public String getSelectedKey()
- Get the currently selected key value.
- Returns:
- the item key value.
getSelectedKeys
public String[] getSelectedKeys()
- Get the currently selected key values.
- Returns:
- the item key values.
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.
getItems
public String[] getItems(int icon)
- Get all the items in the list with the specified icon.
- Parameters:
- iconNumber - the icon number.
getItemKeys
public String[] getItemKeys(int icon)
- Get all the items in the list with the specified icon.
- Parameters:
- iconNumber - the icon number.
sortList
public void sortList()
- Sort the entries in the List ignoring the case
sortList
public void sortList(int sortColumn)
- Sort the entries in the List ignoring the case
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
handleEvent
public boolean handleEvent(Event e)
- Overrides:
- handleEvent in class JDPTreePicker