HierarchicalListEditor.st
changeset 581 399646a86258
parent 566 58b18ffe959c
child 602 5bf03bf611c8
--- a/HierarchicalListEditor.st	Wed Feb 04 15:21:12 1998 +0100
+++ b/HierarchicalListEditor.st	Wed Feb 04 16:12:58 1998 +0100
@@ -76,6 +76,9 @@
 #addSister
 'Adds a new sister item.'
 
+#contents
+'Contents of the tree item.'
+
 #fileNew
 'Creates a new hierarchical list.'
 
@@ -85,6 +88,9 @@
 #fileSave
 'Saves current hierarchical list.'
 
+#label
+'Label of the tree item.'
+
 )
 ! !
 
@@ -185,11 +191,11 @@
           #'window:' 
            #(#WindowSpec
               #'name:' 'Hierarchical List Editor'
-              #'layout:' #(#LayoutFrame 366 0 355 0 840 0 667 0)
+              #'layout:' #(#LayoutFrame 92 0 328 0 566 0 640 0)
               #'label:' 'Hierarchical List Editor'
               #'min:' #(#Point 10 10)
               #'max:' #(#Point 1160 870)
-              #'bounds:' #(#Rectangle 366 355 841 668)
+              #'bounds:' #(#Rectangle 92 328 567 641)
               #'menu:' #menu
               #'usePreferredExtent:' false
           )
@@ -228,24 +234,27 @@
                                      #(#LabelSpec
                                         #'name:' 'nameLabel'
                                         #'layout:' #(#AlignmentOrigin 107 0 25 0 1 0.5)
-                                        #'label:' 'Name:'
+                                        #'label:' 'Label:'
                                         #'resizeForLabel:' true
                                     )
                                      #(#InputFieldSpec
-                                        #'name:' 'nameInputField'
+                                        #'name:' 'labelInputField'
                                         #'layout:' #(#LayoutFrame 110 0 15 0 -5 1.0 37 0)
+                                        #'activeHelpKey:' #label
                                         #'tabable:' true
                                         #'model:' #itemName
                                     )
                                      #(#LabelSpec
                                         #'name:' 'valueLabel'
                                         #'layout:' #(#AlignmentOrigin 107 0 51 0 1 0.5)
-                                        #'label:' 'Value:'
+                                        #'activeHelpKey:' #contents
+                                        #'label:' 'Contents:'
                                         #'resizeForLabel:' true
                                     )
                                      #(#InputFieldSpec
                                         #'name:' 'valueInputField'
                                         #'layout:' #(#LayoutFrame 110 0 41 0 -5 1.0 63 0)
+                                        #'activeHelpKey:' #contents
                                         #'tabable:' true
                                         #'model:' #itemValue
                                         #'type:' #symbolOrNil
@@ -340,6 +349,15 @@
                           #'label:' '-'
                       )
                        #(#MenuItem
+                          #'label:' 'Browse Class'
+                          #'value:' #doBrowse
+                          #'activeHelpKey:' #fileBrowseClass
+                          #'enabled:' #hasValidClass
+                      )
+                       #(#MenuItem
+                          #'label:' '-'
+                      )
+                       #(#MenuItem
                           #'label:' 'Exit'
                           #'value:' #closeRequest
                           #'activeHelpKey:' #fileExit
@@ -377,34 +395,6 @@
                 )
             )
              #(#MenuItem
-                #'label:' 'Browse'
-                #'enabled:' #hasValidClass
-                #'submenu:' 
-                 #(#Menu
-                    
-                     #(
-                       #(#MenuItem
-                          #'label:' 'Class'
-                          #'value:' #'doBrowse:'
-                          #'argument:' #class
-                      )
-                       #(#MenuItem
-                          #'label:' 'Method'
-                          #'value:' #'doBrowse:'
-                          #'enabled:' #hasValidMethodSelector
-                          #'argument:' #method
-                      )
-                       #(#MenuItem
-                          #'label:' 'Specification'
-                          #'value:' #'doBrowse:'
-                          #'enabled:' #hasValidSpecSelector
-                          #'argument:' #spec
-                      )
-                    ) nil
-                    nil
-                )
-            )
-             #(#MenuItem
                 #'label:' 'Help'
                 #'startGroup:' #right
                 #'submenuChannel:' #menuHelp
@@ -753,6 +743,15 @@
     self valueOfEnablingCommitButtons value: true
 ! !
 
+!HierarchicalListEditor methodsFor:'help'!
+
+defaultInfoLabel
+
+    specClass isNil ifTrue: [^'No hierarchical list class defined'].
+    ^specClass name, ' >> ', specSelector printString
+
+! !
+
 !HierarchicalListEditor methodsFor:'private'!
 
 checkMenuItemModified
@@ -1016,22 +1015,11 @@
     self valueOfEnablingCommitButtons value: false
 !
 
-doBrowse:what
+doBrowse
     "open a system browser"
 
-    |cls sel|
+    SystemBrowser openInClass: specClass class selector: specSelector
 
-    (cls := specClass) notNil 
-    ifTrue:
-    [
-        what == #class 
-        ifFalse:
-        [
-            (sel := specSelector) isNil ifTrue:[^self].
-            what == #spec ifTrue:[cls := cls class]
-        ].
-        SystemBrowser openInClass:cls selector:sel
-    ]
 !
 
 doCopy
@@ -1128,6 +1116,7 @@
                     specSelector := sel asSymbol.
                     self hasValidClass value: true.
                     isModified := true.
+                    self updateInfoLabel.
                     ^self
                 ]
             ]
@@ -1217,8 +1206,7 @@
 
     treeView root:(TreeItem name:'Root' contents:#anchor).
     treeView selection:1.
-    isModified := true
-
+    isModified := true.