X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FCutAndPasteTransfer.java;h=12f9e283a1a8516f57a15cdec2590f00297414a2;hb=14bad6b2390493bb6ad030c6f3ea7cde4cba1b53;hp=a10f43304f1bbb23e9684b1267eab5b4bd5fced3;hpb=3cc7159787bd31859f7bc27916e7ff854b895280;p=jalview.git diff --git a/src/jalview/gui/CutAndPasteTransfer.java b/src/jalview/gui/CutAndPasteTransfer.java index a10f433..12f9e28 100755 --- a/src/jalview/gui/CutAndPasteTransfer.java +++ b/src/jalview/gui/CutAndPasteTransfer.java @@ -80,6 +80,11 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer textarea.setText(text); } + public void appendText(String text) + { + textarea.append(text); + } + /** * DOCUMENT ME! * @@ -124,12 +129,20 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer */ public void ok_actionPerformed(ActionEvent e) { - String format = IdentifyFile.Identify(getText(), "Paste"); + String format = new IdentifyFile().Identify(getText(), "Paste"); SequenceI[] sequences = null; if (FormatAdapter.formats.contains(format)) { + try{ sequences = new FormatAdapter().readFile(getText(), "Paste", format); + }catch(java.io.IOException ex) + { + JOptionPane.showInternalMessageDialog(Desktop.desktop, + "Couldn't read the pasted text.\n" +ex.toString(), + "Error parsing text", + JOptionPane.WARNING_MESSAGE); + } } if (sequences != null) @@ -156,14 +169,6 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer { } } - else - { - JOptionPane.showInternalMessageDialog(Desktop.desktop, - "Couldn't read the pasted text.\n" + - "Formats currently supported are\n" + - "Fasta, MSF, Clustal, BLC, PIR, MSP, and PFAM", - "Error parsing text", JOptionPane.WARNING_MESSAGE); - } } /**