SystemBrowser.st
changeset 2677 a5ef0e288aae
parent 2675 9a1138c3fe76
child 2692 652bbda35217
equal deleted inserted replaced
2676:06199a1e7dba 2677:a5ef0e288aae
  1417      instvar is modified"
  1417      instvar is modified"
  1418 
  1418 
  1419     |filter browser pattern|
  1419     |filter browser pattern|
  1420 
  1420 
  1421     filter := self filterToSearchRefsTo:varName classVars:classVars modificationsOnly:modsOnly.
  1421     filter := self filterToSearchRefsTo:varName classVars:classVars modificationsOnly:modsOnly.
  1422     browser := self browseMethodsIn:aCollectionOfClasses 
  1422     browser := self browseMethodsIn:aCollectionOfClasses inst:true class:classVars where:filter title:title.
  1423 			inst:true class:classVars where:filter title:title.
       
  1424 
  1423 
  1425     browser notNil ifTrue:[
  1424     browser notNil ifTrue:[
  1426 	modsOnly ifTrue:[
  1425         modsOnly ifTrue:[
  1427 	    pattern := varName , ' :='
  1426             pattern := varName , ' :='
  1428 	] ifFalse:[
  1427         ] ifFalse:[
  1429 	    pattern := varName
  1428             pattern := varName
  1430 	].
  1429         ].
  1431 	browser autoSearch:pattern 
  1430         browser autoSearch:pattern 
  1432     ].
  1431     ].
  1433     ^ browser
  1432     ^ browser
  1434 !
  1433 !
  1435 
  1434 
  1436 browseSuperCallsIn:aCollectionOfClasses title:title
  1435 browseSuperCallsIn:aCollectionOfClasses title:title
  1661         result
  1660         result
  1662     ].
  1661     ].
  1663     ^ searchBlock
  1662     ^ searchBlock
  1664 
  1663 
  1665     "Modified: 19.6.1997 / 18:27:57 / cg"
  1664     "Modified: 19.6.1997 / 18:27:57 / cg"
       
  1665 !
       
  1666 
       
  1667 findClassRefsTo:aString in:aCollectionOfClasses modificationsOnly:modsOnly
       
  1668     "return all methods in aClass where the classVar named
       
  1669      aString is referenced; 
       
  1670      if modsOnly is true, browse only methods where the classvar is modified"
       
  1671 
       
  1672     ^ self findRefsTo:aString classVars:true in:aCollectionOfClasses modificationsOnly:modsOnly
       
  1673 !
       
  1674 
       
  1675 findClassRefsTo:aString under:aClass modificationsOnly:modsOnly
       
  1676     "return all methods in aClass and subclasses
       
  1677      where the classVar named aString is referenced; 
       
  1678      if modsOnly is true, browse only methods where the classvar is modified"
       
  1679 
       
  1680     ^ self findClassRefsTo:aString in:(aClass withAllSubclasses) modificationsOnly:modsOnly
       
  1681 
  1666 !
  1682 !
  1667 
  1683 
  1668 findImplementorsOf:aSelectorString in:aCollectionOfClasses ignoreCase:ignoreCase
  1684 findImplementorsOf:aSelectorString in:aCollectionOfClasses ignoreCase:ignoreCase
  1669     "search for all implementors of aSelector in
  1685     "search for all implementors of aSelector in
  1670      the classes contained in aCollectionOfClasses and its metaclasses.
  1686      the classes contained in aCollectionOfClasses and its metaclasses.
  1767                                                with:SmallInteger)
  1783                                                with:SmallInteger)
  1768     "
  1784     "
  1769 
  1785 
  1770 !
  1786 !
  1771 
  1787 
       
  1788 findInstRefsTo:aString in:aCollectionOfClasses modificationsOnly:modsOnly
       
  1789     "return all methods in aClass where the instVar named
       
  1790      aString is referenced; if modsOnly is true, browse only methods where the
       
  1791      instvar is modified"
       
  1792 
       
  1793     ^ self findRefsTo:aString classVars:false in:aCollectionOfClasses modificationsOnly:modsOnly
       
  1794 !
       
  1795 
       
  1796 findInstRefsTo:aString under:aClass modificationsOnly:modsOnly
       
  1797     "return all methods in aClass and subclasses
       
  1798      where the instVar named aString is referenced; 
       
  1799      if modsOnly is true, browse only methods where the instvar is modified"
       
  1800 
       
  1801     ^ self findInstRefsTo:aString in:(aClass withAllSubclasses) modificationsOnly:modsOnly
       
  1802 !
       
  1803 
       
  1804 findRefsTo:varName classVars:classVars in:aCollectionOfClasses modificationsOnly:modsOnly
       
  1805     "return a list of all methods in aCollectionOfClasses where the instVar/classVar named
       
  1806      varName is referenced; 
       
  1807      if modsOnly is true, browse only methods where the instvar is modified"
       
  1808 
       
  1809     |filter|
       
  1810 
       
  1811     filter := self filterToSearchRefsTo:varName classVars:classVars modificationsOnly:modsOnly.
       
  1812     ^ self findMethodsIn:aCollectionOfClasses inst:true class:classVars where:filter.
       
  1813 
       
  1814     "
       
  1815      self
       
  1816         findRefsTo:'x'
       
  1817         classVars:false
       
  1818         in:(Array with:Point)
       
  1819         modificationsOnly:true
       
  1820     "
       
  1821 !
       
  1822 
  1772 findSendersOf:aSelectorString in:aCollectionOfClasses ignoreCase:ignoreCase
  1823 findSendersOf:aSelectorString in:aCollectionOfClasses ignoreCase:ignoreCase
  1773     "search for all senders of aSelector in
  1824     "search for all senders of aSelector in
  1774      the classes contained in aCollectionOfClasses and its metaclasses.
  1825      the classes contained in aCollectionOfClasses and its metaclasses.
  1775      Return a collection of methods"
  1826      Return a collection of methods"
  1776 
  1827 
  2192         title:title
  2243         title:title
  2193 
  2244 
  2194     "Modified: 24.1.1997 / 19:44:30 / cg"
  2245     "Modified: 24.1.1997 / 19:44:30 / cg"
  2195 !
  2246 !
  2196 
  2247 
  2197 browseindMethodsIn:aCollectionOfClasses where:aBlock title:title
       
  2198     "find all instance- and classmethods from classes in aCollectionOfClasses,
       
  2199      where aBlock evaluates to true.
       
  2200      The block is called with 3 arguments, class, method and seelctor."
       
  2201 
       
  2202     ^ self 
       
  2203         findMethodsIn:aCollectionOfClasses 
       
  2204         inst:true 
       
  2205         class:true 
       
  2206         where:aBlock 
       
  2207 !
       
  2208 
       
  2209 findMethodsIn:aCollectionOfClasses inst:wantInst class:wantClass where:aBlock
  2248 findMethodsIn:aCollectionOfClasses inst:wantInst class:wantClass where:aBlock
  2210     "return all instance- (if wantInst is true) and/or classmethods (if wantClass is true) 
  2249     "return all instance- (if wantInst is true) and/or classmethods (if wantClass is true) 
  2211      from classes in aCollectionOfClasses, where aBlock evaluates to true."
  2250      from classes in aCollectionOfClasses, where aBlock evaluates to true."
  2212 
  2251 
  2213     |list checkedClasses checkBlock|
  2252     |list checkedClasses checkBlock|
  2317 ! !
  2356 ! !
  2318 
  2357 
  2319 !SystemBrowser class methodsFor:'documentation'!
  2358 !SystemBrowser class methodsFor:'documentation'!
  2320 
  2359 
  2321 version
  2360 version
  2322     ^ '$Header: /cvs/stx/stx/libtool/SystemBrowser.st,v 1.105 2000-07-14 16:56:27 cg Exp $'
  2361     ^ '$Header: /cvs/stx/stx/libtool/SystemBrowser.st,v 1.106 2000-07-21 12:40:12 cg Exp $'
  2323 ! !
  2362 ! !
  2324 SystemBrowser initialize!
  2363 SystemBrowser initialize!