summaryrefslogtreecommitdiff
path: root/base/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java
diff options
context:
space:
mode:
authorBenjamin J. Culkin <bjculkin@mix.wvu.edu>2017-10-17 12:00:05 -0300
committerBenjamin J. Culkin <bjculkin@mix.wvu.edu>2017-10-17 12:00:05 -0300
commite4f7dd636cd0b512eca5fbc2a8e7108ddc851a62 (patch)
treeb94e4e51e8507823d206db4a516b4d94fe57541b /base/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java
parent8923edffdb36b790014ff47301e53f7ede93ea0d (diff)
More cleanup
Diffstat (limited to 'base/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java')
-rw-r--r--base/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java75
1 files changed, 48 insertions, 27 deletions
diff --git a/base/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java b/base/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java
index 77a4a59..e9236fe 100644
--- a/base/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java
+++ b/base/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java
@@ -8,42 +8,50 @@ import java.io.FilenameFilter;
import bjc.utils.gui.SimpleDialogs;
/**
- * A simple way to get the user to pick a file
+ * A simple way to get the user to pick a file.
*
* Built for AWT.
*
* @author ben
- *
*/
public class SimpleFileDialog {
/**
- * Prompt the user to pick a file to open
+ * Prompt the user to pick a file to open.
*
* @param parent
- * The parent of the file picker
+ * The parent of the file picker.
+ *
* @param title
- * The title of the file picker
- * @return The file the user picked
+ * The title of the file picker.
+ *
+ * @return
+ * The file the user picked.
*/
public static File getOpenFile(final Frame parent, final String title) {
return getOpenFile(parent, title, (String[]) null);
}
/**
- * Prompt the user to pick a file to open
+ * Prompt the user to pick a file to open.
*
* @param parent
- * The parent of the file picker
+ * The parent of the file picker.
+ *
* @param title
- * The title of the file picker
+ * The title of the file picker.
+ *
* @param extensions
- * The extensions to accept as valid
- * @return The file the user picked
+ * The extensions to accept as valid.
+ *
+ * @return
+ * The file the user picked.
*/
public static File getOpenFile(final Frame parent, final String title, final String... extensions) {
- if (parent == null)
+ if (parent == null) {
throw new NullPointerException("Parent must not be null");
- else if (title == null) throw new NullPointerException("Title must not be null");
+ } else if (title == null) {
+ throw new NullPointerException("Title must not be null");
+ }
final FileDialog chooser = new FileDialog(parent, title, FileDialog.LOAD);
@@ -63,20 +71,25 @@ public class SimpleFileDialog {
}
/**
- * Prompt the user to pick a file to open
+ * Prompt the user to pick a file to open.
*
* @param parent
- * The parent of the file picker
+ * The parent of the file picker.
+ *
* @param title
- * The title of the file picker
+ * The title of the file picker.
+ *
* @param extensions
- * The extensions to accept as valid
- * @return The file the user picked
+ * The extensions to accept as valid.
+ *
+ * @return
+ * The file the user picked.
*/
public static File[] getOpenFiles(final Frame parent, final String title, final String... extensions) {
if (parent == null)
throw new NullPointerException("Parent must not be null");
- else if (title == null) throw new NullPointerException("Title must not be null");
+ else if (title == null)
+ throw new NullPointerException("Title must not be null");
final FileDialog chooser = new FileDialog(parent, title, FileDialog.LOAD);
@@ -100,10 +113,13 @@ public class SimpleFileDialog {
* Prompt the user to pick a file to save
*
* @param parent
- * The parent of the file picker
+ * The parent of the file picker
+ *
* @param title
- * The title of the file picker
- * @return The file the user picked
+ * The title of the file picker
+ *
+ * @return
+ * The file the user picked
*/
public static File getSaveFile(final Frame parent, final String title) {
return getSaveFile(parent, title, (String[]) null);
@@ -113,17 +129,22 @@ public class SimpleFileDialog {
* Prompt the user to pick a file to save
*
* @param parent
- * The parent of the file picker
+ * The parent of the file picker
+ *
* @param title
- * The title of the file picker
+ * The title of the file picker
+ *
* @param extensions
- * The extensions to accept as valid
- * @return The file the user picked
+ * The extensions to accept as valid
+ *
+ * @return
+ * The file the user picked
*/
public static File getSaveFile(final Frame parent, final String title, final String... extensions) {
if (parent == null)
throw new NullPointerException("Parent must not be null");
- else if (title == null) throw new NullPointerException("Title must not be null");
+ else if (title == null)
+ throw new NullPointerException("Title must not be null");
final FileDialog chooser = new FileDialog(parent, title, FileDialog.SAVE);