Class MessageDialog
java.lang.Object
com.googlecode.lanterna.gui2.AbstractBasePane<Window>
com.googlecode.lanterna.gui2.AbstractWindow
com.googlecode.lanterna.gui2.dialogs.DialogWindow
com.googlecode.lanterna.gui2.dialogs.MessageDialog
Simple message dialog that displays a message and has optional selection/confirmation buttons
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractBasePane
AbstractBasePane.ContentHolderNested classes/interfaces inherited from interface Window
Window.Hint -
Field Summary
FieldsFields inherited from class AbstractBasePane
contentHolder, interactableLookupMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionshowDialog(WindowBasedTextGUI textGUI) Opens the dialog by showing it on the GUI and doesn't return until the dialog has been closedstatic MessageDialogButtonshowMessageDialog(WindowBasedTextGUI textGUI, String title, String text, MessageDialogButton... buttons) Shortcut for quickly displaying a message boxMethods inherited from class AbstractWindow
addWindowListener, close, draw, fromGlobal, fromGlobalToContentRelative, fromGlobalToDecoratedRelative, getDecoratedSize, getHints, getPosition, getPostRenderer, getPreferredSize, getSize, getTextGUI, getTitle, handleInput, isVisible, removeWindowListener, setCloseWindowWithEscape, setContentOffset, setDecoratedSize, setFixedSize, setHints, setPosition, setSize, setTextGUI, setTitle, setVisible, setWindowPostRenderer, toGlobal, toGlobalFromContentRelative, toGlobalFromDecoratedRelative, waitUntilClosedMethods inherited from class AbstractBasePane
addBasePaneListener, getBasePaneListeners, getComponent, getCursorPosition, getFocusedInteractable, getMenuBar, getTheme, invalidate, isInvalid, removeBasePaneListener, setComponent, setEnableDirectionBasedMovements, setFocusedInteractable, setFocusedInteractable, setMenuBar, setStrictFocusChange, setThemeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BasePane
getTheme, setEnableDirectionBasedMovements, setStrictFocusChange, setThemeMethods inherited from interface Window
getBounds, getComponent, getCursorPosition, getFocusedInteractable, getMenuBar, invalidate, isInvalid, setComponent, setFocusedInteractable, setMenuBar
-
Field Details
-
result
-
-
Constructor Details
-
MessageDialog
MessageDialog(String title, String text, MessageDialogButton... buttons)
-
-
Method Details
-
showDialog
Opens the dialog by showing it on the GUI and doesn't return until the dialog has been closed- Overrides:
showDialogin classDialogWindow- Parameters:
textGUI- Text GUI to add the dialog to- Returns:
- The selected button's enum value
-
showMessageDialog
public static MessageDialogButton showMessageDialog(WindowBasedTextGUI textGUI, String title, String text, MessageDialogButton... buttons) Shortcut for quickly displaying a message box- Parameters:
textGUI- The GUI to display the message box ontitle- Title of the message boxtext- Main message of the message boxbuttons- Buttons that the user can confirm the message box with- Returns:
- Which button the user selected
-