proper.gui.core.list
Class JListHelper

java.lang.Object
  extended by proper.gui.core.list.JListHelper

public class JListHelper
extends java.lang.Object

A little helper class for handling JLists that contain Strings.

Version:
$Revision: 1.2 $
Author:
FracPete

Constructor Summary
JListHelper(javax.swing.JList jlist)
          initializes the object
 
Method Summary
 java.lang.Object[] getAllListData()
          returns all the lines
static java.lang.Object[] getAllListData(javax.swing.JList jlist)
          returns all the lines from the given JList
 int[] getInverseSelectedIndices()
          returns an int-array with the non-selected lines
static int[] getInverseSelectedIndices(javax.swing.JList jlist)
          returns an int-array with the non-selected lines from the given JList
 java.lang.Object[] getInverseSelectedValues()
          returns the inverse selection of the lines
static java.lang.Object[] getInverseSelectedValues(javax.swing.JList jlist)
          returns the inverse selection of the lines from the given JList
 javax.swing.JList getJList()
          returns the used JList
 java.lang.Object[] getListData()
          returns the selected lines or all if none are selected
static java.lang.Object[] getListData(javax.swing.JList jlist)
          returns the selected lines or all if none are selected from the given JList
static int[] getMatches(javax.swing.JList jlist, java.lang.String searchString)
          returns an int-array with all the indices of the lines that match the given search string in the given JList
 int[] getMatches(java.lang.String searchString)
          returns an int-array with all the indices of the lines that match the given search string
 int[] invertIndices(int[] indices)
          inverts the given indices
static int[] invertIndices(javax.swing.JList jlist, int[] indices)
          inverts the given indices from the given JList
static java.lang.String[] toStringArray(java.lang.Object[] array)
          turns the Object-Array into a String-Array
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JListHelper

public JListHelper(javax.swing.JList jlist)
initializes the object

Method Detail

getJList

public javax.swing.JList getJList()
returns the used JList


toStringArray

public static java.lang.String[] toStringArray(java.lang.Object[] array)
turns the Object-Array into a String-Array


getListData

public java.lang.Object[] getListData()
returns the selected lines or all if none are selected


getListData

public static java.lang.Object[] getListData(javax.swing.JList jlist)
returns the selected lines or all if none are selected from the given JList


getAllListData

public java.lang.Object[] getAllListData()
returns all the lines


getAllListData

public static java.lang.Object[] getAllListData(javax.swing.JList jlist)
returns all the lines from the given JList


invertIndices

public int[] invertIndices(int[] indices)
inverts the given indices


invertIndices

public static int[] invertIndices(javax.swing.JList jlist,
                                  int[] indices)
inverts the given indices from the given JList


getInverseSelectedIndices

public int[] getInverseSelectedIndices()
returns an int-array with the non-selected lines


getInverseSelectedIndices

public static int[] getInverseSelectedIndices(javax.swing.JList jlist)
returns an int-array with the non-selected lines from the given JList


getInverseSelectedValues

public java.lang.Object[] getInverseSelectedValues()
returns the inverse selection of the lines


getInverseSelectedValues

public static java.lang.Object[] getInverseSelectedValues(javax.swing.JList jlist)
returns the inverse selection of the lines from the given JList


getMatches

public int[] getMatches(java.lang.String searchString)
returns an int-array with all the indices of the lines that match the given search string


getMatches

public static int[] getMatches(javax.swing.JList jlist,
                               java.lang.String searchString)
returns an int-array with all the indices of the lines that match the given search string in the given JList