EditTextView.st
branchjv
changeset 6348 bbae86d44915
parent 6215 c6976b98f3c3
child 6349 4366b65a2c8a
--- a/EditTextView.st	Fri Jan 26 11:43:24 2018 +0000
+++ b/EditTextView.st	Fri Dec 15 08:49:11 2017 +0000
@@ -6281,9 +6281,11 @@
     "/ completer. Otherwise, completion does not work when clocking into the list.
     explicit ifTrue:[
         completionSupport notNil ifTrue:[
-            completionSupport release.
-        ].
-    ].
+            completionSupport editViewLostFocus.
+        ].
+    ].
+
+    "Modified: / 15-12-2017 / 00:30:27 / jv"
 !
 
 wantsFocusWithPointerEnter
@@ -8105,10 +8107,12 @@
 !EditTextView methodsFor:'queries'!
 
 canAccept
-    "true if text can be accepts.
+    "true if text can be accepted.
      Used to disable the menu if there is nothing selector or the text is readonly"
 
-    ^ acceptEnabled ~~ false
+    ^ acceptEnabled ~~ false and:[ self isReadOnly not ]
+
+    "Modified: / 06-02-2018 / 15:32:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 canCut
@@ -8137,6 +8141,27 @@
     "Created: / 17.5.1998 / 20:07:52 / cg"
 !
 
+hasLanguage
+    "Returns `true` if the editor has a langiage associated, `false` otherwise.
+     Used to disable language-specific menu items items if there's no language."
+
+    ^ self editedLanguage notNil
+
+    "Created: / 06-02-2018 / 15:45:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+hasLanguageToolbox
+    "Returns `true` if the editor has a langiage that has a 'toolbox', `false` otherwise.
+     Used to disable language-specific menu items if there's no `toolbox`."
+
+    | lang |
+
+    lang := self editedLanguage.
+    ^lang notNil and:[ lang toolbox notNil ]
+
+    "Created: / 06-02-2018 / 20:08:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 hasSearchActionSelection
 
     ^ typeOfSelection == #searchAction