X-Git-Url: http://git.nikiroo.be/?p=jvcard.git;a=blobdiff_plain;f=src%2Fcom%2Fgooglecode%2Flanterna%2Fgui2%2Fdialogs%2FMessageDialogBuilder.java;fp=src%2Fcom%2Fgooglecode%2Flanterna%2Fgui2%2Fdialogs%2FMessageDialogBuilder.java;h=0000000000000000000000000000000000000000;hp=d6f723f459dc47caec62d13d226bb34c295df1e5;hb=f06c81000632cfb5f525ca458f719338f55f9f66;hpb=a73a906356c971b080c36368e71a15d87e8b8d31 diff --git a/src/com/googlecode/lanterna/gui2/dialogs/MessageDialogBuilder.java b/src/com/googlecode/lanterna/gui2/dialogs/MessageDialogBuilder.java deleted file mode 100644 index d6f723f..0000000 --- a/src/com/googlecode/lanterna/gui2/dialogs/MessageDialogBuilder.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.googlecode.lanterna.gui2.dialogs; - -import java.util.ArrayList; -import java.util.List; - -/** - * Dialog builder for the {@code MessageDialog} class, use this to create instances of that class and to customize - * them - * @author Martin - */ -public class MessageDialogBuilder { - private String title; - private String text; - private List buttons; - - /** - * Default constructor - */ - public MessageDialogBuilder() { - this.title = "MessageDialog"; - this.text = "Text"; - this.buttons = new ArrayList(); - } - - /** - * Builds a new {@code MessageDialog} from the properties in the builder - * @return Newly build {@code MessageDialog} - */ - public MessageDialog build() { - return new MessageDialog( - title, - text, - buttons.toArray(new MessageDialogButton[buttons.size()])); - } - - /** - * Sets the title of the {@code MessageDialog} - * @param title New title of the message dialog - * @return Itself - */ - public MessageDialogBuilder setTitle(String title) { - if(title == null) { - title = ""; - } - this.title = title; - return this; - } - - /** - * Sets the main text of the {@code MessageDialog} - * @param text Main text of the {@code MessageDialog} - * @return Itself - */ - public MessageDialogBuilder setText(String text) { - if(text == null) { - text = ""; - } - this.text = text; - return this; - } - - /** - * Adds a button to the dialog - * @param button Button to add to the dialog - * @return Itself - */ - public MessageDialogBuilder addButton(MessageDialogButton button) { - if(button != null) { - buttons.add(button); - } - return this; - } -}