Class EntityChoiceDialog

All Implemented Interfaces:
WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class EntityChoiceDialog extends AbstractChoiceDialog<Entity>
A modal dialog for choosing one or more Entities. Can show stats in brief or in detail.
See Also:
  • Constructor Details

    • EntityChoiceDialog

      protected EntityChoiceDialog(JFrame frame, String title, String message, @Nullable List<Entity> targets, boolean isMultiSelect)
      This creates a modal dialog to pick one or more entities.
      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

    • detailLabel

      protected void detailLabel(JToggleButton button, Entity target)
      Description copied from class: AbstractChoiceDialog
      Override to set button text and/or icon with details about this choice. Usually this is called then the show details button is depressed
      Specified by:
      detailLabel in class AbstractChoiceDialog<Entity>
      Parameters:
      button - A Toggle Button
      target - Target to store value?
    • summaryLabel

      protected void summaryLabel(JToggleButton button, Entity target)
      Description copied from class: AbstractChoiceDialog
      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
      Specified by:
      summaryLabel in class AbstractChoiceDialog<Entity>
      Parameters:
      button - A Toggle Button
      target - Target to store value?
    • showSingleChoiceDialog

      @Nullable public static Entity showSingleChoiceDialog(JFrame frame, String title, String message, @Nullable List<Entity> targets)
      show modal dialog to chose one entity from a list This creates a modal dialog to pick one or more entities.
      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 - Entities to chose from
      Returns:
      chosen entity or null if not chosen
    • showMultiChoiceDialog

      @Nullable public static List<Entity> showMultiChoiceDialog(JFrame frame, String title, String message, @Nullable List<Entity> targets)
      show modal dialog to chose one or more entities from a list This creates a modal dialog to pick one or more entities.
      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 - Entities to chose from
      Returns:
      chosen entities or empty list if none chosen