Right click copy/paste popup
authoramwaterhouse <Andrew Waterhouse>
Fri, 23 Sep 2005 16:17:12 +0000 (16:17 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 23 Sep 2005 16:17:12 +0000 (16:17 +0000)
src/jalview/gui/CutAndPasteTransfer.java
src/jalview/jbgui/GCutAndPasteTransfer.java

index 219ad4b..f2920e5 100755 (executable)
@@ -103,7 +103,7 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer
 \r
         try\r
         {\r
-            textarea.setText((String) contents.getTransferData(\r
+            textarea.append((String) contents.getTransferData(\r
                     DataFlavor.stringFlavor));\r
         }\r
         catch (Exception ex)\r
@@ -175,4 +175,31 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer
         {\r
         }\r
     }\r
+\r
+    public void textarea_mousePressed(MouseEvent e)\r
+    {\r
+      if(SwingUtilities.isRightMouseButton(e))\r
+      {\r
+        JPopupMenu popup = new JPopupMenu("Edit");\r
+        JMenuItem item = new JMenuItem("Copy");\r
+        item.addActionListener(new ActionListener()\r
+            {public void actionPerformed(ActionEvent e)\r
+                  {\r
+                    copyItem_actionPerformed(e);\r
+                  }\r
+            });\r
+        popup.add(item);\r
+        item = new JMenuItem("Paste");\r
+        item.addActionListener(new ActionListener()\r
+            {public void actionPerformed(ActionEvent e)\r
+                  {\r
+                    pasteMenu_actionPerformed(e);\r
+                  }\r
+            });\r
+        popup.add(item);\r
+        popup.show(this, e.getX(), e.getY()+30);\r
+\r
+      }\r
+    }\r
+\r
 }\r
index 0c42724..384f09e 100755 (executable)
@@ -145,12 +145,9 @@ public class GCutAndPasteTransfer extends JInternalFrame
      *\r
      * @param e DOCUMENT ME!\r
      */\r
-    void textarea_mousePressed(MouseEvent e)\r
+    public void textarea_mousePressed(MouseEvent e)\r
     {\r
-        if (textarea.getText().equals("Paste your alignment file here"))\r
-        {\r
-            textarea.setText("");\r
-        }\r
+\r
     }\r
 \r
     /**\r