#REFACTORING by stefan
authorStefan Vogel <sv@exept.de>
Wed, 18 Apr 2018 12:16:18 +0200
changeset 6305 5e9740739ad1
parent 6304 93a632d04f8c
child 6306 da16573a2e64
#REFACTORING by stefan class: EditField added: #doCompletion changed: #keyPress:x:y:
EditField.st
--- a/EditField.st	Tue Apr 17 08:21:14 2018 +0200
+++ b/EditField.st	Wed Apr 18 12:16:18 2018 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1990 by Claus Gittinger
 	      All Rights Reserved
@@ -1666,7 +1668,7 @@
                           #DeleteLine #GotoLine #EndOfLine #EndOfText
                           #CursorDown #CursorUp)>
 
-    |leave oldContents newContents doAccept keyAction numArgs|
+    |leave doAccept keyAction numArgs|
 
     enabled ifFalse:[
         ^ self
@@ -1679,24 +1681,7 @@
     ].
 
     (key == entryCompletionCharacter and:[self entryCompletionBlock notNil]) ifTrue:[
-        oldContents := self contents.
-        oldContents isNil ifTrue:[
-            oldContents := ''
-        ] ifFalse:[
-            oldContents := oldContents asString
-        ].
-
-        self entryCompletionBlock valueWithOptionalArgument:oldContents and:self.
-
-        newContents := self contents.
-        newContents isNil ifTrue:[
-            newContents := ''
-        ] ifFalse:[
-            newContents := newContents asString
-        ].
-        newContents ~= oldContents ifTrue:[
-            self textChanged
-        ].
+        self doCompletion.
         ^ self
     ].
 
@@ -1787,8 +1772,8 @@
         self resizeOrScroll.
     ].
 
-    "Modified: / 02-05-1996 / 17:24:16 / stefan"
     "Modified: / 27-09-2017 / 15:34:19 / cg"
+    "Modified: / 18-04-2018 / 11:47:58 / stefan"
 !
 
 keyboardZoom:largerBoolean
@@ -2172,6 +2157,35 @@
     ^ str
 !
 
+doCompletion
+    |oldContents newContents|
+
+    self entryCompletionBlock isNil ifTrue:[
+        ^ self.
+    ].
+
+    oldContents := self contents.
+    oldContents isNil ifTrue:[
+        oldContents := ''
+    ] ifFalse:[
+        oldContents := oldContents asString
+    ].
+
+    self entryCompletionBlock valueWithOptionalArgument:oldContents and:self.
+
+    newContents := self contents.
+    newContents isNil ifTrue:[
+        newContents := ''
+    ] ifFalse:[
+        newContents := newContents asString
+    ].
+    newContents ~= oldContents ifTrue:[
+        self textChanged
+    ].
+
+    "Created: / 18-04-2018 / 11:46:17 / stefan"
+!
+
 getListFromModel
     "redefined to acquire the text via the aspectMsg - not the listMsg,
      and to ignore updates resulting from my own change."