Module com.googlecode.lanterna
Class MessageDialogBuilder
- java.lang.Object
-
- com.googlecode.lanterna.gui2.dialogs.MessageDialogBuilder
-
public class MessageDialogBuilder extends java.lang.ObjectDialog builder for theMessageDialogclass, use this to create instances of that class and to customize them
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<MessageDialogButton>buttonsprivate java.util.Set<Window.Hint>extraWindowHintsprivate java.lang.Stringtextprivate java.lang.Stringtitle
-
Constructor Summary
Constructors Constructor Description MessageDialogBuilder()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageDialogBuilderaddButton(MessageDialogButton button)Adds a button to the dialogMessageDialogbuild()Builds a newMessageDialogfrom the properties in the builderMessageDialogBuildersetExtraWindowHints(java.util.Collection<Window.Hint> extraWindowHints)Assigns a set of extra window hints that you want the built dialog to haveMessageDialogBuildersetText(java.lang.String text)Sets the main text of theMessageDialogMessageDialogBuildersetTitle(java.lang.String title)Sets the title of theMessageDialog
-
-
-
Field Detail
-
title
private java.lang.String title
-
text
private java.lang.String text
-
buttons
private final java.util.List<MessageDialogButton> buttons
-
extraWindowHints
private final java.util.Set<Window.Hint> extraWindowHints
-
-
Method Detail
-
build
public MessageDialog build()
Builds a newMessageDialogfrom the properties in the builder- Returns:
- Newly build
MessageDialog
-
setTitle
public MessageDialogBuilder setTitle(java.lang.String title)
Sets the title of theMessageDialog- Parameters:
title- New title of the message dialog- Returns:
- Itself
-
setText
public MessageDialogBuilder setText(java.lang.String text)
Sets the main text of theMessageDialog- Parameters:
text- Main text of theMessageDialog- Returns:
- Itself
-
setExtraWindowHints
public MessageDialogBuilder setExtraWindowHints(java.util.Collection<Window.Hint> extraWindowHints)
Assigns a set of extra window hints that you want the built dialog to have- Parameters:
extraWindowHints- Window hints to assign to the window in addition to the ones the builder will put- Returns:
- Itself
-
addButton
public MessageDialogBuilder addButton(MessageDialogButton button)
Adds a button to the dialog- Parameters:
button- Button to add to the dialog- Returns:
- Itself
-
-