setAccessory(new RecentlyOpened());\r
}\r
\r
- public JalviewFileChooser(String dir, String[] suffix, String[] desc,\r
+ public JalviewFileChooser(String dir,\r
+ String[] suffix,\r
+ String[] desc,\r
+ String selected,\r
+ boolean selectAll)\r
+ {\r
+ super(dir);\r
+ init( suffix, desc, selected, selectAll);\r
+ }\r
+\r
+ public JalviewFileChooser(String dir,\r
+ String[] suffix,\r
+ String[] desc,\r
String selected)\r
{\r
super(dir);\r
+ init( suffix, desc, selected, true);\r
+ }\r
+\r
+ void init(String[] suffix,\r
+ String[] desc,\r
+ String selected,\r
+ boolean selectAll)\r
+ {\r
\r
JalviewFileFilter chosen = null;\r
\r
+ //SelectAllFilter needs to be set first before adding further\r
+ //file filters to fix bug on Mac OSX\r
+ setAcceptAllFileFilterUsed(selectAll);\r
+\r
for (int i = 0; i < suffix.length; i++)\r
{\r
JalviewFileFilter jvf = new JalviewFileFilter(suffix[i], desc[i]);\r
{\r
setFileFilter(chosen);\r
}\r
+\r
setAccessory(new RecentlyOpened());\r
}\r
\r
{\r
super.setFileFilter(filter);\r
\r
+\r
try{\r
if(getUI() instanceof javax.swing.plaf.basic.BasicFileChooserUI)\r
{\r
}\r
}catch(Exception ex)\r
{\r
+ ex.printStackTrace();\r
// Some platforms do not have BasicFileChooserUI\r
}\r
}\r
{\r
this.setAccessory(null);\r
\r
+\r
setDialogType(SAVE_DIALOG);\r
\r
- int ret = showDialog(parent, null);\r
+ int ret = showDialog(parent, "Save");\r
\r
if (getFileFilter() instanceof JalviewFileFilter)\r
{\r
}\r
\r
list = new JList(recent);\r
+\r
+ DefaultListCellRenderer dlcr = new DefaultListCellRenderer();\r
+ dlcr.setHorizontalAlignment(DefaultListCellRenderer.RIGHT);\r
+ list.setCellRenderer(dlcr);\r
+\r
+\r
list.addMouseListener(new MouseAdapter()\r
{\r
public void mousePressed(MouseEvent evt)\r
this.setBorder(new javax.swing.border.TitledBorder("Recently Opened"));\r
\r
final JScrollPane scroller = new JScrollPane(list);\r
- scroller.setPreferredSize(new Dimension(120, 200));\r
+ scroller.setPreferredSize(new Dimension(130, 200));\r
this.add(scroller);\r
\r
javax.swing.SwingUtilities.invokeLater(new Runnable()\r