Tools__NewSystemBrowser.st
changeset 17781 5cb19a5a9277
parent 17737 069bfd6d6501
child 17783 678f472d5358
--- a/Tools__NewSystemBrowser.st	Sat Nov 25 12:11:25 2017 +0100
+++ b/Tools__NewSystemBrowser.st	Sat Nov 25 12:11:56 2017 +0100
@@ -341,7 +341,11 @@
 'Search class'
 
 #selectorNameFilter
-'Show only methods with matching selectors'
+'Show only methods with matching selectors / which contain the text '
+
+#nameFilterType
+'Switch between selector- (S) and text matching (T)'
+
 #hideSelectorNameFilter
 'Hide the filter. Reopen via the "View" menu'
 
@@ -388,7 +392,7 @@
     ].
     ^ spec.
 
-    "Modified: / 09-11-2017 / 20:46:59 / cg"
+    "Modified: / 25-11-2017 / 11:55:44 / cg"
 ! !
 
 !NewSystemBrowser class methodsFor:'image specs'!
@@ -24127,9 +24131,11 @@
     self updateSpecialCodeEditorVisibility.
     self normalLabel.      "/ update my window label
     self updateLintEnablement.
+    self enqueueDelayedUpdateCodeWithoutAutoSearch.
 
     "Created: / 24-02-2000 / 22:01:46 / cg"
     "Modified: / 02-04-2014 / 12:33:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 25-11-2017 / 11:31:54 / cg"
 !
 
 classReselected
@@ -24333,8 +24339,13 @@
 !
 
 delayedUpdateCodeWithAutoSearch:withAutoSearch checkModified:checkModified
-    |methods mthd selectedClass protocol package projectDef
-     codeView code filteredVariables
+    "the central method to update what is shownin the codeview.
+     Determines what is currently selected in the navigationstate, and
+     generates either the source of a selected method, or a class definition template
+     or some synthetic comment giving a hint (usually for newcomers)"
+     
+    |methods mthd selectedClassCategory selectedClass protocol package projectDef
+     codeView code filteredVariables packages defClass
      searchAction searchPattern doShowMethodTemplate|
 
     navigationState isNil ifTrue:[^ self].
@@ -24441,14 +24452,45 @@
                         projectDef notNil ifTrue:[
                             code := projectDef commentOrDocumentationString.
                         ].
-                        self showCode:code ? ''.
                         self codeAspect:nil.
 "/                        self setAcceptActionForProjectComment.
                     ] ifFalse:[
+                        (selectedClassCategory := self theSingleSelectedCategory) notNil ifTrue:[
+                            packages := ((Smalltalk allClassesInCategory:selectedClassCategory) collect:#package) asSet.
+                            code := String streamContents:[:s |
+                                |first|
+
+                                first := true.
+                                s nextPutLine:'"'.
+                                packages size > 1 ifTrue:[
+                                    s nextPutLine:'Classes are in multiple packages.'; cr.
+                                ].    
+                                packages do:[:eachPackage|
+                                    first ifFalse:[
+                                        s cr.
+                                        s cr.
+                                    ]. 
+                                    first := false.
+                                    s nextPutAll:'Classes in package: ',eachPackage.
+                                    defClass := eachPackage asPackageId projectDefinitionClass.
+                                    defClass isNil ifTrue:[
+                                        mthd := nil.
+                                    ] ifFalse:[    
+                                        mthd := defClass theMetaclass compiledMethodAt:#documentation.
+                                    ].    
+                                    mthd isNil ifTrue:[
+                                        s cr; nextPutLine:'    Sorry, the package does not seem to provide documentation'
+                                    ] ifFalse:[
+                                        s nextPutAll:(mthd comment).
+                                    ].    
+                                ].    
+                                s nextPutLine:'"'.
+                            ].
+                        ].    
                         "/ really nothing selected
-                        self showCode:code ? ''.
                         self setAcceptActionForClass.
-                    ]
+                    ].
+                    self showCode:code ? ''.
                 ]
             ]
         ]
@@ -24457,7 +24499,7 @@
 
     codeView notNil ifTrue:[
         "/ perform an auto-search, unless the user did some other search
-        "/ in the meanwhile (i.e. the codeViews searchPattern is different from the autoSearchPattern)
+        "/ in the meanwhile (i.e. the codeView's searchPattern is different from the autoSearchPattern)
         withAutoSearch ifTrue:[
             codeView numberOfLines > 0 ifTrue:[
                 searchAction := navigationState autoSearchAction.
@@ -24504,7 +24546,7 @@
 
     "Created: / 29-08-2006 / 13:59:06 / cg"
     "Modified: / 23-07-2014 / 12:03:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 18-11-2016 / 01:41:27 / cg"
+    "Modified: / 25-11-2017 / 11:38:23 / cg"
 !
 
 delayedVariableSelectionChanged
@@ -24652,14 +24694,14 @@
 !
 
 enqueueDelayedUpdateCodeWithoutAutoSearch
-^ self delayedUpdateCodeWithAutoSearch:false.
+    "/ ^ self delayedUpdateCodeWithAutoSearch:false.
 
     ^ self
         enqueueMessage:#delayedUpdateCodeWithAutoSearch:
         for:self
         arguments:#( false )
 
-    "Modified: / 06-09-2006 / 19:07:00 / cg"
+    "Modified: / 25-11-2017 / 11:04:51 / cg"
 !
 
 enqueueDelayedUpdateExecuteMethodVisibility
@@ -58933,7 +58975,7 @@
 !
 
 theSingleSelectedCategory
-    "the current buffers single selected category;
+    "the current buffers single selected class category;
      nil if no selection or if multiple categories are selected"
 
     |categories|
@@ -58944,7 +58986,8 @@
     ].
     ^ nil
 
-    "Created: / 6.2.2000 / 01:13:21 / cg"
+    "Created: / 06-02-2000 / 01:13:21 / cg"
+    "Modified (comment): / 25-11-2017 / 11:06:54 / cg"
 !
 
 theSingleSelectedClass
@@ -59034,7 +59077,7 @@
 !
 
 theSingleSelectedProtocol
-    "return the selected protocol, but only if exactly one is selected.
+    "return the selected method protocol, but only if exactly one is selected.
      Otherwise, return nil."
 
     |selectedProtocols|
@@ -59044,7 +59087,8 @@
     ].
     ^ nil
 
-    "Modified: / 6.2.2000 / 01:02:18 / cg"
+    "Modified: / 06-02-2000 / 01:02:18 / cg"
+    "Modified (comment): / 25-11-2017 / 11:07:02 / cg"
 !
 
 theSingleSelectedSelector