Tools_MethodList.st
changeset 13803 19ffa07a5538
parent 13731 102d23da3759
child 14024 877fd52ae84b
--- a/Tools_MethodList.st	Wed Feb 05 19:56:09 2014 +0100
+++ b/Tools_MethodList.st	Wed Feb 05 19:56:11 2014 +0100
@@ -20,7 +20,7 @@
 		showMethodInheritance lastMethodClass lastMethodClassesSubclasses
 		classAndSelectorsRedefinedBySubclassesOfClass showClass
 		showMethodComplexity showMethodTypeIcon
-		showImageResourceMethodsImages'
+		showImageResourceMethodsImages showSyntheticMethods'
 	classVariableNames:'ShowComplexityValue'
 	poolDictionaries:''
 	category:'Interface-Browsers-New'
@@ -164,26 +164,28 @@
      (if this app is embedded in a subCanvas)."
 
     ^ #(
-        #(doubleClickChannel action)
-        #filterClassVars
-        #forceGeneratorTrigger
-        #immediateUpdate
-        #inGeneratorHolder
-        #menuHolder
-        #methodCategoryHolder
-        #packageFilter
-        #selectedMethods
-        #selectionChangeCondition
-        #showCoverageInformation
-        #showImageResourceMethodsImages
-        #showMethodComplexity
-        #showMethodInheritance
-        #showMethodTypeIcon
-        #sortBy
-        #updateTrigger
-        #variableFilter
+	#(doubleClickChannel action)
+	#filterClassVars
+	#forceGeneratorTrigger
+	#immediateUpdate
+	#inGeneratorHolder
+	#menuHolder
+	#methodCategoryHolder
+	#packageFilter
+	#selectedMethods
+	#selectionChangeCondition
+	#showCoverageInformation
+	#showImageResourceMethodsImages
+	#showMethodComplexity
+	#showMethodInheritance
+	#showMethodTypeIcon
+	#sortBy
+	#updateTrigger
+	#variableFilter
+	#showSyntheticMethods
       ).
 
+    "Modified: / 13-04-2012 / 16:11:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !MethodList methodsFor:'aspects'!
@@ -321,6 +323,28 @@
     ].
 !
 
+showSyntheticMethods
+    showSyntheticMethods isNil ifTrue:[
+        showSyntheticMethods := false asValue.
+        showSyntheticMethods addDependent:self
+    ].
+    ^  showSyntheticMethods
+
+    "Created: / 13-04-2012 / 16:03:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+showSyntheticMethods:aValueHolder
+    showSyntheticMethods notNil ifTrue:[
+        showSyntheticMethods removeDependent:self
+    ].
+    showSyntheticMethods := aValueHolder.
+    showSyntheticMethods notNil ifTrue:[
+        showSyntheticMethods addDependent:self
+    ].
+
+    "Created: / 13-04-2012 / 16:03:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 variableFilter
     variableFilter isNil ifTrue:[
         variableFilter := nil asValue.
@@ -609,7 +633,9 @@
     (changedObject == variableFilter
     or:[changedObject == filterClassVars
     or:[changedObject == showMethodInheritance
-    or:[changedObject == showMethodComplexity]]]) ifTrue:[
+    or:[changedObject == showMethodComplexity
+    or:[changedObject == showSyntheticMethods
+    ]]]]) ifTrue:[
         self invalidateList.
         ^  self
     ].
@@ -680,8 +706,8 @@
     super delayedUpdate:something with:aParameter from:changedObject
 
     "Created: / 05-02-2000 / 13:42:14 / cg"
-    "Modified: / 22-07-2011 / 18:12:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 05-06-2012 / 23:47:15 / cg"
+    "Modified: / 24-08-2013 / 00:41:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 selectedMethodsChanged
@@ -745,11 +771,12 @@
     ].
     "/ to allow reselect, change my valueHolder, even if the same collection
 "/    self selectedMethods value ~= methods ifTrue:[
-        self selectedMethods value:methods
+        self selectedMethods value:methods asOrderedCollection
 "/    ]
 
-    "Created: / 5.2.2000 / 13:42:14 / cg"
-    "Modified: / 5.2.2000 / 23:32:20 / cg"
+    "Created: / 05-02-2000 / 13:42:14 / cg"
+    "Modified: / 05-02-2000 / 23:32:20 / cg"
+    "Modified: / 13-06-2013 / 12:19:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 selectionChangedByClick
@@ -811,8 +838,7 @@
                  deiconified -> leads to confusing behavior
                  (browser shows obsolete info)"
                 "/changedObject removeDependent:self. "/ ?????
-                listValid := false.
-                "/ self invalidateList.
+                self invalidateList.
                 ^ self
             ].
             cls := aParameter at:1.
@@ -1004,8 +1030,12 @@
     entries := OrderedCollection new.
     enforceClassAndProtocolInList := false.
     anyMethodToWatch := false.
-"/ no longer filter those
-"/    packageFilterValue := packageFilter value.
+
+    "/ no longer filter those
+    "/ JV@2013-09-17: Why on hell not? A little explanation please!!
+    "/ Enabled again, because when i select package in a browser I expect
+    "/ to see only methods belonging to that package!!
+    packageFilterValue := packageFilter value.
 
     "/ generator generates nil-selector entries
     "/ to pass multiple-class and multiple-protocol info
