}
}
+ public void vamsasSave_actionPerformed(ActionEvent e)
+ {
+ if (v_client != null)
+ {
+ JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache.
+ getProperty(
+ "LAST_DIRECTORY"), new String[]
+ {"vdj"}, // TODO: VAMSAS DOCUMENT EXTENSION is VDJ
+ new String[]
+ {"Vamsas Document"}, "Vamsas Document");
+
+ chooser.setFileView(new JalviewFileView());
+ chooser.setDialogTitle("Save Vamsas Document Archive");
+
+ int value = chooser.showSaveDialog(this);
+
+ if (value == JalviewFileChooser.APPROVE_OPTION)
+ {
+ java.io.File choice = chooser.getSelectedFile();
+ jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice.getParent());
+ String warnmsg=null;
+ String warnttl=null;
+ try {
+ v_client.vclient.storeDocument(choice);
+ }
+ catch (Error ex)
+ {
+ warnttl = "Serious Problem saving Vamsas Document";
+ warnmsg = ex.toString();
+ jalview.bin.Cache.log.error("Error Whilst saving document to "+choice,ex);
+
+ }
+ catch (Exception ex)
+ {
+ warnttl = "Problem saving Vamsas Document.";
+ warnmsg = ex.toString();
+ jalview.bin.Cache.log.warn("Exception Whilst saving document to "+choice,ex);
+
+ }
+ if (warnmsg!=null)
+ {
+ JOptionPane.showInternalMessageDialog(Desktop.desktop,
+
+ warnmsg, warnttl,
+ JOptionPane.ERROR_MESSAGE);
+ }
+ }
+ }
+ }
/**
* hide vamsas user gui bits when a vamsas document event is being handled.
* @param b true to hide gui, false to reveal gui