X-Git-Url: http://git.nikiroo.be/?p=jvcard.git;a=blobdiff_plain;f=src%2Fcom%2Fgooglecode%2Flanterna%2Fgui2%2Fdialogs%2FFileDialogBuilder.java;fp=src%2Fcom%2Fgooglecode%2Flanterna%2Fgui2%2Fdialogs%2FFileDialogBuilder.java;h=0000000000000000000000000000000000000000;hp=2074c09a1bec260192f55db416e7cdb83ad771a8;hb=f06c81000632cfb5f525ca458f719338f55f9f66;hpb=a73a906356c971b080c36368e71a15d87e8b8d31 diff --git a/src/com/googlecode/lanterna/gui2/dialogs/FileDialogBuilder.java b/src/com/googlecode/lanterna/gui2/dialogs/FileDialogBuilder.java deleted file mode 100644 index 2074c09..0000000 --- a/src/com/googlecode/lanterna/gui2/dialogs/FileDialogBuilder.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.googlecode.lanterna.gui2.dialogs; - -import com.googlecode.lanterna.TerminalSize; -import com.googlecode.lanterna.gui2.LocalizedString; - -import java.io.File; - -/** - * Dialog builder for the {@code FileDialog} class, use this to create instances of that class and to customize - * them - * @author Martin - */ -public class FileDialogBuilder extends AbstractDialogBuilder { - - private String actionLabel; - private TerminalSize suggestedSize; - private File selectedFile; - private boolean showHiddenDirectories; - - /** - * Default constructor - */ - public FileDialogBuilder() { - super("FileDialog"); - actionLabel = LocalizedString.OK.toString(); - suggestedSize = new TerminalSize(45, 10); - showHiddenDirectories = false; - selectedFile = null; - } - - @Override - protected FileDialog buildDialog() { - return new FileDialog(title, description, actionLabel, suggestedSize, showHiddenDirectories, selectedFile); - } - - /** - * Defines the label to be but on the confirmation button (default: "ok"). You probably want to set this to - * {@code LocalizedString.Save.toString()} or {@code LocalizedString.Open.toString()} - * @param actionLabel Label to put on the confirmation button - * @return Itself - */ - public FileDialogBuilder setActionLabel(String actionLabel) { - this.actionLabel = actionLabel; - return this; - } - - /** - * Returns the label on the confirmation button - * @return Label on the confirmation button - */ - public String getActionLabel() { - return actionLabel; - } - - /** - * Sets the suggested size for the file dialog, it won't have exactly this size but roughly. Default suggested size - * is 45x10. - * @param suggestedSize Suggested size for the file dialog - * @return Itself - */ - public FileDialogBuilder setSuggestedSize(TerminalSize suggestedSize) { - this.suggestedSize = suggestedSize; - return this; - } - - /** - * Returns the suggested size for the file dialog - * @return Suggested size for the file dialog - */ - public TerminalSize getSuggestedSize() { - return suggestedSize; - } - - /** - * Sets the file that is initially selected in the dialog - * @param selectedFile File that is initially selected in the dialog - * @return Itself - */ - public FileDialogBuilder setSelectedFile(File selectedFile) { - this.selectedFile = selectedFile; - return this; - } - - /** - * Returns the file that is initially selected in the dialog - * @return File that is initially selected in the dialog - */ - public File getSelectedFile() { - return selectedFile; - } - - /** - * Sets if hidden files and directories should be visible in the dialog (default: {@code false} - * @param showHiddenDirectories If {@code true} then hidden files and directories will be visible - */ - public void setShowHiddenDirectories(boolean showHiddenDirectories) { - this.showHiddenDirectories = showHiddenDirectories; - } - - /** - * Checks if hidden files and directories will be visible in the dialog - * @return If {@code true} then hidden files and directories will be visible - */ - public boolean isShowHiddenDirectories() { - return showHiddenDirectories; - } - - @Override - protected FileDialogBuilder self() { - return this; - } -}