Module com.googlecode.lanterna
Class MessageDialogBuilder
- java.lang.Object
-
- com.googlecode.lanterna.gui2.dialogs.MessageDialogBuilder
-
public class MessageDialogBuilder extends java.lang.Object
Dialog builder for theMessageDialog
class, 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>
buttons
private java.util.Set<Window.Hint>
extraWindowHints
private java.lang.String
text
private java.lang.String
title
-
Constructor Summary
Constructors Constructor Description MessageDialogBuilder()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageDialogBuilder
addButton(MessageDialogButton button)
Adds a button to the dialogMessageDialog
build()
Builds a newMessageDialog
from the properties in the builderMessageDialogBuilder
setExtraWindowHints(java.util.Collection<Window.Hint> extraWindowHints)
Assigns a set of extra window hints that you want the built dialog to haveMessageDialogBuilder
setText(java.lang.String text)
Sets the main text of theMessageDialog
MessageDialogBuilder
setTitle(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 newMessageDialog
from 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
-
-