From: amwaterhouse Date: Thu, 9 Jun 2005 09:58:53 +0000 (+0000) Subject: Warn if Textarea limit has been reached X-Git-Tag: Release_2_0~83 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=fa01b399367489ceab50514c8ca4e516e5ec417a;p=jalview.git Warn if Textarea limit has been reached --- diff --git a/src/jalview/appletgui/CutAndPasteTransfer.java b/src/jalview/appletgui/CutAndPasteTransfer.java index ed89001..46f3d70 100755 --- a/src/jalview/appletgui/CutAndPasteTransfer.java +++ b/src/jalview/appletgui/CutAndPasteTransfer.java @@ -52,6 +52,23 @@ public class CutAndPasteTransfer protected void ok_actionPerformed(ActionEvent e) { String text = getText(); + int length = text.length(); + textarea.append("\n"); + if(textarea.getText().length()==length) + { + String warning = "\n\n#################################################\n" + +"WARNING!! THIS IS THE MAXIMUM SIZE OF TEXTAREA!!\n" + +"\nCAN'T INPUT FULL ALIGNMENT" + +"\n\nYOU MUST DELETE THIS WARNING TO CONTINUE" + +"\n\nMAKE SURE LAST SEQUENCE PASTED IS COMPLETE" + +"\n#################################################\n"; + textarea.setText(text.substring(0, text.length()-warning.length()) + +warning); + + textarea.setCaretPosition(text.length()); + return; + } + SequenceI[] sequences = null; String format = IdentifyFile.Identify(text, "Paste");