groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [groovy] 04/04: GROOVY-9133 Loop mode for groovy-console (rename prefs variable) (closes #951)
Date Tue, 11 Jun 2019 12:28:38 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

commit 4a1f7c32823fbbf271e9c9c02b1e7d5aff6e3936
Author: Paul King <paulk@asert.com.au>
AuthorDate: Tue Jun 11 22:28:14 2019 +1000

    GROOVY-9133 Loop mode for groovy-console (rename prefs variable) (closes #951)
---
 .../src/main/groovy/groovy/console/ui/Console.groovy       |  2 +-
 .../groovy/groovy/console/ui/ConsolePreferences.groovy     | 14 +++++++-------
 .../main/resources/groovy/console/ui/Console.properties    |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/Console.groovy b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/Console.groovy
index 46b63c1..7c82101 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/Console.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/Console.groovy
@@ -1290,7 +1290,7 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener,
Fo
                 interruptAction.enabled = false
                 systemOutInterceptor.removeConsoleId()
                 if( loopMode ) {
-                    int delay = prefs.getInt('loopModeLength', ConsolePreferences.DEFAULT_LOOP_MODE_LENGTH_MILLIS)
+                    int delay = prefs.getInt('loopModeDelay', ConsolePreferences.DEFAULT_LOOP_MODE_DELAY_MILLIS)
                     Timer timer = new Timer(delay, {
                         if( inputAreaContentHash == inputArea.getText().hashCode() ) {
                             runScriptImpl(selected)
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ConsolePreferences.groovy
b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ConsolePreferences.groovy
index bf76d53..ee9faf6 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ConsolePreferences.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/ConsolePreferences.groovy
@@ -30,13 +30,13 @@ class ConsolePreferences {
 
     // Default maximum number of characters to show on console at any time
     static int DEFAULT_MAX_OUTPUT_CHARS = 20000
-    static int DEFAULT_LOOP_MODE_LENGTH_MILLIS = 1000
+    static int DEFAULT_LOOP_MODE_DELAY_MILLIS = 1000
 
     @Bindable
     int maxOutputChars
 
     @Bindable
-    int loopModeLength
+    int loopModeDelay
 
     private final console
     private final MessageSource T
@@ -49,7 +49,7 @@ class ConsolePreferences {
         T = new MessageSource(Console)
 
         maxOutputChars = console.loadMaxOutputChars()
-        loopModeLength = console.prefs.getInt('loopModeLength', DEFAULT_LOOP_MODE_LENGTH_MILLIS)
+        loopModeDelay = console.prefs.getInt('loopModeDelay', DEFAULT_LOOP_MODE_DELAY_MILLIS)
         console.maxOutputChars = maxOutputChars
     }
 
@@ -85,9 +85,9 @@ class ConsolePreferences {
                     hbox {
                         label "${T['prefs.loop.mode.title']}:"
 
-                        formattedTextField value: loopModeLength, id: 'txtLoopModeLength',
+                        formattedTextField value: loopModeDelay, id: 'txtLoopModeDelay',
                                 text:
-                        bind(target: this, targetProperty: 'loopModeLength',
+                        bind(target: this, targetProperty: 'loopModeDelay',
                                 validator: this.&isInteger, converter: Integer.&parseInt),
                         columns: 8
                     }
@@ -134,12 +134,12 @@ class ConsolePreferences {
 
     private void onReset(EventObject event) {
         console.swing.txtMaxOutputChars.text = DEFAULT_MAX_OUTPUT_CHARS
-        console.swing.txtLoopModeLength.text = DEFAULT_LOOP_MODE_LENGTH_MILLIS
+        console.swing.txtLoopModeDelay.text = DEFAULT_LOOP_MODE_DELAY_MILLIS
     }
 
     private void onClose(EventObject event) {
         console.prefs.putInt('maxOutputChars', maxOutputChars)
-        console.prefs.putInt('loopModeLength', loopModeLength)
+        console.prefs.putInt('loopModeDelay', loopModeDelay)
         // For backwards compatibility 'maxOutputChars' remains defined in the Console class
         // and so we update the value to keep it in sync.
         if (maxOutputChars != console.maxOutputChars) {
diff --git a/subprojects/groovy-console/src/main/resources/groovy/console/ui/Console.properties
b/subprojects/groovy-console/src/main/resources/groovy/console/ui/Console.properties
index cc56d57..6c443b7 100644
--- a/subprojects/groovy-console/src/main/resources/groovy/console/ui/Console.properties
+++ b/subprojects/groovy-console/src/main/resources/groovy/console/ui/Console.properties
@@ -40,7 +40,7 @@ cli.info.version=GroovyConsole {0}
 prefs.dialog.title=Preferences
 prefs.output.settings.title=Output Settings
 prefs.max.characters.output=Maximum Characters to Output
-prefs.loop.mode.title=Loop mode length (millis)
+prefs.loop.mode.title=Loop mode delay (millis)
 prefs.reset.defaults=Reset To Defaults
 prefs.output.file=Output to file
 prefs.output.file.select=Select


Mime
View raw message