Tools__NewSystemBrowser.st
branchjv
changeset 16571 cf319f2e56d0
parent 16570 dc5e958a20dc
parent 16533 84fe5d2d72f3
child 16573 2f5cd8950dcf
--- a/Tools__NewSystemBrowser.st	Mon May 09 21:47:57 2016 +0200
+++ b/Tools__NewSystemBrowser.st	Thu May 12 08:33:55 2016 +0200
@@ -448,12 +448,16 @@
 #hideBookmarkBar
 'Hide the bookmark-bar. Show again via the "View"-menu'
 
+#infoLabelHelp
+'Display info on the just selected method, the clicked on code-fragment or the current activity'
+
 #redoOperation
 'Redo undone operation'
 
 #undoOperation
 'Undo operation'
 
+
 ).
 
     (RefactoryChangeManager notNil and:[ RefactoryChangeManager isLoaded ]) ifTrue:[
@@ -1473,6 +1477,7 @@
                          translateLabel: true
                          labelChannel: infoLabelHolder
                          adjust: left
+                         activeHelpKey: infoLabelHelp
                        )
                       (HorizontalPanelViewSpec
                          name: 'PackageInfoPanel'
@@ -1482,6 +1487,7 @@
                          horizontalSpace: 0
                          verticalSpace: 0
                          elementsChangeSize: true
+                         activeHelpKey: packageInfoLabel
                          component: 
                         (SpecCollection
                            collection: (
@@ -12669,6 +12675,11 @@
             indication: sortVariablesByName
           )
          (MenuItem
+            label: 'Group by Inheritance'
+            hideMenuOnActivated: false
+            indication: groupVariablesByInheritance
+          )
+         (MenuItem
             label: '-'
           )
          (MenuItem
@@ -18435,7 +18446,7 @@
                             cls := Smalltalk classNamed:nm.
                             cls isNil ifTrue:[
                                 "/ class no longer exists (removed?)
-                                nm colorizeAllWith:(Color gray)
+                                nm withColor:(Color gray)
                             ] ifFalse:[
                                 cls isJavaClass ifTrue:[
                                     cls javaName
@@ -19703,7 +19714,8 @@
 !
 
 selectedMethodsClasses
-    ^ (self selectedMethodsValue collect:[:m | m mclass] as:Set)
+    ^ (self selectedMethodsValue 
+        collect:[:m | m mclass] as:Set)
             select:[:each| each notNil]
 
     "Created: / 07-08-2006 / 12:13:37 / cg"
@@ -19751,24 +19763,31 @@
 !
 
 selectorListGenerator1
+    "used for the sender-/implementor-chain's first methodlist"
+    
     ^ self navigationState selectorListGeneratorArrayAt:1
 !
 
 selectorListGenerator2
+    "used for the sender-/implementor-chain's second methodlist"
+
     ^ self navigationState selectorListGeneratorArrayAt:2
 !
 
 selectorListGenerator3
+    "used for the sender-/implementor-chain's third methodlist"
+
     ^ self navigationState selectorListGeneratorArrayAt:3
 !
 
 selectorListGenerator4
+    "used for the sender-/implementor-chain's fourth methodlist"
+
     ^ self navigationState selectorListGeneratorArrayAt:4
 !
 
 selectorListGenerator5
-
-    "Used for all methods generator of ClassList. "
+    "Used for all method's generator of ClassList. "
 
     ^ self navigationState selectorListGeneratorArrayAt:5
 
@@ -20391,6 +20410,10 @@
     "Modified: / 31.10.2001 / 11:14:50 / cg"
 !
 
+groupVariablesByInheritance
+    ^ builder valueAspectFor:#groupVariablesByInheritance initialValue:true
+!
+
 hidePrivateClasses
     ^ self navigationState hidePrivateClasses
 
@@ -24939,7 +24962,9 @@
     |changeSet spec|
 
     spec := super flyByHelpSpec.
+
     changeSet := ChangeSet current.
+    "/ (changeSet contains:[:chg | chg isMethodChange and:[chg changeClass notNil]]) ifTrue:[
     (changeSet findLast:[:chg | chg isMethodChange and:[chg changeClass notNil]]) ~~ 0 ifTrue:[
         spec at:#recentChanges put:(spec at:#recentlyChangedMethods).
     ] ifFalse:[
@@ -24954,10 +24979,23 @@
     "Modified: / 08-09-2011 / 05:05:06 / cg"
 !
 
-flyByHelpTextFor:aComponent
-"/    (aComponent == builder componentAt:) ifTrue:[
-"/    ].
-    ^ super flyByHelpTextFor:aComponent
+flyByHelpTextFor:aWidget at:aPoint
+    |action info label|
+    
+    aWidget = (navigationState canvas builder componentAt:'InfoLabel') ifTrue:[
+        action := aWidget actionAt:aPoint.
+        Transcript showCR:action.
+        info := action perform:#info ifNotUnderstood:nil.
+        info notNil ifTrue:[
+            ^ info value
+        ].
+        (label := aWidget label) notNil ifTrue:[
+            (label widthOn:aWidget) > aWidget width ifTrue:[
+                ^ label
+            ]    
+        ]    
+    ].
+    ^ nil
 ! !
 
 !NewSystemBrowser methodsFor:'history'!
@@ -39384,16 +39422,16 @@
                                 ].
                                 iconifiedOrNot := ''.
                                 topView isCollapsed ifTrue:[
-                                    iconifiedOrNot := ' iconified' colorizeAllWith:Color blue.
+                                    iconifiedOrNot := ' iconified' withColor:Color blue.
                                 ].
                                 busyOrNot notEmptyOrNil ifTrue:[
-                                    busyOrNot := busyOrNot allBold colorizeAllWith:Color red
+                                    busyOrNot := busyOrNot allBold withColor:Color red
                                 ].
                                 winLabel := '  ("' , topLabel , '"',busyOrNot,iconifiedOrNot, ')'
                             ].
                         ] ifFalse:[
                             (aProcess isDebugged) ifTrue:[
-                                winLabel := ' (debug)' allBold colorizeAllWith:Color red
+                                winLabel := ' (debug)' allBold withColor:Color red
                             ].
                         ].
                         aProcess id printString , ' [' , pName , ']' , winLabel
@@ -46653,7 +46691,7 @@
 
     |method mclass mselector className mgr revisions previousMethods browser
      lastSource currentSource lastRevision lastDate lastChange lastAuthor thisIsAnExtensionMethod
-     packageId directory module|
+     packageId directory module currentVersion newestVersion|
 
     method := self theSingleSelectedMethod.
     method isNil ifTrue:[^ self].
@@ -46668,7 +46706,8 @@
         set := set select:[:c | c isMethodChange].
         lastChange := set first.
     ] value.
-
+    currentVersion := mclass revisionOfManager:manager.
+    
     thisIsAnExtensionMethod := (method isExtension).
     thisIsAnExtensionMethod ifTrue:[
         packageId := method package asPackageId.
@@ -46683,7 +46722,7 @@
     module := packageId module.
 
     self withWaitCursorDo:[
-        |revisionLog start stop answer t tS list msg first|
+        |revisionLog numRevisions stop answer t tS list msg first|
 
         thisIsAnExtensionMethod ifTrue:[
             revisionLog := mgr
@@ -46699,8 +46738,7 @@
         ].
         revisions := revisionLog at:#revisions.
 
-        start := 1.
-        stop := revisions size.
+        stop := numRevisions := revisions size.
         stop > 20 ifTrue:[
             thisIsAnExtensionMethod ifTrue:[
                 t := 500.   "/ fake time
@@ -46714,6 +46752,7 @@
                     revSourceStream close.
                 ].
             ].
+            newestVersion := revisions first at:#revision.
 
             list := revisions collect:[:entry |
                                         |rev author dateString date msg|
@@ -46728,21 +46767,19 @@
                                         rev,' ',author,' ',dateString,' ',msg
                                       ].
             msg := 'There are %1 revisions to extract from the repository'.
-            t := (t * revisions size / 1000) rounded.
+            t := (t * numRevisions / 1000) rounded.
             t < 10 ifTrue:[
                 msg := msg,'\(this will take a few seconds).'.
                 tS := t.
             ] ifFalse:[
-                t := t * revisions size // 1000 // 10 * 10.
+                t := t * numRevisions // 1000 // 10 * 10.
                 tS := (TimeDuration fromSeconds:t) printStringForApproximation.
                 msg := msg,'\(this will take roughly %2).'
             ].
             msg := msg,'\\Do you want to see all or only some of the revisions ?'.
 
             answer := Dialog
-                choose:(resources stringWithCRs:msg
-                                    with:revisions size
-                                    with:tS)
+                choose:(resources stringWithCRs:msg with:numRevisions with:tS)
                 fromList:list values:revisions initialSelection:nil
                 buttons:nil
                 values:nil
@@ -46751,16 +46788,17 @@
                 cancel:[^ self]
                 multiple:false
                 title:(resources string:'Confirmation')
-                postBuildBlock:[:dialog |
-                            |b|
-
-                            b := Button label:(resources string:'Browse Newer than Selected').
-                            b action:[ stop := (dialog componentAt:#ListView) selection. dialog okPressed].
-                            b := dialog addButton:b before:dialog okButton.
-
-                            dialog okButton label:(resources string:'Browse All').
-                            dialog okButton action:[ stop := revisions size. dialog okPressed].
-                        ].
+                postBuildBlock:
+                    [:dialog |
+                        |b|
+
+                        b := Button label:(resources string:'Browse Newer than Selected').
+                        b action:[ stop := (dialog componentAt:#ListView) selection. dialog okPressed].
+                        b := dialog addButton:b before:dialog okButton.
+
+                        dialog okButton label:(resources string:'Browse All').
+                        dialog okButton action:[ stop := revisions size. dialog okPressed].
+                    ].
 
             stop isNil ifTrue:[^ self ].
         ].
@@ -46768,11 +46806,15 @@
 t := Time millisecondsToRun:[
 
         previousMethods := ChangeSet new.
-        lastSource := currentSource := method source.
+        currentSource := method source.
+        currentVersion = newestVersion ifTrue:[
+            lastSource := currentSource.
+        ].    
         lastRevision := lastDate := lastAuthor := nil.
         first := true.
-
-        revisions from:start to:stop do:[:eachLogEntry |
+self halt.
+        "/ revisions at:1 is now the newest (may be newer than current!!)         
+        revisions from:1 to:stop do:[:eachLogEntry |
             |revision date author revSourceStream|
 
             revision := eachLogEntry at:#revision.
@@ -46782,7 +46824,7 @@
             [
                 |chg nChg classChangeSet changeSource changeName|
 
-                self activityNotification:('Fetching revision ',revision,'...').
+                self activityNotification:(resources string:'Fetching revision %1...' with:revision).
                 thisIsAnExtensionMethod ifTrue:[
                     revSourceStream := mgr
                                             streamForClass:nil
@@ -46795,7 +46837,7 @@
                     revSourceStream := mgr getSourceStreamFor:mclass revision:revision.
                 ].
                 revSourceStream isNil ifTrue:[
-                    self warn:'could not load source for ' , mclass name , ' revision ', revision,  ' from repository'.
+                    self warn:(resources string:'Could not load source for %1 revision %2 from repository' with:mclass name with:revision).
                     chg := nil.
                 ] ifFalse:[
                     classChangeSet := ChangeSet fromStream:revSourceStream.
@@ -46803,8 +46845,14 @@
                     chg := classChangeSet
                                 detect:[:chg | chg isMethodChange
                                                and:[chg selector = mselector
-                                               and:[chg className = className]]]
+                                               and:[chg fullClassName = className]]]
                                 ifNone:nil.
+                    chg isNil ifTrue:[
+                        "/ maybe the class was renamed!!
+                        (classChangeSet contains:[:chg | chg isMethodChange and:[chg selector = mselector]]) ifTrue:[
+                            self halt:'check for renamed class'.
+                        ]     
+                    ].            
                 ].
 
                 chg isNil ifTrue:[
@@ -46821,16 +46869,19 @@
                         nChg := lastChange asNamedMethodChange
                     ].
                     lastRevision isNil ifTrue:[
+                        
                         (stop = revisions size) ifTrue:[
                             changeName := 'current (not in the repository)'.
                         ] ifFalse:[
-                            "/ not showing all - dont really know
+                            "/ not showing all - don't really know
                             changeName := 'current'.
                         ].
                     ] ifFalse:[
                         changeName := lastRevision,' [',lastDate,' by ',lastAuthor,']'.
                         first ifTrue:[
-                            changeName := changeName,' (= current)'.
+                            (newestVersion compareAsVersionNumberWith:lastRevision) >= 0 ifTrue:[
+                                changeName := changeName,' (= current)'.
+                            ].    
                         ]
                     ].
                     nChg notNil ifTrue:[
@@ -46854,7 +46905,7 @@
 
         self activityNotification:nil.
         browser := (UserPreferences current changeSetBrowserClass) openOn:previousMethods.
-        browser window label:('Revisions of ' , mclass name , ' ' , mselector).
+        browser window label:(resources string:'Revisions of %1  %2' with:mclass name with:mselector).
         browser readOnly:true.
     ].
 
@@ -52848,7 +52899,7 @@
     (item notNil) ifTrue:[
         manager notNil ifTrue:[
             manager := managers anyOne.
-            item label:(resources string:'Repository') , '  ' , (manager managerTypeName asText colorizeAllWith:Color gray).
+            item label:(resources string:'Repository') , '  ' , (manager managerTypeName withColor:Color gray).
         ] ifFalse:[
             item label:(resources string:'Repository').
             item enabled: false.
@@ -52859,7 +52910,7 @@
         menu itemsDo:[:item|
             manager notNil ifTrue:[
                 item argument == manager name ifTrue:[
-                    item label: (item label , '  ' , ((resources string: '(default)') asText colorizeAllWith: Color gray)).
+                    item label: (item label , '  ' , ((resources string: '(default)') withColor: Color gray)).
                 ]
             ] ifFalse:[
                 item enabled: false
@@ -53961,10 +54012,10 @@
                                         with:aMatchString allBold
                                         with:implementors size
                                         with:classesMatchingCaseless size)
-                        fromList:({'Implementors:' colorizeAllWith:Color gray}
+                        fromList:({'Implementors:' withColor:Color gray}
                                   ,(implementors collect:[:m | m mclass name])
                                   ,'-'
-                                  ,{'Classes:' colorizeAllWith:Color gray}
+                                  ,{'Classes:' withColor:Color gray}
                                   ,classesMatchingCaseless)
                         values:(#(nil),implementors,#(nil nil),classesMatchingCaseless)
                         buttons:#('No, Search for a Class' 'Show all Implementors') 
@@ -56045,7 +56096,7 @@
                                     stringWithCRs:label,extraStringMsg 
                                     with:((string ? '') 
                                             allBold 
-                                                colorizeAllWith:Color red darkened).
+                                                withColor:Color red darkened).
                     question := question , (resources string:' - none found.').
 
                     ((selector == #findImplementors:in:ignoreCase:match:)
@@ -56125,6 +56176,7 @@
                         newBrowser methodListApp autoUpdateOnChange: false.
                     ].
                 ].
+                Transcript show:'search time: '; showCR:t.
                 ^ newBrowser.
             ].
         ].
@@ -58434,9 +58486,9 @@
 
     method isInstrumented ifTrue:[
         msg isEmpty ifTrue:[
-            msg := 'Instrumented.' colorizeAllWith:(Color green darkened).
-        ] ifFalse:[
-            msg := ('Instrumented.' colorizeAllWith:(Color green darkened)),' ',msg.
+            msg := 'Instrumented.' withColor:(Color green darkened).
+        ] ifFalse:[
+            msg := ('Instrumented.' withColor:(Color green darkened)),' ',msg.
         ].
         self showCoverageInformation value ifFalse:[
             msg := msg , ' (coverage display is turned off - see "view"-menu)'
@@ -59056,7 +59108,7 @@
                                         "/ Transcript topView raiseDeiconified.
                                         "/ Transcript showCR:'ParseError: ', ex description.
     "/ self halt.
-                                        self showInfo:(errMsg colorizeAllWith:Color red).
+                                        self showInfo:(errMsg withColor:Color red).
                                         self navigationState showingParseError:true.
                                         newCode := nil.
                                     ] do:[