SystemBrowser.st
changeset 8047 8bc319ff9ba7
parent 7998 0c63e8647d1f
child 8129 9bb5ca89393a
equal deleted inserted replaced
8046:cf3c8fd63277 8047:8bc319ff9ba7
  2956 !
  2956 !
  2957 
  2957 
  2958 browseImplementorsOfAny:setOfSelectors in:aSetOfClasses
  2958 browseImplementorsOfAny:setOfSelectors in:aSetOfClasses
  2959     "launch a browser for all implementors of aSelector"
  2959     "launch a browser for all implementors of aSelector"
  2960 
  2960 
       
  2961     |title|
       
  2962 
       
  2963     setOfSelectors size == 1 ifTrue:[
       
  2964         title := self classResources 
       
  2965                 string:'Implementors of %1' 
       
  2966                 with:(setOfSelectors asOrderedCollection first).
       
  2967     ] ifFalse:[
       
  2968         setOfSelectors size == 2 ifTrue:[
       
  2969             title := self classResources 
       
  2970                     string:'Implementors of %1 or %2' 
       
  2971                     with:(setOfSelectors asOrderedCollection first)
       
  2972                     with:(setOfSelectors asOrderedCollection second).
       
  2973         ] ifFalse:[
       
  2974             title := self classResources string:'Implementors of some'.
       
  2975         ].
       
  2976     ].
       
  2977 
  2961     ^ self 
  2978     ^ self 
  2962         browseImplementorsOfAny:setOfSelectors
  2979         browseImplementorsOfAny:setOfSelectors
  2963         in:aSetOfClasses
  2980         in:aSetOfClasses
  2964         title:(self classResources string:'Implementors of some')
  2981         title:title
  2965 
  2982 
  2966     "
  2983     "
  2967      SystemBrowser browseImplementorsOf:#+ in:(Number withAllSubclasses)
  2984      SystemBrowser browseImplementorsOf:#+ in:(Number withAllSubclasses)
  2968      NewSystemBrowser browseImplementorsOf:#+ in:(Number withAllSubclasses)
  2985      NewSystemBrowser browseImplementorsOf:#+ in:(Number withAllSubclasses)
  2969     "
  2986     "
  5235 
  5252 
  5236 extractSelectorFrom:aString
  5253 extractSelectorFrom:aString
  5237     "given an arbitrary string, try to extract a useful selector.
  5254     "given an arbitrary string, try to extract a useful selector.
  5238      Useful to open browser on a selected code fragment."
  5255      Useful to open browser on a selected code fragment."
  5239 
  5256 
  5240     |s sel t|
  5257     |s sel sel2 t|
  5241 
  5258 
  5242     aString isNil ifTrue:[^ nil].
  5259     aString isNil ifTrue:[^ nil].
  5243 
  5260 
  5244     s := aString asString string.
  5261     s := aString asString string.
  5245     s := s withoutSeparators.
  5262     s := s withoutSeparators.
  5258         "oops - thats probably not what we want here ..."
  5275         "oops - thats probably not what we want here ..."
  5259         self extractClassAndSelectorFrom:s into:[:c :s :m |
  5276         self extractClassAndSelectorFrom:s into:[:c :s :m |
  5260             sel := s
  5277             sel := s
  5261         ]
  5278         ]
  5262     ].
  5279     ].
       
  5280 
       
  5281     sel asSymbolIfInterned isNil ifTrue:[
       
  5282         (sel startsWith:'#') ifTrue:[
       
  5283             sel2 := sel copyFrom:2.
       
  5284             ((sel2 startsWith:'''') and:[(sel2 endsWith:'''')]) ifTrue:[
       
  5285                 sel2 := (sel2 copyFrom:2) copyWithoutLast:1
       
  5286             ].
       
  5287             sel2 asSymbolIfInterned notNil ifTrue:[
       
  5288                 ^ sel2
       
  5289             ].
       
  5290         ].
       
  5291     ].
       
  5292 
  5263     ^ sel
  5293     ^ sel
  5264 
  5294 
  5265     "
  5295     "
  5266      self extractSelectorFrom:'at:put:'      
  5296      self extractSelectorFrom:'at:put:'      
  5267      self extractSelectorFrom:'#at:put:'                       
  5297      self extractSelectorFrom:'#at:put:'                       
  5374 ! !
  5404 ! !
  5375 
  5405 
  5376 !SystemBrowser class methodsFor:'documentation'!
  5406 !SystemBrowser class methodsFor:'documentation'!
  5377 
  5407 
  5378 version
  5408 version
  5379     ^ '$Header: /cvs/stx/stx/libtool/SystemBrowser.st,v 1.251 2008-03-08 10:58:56 cg Exp $'
  5409     ^ '$Header: /cvs/stx/stx/libtool/SystemBrowser.st,v 1.252 2008-04-04 15:31:50 cg Exp $'
  5380 ! !
  5410 ! !
  5381 
  5411 
  5382 SystemBrowser initialize!
  5412 SystemBrowser initialize!