JIDE 3.5.15

com.jidesoft.list
Class ListUtils

java.lang.Object
  extended by com.jidesoft.list.ListUtils

public class ListUtils
extends Object

A collection of utility methods for JList.


Constructor Summary
ListUtils()
           
 
Method Summary
static void ensureSelectionVisible(JList list)
           
static void loadSelection(JList list, int[] selected)
          Restore the selection in JList.
static void loadSelectionByValues(JList list, Object[] selected)
          Restores the selection in JList.
static int[] saveSelection(JList list)
          Save the selection of the JList as an array of integer.
static Object[] saveSelectionByValues(JList list)
          Saves the selection of the JList as an array of objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListUtils

public ListUtils()
Method Detail

saveSelection

public static int[] saveSelection(JList list)
Save the selection of the JList as an array of integer.

Parameters:
list -
Returns:
selection as an array

loadSelection

public static void loadSelection(JList list,
                                 int[] selected)
Restore the selection in JList. It must used the array that created by saveSelection.

Parameters:
list -
selected - an int array created by saveSelection

saveSelectionByValues

public static Object[] saveSelectionByValues(JList list)
Saves the selection of the JList as an array of objects. Different from saveSelection(javax.swing.JList), this method will return the actual values that are selected. If there are new values added to or existing values removed from the list and cause the indices, this method will still be able to restore the selected values correctly.

Parameters:
list -
Returns:
selection as an array

loadSelectionByValues

public static void loadSelectionByValues(JList list,
                                         Object[] selected)
Restores the selection in JList. It must used the array that created by saveSelectionByValues(javax.swing.JList).

Parameters:
list -
selected - an int array created by saveSelection

ensureSelectionVisible

public static void ensureSelectionVisible(JList list)

JIDE 3.5.15