#FEATURE by exept
authorClaus Gittinger <cg@exept.de>
Wed, 30 Oct 2019 11:37:26 +0100
changeset 6725 48ab339411d2
parent 6724 0185a3113b0d
child 6726 9e386937fc31
#FEATURE by exept class: EditField added: #openFileBrowser comment/format in: #hideAsPassword #showPasswordCharacters changed: #editMenu
EditField.st
--- a/EditField.st	Wed Oct 30 11:26:36 2019 +0100
+++ b/EditField.st	Wed Oct 30 11:37:26 2019 +0100
@@ -2201,7 +2201,7 @@
         items := items ,
                     #(
                         ('-'                     )
-                        ('Show Password'                showPasswordCharacters )
+                        ('Show Text'                showPasswordCharacters )
                     ).
     ] ifFalse:[
         items := items ,
@@ -2225,6 +2225,22 @@
         ].
     ].
 
+    self contents asFilename exists ifTrue:[
+        items := items ,
+                    #(
+                        ('-'                     )
+                        ('Show in File Browser'                openFileBrowser )
+                    ).
+    ] ifFalse:[
+        self contents asFilename directory exists ifTrue:[
+            items := items ,
+                        #(
+                            ('-'                     )
+                            ('Show Directory in File Browser'                openFileBrowser )
+                        ).
+        ]
+    ].
+
     m := PopUpMenu itemList:items resources:resources.
 
     passwordCharacter notNil ifTrue:[
@@ -2247,6 +2263,8 @@
 !
 
 hideAsPassword
+    "hide passwords (i.e. turn on password mode)"
+
     |id|
 
     passwordCharacter := $*.
@@ -2264,7 +2282,19 @@
     "Created: / 17-08-2017 / 00:11:41 / cg"
 !
 
+openFileBrowser
+    |fn|
+
+    fn := self contents asFilename.
+    fn exists ifFalse:[
+        fn := fn directory.
+    ].
+    FileBrowser default openOn:fn
+!
+
 showPasswordCharacters
+    "show the plain text (i.e. turn off password mode)"
+
     |id|
 
     passwordCharacter := nil.