#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Thu, 21 Jun 2018 18:41:38 +0200
changeset 6359 7c4a24875876
parent 6358 c260ba065216
child 6362 6b79d8bfdcd9
#FEATURE by cg class: EditTextView changed: #editMenu
EditTextView.st
--- a/EditTextView.st	Thu Jun 21 18:40:23 2018 +0200
+++ b/EditTextView.st	Thu Jun 21 18:41:38 2018 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
               All Rights Reserved
@@ -6816,10 +6814,15 @@
                     ('Rot13'                       selectionRot13            )
               ).
 
+    toolItems := toolItems , #(
+                    ('-'                                                      )
+                    ('Open FileBrowser on It'      openFileBrowserOnIt        )
+                    ('Open WebBrowser on It'       openWebBrowserOnIt         )
+              ).
+
     Smalltalk isStandAloneApp ifFalse:[
         toolItems := toolItems , #(
                         ('-'                                                      )
-                        ('Open FileBrowser on It'      openFileBrowserOnIt        )
                         ('Open Workspace with It'      openWorkspaceWithIt        )
                         ('Inspect Selected String'     inspectSelectedString      )
                   ).
@@ -6917,6 +6920,7 @@
     ].
     self hasSelection ifFalse:[
         m disableAll:#(cut googleSpellingSuggestion babelFishTranslateMenu openFileBrowserOnIt
+                       openWebBrowserOnIt
                        openWorkspaceWithIt sortMenu indent splitLinesAtCharacterOrString inspectSelectedString
                        convertMenu).
     ] ifTrue:[
@@ -6928,6 +6932,15 @@
             fn asFilename exists or:[ fn withoutSeparators withoutQuotes asFilename exists ]
         ]) ifFalse:[
             m disableAll:#(openFileBrowserOnIt).
+        ].
+        (Error handle:[:ex |
+            ex return:false
+        ] do:[
+            |fn|
+            fn := self selectionAsString.
+            #('http' 'https' 'ftp') includes:fn asURL method
+        ]) ifFalse:[
+            m disableAll:#(openWebBrowserOnIt).
         ]
     ].
     self hasUndoAction ifFalse:[
@@ -6954,6 +6967,7 @@
     ^ m.
 
     "Modified: / 30-11-2017 / 15:06:03 / cg"
+    "Modified: / 21-06-2018 / 18:41:20 / Claus Gittinger"
 !
 
 getTextSelectionFromHistory