diff options
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/gui/awt/SimpleFileDialog.java | 53 |
1 files changed, 22 insertions, 31 deletions
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); } |
