public enum TYPE
{
- EPS("EPS", MessageManager.getString("label.eps_file"), getEPSChooser()),
+ EPS("EPS", MessageManager.getString("label.eps_file"), EPS_EXTENSION,
+ EPS_DESCRIPTION),
PNG("PNG", MessageManager.getString("label.png_image"),
- getPNGChooser()),
- SVG("SVG", "SVG", getSVGChooser());
-
- private JalviewFileChooser chooser;
+ PNG_EXTENSION, PNG_DESCRIPTION),
+ SVG("SVG", "SVG", SVG_EXTENSION, SVG_DESCRIPTION);
private String name;
private String label;
- TYPE(String name, String label, JalviewFileChooser chooser)
+ private String extension;
+
+ private String description;
+
+ TYPE(String name, String label, String ext, String desc)
{
this.name = name;
this.label = label;
- this.chooser = chooser;
+ this.extension = ext;
+ this.description = desc;
}
public String getName()
return name;
}
- public JalviewFileChooser getChooser()
+ public JalviewFileChooser getFileChooser()
{
- return chooser;
+ return new JalviewFileChooser(extension, description);
}
public String getLabel()
setProgressMessage(MessageManager.formatMessage(
"status.waiting_for_user_to_select_output_file", type.name));
JalviewFileChooser chooser;
- chooser = type.getChooser();
+ chooser = type.getFileChooser();
chooser.setFileView(new jalview.io.JalviewFileView());
chooser.setDialogTitle(title);
chooser.setToolTipText(MessageManager.getString("action.save"));