com.partnersoft.gui
Class ListSelectionControl

java.lang.Object
  extended by com.partnersoft.gui.ListSelectionControl
All Implemented Interfaces:
GUIControl

public class ListSelectionControl
extends java.lang.Object
implements GUIControl

A convenience wrapper for JList.

Author:
Paul Reavis Copyright 2004 Partner Software, Inc.

Constructor Summary
ListSelectionControl()
           
ListSelectionControl(javax.swing.ListModel model)
           
 
Method Summary
 void doAction()
          Subclasses should override this to take action whenever an action should occur (generally when the user hits return in the field).
 javax.swing.JComponent getGUI()
           
 javax.swing.JList getJList()
           
 javax.swing.JScrollPane getJScrollPane()
           
 int getSelectedIndex()
           
 java.lang.Object getSelectedItem()
           
 void optimizeForLongList()
          Call this to tweak for longer listings.
 void selectAndShowIndex(int index)
           
 void selectIndex(int index)
          Selects the given item.
 void selectionModified()
          Subclasses should override this to take action whenever the selection set changes.
 void setModel(javax.swing.ListModel newModel)
           
 void setSelectedIndex(int newIndex)
           
 void setSelectedItem(java.lang.Object newItem)
           
 void showIndex(int index)
          Makes sure you can see the selected item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListSelectionControl

public ListSelectionControl()

ListSelectionControl

public ListSelectionControl(javax.swing.ListModel model)
Method Detail

selectIndex

public void selectIndex(int index)
Selects the given item.


showIndex

public void showIndex(int index)
Makes sure you can see the selected item. It tries its best to place it about 1/3 of the way from the top.


selectAndShowIndex

public void selectAndShowIndex(int index)

setModel

public void setModel(javax.swing.ListModel newModel)

optimizeForLongList

public void optimizeForLongList()
Call this to tweak for longer listings.


getSelectedIndex

public int getSelectedIndex()

setSelectedIndex

public void setSelectedIndex(int newIndex)

getSelectedItem

public java.lang.Object getSelectedItem()

setSelectedItem

public void setSelectedItem(java.lang.Object newItem)

getJList

public javax.swing.JList getJList()

getJScrollPane

public javax.swing.JScrollPane getJScrollPane()

selectionModified

public void selectionModified()
Subclasses should override this to take action whenever the selection set changes.


doAction

public void doAction()
Subclasses should override this to take action whenever an action should occur (generally when the user hits return in the field).


getGUI

public javax.swing.JComponent getGUI()
Specified by:
getGUI in interface GUIControl