Tools__MethodRewriter.st
branchjv
changeset 16571 cf319f2e56d0
parent 15825 462e872a3fb6
parent 16514 0a071f68ea56
child 17136 cb908d2ba02e
equal deleted inserted replaced
16570:dc5e958a20dc 16571:cf319f2e56d0
   940     ^self rules at:self selectedRuleIndex value
   940     ^self rules at:self selectedRuleIndex value
   941 !
   941 !
   942 
   942 
   943 rules
   943 rules
   944     RBTransformationRule isNil ifTrue:[
   944     RBTransformationRule isNil ifTrue:[
   945 	Smalltalk loadPackage:'stx:goodies/refactoryBrowser/lint'.
   945         Smalltalk loadPackage:'stx:goodies/refactoryBrowser/lint'.
   946     ].
   946     ].
   947 
   947 
   948     rules isNil ifTrue:[
   948     rules isNil ifTrue:[
   949 	|knownRules separator1 separator2 separator3|
   949         |knownRules separator1 separator2 separator3|
   950 
   950 
   951 	"/ construct a pseudo list from existing transformation rules
   951         "/ construct a pseudo list from existing transformation rules
   952 	separator1 := '----------- search for:' asText colorizeAllWith:Color grey.
   952         separator1 := '----------- search for:' withColor:Color grey.
   953 	separator2 := '----------- replace by:' asText colorizeAllWith:Color grey.
   953         separator2 := '----------- replace by:' withColor:Color grey.
   954 	separator3 := '\=================================================================================\' withCRs asText colorizeAllWith:Color grey.
   954         separator3 := '\=================================================================================\' withCRs withColor:Color grey.
   955 
   955 
   956 	knownRules := OrderedCollection new.
   956         knownRules := OrderedCollection new.
   957 	(RBTransformationRule allSubclasses asNewOrderedCollection sort:[:a :b | a basicNew name < b basicNew name])
   957         (RBTransformationRule allSubclasses asNewOrderedCollection sort:[:a :b | a basicNew name < b basicNew name])
   958 	do:[:each |
   958         do:[:each |
   959 	    |rule |
   959             |rule |
   960 
   960 
   961 	    rule := each new.
   961             rule := each new.
   962 	    knownRules add:{ rule .
   962             knownRules add:{ rule .
   963 			     (rule rewriteRule searches
   963                              (rule rewriteRule searches
   964 				collectAll:[:each |
   964                                 collectAll:[:each |
   965 				    {
   965                                     {
   966 				      separator1.
   966                                       separator1.
   967 				      each searchString
   967                                       each searchString
   968 					asText backgroundColorizeAllWith:(Color red lightened lightened lightened) .
   968                                         asText backgroundColorizeAllWith:(Color red lightened lightened lightened) .
   969 				      separator2.
   969                                       separator2.
   970 				      each replaceString asText
   970                                       each replaceString asText
   971 					asText backgroundColorizeAllWith:(Color green lightened lightened lightened) .
   971                                         asText backgroundColorizeAllWith:(Color green lightened lightened lightened) .
   972 				      separator3
   972                                       separator3
   973 				    }
   973                                     }
   974 				]
   974                                 ]
   975 			     ) asStringCollection asString.
   975                              ) asStringCollection asString.
   976 			   }
   976                            }
   977 	].
   977         ].
   978 
   978 
   979 	rules := knownRules
   979         rules := knownRules
   980     ].
   980     ].
   981     ^ rules
   981     ^ rules
   982 
   982 
   983     "
   983     "
   984      self new rules
   984      self new rules
  1709 !
  1709 !
  1710 
  1710 
  1711 version_SVN
  1711 version_SVN
  1712     ^ '$Id$'
  1712     ^ '$Id$'
  1713 ! !
  1713 ! !
       
  1714