summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/gui/awt
diff options
context:
space:
mode:
authorEVE <EVE@EVE-PC>2017-03-13 16:42:21 -0400
committerEVE <EVE@EVE-PC>2017-03-13 16:42:21 -0400
commit27bf571d6413c3cc6a5d664b5bddd38d21d7b1cd (patch)
tree847fb52acb091c1c613d37b8477094d5762c6988 /BJC-Utils2/src/main/java/bjc/utils/gui/awt
parentaa807a96cae2c47259fb38f710640883060339e9 (diff)
Formatting
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/gui/awt')
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/gui/awt/ExtensionFileFilter.java10
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java53
2 files changed, 26 insertions, 37 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/gui/awt/ExtensionFileFilter.java b/BJC-Utils2/src/main/java/bjc/utils/gui/awt/ExtensionFileFilter.java
index a375a98..0990f4f 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/gui/awt/ExtensionFileFilter.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/gui/awt/ExtensionFileFilter.java
@@ -22,11 +22,10 @@ public class ExtensionFileFilter implements FilenameFilter {
private IList<String> extensions;
/**
- * Create a new filter only showing files with the specified
- * extensions.
+ * Create a new filter only showing files with the specified extensions.
*
* @param exts
- * The extensions to show in this filter.
+ * The extensions to show in this filter.
*/
public ExtensionFileFilter(List<String> exts) {
if (exts == null) {
@@ -37,11 +36,10 @@ public class ExtensionFileFilter implements FilenameFilter {
}
/**
- * Create a new filter only showing files with the specified
- * extensions.
+ * Create a new filter only showing files with the specified extensions.
*
* @param exts
- * The extensions to show in this filter.
+ * The extensions to show in this filter.
*/
public ExtensionFileFilter(String... exts) {
extensions = new FunctionalList<>(exts);
diff --git a/BJC-Utils2/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java b/BJC-Utils2/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java
index 280c5d8..041a9a2 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java
@@ -20,9 +20,9 @@ public class SimpleFileDialog {
* 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
* @return The file the user picked
*/
public static File getOpenFile(Frame parent, String title) {
@@ -33,23 +33,21 @@ public class SimpleFileDialog {
* 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
+ * The extensions to accept as valid
* @return The file the user picked
*/
- public static File getOpenFile(Frame parent, String title,
- String... extensions) {
+ public static File getOpenFile(Frame parent, String title, 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");
}
- FileDialog chooser = new FileDialog(parent, title,
- FileDialog.LOAD);
+ FileDialog chooser = new FileDialog(parent, title, FileDialog.LOAD);
if (extensions != null) {
FilenameFilter filter = new ExtensionFileFilter(extensions);
@@ -59,8 +57,7 @@ public class SimpleFileDialog {
chooser.setVisible(true);
while (chooser.getFile() == null) {
- SimpleDialogs.showError(parent, "File I/O Error",
- "Please choose a file to open.");
+ SimpleDialogs.showError(parent, "File I/O Error", "Please choose a file to open.");
chooser.setVisible(true);
}
@@ -71,23 +68,21 @@ public class SimpleFileDialog {
* 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
+ * The extensions to accept as valid
* @return The file the user picked
*/
- public static File[] getOpenFiles(Frame parent, String title,
- String... extensions) {
+ public static File[] getOpenFiles(Frame parent, String title, 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");
}
- FileDialog chooser = new FileDialog(parent, title,
- FileDialog.LOAD);
+ FileDialog chooser = new FileDialog(parent, title, FileDialog.LOAD);
if (extensions != null) {
FilenameFilter filter = new ExtensionFileFilter(extensions);
@@ -98,8 +93,7 @@ public class SimpleFileDialog {
chooser.setVisible(true);
while (chooser.getFile() == null) {
- SimpleDialogs.showError(parent, "File I/O Error",
- "Please choose a file to open.");
+ SimpleDialogs.showError(parent, "File I/O Error", "Please choose a file to open.");
chooser.setVisible(true);
}
@@ -110,9 +104,9 @@ 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
* @return The file the user picked
*/
public static File getSaveFile(Frame parent, String title) {
@@ -123,23 +117,21 @@ 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
+ * The extensions to accept as valid
* @return The file the user picked
*/
- public static File getSaveFile(Frame parent, String title,
- String... extensions) {
+ public static File getSaveFile(Frame parent, String title, 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");
}
- FileDialog chooser = new FileDialog(parent, title,
- FileDialog.SAVE);
+ FileDialog chooser = new FileDialog(parent, title, FileDialog.SAVE);
if (extensions != null) {
FilenameFilter filter = new ExtensionFileFilter(extensions);
@@ -149,8 +141,7 @@ public class SimpleFileDialog {
chooser.setVisible(true);
while (chooser.getFile() == null) {
- SimpleDialogs.showError(parent, "File I/O Error",
- "Please choose a file to save to.");
+ SimpleDialogs.showError(parent, "File I/O Error", "Please choose a file to save to.");
chooser.setVisible(true);
}