@@ -1028,7 +1058,7 @@
             "/ JV: Filter method through package filter
             "/ but not, if it is an extension method and we are showing extensions
             (mthd notNil 
-                and:[ mthd isSynthetic not 
+                and:[ (mthd isSynthetic not or:[showSyntheticMethods value == true])
                 and:[ sel notNil ]]
             ) ifTrue:[ 
                 (packageFilterValue isNil 
@@ -1167,12 +1197,10 @@
     "/ first generate the new methodList, and see if it is different ...
     
     entries do:[:entry | 
-        |mthd|
+        |sel mthd|
 
         mthd := entry at:3.
-        mthd notNil ifTrue:[
-            methods add:mthd.
-        ].
+        methods add:mthd.
     ].
     false "methodList = methods" "does not care for changed icons" ifTrue:[
         "/ same list
@@ -1242,9 +1270,9 @@
     ^ newNameList.
 
     "Created: / 05-02-2000 / 22:43:40 / cg"
-    "Modified: / 20-07-2010 / 11:21:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 24-08-2010 / 20:34:09 / Jan Vrany <enter your email here>"
     "Modified: / 20-07-2012 / 20:00:58 / cg"
+    "Modified (comment): / 17-09-2013 / 10:31:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 makeDependent
@@ -1332,7 +1360,7 @@
     ].
     ^ false
 
-    "Modified: / 06-09-2013 / 18:02:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 30-08-2013 / 13:46:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 methodIsInheritedFromAbove:aMethod
@@ -1512,7 +1540,16 @@
      (used when a single methods package, code or whatever changes, and a full udpate
       would be too slow)"
 
-    |mthd s idx|
+    |s idx|
+
+    s := self 
+            listEntryForMethod:aMethod 
+            selector:aMethod selector 
+            class:aMethod mclass 
+            showClass:lastShowClass 
+            showCategory:lastShowCategory
+            classFirst:lastShowClassFirst
+            suppressInheritanceInfo:false.
 
     idx := methodList identityIndexOf:aMethod.
     idx == 0 ifTrue:[
@@ -1524,16 +1561,6 @@
             ].
         ]
     ].
-
-    s := self 
-            listEntryForMethod:aMethod 
-            selector:aMethod selector 
-            class:aMethod mclass 
-            showClass:lastShowClass 
-            showCategory:lastShowCategory
-            classFirst:lastShowClassFirst
-            suppressInheritanceInfo:false.
-
     idx == 0 ifTrue:[
         "/ method was not previously shown; try to avoid a full update
         (self isMethodToBeShown:aMethod) ifTrue:[
@@ -1596,7 +1623,7 @@
     ].
 
     showClassFirst ifTrue:[
-        s := aMethod printStringForBrowserWithSelector:(selector ? 'unbound') allBold inClass:cls.
+        s := aMethod printStringForBrowserWithSelector:selector allBold inClass:cls.
         s := cls nameInBrowser , ' ' , s
     ] ifFalse:[
         s := aMethod printStringForBrowserWithSelector:selector inClass:cls.
@@ -1696,7 +1723,7 @@
             s := s , ' [' , cls name allBold , ']'.
         ]
     ].
-    showCategory ifTrue:[
+    (showCategory and:[aMethod mclass supportsMethodCategories]) ifTrue:[
         cat := aMethod category.
         cat notNil ifTrue:[
             s := s , ' {' , (cat "asText allItalic" colorizeAllWith:Color grey), '}'
@@ -1711,8 +1738,7 @@
             "/     icn := self instrumentationIcon
             "/ ].
         ].
-    ].
-    clr isNil ifTrue:[
+    ] ifFalse:[
         (ChangeSet current includesChangeForClass:cls selector:selector) ifTrue:[
             mark := self class markForBeingInChangeList.
             "/ mark := self colorizeForChangedCode:mark.
@@ -1721,6 +1747,7 @@
             "/ see changed methods in a method list (implementors...)
             s := self colorizeForChangedCode:s.
         ].
+
         (SmallTeam notNil and:[SmallTeam includesChangeForClass:cls selector:selector]) ifTrue:[
             s := (self colorizeForChangedCodeInSmallTeam:'!! '),s
         ].
@@ -1790,8 +1817,8 @@
 
     "Created: / 22-10-1996 / 19:51:00 / cg"
     "Modified: / 15-08-2009 / 13:13:32 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 17-11-2011 / 20:51:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 07-03-2012 / 19:06:09 / cg"
+    "Modified: / 16-10-2013 / 01:10:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !MethodList methodsFor:'private-watching'!
@@ -1841,10 +1868,10 @@
 !MethodList class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools_MethodList.st,v 1.94 2013-12-20 10:56:40 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools_MethodList.st,v 1.95 2014-02-05 18:56:11 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools_MethodList.st,v 1.94 2013-12-20 10:56:40 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools_MethodList.st,v 1.95 2014-02-05 18:56:11 cg Exp $'
 ! !