}
String path = openFileChooser(false);
- if (new File(path).exists())
+ if (path != null && new File(path).exists())
{
IdentifyFile identifier = new IdentifyFile();
FileFormatI format = identifier.identify(path, DataSourceType.FILE);
MessageManager.getString("warn.invalid_format"));
}
}
- else
- {
- JOptionPane.showMessageDialog(this,
- MessageManager.getString("label.not_enough_sequences"));
- }
}
/**
- * Opens a file chooser
+ * Opens a file chooser, optionally restricted to selecting folders
+ * (directories) only. Answers the path to the selected file or folder, or
+ * null if none is chosen.
*
- * @param forFolder
+ * @param
* @return
*/
protected String openFileChooser(boolean forFolder)
{
+ // TODO duplicates GPreferences method - relocate to JalviewFileChooser?
String choice = null;
JFileChooser chooser = new JFileChooser();
if (forFolder)