git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d25ed8f
)
JAL-2629 handle decline 'Add Database'
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Thu, 10 May 2018 12:34:59 +0000
(13:34 +0100)
committer
gmungoc
<g.m.carstairs@dundee.ac.uk>
Thu, 10 May 2018 12:34:59 +0000
(13:34 +0100)
src/jalview/gui/AlignFrame.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/AlignFrame.java
b/src/jalview/gui/AlignFrame.java
index
f258990
..
d52aa97
100644
(file)
--- a/
src/jalview/gui/AlignFrame.java
+++ b/
src/jalview/gui/AlignFrame.java
@@
-1150,7
+1150,7
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
}
String path = openFileChooser(false);
}
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);
{
IdentifyFile identifier = new IdentifyFile();
FileFormatI format = identifier.identify(path, DataSourceType.FILE);
@@
-1178,21
+1178,19
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
MessageManager.getString("warn.invalid_format"));
}
}
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)
{
* @return
*/
protected String openFileChooser(boolean forFolder)
{
+ // TODO duplicates GPreferences method - relocate to JalviewFileChooser?
String choice = null;
JFileChooser chooser = new JFileChooser();
if (forFolder)
String choice = null;
JFileChooser chooser = new JFileChooser();
if (forFolder)