Class ListChooser

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
ModificationChooser, StringListChooser

public abstract class ListChooser
extends JDialog
Dialog for choosing an item in a list.
Author:
Marc Vaudel
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • ListChooser

      public ListChooser()
      Empty default constructor
    • ListChooser

      protected ListChooser​(Frame parent, ArrayList<String> items, String dialogTitle, String panelTitle, String instructionsLabel, boolean multipleSelection)
      Constructor. Null values will be replaced by default.
      Parameters:
      parent - the parent frame
      items - list of items for the user to select
      dialogTitle - the title to give to the dialog.
      panelTitle - the title to give to the panel containing the table.
      instructionsLabel - the instructions label on top of the table.
      multipleSelection - boolean indicating whether the user should be allowed to select multiple items.
    • ListChooser

      protected ListChooser​(JDialog parent, ArrayList<String> items, String dialogTitle, String panelTitle, String instructionsLabel, boolean multipleSelection)
      Constructor. Null values will be replaced by default.
      Parameters:
      parent - the parent frame
      items - list of items for the user to select
      dialogTitle - the title to give to the dialog.
      panelTitle - the title to give to the panel containing the table.
      instructionsLabel - the instructions label on top of the table.
      multipleSelection - boolean indicating whether the user should be allowed to select multiple items.
  • Method Details

    • formatTable

      protected abstract void formatTable()
      Formats the table.
    • getTableTooltips

      protected ArrayList<String> getTableTooltips()
      Returns the tooltips used for the column headers.
      Returns:
      the tooltips used for the column headers
    • getTable

      protected JTable getTable()
      Returns the JTable containing the items.
      Returns:
      the JTable containing the items
    • setUpTable

      public void setUpTable()
      Updates the table content.
    • isCanceled

      public boolean isCanceled()
      Returns a boolean indicating whether the selection was canceled by the user.
      Returns:
      a boolean indicating whether the selection was canceled by the user
    • getSelectedItem

      public String getSelectedItem()
      Returns the item selected by the user.
      Returns:
      the item selected by the user
    • getSelectedItems

      public HashSet<String> getSelectedItems()
      Returns the items selected by the user in a list.
      Returns:
      the items selected by the user in a list