SystemBrowser.st
changeset 1573 4b6ce12dff2b
parent 1561 102b90f99e58
child 1620 51341ec8360b
equal deleted inserted replaced
1572:17986c6f38bf 1573:4b6ce12dff2b
   662     "/ at the source ...
   662     "/ at the source ...
   663     (aResourceSymbol isNil and:[item isNil]) ifTrue:[
   663     (aResourceSymbol isNil and:[item isNil]) ifTrue:[
   664         searchBlock := [:class :method :s | method hasResource]
   664         searchBlock := [:class :method :s | method hasResource]
   665     ] ifFalse:[
   665     ] ifFalse:[
   666         searchBlock := [:class :method :s |
   666         searchBlock := [:class :method :s |
   667                             |src parser rsrc val found|
   667                             |rsrc val found|
   668 
   668 
   669                             found := false.
   669                             found := false.
   670                             method hasResource ifTrue:[
   670                             method hasResource ifTrue:[
   671                                 src := method source.
   671                                 rsrc := method resources.
   672                                 src isNil ifTrue:[
   672                                 rsrc notNil ifTrue:[
   673                                     found := true   "/ actually: dont know
   673                                     aResourceSymbol isNil ifTrue:[
   674                                 ] ifFalse:[
   674                                         item isNil ifTrue:[
   675                                     (src findString:'resource:') ~~ 0 ifTrue:[
   675                                             found := true
   676                                         parser := Parser
   676                                         ] ifFalse:[
   677                                                         parseMethod:src 
   677                                             rsrc isCollection ifTrue:[
   678                                                         in:class 
   678                                                 rsrc keysAndValuesDo:[:rsrc :val |
   679                                                         ignoreErrors:true 
   679                                                     val isCollection ifTrue:[
   680                                                         ignoreWarnings:true.
   680                                                         val do:[:v |
   681 
   681                                                             found := item match:v printString 
   682                                         rsrc := parser primitiveResources.
       
   683                                         rsrc notNil ifTrue:[
       
   684                                             aResourceSymbol isNil ifTrue:[
       
   685                                                 item isNil ifTrue:[
       
   686                                                     found := true
       
   687                                                 ] ifFalse:[
       
   688                                                     rsrc isCollection ifTrue:[
       
   689                                                         rsrc keysAndValuesDo:[:rsrc :val |
       
   690                                                             val isCollection ifTrue:[
       
   691                                                                 val do:[:v |
       
   692                                                                     found := item match:v printString 
       
   693                                                                 ]
       
   694                                                             ] ifFalse:[
       
   695                                                                 found := item match:val printString 
       
   696                                                             ]
       
   697                                                         ]
   682                                                         ]
   698                                                     ] ifFalse:[
   683                                                     ] ifFalse:[
   699                                                         found := item match:rsrc printString
   684                                                         found := item match:val printString 
   700                                                     ]
   685                                                     ]
   701                                                 ]
   686                                                 ]
   702                                             ] ifFalse:[
   687                                             ] ifFalse:[
   703                                                 (rsrc includesKey:aResourceSymbol) ifTrue:[
   688                                                 found := item match:rsrc printString
   704                                                     item isNil ifTrue:[
   689                                             ]
   705                                                         found := true
   690                                         ]
       
   691                                     ] ifFalse:[
       
   692                                         (rsrc includesKey:aResourceSymbol) ifTrue:[
       
   693                                             item isNil ifTrue:[
       
   694                                                 found := true
       
   695                                             ] ifFalse:[
       
   696                                                 rsrc isCollection ifTrue:[
       
   697                                                     val := rsrc at:aResourceSymbol.
       
   698                                                     val isCollection ifTrue:[
       
   699                                                         val do:[:v |
       
   700                                                             found := item match:v printString 
       
   701                                                         ]
   706                                                     ] ifFalse:[
   702                                                     ] ifFalse:[
   707                                                         rsrc isCollection ifTrue:[
   703                                                         found := item match:val printString 
   708                                                             val := rsrc at:aResourceSymbol.
       
   709                                                             val isCollection ifTrue:[
       
   710                                                                 val do:[:v |
       
   711                                                                     found := item match:v printString 
       
   712                                                                 ]
       
   713                                                             ] ifFalse:[
       
   714                                                                 found := item match:val printString 
       
   715                                                             ]
       
   716                                                         ] ifFalse:[
       
   717                                                             found := item match:rsrc printString
       
   718                                                         ]
       
   719                                                     ]
   704                                                     ]
       
   705                                                 ] ifFalse:[
       
   706                                                     found := item match:rsrc printString
   720                                                 ]
   707                                                 ]
   721                                             ]
   708                                             ]
   722                                         ]
   709                                         ]
   723                                     ]
   710                                     ]
   724                                 ].
   711                                 ].
   754         containing:'arrowButton*'
   741         containing:'arrowButton*'
   755         in:Smalltalk allClasses
   742         in:Smalltalk allClasses
   756         title:'methods with a #style resource'
   743         title:'methods with a #style resource'
   757     "
   744     "
   758 
   745 
   759     "Modified: / 27.10.1997 / 17:32:43 / cg"
   746     "Modified: / 22.4.1998 / 10:29:20 / cg"
   760 !
   747 !
   761 
   748 
   762 browseForResource:aResourceSymbol in:aCollectionOfClasses title:title
   749 browseForResource:aResourceSymbol in:aCollectionOfClasses title:title
   763     "launch a browser for all methods which have a particular (or any, ifNil)
   750     "launch a browser for all methods which have a particular (or any, ifNil)
   764      resource in aCollectionOfClasses"
   751      resource in aCollectionOfClasses"
  1935 ! !
  1922 ! !
  1936 
  1923 
  1937 !SystemBrowser class methodsFor:'documentation'!
  1924 !SystemBrowser class methodsFor:'documentation'!
  1938 
  1925 
  1939 version
  1926 version
  1940     ^ '$Header: /cvs/stx/stx/libtool/SystemBrowser.st,v 1.83 1998-04-19 15:21:39 cg Exp $'
  1927     ^ '$Header: /cvs/stx/stx/libtool/SystemBrowser.st,v 1.84 1998-04-22 08:35:39 cg Exp $'
  1941 ! !
  1928 ! !
  1942 SystemBrowser initialize!
  1929 SystemBrowser initialize!