- if (FormatAdapter.formats.contains( format ))
- sequences = FormatAdapter.readFile(getText(), "Paste", format);
+ String format = new IdentifyFile().Identify(text, "Paste");
+ if (format == null || format.equalsIgnoreCase("EMPTY DATA FILE"))
+ {
+ System.err.println(MessageManager
+ .getString("label.couldnt_read_data"));
+ if (!Jalview.isHeadlessMode())
+ {
+ javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,
+ AppletFormatAdapter.SUPPORTED_FORMATS,
+ MessageManager.getString("label.couldnt_read_data"),
+ JOptionPane.WARNING_MESSAGE);
+ }
+ return;
+ }
+
+ // TODO: identify feature, annotation or tree file and parse appropriately.
+ AlignmentI al = null;
+
+ if (FormatAdapter.isValidFormat(format))
+ {
+ try
+ {
+ FormatAdapter fa = new FormatAdapter(alignpanel);
+ al = fa.readFile(getText(), "Paste", format);
+ source = fa.getAlignFile();