@Override
public File getSelectedFile()
{
- File selfile = super.getSelectedFile();
- if (selfile == null && ourselectedFile != null)
- {
- return ourselectedFile;
- }
- return selfile;
+ File f = super.getSelectedFile();
+ return f == null ? selectedFile : f;
}
- /**
- * Overridden for JalviewJS compatibility: only one thread in Javascript,
- * so we can't wait for user choice in another thread and then perform the
- * desired action
- */
@Override
public int showSaveDialog(Component parent) throws HeadlessException
{
}
}
- /**
- * A panel to set as the 'accessory' component to the file chooser dialog,
- * holding a list of recently opened files (if any). These are held as a
- * tab-separated list of file paths under key <code>RECENT_FILE</code> in
- * <code>.jalview_properties</code>. A click in the list calls a method in
- * JalviewFileChooser to set the chosen file as the selection.
- */
class RecentlyOpened extends JPanel
{
+ private static final long serialVersionUID = 1L;
-
JList<String> list;
- public RecentlyOpened()
+ RecentlyOpened()
{
-
setPreferredSize(new Dimension(300,100));
- String historyItems = jalview.bin.Cache.getProperty("RECENT_FILE");
+ String historyItems = Cache.getProperty("RECENT_FILE");
StringTokenizer st;
Vector<String> recent = new Vector<>();