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 |