groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [groovy] branch GROOVY_2_4_X updated: GROOVY-9101: Add context menus to Console's input & output areas (closes #918)
Date Fri, 03 May 2019 00:47:30 GMT
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_2_4_X
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/GROOVY_2_4_X by this push:
     new b96f486  GROOVY-9101: Add context menus to Console's input & output areas (closes
#918)
b96f486 is described below

commit b96f4865201ee3c3a6167af3ec0d1c95b61103c5
Author: aalmiray <aalmiray@gmail.com>
AuthorDate: Thu May 2 21:18:26 2019 +0200

    GROOVY-9101: Add context menus to Console's input & output areas (closes #918)
---
 .../src/main/groovy/groovy/ui/Console.groovy           |  2 +-
 .../src/main/groovy/groovy/ui/ConsoleView.groovy       | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy b/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
index d18fc3f..1dfc15e 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
@@ -1269,7 +1269,7 @@ options:
     }
 
     void selectAll(EventObject evt = null) {
-        invokeTextAction(evt, { source -> source.selectAll() })
+        invokeTextAction(evt, { source -> source.selectAll() }, copyFromComponent ?: inputEditor.textEditor)
     }
 
     void setRowNumAndColNum() {
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/ui/ConsoleView.groovy b/subprojects/groovy-console/src/main/groovy/groovy/ui/ConsoleView.groovy
index 8463c3e..5a1ddb1 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/ui/ConsoleView.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/ui/ConsoleView.groovy
@@ -68,6 +68,24 @@ container(consoleFrame) {
     build(statusBarClass)
 }
 
+inputEditor.textEditor.componentPopupMenu = popupMenu {
+    menuItem(cutAction)
+    menuItem(copyAction)
+    menuItem(pasteAction)
+    menuItem(selectAllAction)
+    separator()
+    menuItem(undoAction)
+    menuItem(redoAction)
+    separator()
+    menuItem(runAction)
+    menuItem(runSelectionAction)
+}
+
+outputArea.componentPopupMenu = popupMenu {
+    menuItem(copyAction)
+    menuItem(selectAllAction)
+    menuItem(clearOutputAction)
+}
 
 controller.promptStyle = promptStyle
 controller.commandStyle = commandStyle


Mime
View raw message