Class AbstractChoiceDialog<T>

Type Parameters:
T - Any object type
All Implemented Interfaces:
WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
DeployElevationChoiceDialog, EntityChoiceDialog, SBFJumpChoiceDialog, TargetChoiceDialog

public abstract class AbstractChoiceDialog<T> extends AbstractButtonDialog
A modal dialog for presenting options as buttons. Can do single or multi-selection. Sub-classes should define methods for setting the text labels for the buttons as a summary or details of the item. Text label can be HTML or any other JButton legal content.
See Also:
  • Constructor Details

    • AbstractChoiceDialog

      protected AbstractChoiceDialog(JFrame frame, String title, String message, @Nullable List<T> targets, boolean isMultiSelect)
      This creates a modal AbstractChoiceDialog using the default resource bundle as a Modal dialog. concrete classes must call initialize() at the end of the constructor
      Parameters:
      frame - parent @JFrame that owns this dialog
      title - Resource key string only, plain text will result in NPE from Resources
      message - HTML or plain text message show at top of dialog
      targets - things to chose from
      isMultiSelect - if true, allows user to select multiple items. if false first, item chosen will close the window
  • Method Details

    • setUseDetailed

      public void setUseDetailed(boolean useDetailed)
      Parameters:
      useDetailed - Enables or disables the useDetailed flag.
    • setColumns

      public void setColumns(int columns)
      Parameters:
      columns - Number of columns to use. Min: 1
    • createCenterPane

      protected Container createCenterPane()
      Description copied from class: AbstractDialog
      This is used to create the dialog's center pane
      Specified by:
      createCenterPane in class AbstractDialog
      Returns:
      the center pane of the dialog
    • setVisible

      public void setVisible(boolean value)
      Overrides:
      setVisible in class Dialog
    • detailLabel

      protected abstract void detailLabel(JToggleButton button, T target)
      Override to set button text and/or icon with details about this choice. Usually this is called then the show details button is depressed
      Parameters:
      button - A Toggle Button
      target - Target to store value?
    • summaryLabel

      protected abstract void summaryLabel(JToggleButton button, T target)
      Override to set button text and/or icon with summary info about this choice. This is called then the show details button is not depressed
      Parameters:
      button - A Toggle Button
      target - Target to store value?
    • getFirstChoice

      @Nullable public T getFirstChoice()
      Returns:
      first chosen item, or null if nothing chosen
    • getChosen

      public List<T> getChosen()
      Returns:
      list of items picked by user. List will be empty if nothing picked