Tools__MethodList.st
changeset 18760 7b0551a880c2
parent 18655 32e5509657e7
child 18951 cee95f803d93
equal deleted inserted replaced
18759:41e03469a04f 18760:7b0551a880c2
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 2000 by eXept Software AG
     4  COPYRIGHT (c) 2000 by eXept Software AG
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
   210                                activeHelpKey: nameFilterType
   212                                activeHelpKey: nameFilterType
   211                                uuid: '0ad3d608-d1ce-11e7-900e-c42c033b4871'
   213                                uuid: '0ad3d608-d1ce-11e7-900e-c42c033b4871'
   212                                model: nameFilterTypeHolder
   214                                model: nameFilterTypeHolder
   213                                comboList: 
   215                                comboList: 
   214                               (Array
   216                               (Array
   215                                  'Ss' 'Tt' '-Ss' '-Tt' '-'
   217                                  'Ss' 'Tt' 'Mm' '-Ss' '-Tt' '-'
   216                                  'S' '-S'
   218                                  'S' '-S'
   217                                  'T' '-T'
   219                                  'T' '-T'
       
   220                                  'M'
   218                                )
   221                                )
   219                                useIndex: false
   222                                useIndex: false
   220                                extent: (Point 45 26)
   223                                extent: (Point 45 26)
   221                              )
   224                              )
   222                             )
   225                             )
   258            )
   261            )
   259           )
   262           )
   260         
   263         
   261        )
   264        )
   262      )
   265      )
       
   266 
       
   267     "Modified: / 11-05-2019 / 11:22:02 / Claus Gittinger"
   263 ! !
   268 ! !
   264 
   269 
   265 !MethodList class methodsFor:'plugIn spec'!
   270 !MethodList class methodsFor:'plugIn spec'!
   266 
   271 
   267 aspectSelectors
   272 aspectSelectors
  1216 
  1221 
  1217     "Created: / 17-08-2011 / 15:03:34 / cg"
  1222     "Created: / 17-08-2011 / 15:03:34 / cg"
  1218 !
  1223 !
  1219 
  1224 
  1220 isNameFilterMatchingSelector:sel method:mthd
  1225 isNameFilterMatchingSelector:sel method:mthd
  1221     "true if the method matches the current nameFilter"
  1226     "true if the method matches the current nameFilter.
       
  1227      The namefilter is one of:
       
  1228         S/Ss - show methods where the selector matches / matches case ignoring
       
  1229         T/Tt - show methods containing a string with case / case ignoring
       
  1230         M/Mm - show methods sending a message with case / case ignoring
       
  1231         -xx - negation; which do not match
       
  1232     "
  1222     
  1233     
  1223     |source filterType doesMatch caseSensitive positiveMatch|
  1234     |source filterType doesMatch caseSensitive positiveMatch|
  1224     
  1235     
  1225     sel isNil ifTrue:[^ true].
  1236     sel isNil ifTrue:[^ true].
  1226     nameFilter isEmptyOrNil ifTrue:[^ true].   
  1237     nameFilter isEmptyOrNil ifTrue:[^ true].   
  1231     filterType := nameFilterTypeHolder value.
  1242     filterType := nameFilterTypeHolder value.
  1232 
  1243 
  1233     caseSensitive := true.
  1244     caseSensitive := true.
  1234     positiveMatch := true.
  1245     positiveMatch := true.
  1235     
  1246     
  1236     (#('Ss' '-Ss' 'Tt' '-Tt') includes:filterType) ifTrue:[
  1247     (#('Ss' '-Ss' 'Tt' '-Tt' 'Mm' '-Mm') includes:filterType) ifTrue:[
  1237         caseSensitive := false.
  1248         caseSensitive := false.
  1238         filterType := filterType copyButLast.
  1249         filterType := filterType copyButLast.
  1239     ].        
  1250     ].        
  1240     filterType first == $- ifTrue:[
  1251     filterType first == $- ifTrue:[
  1241         positiveMatch := false.
  1252         positiveMatch := false.
  1246         "/ selector filter
  1257         "/ selector filter
  1247         nameFilter includesMatchCharacters ifTrue:[
  1258         nameFilter includesMatchCharacters ifTrue:[
  1248             doesMatch := nameFilter match:sel caseSensitive:caseSensitive.
  1259             doesMatch := nameFilter match:sel caseSensitive:caseSensitive.
  1249         ] ifFalse:[ 
  1260         ] ifFalse:[ 
  1250             doesMatch := sel includesString:nameFilter caseSensitive:caseSensitive
  1261             doesMatch := sel includesString:nameFilter caseSensitive:caseSensitive
       
  1262         ].
       
  1263         positiveMatch ifFalse:[^ doesMatch not ].
       
  1264         ^ doesMatch
       
  1265     ].
       
  1266 
       
  1267     (filterType = 'M') ifTrue:[
       
  1268         "/ messages-sent filter
       
  1269         nameFilter includesMatchCharacters ifTrue:[
       
  1270             doesMatch := mthd messagesSent contains:[:sel |
       
  1271                                 nameFilter match:sel caseSensitive:caseSensitive.
       
  1272                          ]                        
       
  1273         ] ifFalse:[ 
       
  1274             doesMatch := mthd messagesSent contains:[:sel |
       
  1275                                 sel includesString:nameFilter caseSensitive:caseSensitive
       
  1276                          ]                        
  1251         ].
  1277         ].
  1252         positiveMatch ifFalse:[^ doesMatch not ].
  1278         positiveMatch ifFalse:[^ doesMatch not ].
  1253         ^ doesMatch
  1279         ^ doesMatch
  1254     ].
  1280     ].
  1255 
  1281 
  1270     "/ oops - unknown filterType
  1296     "/ oops - unknown filterType
  1271     ^ true
  1297     ^ true
  1272 
  1298 
  1273     "Created: / 25-11-2017 / 12:04:21 / cg"
  1299     "Created: / 25-11-2017 / 12:04:21 / cg"
  1274     "Modified: / 04-12-2017 / 23:42:12 / cg"
  1300     "Modified: / 04-12-2017 / 23:42:12 / cg"
       
  1301     "Modified: / 11-05-2019 / 12:10:44 / Claus Gittinger"
  1275 !
  1302 !
  1276 
  1303 
  1277 listOfMethodNames
  1304 listOfMethodNames
  1278     |methods entries selectorBag newNameList allClasses newClasses
  1305     |methods entries selectorBag newNameList allClasses newClasses
  1279      allCategories                  "allSelectors"
  1306      allCategories                  "allSelectors"