All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.netobjects.nfx.ui.TwoListPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.JPanel
                                   |
                                   +----com.netobjects.nfx.ui.TwoListPanel

public class TwoListPanel
extends JPanel
Component: TwoListPanel Description: This components provides the functionality to move items from one ListModel to another. This component assumes that the model be at least a derivative of DefaultListModel. However, the default model for both lists are OrderedListModel, a derivative of the DefaultListModel that implements ordering (in particular, ascending by the String representation of the object.

Version:
: 1.0 9/21/98
Author:
: Toby Karyadi Application Methods, Inc. 6300 Southcenter Blvd. Seattle, WA 98188 (206) 244-2400 http://www.appmethods.com
See Also:
:

Variable Index

 o _btnToLeft
 o _btnToRight
 o _lblLeftList
 o _lblRightList
 o _lstLeft
 o _lstRight
 o _moveSrcItems
 o _scpLeft
 o _scpRight
 o _scrollPaneWidth

Constructor Index

 o TwoListPanel()
Constructor
 o TwoListPanel(OrderedListModel, String, OrderedListModel, String)
Constructor

Method Index

 o copyFromTo(JList, JList)
This method copies an item from one ListModel to the other.
 o copyToRight()
This method is called by the ActionListener of the _btnLeft
 o getLeftList()
Accessor method to the left JList sub component.
 o getLeftListLabel()
Accessor method to the JLabel sub component of the left list.
 o getRightList()
Accessor method to the right JList sub component.
 o getRightListLabel()
Accessor method to the JLabel sub component of the left list.
 o getToLeftButton()
Accessor method to the JButton sub component to move items to the left list.
 o getToRightButton()
Accessor method to the JButton sub component to move items to the right list.
 o handleListSelection(ListSelectionEvent)
 o initComponentListeners()
This method hooks up the sub components to the event handler methods that are implemented in this class.
 o initControls()
 o initLayout()
This is a method that is responsible for laying out the sub components.
 o moveFromTo(JList, JList)
This method moves an item from one ListModel to the other.
 o moveToLeft()
This method is called by the ActionListener of the _btnRight
 o moveToRight()
This method is called by the ActionListener of the _btnLeft
 o removeFrom(JList)
This method removes items from a ListModel.
 o removeFromRight()
This method is called by the ActionListener of the _btnLeft
 o setMoveSrcItems(boolean)
Set to true if source items are to be removed, not just coppied, from the left and right list.

Variables

 o _lblLeftList
 private JLabel _lblLeftList
 o _lblRightList
 private JLabel _lblRightList
 o _lstLeft
 private JList _lstLeft
 o _lstRight
 private JList _lstRight
 o _btnToLeft
 private JButton _btnToLeft
 o _btnToRight
 private JButton _btnToRight
 o _scpLeft
 private JScrollPane _scpLeft
 o _scpRight
 private JScrollPane _scpRight
 o _moveSrcItems
 private boolean _moveSrcItems
 o _scrollPaneWidth
 private int _scrollPaneWidth

Constructors

 o TwoListPanel
 public TwoListPanel()
Constructor

 o TwoListPanel
 public TwoListPanel(OrderedListModel modelLeft,
                     String titleLeft,
                     OrderedListModel modelRight,
                     String titleRight)
Constructor

Parameters:
modelLeft - the model for the left list.
titleLeft - the list title for the left list.
modelRight - the model for the right list.
titleRight - he list title for the right list.

Methods

 o initControls
 protected void initControls()
 o initLayout
 protected void initLayout()
This is a method that is responsible for laying out the sub components.

 o initComponentListeners
 protected void initComponentListeners()
This method hooks up the sub components to the event handler methods that are implemented in this class.

 o getLeftListLabel
 public JLabel getLeftListLabel()
Accessor method to the JLabel sub component of the left list.

 o getRightListLabel
 public JLabel getRightListLabel()
Accessor method to the JLabel sub component of the left list.

 o getLeftList
 public JList getLeftList()
Accessor method to the left JList sub component.

 o getRightList
 public JList getRightList()
Accessor method to the right JList sub component.

 o getToRightButton
 public JButton getToRightButton()
Accessor method to the JButton sub component to move items to the right list.

 o getToLeftButton
 public JButton getToLeftButton()
Accessor method to the JButton sub component to move items to the left list.

 o moveToRight
 protected void moveToRight()
This method is called by the ActionListener of the _btnLeft

 o moveToLeft
 protected void moveToLeft()
This method is called by the ActionListener of the _btnRight

 o copyToRight
 protected void copyToRight()
This method is called by the ActionListener of the _btnLeft

 o removeFromRight
 protected void removeFromRight()
This method is called by the ActionListener of the _btnLeft

 o setMoveSrcItems
 protected void setMoveSrcItems(boolean set)
Set to true if source items are to be removed, not just coppied, from the left and right list. The default is false.

Parameters:
set - true/false
 o moveFromTo
 protected void moveFromTo(JList lstSrc,
                           JList lstDst)
This method moves an item from one ListModel to the other. This method only assumes that the ListModel be at least a derivative of DefaultListModel.

 o copyFromTo
 protected void copyFromTo(JList lstSrc,
                           JList lstDst)
This method copies an item from one ListModel to the other. This method only assumes that the ListModel be at least a derivative of OrderedListModel.

 o removeFrom
 protected void removeFrom(JList lst)
This method removes items from a ListModel. This method only assumes that the ListModel be at least a derivative of DefaultListModel.

 o handleListSelection
 protected void handleListSelection(ListSelectionEvent e)

All Packages  Class Hierarchy  This Package  Previous  Next  Index