1 package com
.googlecode
.lanterna
.gui2
.dialogs
;
3 import java
.util
.ArrayList
;
7 * Dialog builder for the {@code MessageDialog} class, use this to create instances of that class and to customize
11 public class MessageDialogBuilder
{
14 private List
<MessageDialogButton
> buttons
;
19 public MessageDialogBuilder() {
20 this.title
= "MessageDialog";
22 this.buttons
= new ArrayList
<MessageDialogButton
>();
26 * Builds a new {@code MessageDialog} from the properties in the builder
27 * @return Newly build {@code MessageDialog}
29 public MessageDialog
build() {
30 return new MessageDialog(
33 buttons
.toArray(new MessageDialogButton
[buttons
.size()]));
37 * Sets the title of the {@code MessageDialog}
38 * @param title New title of the message dialog
41 public MessageDialogBuilder
setTitle(String title
) {
50 * Sets the main text of the {@code MessageDialog}
51 * @param text Main text of the {@code MessageDialog}
54 public MessageDialogBuilder
setText(String text
) {
63 * Adds a button to the dialog
64 * @param button Button to add to the dialog
67 public MessageDialogBuilder
addButton(MessageDialogButton button
) {