groovy-commits mailing list archives

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

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


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

commit 57d3394fb41a3aa19ee6a4c0f32b7315116625ca
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 c121ac5..400c361 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
@@ -1608,7 +1608,7 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener,
Fo
     }
 
     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 d18edc1..b70cf00 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/ui/ConsoleView.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/ui/ConsoleView.groovy
@@ -69,6 +69,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