Class SubListSelectionPanel<T>

Type Parameters:
T - Type of item managed by panel.
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public abstract class SubListSelectionPanel<T> extends JPanel
Panel for selecting a set of items from a list. Optionally, allow user to order included items. User must implement getIncludedOptions and getExcludedOptions.
See Also:
  • Constructor Details

    • SubListSelectionPanel

      protected SubListSelectionPanel()
      By default, allows sorting of included elements.
    • SubListSelectionPanel

      protected SubListSelectionPanel(boolean pAllowIncludedItemReordering)
      Parameters:
      pAllowIncludedItemReordering - Allow user to order included items.
  • Method Details

    • getIncludedList

      public final JList<T> getIncludedList()
    • getExcludedList

      public final JList<T> getExcludedList()
    • getIncludeAction

      protected Action getIncludeAction()
      Moves item(s) from excluded to included set.
    • getExcludeAction

      protected Action getExcludeAction()
      Moves item(s) from included to excluded set.
    • getSelection

      public Set<T> getSelection()
      Get selected elements from included and excluded lists. By default, only one list can have selected elements.
    • getExcludedOptions

      public abstract ListModel<T> getExcludedOptions()
    • getIncludedOptions

      public abstract ListModel<T> getIncludedOptions()
    • exclude

      public abstract void exclude(Set<? extends T> pSet)
      Executed when the '<' button is pressed.
    • include

      public abstract void include(Set<? extends T> pSet)
      Executed when the '>' button is pressed.
    • main

      public static void main(String[] pArgs)
      Creates a JFrame and runs a sample instance of the selection panel with some dummy data.