Class DoubleAddRemovePanel<T>

  • Type Parameters:
    T - the type of the objects in the list.
    All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, Accessible

    public class DoubleAddRemovePanel<T>
    extends JPanel
    This component displays three list (one available list and two selected lists) with some buttons to move the components of one list to the other.
    See Also:
    Serialized Form
    • Constructor Detail

      • DoubleAddRemovePanel

        public DoubleAddRemovePanel​(int displayOptions,
                                    Class<T> theClass)
        Constructor of the double add remove panel allowing the user to provide some display options. The class is required to avoid warnings in compilation.
        Parameters:
        displayOptions - the display options.
        theClass - the class of the objects in the panel.
    • Method Detail

      • setEnabled

        public void setEnabled​(boolean enable)
        Overrides:
        setEnabled in class JComponent
      • getAvailableLabel

        public JLabel getAvailableLabel()
        Returns the available label contained in the panel.
        Returns:
        the available label contained in the panel.
      • getAvailableListModel

        public SortableListModel<T> getAvailableListModel()
        Returns the list of elements in the available list.
        Returns:
        the list of elements in the available list.
      • getSelectedLabel1

        public JLabel getSelectedLabel1()
        Returns the first selected label contained in the panel.
        Returns:
        the first selected label contained in the panel.
      • getSelectedListModel1

        public SortableListModel<T> getSelectedListModel1()
        Returns the list of elements in the first selected list.
        Returns:
        the list of elements in the first selected list.
      • getSelectedLabel2

        public JLabel getSelectedLabel2()
        Returns the second selected label contained in the panel.
        Returns:
        the second selected label contained in the panel.
      • getSelectedListModel2

        public SortableListModel<T> getSelectedListModel2()
        Returns the list of elements in the second selected list.
        Returns:
        the list of elements in the second selected list.
      • getAvailableList

        public JList getAvailableList()
        Returns the available list.
        Returns:
        the available list.
      • getSelectedList1

        public JList<T> getSelectedList1()
        Returns the first selected list.
        Returns:
        the first selected list.
      • getSelectedList2

        public JList<T> getSelectedList2()
        Returns the second selected list.
        Returns:
        the second selected list.
      • setUnmovableItems

        public void setUnmovableItems​(Collection<T> unmovableItems)
        Sets the list of items that cannot be moved from one list to the others.
        Parameters:
        unmovableItems - the list of items that cannot be moved from one list to the others.