--- a/Tools__MethodRewriter.st Fri Aug 28 09:48:31 2015 +0200
+++ b/Tools__MethodRewriter.st Fri Aug 28 09:53:22 2015 +0200
@@ -79,20 +79,20 @@
templateReplaceAtIfAbsentByAtAifAbsentPut
- ^Array
- with:('Replace ','Dictionary>>#at:ifAbsent:'allBold,' by ','#at:ifAbsentPut:' allBold)
+ ^Array
+ with:('Replace ','Dictionary>>#at:ifAbsent:'allBold,' by ','#at:ifAbsentPut:' allBold)
with: '``@dictionary
at: ``@key
ifAbsent:
- [| `@temps |
- `@.statements.
- ``@dictionary at: ``@key put: ``@object]'
+ [| `@temps |
+ `@.statements.
+ ``@dictionary at: ``@key put: ``@object]'
with:'``@dictionary
at: ``@key
ifAbsentPut:
- [| `@temps |
- `@.statements.
- ``@object]'
+ [| `@temps |
+ `@.statements.
+ ``@object]'
"Created: / 12-12-2007 / 11:08:01 / janfrog"
"Modified: / 17-02-2008 / 08:35:17 / janfrog"
@@ -101,28 +101,28 @@
templateReplaceIfNilByIsNilIfTrue
- ^Array
- with:('Replace ','ifNil:' allBold,' by ','isNil ifTrue:' allBold)
- with: '``@receiver ifNil: ``@block'
- with: '``@receiver isNil ifTrue: ``@block'
+ ^Array
+ with:('Replace ','ifNil:' allBold,' by ','isNil ifTrue:' allBold)
+ with: '``@receiver ifNil: ``@block'
+ with: '``@receiver isNil ifTrue: ``@block'
"Created: / 04-07-2011 / 19:25:06 / cg"
!
templateReplaceIfNotNilByNotNilIfTrue
- ^Array
- with:('Replace ','ifNotNil:' allBold,' by ','notNil ifTrue:' allBold)
- with: '``@receiver ifNotNil: ``@block'
- with: '``@receiver notNil ifTrue: ``@block'
+ ^Array
+ with:('Replace ','ifNotNil:' allBold,' by ','notNil ifTrue:' allBold)
+ with: '``@receiver ifNotNil: ``@block'
+ with: '``@receiver notNil ifTrue: ``@block'
!
templateReplaceIsNilOrEmptyCollectionByIsEmptyOrNil
- ^Array
- with:('Replace ','isNilOrEmptyCollection' allBold,' by ','isEmptyOrNil' allBold)
- with: '``@receiver isNilOrEmptyCollection'
- with: '``@receiver isEmptyOrNil'''
+ ^Array
+ with:('Replace ','isNilOrEmptyCollection' allBold,' by ','isEmptyOrNil' allBold)
+ with: '``@receiver isNilOrEmptyCollection'
+ with: '``@receiver isEmptyOrNil'''
"Created: / 03-07-2011 / 21:59:47 / cg"
!
@@ -132,10 +132,10 @@
initials := OperatingSystem getLoginName.
- ^Array
- with:('Replace ','self halt' allBold,' by ','self breakPoint: #' allBold ,initials)
- with: 'self halt'
- with: 'self breakPoint: #',initials
+ ^Array
+ with:('Replace ','self halt' allBold,' by ','self breakPoint: #' allBold ,initials)
+ with: 'self halt'
+ with: 'self breakPoint: #',initials
"Modified: / 17-02-2008 / 08:35:09 / janfrog"
"Created: / 04-07-2011 / 17:43:46 / cg"
@@ -143,10 +143,10 @@
templateReplaceSelfHaltBySelfError
- ^Array
- with:('Replace ','self halt'allBold,' by ','self error:''was: self halt''' allBold)
- with: 'self halt'
- with: 'self error:''was: self halt'''
+ ^Array
+ with:('Replace ','self halt'allBold,' by ','self error:''was: self halt''' allBold)
+ with: 'self halt'
+ with: 'self error:''was: self halt'''
"Created: / 12-12-2007 / 11:29:51 / janfrog"
"Modified: / 17-02-2008 / 08:35:09 / janfrog"
@@ -158,13 +158,13 @@
|templateSelectors templatesHere|
- templateSelectors :=
- (self class selectors select:[:e|(e startsWith:'template')
- and:[e ~= #templates and:[e ~= #templatesSpec]]]).
+ templateSelectors :=
+ (self class selectors select:[:e|(e startsWith:'template')
+ and:[e ~= #templates and:[e ~= #templatesSpec]]]).
templatesHere := templateSelectors collect:[:e| (self perform:e) copyWith:nil ].
templatesHere := templatesHere sort:[:a :b | a first < b first].
- ^ templatesHere
+ ^ templatesHere
"
self templates
@@ -183,7 +183,7 @@
the UIHelpTool may not be able to read the specification."
"
- UIHelpTool openOnClass:Tools::MethodRewriter
+ UIHelpTool openOnClass:Tools::MethodRewriter
"
<resource: #help>
@@ -218,75 +218,75 @@
<resource: #canvas>
- ^
+ ^
#(FullSpec
name: classesSpec
- window:
+ window:
(WindowSpec
- label: 'Classes'
- name: 'Classes'
- min: (Point 10 10)
- bounds: (Rectangle 0 0 300 300)
+ label: 'Classes'
+ name: 'Classes'
+ min: (Point 10 10)
+ bounds: (Rectangle 0 0 300 300)
)
- component:
+ component:
(SpecCollection
- collection: (
- (LabelSpec
- label: 'Hint: drag''n''drop classes, methods or packages from browser'
- name: 'HintLabel'
- layout: (LayoutFrame 0 0 0 0 0 1 30 0)
- translateLabel: true
- adjust: left
- )
- (SelectionInListModelViewSpec
- name: 'ClassesList'
- layout: (LayoutFrame 0 0 30 0 0 1 -60 1)
- model: selectedClassesHolder
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- listModel: classes
- multipleSelectOk: true
- useIndex: false
- highlightMode: line
- properties:
- (PropertyListDictionary
- canDropSelector: canDropClasses:
- dropArgument: nil
- dropSelector: doDropClasses:
- dragArgument: nil
- )
- )
- (LabelSpec
- name: 'ClassInfoLabel'
- layout: (LayoutFrame 0 0 -60 1 0 1 -30 1)
- translateLabel: true
- labelChannel: classesInfoTextHolder
- adjust: left
- )
- (HorizontalPanelViewSpec
- name: 'HorizontalPanel1'
- layout: (LayoutFrame 0 0 -30 1 -16 1 0 1)
- horizontalLayout: center
- verticalLayout: center
- horizontalSpace: 3
- verticalSpace: 3
- component:
- (SpecCollection
- collection: (
- (ActionButtonSpec
- label: 'Remove Selected Classes'
- name: 'RemoveClassesButton'
- translateLabel: true
- model: removeSeletedClassesAction
- useDefaultExtent: true
- )
- )
-
- )
- keepSpaceForOSXResizeHandleH: true
- )
- )
-
+ collection: (
+ (LabelSpec
+ label: 'Hint: drag''n''drop classes, methods or packages from browser'
+ name: 'HintLabel'
+ layout: (LayoutFrame 0 0 0 0 0 1 30 0)
+ translateLabel: true
+ adjust: left
+ )
+ (SelectionInListModelViewSpec
+ name: 'ClassesList'
+ layout: (LayoutFrame 0 0 30 0 0 1 -60 1)
+ model: selectedClassesHolder
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ listModel: classes
+ multipleSelectOk: true
+ useIndex: false
+ highlightMode: line
+ properties:
+ (PropertyListDictionary
+ canDropSelector: canDropClasses:
+ dropArgument: nil
+ dropSelector: doDropClasses:
+ dragArgument: nil
+ )
+ )
+ (LabelSpec
+ name: 'ClassInfoLabel'
+ layout: (LayoutFrame 0 0 -60 1 0 1 -30 1)
+ translateLabel: true
+ labelChannel: classesInfoTextHolder
+ adjust: left
+ )
+ (HorizontalPanelViewSpec
+ name: 'HorizontalPanel1'
+ layout: (LayoutFrame 0 0 -30 1 -16 1 0 1)
+ horizontalLayout: center
+ verticalLayout: center
+ horizontalSpace: 3
+ verticalSpace: 3
+ component:
+ (SpecCollection
+ collection: (
+ (ActionButtonSpec
+ label: 'Remove Selected Classes'
+ name: 'RemoveClassesButton'
+ translateLabel: true
+ model: removeSeletedClassesAction
+ useDefaultExtent: true
+ )
+ )
+
+ )
+ keepSpaceForOSXResizeHandleH: true
+ )
+ )
+
)
)
!
@@ -305,28 +305,28 @@
<resource: #canvas>
- ^
+ ^
#(FullSpec
name: howToUseSpec
- window:
+ window:
(WindowSpec
- label: 'Classes'
- name: 'Classes'
- min: (Point 10 10)
- bounds: (Rectangle 0 0 300 300)
+ label: 'Classes'
+ name: 'Classes'
+ min: (Point 10 10)
+ bounds: (Rectangle 0 0 300 300)
)
- component:
+ component:
(SpecCollection
- collection: (
- (HTMLViewSpec
- name: 'HTMLBrowser1'
- layout: (LayoutFrame 0 0 0 0 0 1 0 1)
- model: howToUseRewriteToolURL
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- )
- )
-
+ collection: (
+ (HTMLViewSpec
+ name: 'HTMLBrowser1'
+ layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+ model: howToUseRewriteToolURL
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ )
+ )
+
)
)
!
@@ -345,89 +345,89 @@
<resource: #canvas>
- ^
+ ^
#(FullSpec
name: rulesSpec
- window:
+ window:
(WindowSpec
- label: 'Method Rewriter'
- name: 'Method Rewriter'
- min: (Point 10 10)
- bounds: (Rectangle 0 0 472 354)
+ label: 'Method Rewriter'
+ name: 'Method Rewriter'
+ min: (Point 10 10)
+ bounds: (Rectangle 0 0 472 354)
)
- component:
+ component:
(SpecCollection
- collection: (
- (VariableVerticalPanelSpec
- name: 'FindAndReplacePanel'
- layout: (LayoutFrame 0 0 0 0 0 1 -30 1)
- showHandle: true
- snapMode: both
- component:
- (SpecCollection
- collection: (
- (SelectionInListModelViewSpec
- name: 'SelectionInListModelView1'
- model: selectedRuleIndex
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- listModel: ruleNameList
- highlightMode: line
- )
- (ViewSpec
- name: 'ReplaceBox'
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Finds and Replaces With:'
- name: 'ReplaceLabel'
- layout: (LayoutFrame 0 0 0 0 0 1 20 0)
- translateLabel: true
- adjust: left
- )
- (TextEditorSpec
- name: 'ReplaceText'
- layout: (LayoutFrame 0 0 20 0 0 1 0 1)
- model: ruleSearchAndReplacePatternHolder
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- isReadOnly: true
- hasKeyboardFocusInitially: false
- )
- )
-
- )
- )
- )
-
- )
- handles: (Any 0.5 1.0)
- )
- (HorizontalPanelViewSpec
- name: 'HorizontalPanel1'
- layout: (LayoutFrame 0 0 -30 1 -16 1 0 1)
- horizontalLayout: center
- verticalLayout: center
- horizontalSpace: 3
- verticalSpace: 3
- component:
- (SpecCollection
- collection: (
- (ActionButtonSpec
- label: 'Use Rule'
- name: 'UseAsRuleButton'
- translateLabel: true
- model: useAsRuleAction
- useDefaultExtent: true
- )
- )
-
- )
- keepSpaceForOSXResizeHandleH: true
- )
- )
-
+ collection: (
+ (VariableVerticalPanelSpec
+ name: 'FindAndReplacePanel'
+ layout: (LayoutFrame 0 0 0 0 0 1 -30 1)
+ showHandle: true
+ snapMode: both
+ component:
+ (SpecCollection
+ collection: (
+ (SelectionInListModelViewSpec
+ name: 'SelectionInListModelView1'
+ model: selectedRuleIndex
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ listModel: ruleNameList
+ highlightMode: line
+ )
+ (ViewSpec
+ name: 'ReplaceBox'
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Finds and Replaces With:'
+ name: 'ReplaceLabel'
+ layout: (LayoutFrame 0 0 0 0 0 1 20 0)
+ translateLabel: true
+ adjust: left
+ )
+ (TextEditorSpec
+ name: 'ReplaceText'
+ layout: (LayoutFrame 0 0 20 0 0 1 0 1)
+ model: ruleSearchAndReplacePatternHolder
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ isReadOnly: true
+ hasKeyboardFocusInitially: false
+ )
+ )
+
+ )
+ )
+ )
+
+ )
+ handles: (Any 0.5 1.0)
+ )
+ (HorizontalPanelViewSpec
+ name: 'HorizontalPanel1'
+ layout: (LayoutFrame 0 0 -30 1 -16 1 0 1)
+ horizontalLayout: center
+ verticalLayout: center
+ horizontalSpace: 3
+ verticalSpace: 3
+ component:
+ (SpecCollection
+ collection: (
+ (ActionButtonSpec
+ label: 'Use Rule'
+ name: 'UseAsRuleButton'
+ translateLabel: true
+ model: useAsRuleAction
+ useDefaultExtent: true
+ )
+ )
+
+ )
+ keepSpaceForOSXResizeHandleH: true
+ )
+ )
+
)
)
!
@@ -446,176 +446,176 @@
<resource: #canvas>
- ^
+ ^
#(FullSpec
name: searchAndReplaceSpec
- window:
+ window:
(WindowSpec
- label: 'Method Rewriter'
- name: 'Method Rewriter'
- min: (Point 10 10)
- bounds: (Rectangle 0 0 418 294)
+ label: 'Method Rewriter'
+ name: 'Method Rewriter'
+ min: (Point 10 10)
+ bounds: (Rectangle 0 0 418 294)
)
- component:
+ component:
(SpecCollection
- collection: (
- (ViewSpec
- name: 'MethodPatternBox'
- layout: (LayoutFrame 0 0 0 0 0 1 30 0)
- component:
- (SpecCollection
- collection: (
- (CheckBoxSpec
- label: 'Method Pattern'
- name: 'CheckBox1'
- layout: (LayoutFrame 0 0 8 0 136 0 30 0)
- activeHelpKey: isMethodPattern
- model: isMethodPatternHolder
- translateLabel: true
- )
- )
-
- )
- )
- (VariableVerticalPanelSpec
- name: 'FindAndReplacePanel'
- layout: (LayoutFrame 0 0 30 0 0 1 -30 1)
- visibilityChannel: adHocFindAndReplaceVisibleHolder
- showHandle: true
- snapMode: both
- component:
- (SpecCollection
- collection: (
- (ViewSpec
- name: 'FindBox'
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Find:'
- name: 'FindLabel'
- layout: (LayoutFrame 0 0 0 0 0 1 20 0)
- translateLabel: true
- adjust: left
- )
- (TextEditorSpec
- name: 'FindText'
- layout: (LayoutFrame 0 0 20 0 0 1 0 1)
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- hasKeyboardFocusInitially: false
- postBuildCallback: postBuildFindTextView:
- )
- )
-
- )
- )
- (ViewSpec
- name: 'ReplaceBox'
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Replace with:'
- name: 'ReplaceLabel'
- layout: (LayoutFrame 0 0 0 0 0 1 20 0)
- translateLabel: true
- adjust: left
- )
- (TextEditorSpec
- name: 'ReplaceText'
- layout: (LayoutFrame 0 0 20 0 0 1 0 1)
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- hasKeyboardFocusInitially: false
- postBuildCallback: postBuildReplaceTextView:
- )
- )
-
- )
- )
- )
-
- )
- handles: (Any 0.5 1.0)
- )
- (ViewSpec
- name: 'ExecuteRuleBox'
- layout: (LayoutFrame 0 0 30 0 0 1 -30 1)
- visibilityChannel: ruleExecutionVisibleHolder
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Rule:'
- name: 'Label2'
- layout: (LayoutFrame 0 0 0 0 100 0 25 0)
- translateLabel: true
- adjust: left
- )
- (LabelSpec
- name: 'Label4'
- layout: (LayoutFrame 100 0 0 0 0 1 25 0)
- translateLabel: true
- labelChannel: ruleNameHolder
- )
- (TextEditorSpec
- name: 'TextEditor1'
- layout: (LayoutFrame 0 0 25 0 0 1 0 1)
- model: ruleSearchAndReplacePatternHolder
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- isReadOnly: true
- hasKeyboardFocusInitially: false
- )
- )
-
- )
- )
- (ViewSpec
- name: 'Box1'
- layout: (LayoutFrame 0 0 -30 1 -16 1 0 1)
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Enjoy'
- name: 'Label1'
- layout: (LayoutFrame 5 0 -25 1 255 0 -5 1)
- xxvisibilityChannel: actionInProgressHolder
- translateLabel: true
- labelChannel: infoHolder
- adjust: left
- )
- (ProgressIndicatorSpec
- name: 'ProgressIndicator1'
- layout: (LayoutFrame 260 0 -25 1 -215 1 -5 1)
- xxvisibilityChannel: actionInProgressHolder
- model: progressHolder
- )
- (ActionButtonSpec
- label: 'Search'
- name: 'Button2'
- layout: (LayoutFrame -210 1 -26 1 -110 1 -5 1)
- activeHelpKey: doSearchAction
- translateLabel: true
- model: doSearchAction
- )
- (ActionButtonSpec
- label: 'Rewrite...'
- name: 'Button1'
- layout: (LayoutFrame -105 1 -25 1 -5 1 -5 1)
- activeHelpKey: doRewriteAction
- translateLabel: true
- model: doRewriteAction
- )
- )
-
- )
- keepSpaceForOSXResizeHandleH: true
- )
- )
-
+ collection: (
+ (ViewSpec
+ name: 'MethodPatternBox'
+ layout: (LayoutFrame 0 0 0 0 0 1 30 0)
+ component:
+ (SpecCollection
+ collection: (
+ (CheckBoxSpec
+ label: 'Method Pattern'
+ name: 'CheckBox1'
+ layout: (LayoutFrame 0 0 8 0 136 0 30 0)
+ activeHelpKey: isMethodPattern
+ model: isMethodPatternHolder
+ translateLabel: true
+ )
+ )
+
+ )
+ )
+ (VariableVerticalPanelSpec
+ name: 'FindAndReplacePanel'
+ layout: (LayoutFrame 0 0 30 0 0 1 -30 1)
+ visibilityChannel: adHocFindAndReplaceVisibleHolder
+ showHandle: true
+ snapMode: both
+ component:
+ (SpecCollection
+ collection: (
+ (ViewSpec
+ name: 'FindBox'
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Find:'
+ name: 'FindLabel'
+ layout: (LayoutFrame 0 0 0 0 0 1 20 0)
+ translateLabel: true
+ adjust: left
+ )
+ (TextEditorSpec
+ name: 'FindText'
+ layout: (LayoutFrame 0 0 20 0 0 1 0 1)
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ hasKeyboardFocusInitially: false
+ postBuildCallback: postBuildFindTextView:
+ )
+ )
+
+ )
+ )
+ (ViewSpec
+ name: 'ReplaceBox'
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Replace with:'
+ name: 'ReplaceLabel'
+ layout: (LayoutFrame 0 0 0 0 0 1 20 0)
+ translateLabel: true
+ adjust: left
+ )
+ (TextEditorSpec
+ name: 'ReplaceText'
+ layout: (LayoutFrame 0 0 20 0 0 1 0 1)
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ hasKeyboardFocusInitially: false
+ postBuildCallback: postBuildReplaceTextView:
+ )
+ )
+
+ )
+ )
+ )
+
+ )
+ handles: (Any 0.5 1.0)
+ )
+ (ViewSpec
+ name: 'ExecuteRuleBox'
+ layout: (LayoutFrame 0 0 30 0 0 1 -30 1)
+ visibilityChannel: ruleExecutionVisibleHolder
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Rule:'
+ name: 'Label2'
+ layout: (LayoutFrame 0 0 0 0 100 0 25 0)
+ translateLabel: true
+ adjust: left
+ )
+ (LabelSpec
+ name: 'Label4'
+ layout: (LayoutFrame 100 0 0 0 0 1 25 0)
+ translateLabel: true
+ labelChannel: ruleNameHolder
+ )
+ (TextEditorSpec
+ name: 'TextEditor1'
+ layout: (LayoutFrame 0 0 25 0 0 1 0 1)
+ model: ruleSearchAndReplacePatternHolder
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ isReadOnly: true
+ hasKeyboardFocusInitially: false
+ )
+ )
+
+ )
+ )
+ (ViewSpec
+ name: 'Box1'
+ layout: (LayoutFrame 0 0 -30 1 -16 1 0 1)
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Enjoy'
+ name: 'Label1'
+ layout: (LayoutFrame 5 0 -25 1 255 0 -5 1)
+ xxvisibilityChannel: actionInProgressHolder
+ translateLabel: true
+ labelChannel: infoHolder
+ adjust: left
+ )
+ (ProgressIndicatorSpec
+ name: 'ProgressIndicator1'
+ layout: (LayoutFrame 260 0 -25 1 -215 1 -5 1)
+ xxvisibilityChannel: actionInProgressHolder
+ model: progressHolder
+ )
+ (ActionButtonSpec
+ label: 'Search'
+ name: 'Button2'
+ layout: (LayoutFrame -210 1 -26 1 -110 1 -5 1)
+ activeHelpKey: doSearchAction
+ translateLabel: true
+ model: doSearchAction
+ )
+ (ActionButtonSpec
+ label: 'Rewrite...'
+ name: 'Button1'
+ layout: (LayoutFrame -105 1 -25 1 -5 1 -5 1)
+ activeHelpKey: doRewriteAction
+ translateLabel: true
+ model: doRewriteAction
+ )
+ )
+
+ )
+ keepSpaceForOSXResizeHandleH: true
+ )
+ )
+
)
)
!
@@ -634,28 +634,28 @@
<resource: #canvas>
- ^
+ ^
#(FullSpec
name: searchPatternHelpSpec
- window:
+ window:
(WindowSpec
- label: 'Classes'
- name: 'Classes'
- min: (Point 10 10)
- bounds: (Rectangle 0 0 300 300)
+ label: 'Classes'
+ name: 'Classes'
+ min: (Point 10 10)
+ bounds: (Rectangle 0 0 300 300)
)
- component:
+ component:
(SpecCollection
- collection: (
- (HTMLViewSpec
- name: 'HTMLBrowser1'
- layout: (LayoutFrame 0 0 0 0 0 1 0 1)
- model: searchPatternHelpURL
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- )
- )
-
+ collection: (
+ (HTMLViewSpec
+ name: 'HTMLBrowser1'
+ layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+ model: searchPatternHelpURL
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ )
+ )
+
)
)
!
@@ -674,114 +674,114 @@
<resource: #canvas>
- ^
+ ^
#(FullSpec
name: templatesSpec
- window:
+ window:
(WindowSpec
- label: 'Method Rewriter'
- name: 'Method Rewriter'
- min: (Point 10 10)
- bounds: (Rectangle 0 0 472 354)
+ label: 'Method Rewriter'
+ name: 'Method Rewriter'
+ min: (Point 10 10)
+ bounds: (Rectangle 0 0 472 354)
)
- component:
+ component:
(SpecCollection
- collection: (
- (VariableVerticalPanelSpec
- name: 'FindAndReplacePanel'
- layout: (LayoutFrame 0 0 0 0 0 1 -30 1)
- showHandle: true
- snapMode: both
- component:
- (SpecCollection
- collection: (
- (SelectionInListModelViewSpec
- name: 'SelectionInListModelView1'
- model: selectedTemplateIndex
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- listModel: templateNameList
- highlightMode: line
- )
- (ViewSpec
- name: 'FindBox'
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Find:'
- name: 'FindLabel'
- layout: (LayoutFrame 0 0 0 0 0 1 20 0)
- translateLabel: true
- adjust: left
- )
- (TextEditorSpec
- name: 'FindText'
- layout: (LayoutFrame 0 0 20 0 0 1 0 1)
- enableChannel: templateSearchPatternIsEditable
- model: templateSearchPatternHolder
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- hasKeyboardFocusInitially: false
- )
- )
-
- )
- )
- (ViewSpec
- name: 'ReplaceBox'
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Replace With:'
- name: 'ReplaceLabel'
- layout: (LayoutFrame 0 0 0 0 0 1 20 0)
- translateLabel: true
- adjust: left
- )
- (TextEditorSpec
- name: 'ReplaceText'
- layout: (LayoutFrame 0 0 20 0 0 1 0 1)
- enableChannel: templateReplacePatternIsEditable
- model: templateReplacePatternHolder
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- hasKeyboardFocusInitially: false
- )
- )
-
- )
- )
- )
-
- )
- handles: (Any 0.20000000000000001 0.59999999999999998 1.0)
- )
- (HorizontalPanelViewSpec
- name: 'HorizontalPanel1'
- layout: (LayoutFrame 0 0 -30 1 -16 1 0 1)
- horizontalLayout: center
- verticalLayout: center
- horizontalSpace: 3
- verticalSpace: 3
- component:
- (SpecCollection
- collection: (
- (ActionButtonSpec
- label: 'Use as Template'
- name: 'UseAsTemplateButton'
- translateLabel: true
- model: useAsTemplateAction
- useDefaultExtent: true
- )
- )
-
- )
- keepSpaceForOSXResizeHandleH: true
- )
- )
-
+ collection: (
+ (VariableVerticalPanelSpec
+ name: 'FindAndReplacePanel'
+ layout: (LayoutFrame 0 0 0 0 0 1 -30 1)
+ showHandle: true
+ snapMode: both
+ component:
+ (SpecCollection
+ collection: (
+ (SelectionInListModelViewSpec
+ name: 'SelectionInListModelView1'
+ model: selectedTemplateIndex
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ listModel: templateNameList
+ highlightMode: line
+ )
+ (ViewSpec
+ name: 'FindBox'
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Find:'
+ name: 'FindLabel'
+ layout: (LayoutFrame 0 0 0 0 0 1 20 0)
+ translateLabel: true
+ adjust: left
+ )
+ (TextEditorSpec
+ name: 'FindText'
+ layout: (LayoutFrame 0 0 20 0 0 1 0 1)
+ enableChannel: templateSearchPatternIsEditable
+ model: templateSearchPatternHolder
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ hasKeyboardFocusInitially: false
+ )
+ )
+
+ )
+ )
+ (ViewSpec
+ name: 'ReplaceBox'
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Replace With:'
+ name: 'ReplaceLabel'
+ layout: (LayoutFrame 0 0 0 0 0 1 20 0)
+ translateLabel: true
+ adjust: left
+ )
+ (TextEditorSpec
+ name: 'ReplaceText'
+ layout: (LayoutFrame 0 0 20 0 0 1 0 1)
+ enableChannel: templateReplacePatternIsEditable
+ model: templateReplacePatternHolder
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ hasKeyboardFocusInitially: false
+ )
+ )
+
+ )
+ )
+ )
+
+ )
+ handles: (Any 0.20000000000000001 0.59999999999999998 1.0)
+ )
+ (HorizontalPanelViewSpec
+ name: 'HorizontalPanel1'
+ layout: (LayoutFrame 0 0 -30 1 -16 1 0 1)
+ horizontalLayout: center
+ verticalLayout: center
+ horizontalSpace: 3
+ verticalSpace: 3
+ component:
+ (SpecCollection
+ collection: (
+ (ActionButtonSpec
+ label: 'Use as Template'
+ name: 'UseAsTemplateButton'
+ translateLabel: true
+ model: useAsTemplateAction
+ useDefaultExtent: true
+ )
+ )
+
+ )
+ keepSpaceForOSXResizeHandleH: true
+ )
+ )
+
)
)
!
@@ -801,30 +801,30 @@
<resource: #canvas>
- ^
+ ^
#(FullSpec
- name: windowSpec
- window:
+ name: windowSpec
+ window:
(WindowSpec
- label: 'Method Rewriter'
- name: 'Method Rewriter'
- min: (Point 10 10)
- bounds: (Rectangle 0 0 658 490)
- )
- component:
+ label: 'Method Rewriter'
+ name: 'Method Rewriter'
+ min: (Point 10 10)
+ bounds: (Rectangle 0 0 658 490)
+ )
+ component:
(SpecCollection
- collection: (
- (NoteBookViewSpec
- name: 'NoteBook'
- layout: (LayoutFrame 0 0 0 0 0 1 0 1)
- model: selectedTabIndex
- menu: tabList
- useIndex: true
- fitLastRow: false
- )
- )
-
- )
+ collection: (
+ (NoteBookViewSpec
+ name: 'NoteBook'
+ layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+ model: selectedTabIndex
+ menu: tabList
+ useIndex: true
+ fitLastRow: false
+ )
+ )
+
+ )
)
"Modified: / 12-12-2007 / 11:39:31 / janfrog"
@@ -847,37 +847,37 @@
^ #(
(TabItem
- label: 'Search and Replace'
- createNewBuilder: false
- minorKey: searchAndReplaceSpec
- )
+ label: 'Search and Replace'
+ createNewBuilder: false
+ minorKey: searchAndReplaceSpec
+ )
(TabItem
- label: 'Classes'
- createNewBuilder: false
- minorKey: classesSpec
- )
+ label: 'Classes'
+ createNewBuilder: false
+ minorKey: classesSpec
+ )
(TabItem
- label: 'Templates'
- createNewBuilder: false
- minorKey: templatesSpec
- )
+ label: 'Templates'
+ createNewBuilder: false
+ minorKey: templatesSpec
+ )
(TabItem
- label: 'Existing Rules'
- createNewBuilder: false
- minorKey: rulesSpec
- )
+ label: 'Existing Rules'
+ createNewBuilder: false
+ minorKey: rulesSpec
+ )
(TabItem
- label: 'How To Use This Tool'
- createNewBuilder: false
- minorKey: howToUseSpec
- )
+ label: 'How To Use This Tool'
+ createNewBuilder: false
+ minorKey: howToUseSpec
+ )
(TabItem
- label: 'Pattern Info'
- createNewBuilder: false
- minorKey: searchPatternHelpSpec
- )
+ label: 'Pattern Info'
+ createNewBuilder: false
+ minorKey: searchPatternHelpSpec
+ )
)
-
+
collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]
"Modified: / 12-12-2007 / 11:21:27 / janfrog"
@@ -892,10 +892,10 @@
!
classes: aCollection
- self classes contents:((aCollection collect:[:cls|cls theNonMetaclass])
- sortBySelector:#name).
+ self classes contents:((aCollection collect:[:cls|cls theNonMetaclass])
+ sortBySelector:#name).
self classesChanged
-
+
"Created: / 20-07-2007 / 16:31:18 / janfrog"
"Modified: / 12-12-2007 / 09:47:01 / janfrog"
@@ -920,7 +920,7 @@
allClasses := OrderedCollection new.
aCollection do:[:eachPackage |
- allClasses addAll:(Smalltalk allClassesInPackage:eachPackage)
+ allClasses addAll:(Smalltalk allClassesInPackage:eachPackage)
].
self classes:allClasses.
!
@@ -944,41 +944,41 @@
rules
RBTransformationRule isNil ifTrue:[
- Smalltalk loadPackage:'stx:goodies/refactoryBrowser/lint'.
+ Smalltalk loadPackage:'stx:goodies/refactoryBrowser/lint'.
].
rules isNil ifTrue:[
- |knownRules separator1 separator2 separator3|
+ |knownRules separator1 separator2 separator3|
- "/ construct a pseudo list from existing transformation rules
- separator1 := '----------- search for:' asText colorizeAllWith:Color grey.
- separator2 := '----------- replace by:' asText colorizeAllWith:Color grey.
- separator3 := '\=================================================================================\' withCRs asText colorizeAllWith:Color grey.
+ "/ construct a pseudo list from existing transformation rules
+ separator1 := '----------- search for:' asText colorizeAllWith:Color grey.
+ separator2 := '----------- replace by:' asText colorizeAllWith:Color grey.
+ separator3 := '\=================================================================================\' withCRs asText colorizeAllWith:Color grey.
- knownRules := OrderedCollection new.
- (RBTransformationRule allSubclasses asNewOrderedCollection sort:[:a :b | a basicNew name < b basicNew name])
- do:[:each |
- |rule |
+ knownRules := OrderedCollection new.
+ (RBTransformationRule allSubclasses asNewOrderedCollection sort:[:a :b | a basicNew name < b basicNew name])
+ do:[:each |
+ |rule |
- rule := each new.
- knownRules add:{ rule .
- (rule rewriteRule searches
- collectAll:[:each |
- {
- separator1.
- each searchString
- asText backgroundColorizeAllWith:(Color red lightened lightened lightened) .
- separator2.
- each replaceString asText
- asText backgroundColorizeAllWith:(Color green lightened lightened lightened) .
- separator3
- }
- ]
- ) asStringCollection asString.
- }
- ].
+ rule := each new.
+ knownRules add:{ rule .
+ (rule rewriteRule searches
+ collectAll:[:each |
+ {
+ separator1.
+ each searchString
+ asText backgroundColorizeAllWith:(Color red lightened lightened lightened) .
+ separator2.
+ each replaceString asText
+ asText backgroundColorizeAllWith:(Color green lightened lightened lightened) .
+ separator3
+ }
+ ]
+ ) asStringCollection asString.
+ }
+ ].
- rules := knownRules
+ rules := knownRules
].
^ rules
@@ -1026,7 +1026,7 @@
templates
templates isNil ifTrue:[
- templates := self class templates.
+ templates := self class templates.
].
^ templates
@@ -1038,29 +1038,29 @@
doRewrite: methodsMatching
| changes compositeChangeCollector |
- changes := ChangeSet new name:'Rewrite Changes'.
+ changes := ChangeSet new name:'Rewrite Changes'.
- methodsMatching isEmptyOrNil ifTrue:[^Dialog warn:'No methods matching'].
+ methodsMatching isEmptyOrNil ifTrue:[^Dialog warn:(resources string:'No methods matching')].
self withMethods: methodsMatching do:[:mth|
- | rewriter newTree newSource change |
+ | rewriter newTree change |
- rewriter := ParseTreeSourceRewriter new.
- (self isMethodPatternHolder value) ifTrue:[
- rewriter replace: self searchPattern with: self replacePattern
- ] ifFalse:[
- rewriter replaceMethod: self searchPattern with: self replacePattern
- ].
- newTree := rewriter
- executeTree: mth parseTree;
- tree.
+ rewriter := ParseTreeSourceRewriter new.
+ (self isMethodPatternHolder value) ifTrue:[
+ rewriter replaceMethod: self searchPattern with: self replacePattern
+ ] ifFalse:[
+ rewriter replace: self searchPattern with: self replacePattern
+ ].
+ newTree := rewriter
+ executeTree: mth parseTree;
+ tree.
- change := InteractiveAddMethodChange compile: newTree newSource in:(mth mclass ? mth getMclass) classified:mth category.
+ change := InteractiveAddMethodChange compile: newTree newSource in:(mth mclass ? mth getMclass) classified:mth category.
- "/ collect in order to have only one change in the undo-list (instead of many)
- changes add: change.
+ "/ collect in order to have only one change in the undo-list (instead of many)
+ changes add: change.
-"/ mth mclass
+"/ mth mclass
"/ compile: newTree formattedCode
"/ classified: mth category
].
@@ -1086,16 +1086,16 @@
doRewriteAction
self replacePattern isEmptyOrNil ifTrue:[
- (Dialog confirm:'No replace-pattern given.\\Proceed to delete that code.') ifFalse:[
- AbortSignal raise
- ].
+ (Dialog confirm:'No replace-pattern given.\\Proceed to delete that code.') ifFalse:[
+ AbortSignal raise
+ ].
].
- self
- doSearchPattern: self searchPattern
- withResultDo: [:methodsMatching|
- self doRewrite: methodsMatching
- ].
+ self
+ doSearchPattern: self searchPattern
+ withResultDo: [:methodsMatching|
+ self doRewrite: methodsMatching
+ ].
"Created: / 12-12-2007 / 11:14:19 / janfrog"
"Modified: / 22-03-2012 / 18:23:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -1105,33 +1105,33 @@
|methods what|
ruleForRewriteOrNilForAdHoc notNil ifTrue:[
- self
- doSearchRule: self selectedRule
- withResultDo:[:matchingMethods|
- matchingMethods isEmpty
- ifTrue:[
- Dialog warn:'No methods found by rule: ', self selectedRule name
- ]
- ifFalse:[
- self
- showMethods: matchingMethods asArray
- title: 'Methods matching rule: ', self selectedRule name
- ]
- ]
+ self
+ doSearchRule: self selectedRule
+ withResultDo:[:matchingMethods|
+ matchingMethods isEmpty
+ ifTrue:[
+ Dialog warn:'No methods found by rule: ', self selectedRule name
+ ]
+ ifFalse:[
+ self
+ showMethods: matchingMethods asArray
+ title: 'Methods matching rule: ', self selectedRule name
+ ]
+ ]
] ifFalse:[
- self
- doSearchPattern: self searchPattern
- withResultDo:[:matchingMethods|
- matchingMethods isEmpty
- ifTrue:[
- Dialog warn:'No methods found for search pattern'
- ]
- ifFalse:[
- self
- showMethods: matchingMethods asArray
- title: 'Methods matching ', self searchPattern
- ]
- ]
+ self
+ doSearchPattern: self searchPattern
+ withResultDo:[:matchingMethods|
+ matchingMethods isEmpty
+ ifTrue:[
+ Dialog warn:'No methods found for search pattern'
+ ]
+ ifFalse:[
+ self
+ showMethods: matchingMethods asArray
+ title: 'Methods matching ', self searchPattern
+ ]
+ ]
]
"Created: / 12-12-2007 / 11:14:25 / janfrog"
@@ -1150,7 +1150,7 @@
self adHocFindAndReplaceVisibleHolder value:false.
ruleForRewriteOrNilForAdHoc := self selectedRule.
ruleNameHolder value: ruleForRewriteOrNilForAdHoc name.
-
+
self selectedTabIndex value:1
!
@@ -1168,7 +1168,7 @@
actionInProgressHolder
actionInProgressHolder isNil ifTrue:[
- actionInProgressHolder := false asValue.
+ actionInProgressHolder := false asValue.
].
^ actionInProgressHolder.
@@ -1177,14 +1177,14 @@
adHocFindAndReplaceVisibleHolder
adHocFindAndReplaceVisibleHolder isNil ifTrue:[
- adHocFindAndReplaceVisibleHolder := true asValue.
+ adHocFindAndReplaceVisibleHolder := true asValue.
].
^ adHocFindAndReplaceVisibleHolder.
!
classesInfoTextHolder
classesInfoTextHolder isNil ifTrue:[
- classesInfoTextHolder := '' asValue.
+ classesInfoTextHolder := '' asValue.
].
^ classesInfoTextHolder.
!
@@ -1195,7 +1195,7 @@
infoHolder
infoHolder isNil ifTrue:[
- infoHolder := 'Really cool tool!!' asValue.
+ infoHolder := 'Really cool tool!!' asValue.
].
^ infoHolder.
@@ -1205,14 +1205,14 @@
isMethodPatternHolder
isMethodPatternHolder isNil ifTrue:[
- isMethodPatternHolder := false asValue
+ isMethodPatternHolder := false asValue
].
^ isMethodPatternHolder.
!
progressHolder
progressHolder isNil ifTrue:[
- progressHolder := 0 asValue
+ progressHolder := 0 asValue
].
^ progressHolder.
@@ -1220,12 +1220,12 @@
!
ruleExecutionVisibleHolder
- ^ BlockValue forLogicalNot:self adHocFindAndReplaceVisibleHolder
+ ^ BlockValue forLogicalNot:self adHocFindAndReplaceVisibleHolder
!
ruleNameHolder
ruleNameHolder isNil ifTrue:[
- ruleNameHolder := '' asValue.
+ ruleNameHolder := '' asValue.
].
^ ruleNameHolder.
!
@@ -1237,7 +1237,7 @@
ruleSearchAndReplacePatternHolder
ruleSearchAndReplacePatternHolder isNil ifTrue:[
- ruleSearchAndReplacePatternHolder := '' asValue.
+ ruleSearchAndReplacePatternHolder := '' asValue.
].
^ ruleSearchAndReplacePatternHolder.
!
@@ -1248,7 +1248,7 @@
selectedClassesHolder
selectedClassesHolder isNil ifTrue:[
- selectedClassesHolder := ValueHolder new.
+ selectedClassesHolder := ValueHolder new.
].
^ selectedClassesHolder.
@@ -1258,15 +1258,15 @@
selectedRuleIndex
selectedRuleIndex isNil ifTrue:[
- selectedRuleIndex := ValueHolder new.
- selectedRuleIndex onChangeSend:#selectedRuleIndexChanged to:self.
+ selectedRuleIndex := ValueHolder new.
+ selectedRuleIndex onChangeSend:#selectedRuleIndexChanged to:self.
].
^ selectedRuleIndex.
!
selectedTabIndex
selectedTabIndex isNil ifTrue:[
- selectedTabIndex := ValueHolder new.
+ selectedTabIndex := ValueHolder new.
].
^ selectedTabIndex.
@@ -1276,8 +1276,8 @@
selectedTemplateIndex
selectedTemplateIndex isNil ifTrue:[
- selectedTemplateIndex := ValueHolder new.
- selectedTemplateIndex onChangeSend:#selectedTemplateIndexChanged to:self.
+ selectedTemplateIndex := ValueHolder new.
+ selectedTemplateIndex onChangeSend:#selectedTemplateIndexChanged to:self.
].
^ selectedTemplateIndex.
@@ -1290,7 +1290,7 @@
|list|
(list := builder bindingAt:#tabList) isNil ifTrue:[
- builder aspectAt:#tabList put:(list := self class tabList).
+ builder aspectAt:#tabList put:(list := self class tabList).
].
^ list
@@ -1306,7 +1306,7 @@
templateReplacePatternHolder
templateReplacePatternHolder isNil ifTrue:[
- templateReplacePatternHolder := '' asValue.
+ templateReplacePatternHolder := '' asValue.
].
^ templateReplacePatternHolder.
@@ -1317,14 +1317,14 @@
|holder|
(holder := builder bindingAt:#templateReplacePatternIsEditable) isNil ifTrue:[
- builder aspectAt:#templateReplacePatternIsEditable put:(holder := true asValue).
+ builder aspectAt:#templateReplacePatternIsEditable put:(holder := true asValue).
].
^ holder.
!
templateSearchPatternHolder
templateSearchPatternHolder isNil ifTrue:[
- templateSearchPatternHolder := '' asValue.
+ templateSearchPatternHolder := '' asValue.
].
^ templateSearchPatternHolder.
@@ -1335,7 +1335,7 @@
|holder|
(holder := builder bindingAt:#templateSearchPatternIsEditable) isNil ifTrue:[
- builder aspectAt:#templateSearchPatternIsEditable put:(holder := true asValue).
+ builder aspectAt:#templateSearchPatternIsEditable put:(holder := true asValue).
].
^ holder.
! !
@@ -1346,10 +1346,10 @@
cachedMethodsFromClasses := nil. "/ flush
methods := nil.
- self classesInfoTextHolder
- value:(((classes size == 1) ifTrue:['%1 class / %2 method(s)'] ifFalse:['%1 classes / %2 methods'])
- bindWith:classes size
- with:self methods size)
+ self classesInfoTextHolder
+ value:(((classes size == 1) ifTrue:['%1 class / %2 method(s)'] ifFalse:['%1 classes / %2 methods'])
+ bindWith:classes size
+ with:self methods size)
!
selectedRuleIndexChanged
@@ -1373,13 +1373,13 @@
"/ 3) replacement pattern
"/ 4) rule or nil; nil for ad-hoc rewrite
selectedTemplate fourth isNil ifTrue:[
- "/ ad hoc
- self templateReplacePatternIsEditable value:true.
- self templateSearchPatternIsEditable value:true.
+ "/ ad hoc
+ self templateReplacePatternIsEditable value:true.
+ self templateSearchPatternIsEditable value:true.
] ifFalse:[
- "/ existing rule
- self templateReplacePatternIsEditable value:false.
- self templateSearchPatternIsEditable value:false.
+ "/ existing rule
+ self templateReplacePatternIsEditable value:false.
+ self templateSearchPatternIsEditable value:false.
].
self templateSearchPatternHolder value: selectedTemplate second.
self templateReplacePatternHolder value: selectedTemplate third.
@@ -1392,11 +1392,11 @@
canDropClasses: dropContext
"I accept classes, methods and packages"
- ^dropContext dropObjects
- allSatisfy: [:obj|
- obj isClassObject
- or:[ obj isMethodObject
- or:[ obj isProjectObject ]]]
+ ^dropContext dropObjects
+ allSatisfy: [:obj|
+ obj isClassObject
+ or:[ obj isMethodObject
+ or:[ obj isProjectObject ]]]
"Created: / 20-07-2007 / 16:58:13 / janfrog"
!
@@ -1406,33 +1406,33 @@
| droppedProjects droppedClasses newClasses classesAlready|
- droppedProjects := dropContext dropObjects
- select:[:obj| obj isProjectObject]
- thenCollect:[:obj | obj theObject].
+ droppedProjects := dropContext dropObjects
+ select:[:obj| obj isProjectObject]
+ thenCollect:[:obj | obj theObject].
- droppedClasses := dropContext dropObjects
- select:[:obj| obj isClassObject or:[obj isMethodObject]]
- thenCollect:[:obj|
- |clsOrMethod|
+ droppedClasses := dropContext dropObjects
+ select:[:obj| obj isClassObject or:[obj isMethodObject]]
+ thenCollect:[:obj|
+ |clsOrMethod|
- clsOrMethod := obj theObject.
- clsOrMethod isMethod ifTrue:[
- clsOrMethod containingClass
- ] ifFalse:[
- clsOrMethod
- ]
- ] as:IdentitySet.
+ clsOrMethod := obj theObject.
+ clsOrMethod isMethod ifTrue:[
+ clsOrMethod containingClass
+ ] ifFalse:[
+ clsOrMethod
+ ]
+ ] as:IdentitySet.
droppedProjects do:[:eachPackage |
- droppedClasses addAll:(Smalltalk allClassesInPackage:eachPackage)
+ droppedClasses addAll:(Smalltalk allClassesInPackage:eachPackage)
].
classesAlready := self classes asSet.
newClasses := droppedClasses reject:[:cls | classesAlready includes:cls].
- self classes
- addAll: newClasses;
- sortBySelector:#name.
+ self classes
+ addAll: newClasses;
+ sortBySelector:#name.
self classesChanged
"Created: / 20-07-2007 / 16:58:16 / janfrog"
@@ -1469,35 +1469,35 @@
| matchingMethods |
pattern isEmptyOrNil ifTrue:[
- Dialog warn:'No searchpattern given.'.
- AbortSignal raise
+ Dialog warn:'No searchpattern given.'.
+ AbortSignal raise
].
matchingMethods := Set new.
self
- withMethodsDo:[:mthd|
- | tree searcher |
- tree := mthd parseTree.
- tree
- ifNil:[
- Transcript showCR:'MethodRewriter: parse tree error in ',mthd whoString.
- self breakPoint: #jv
- ]
- ifNotNil:[
- searcher := ParseTreeSearcher new.
- (self isMethodPatternHolder value)
- ifTrue:[
- searcher matchesMethod:pattern do:[:aNode :answer | matchingMethods add:mthd ]
- ]
- ifFalse:[
- searcher matches:pattern do:[:aNode :answer | matchingMethods add:mthd ]
- ].
- searcher executeTree: tree
- ]
- ]
- finallyDo:[
- block value: matchingMethods
- ]
+ withMethodsDo:[:mthd|
+ | tree searcher |
+ tree := mthd parseTree.
+ tree
+ ifNil:[
+ Transcript showCR:'MethodRewriter: parse tree error in ',mthd whoString.
+ self breakPoint: #jv
+ ]
+ ifNotNil:[
+ searcher := ParseTreeSearcher new.
+ (self isMethodPatternHolder value)
+ ifTrue:[
+ searcher matchesMethod:pattern do:[:aNode :answer | matchingMethods add:mthd ]
+ ]
+ ifFalse:[
+ searcher matches:pattern do:[:aNode :answer | matchingMethods add:mthd ]
+ ].
+ searcher executeTree: tree
+ ]
+ ]
+ finallyDo:[
+ block value: matchingMethods
+ ]
"Created: / 12-12-2007 / 10:34:50 / janfrog"
"Modified: / 07-04-2011 / 22:02:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -1508,40 +1508,40 @@
| matchingMethods searcher currentMethod|
rule isNil ifTrue:[
- Dialog warn:'No rule selected.'.
- AbortSignal raise
+ Dialog warn:'No rule selected.'.
+ AbortSignal raise
].
searcher := ParseTreeSearcher new.
rule rewriteRule searches do:[:eachSearch |
- searcher
- matchesTree:eachSearch searchTree
- do:[:aNode :answer |
- (eachSearch canMatch: aNode) ifTrue:[
- matchingMethods add:currentMethod
- ]
- ]
+ searcher
+ matchesTree:eachSearch searchTree
+ do:[:aNode :answer |
+ (eachSearch canMatch: aNode) ifTrue:[
+ matchingMethods add:currentMethod
+ ]
+ ]
].
matchingMethods := Set new.
self
- withMethodsDo:[:mthd|
- | tree |
+ withMethodsDo:[:mthd|
+ | tree |
- tree := mthd parseTree.
- tree
- ifNil:[
- Transcript showCR:'MethodRewriter: parse tree error in ',mthd whoString.
- self breakPoint: #jv
- ]
- ifNotNil:[
- currentMethod := mthd.
- searcher executeTree: tree
- ]
- ]
- finallyDo:[
- block value: matchingMethods
- ]
+ tree := mthd parseTree.
+ tree
+ ifNil:[
+ Transcript showCR:'MethodRewriter: parse tree error in ',mthd whoString.
+ self breakPoint: #jv
+ ]
+ ifNotNil:[
+ currentMethod := mthd.
+ searcher executeTree: tree
+ ]
+ ]
+ finallyDo:[
+ block value: matchingMethods
+ ]
"Created: / 12-12-2007 / 10:34:50 / janfrog"
"Modified: / 07-04-2011 / 22:02:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -1566,15 +1566,15 @@
methodsForClasses
cachedMethodsFromClasses isNil ifTrue:[
- cachedMethodsFromClasses :=
- (classes
- inject: OrderedCollection new
- into:[:methods :cls|
- methods
- addAll: cls methodDictionary values;
- addAll: cls class methodDictionary values;
- yourself]
- ) asArray.
+ cachedMethodsFromClasses :=
+ (classes
+ inject: OrderedCollection new
+ into:[:methods :cls|
+ methods
+ addAll: cls methodDictionary values;
+ addAll: cls class methodDictionary values;
+ yourself]
+ ) asArray.
].
^ cachedMethodsFromClasses
!
@@ -1583,16 +1583,16 @@
|methods matchingMethods|
searchPattern isEmptyOrNil ifTrue:[
- Dialog warn:'No searchpattern given'.
- AbortSignal raise
+ Dialog warn:'No searchpattern given'.
+ AbortSignal raise
].
methods := self methodsToSearchOrAbortIfNone.
matchingMethods := OrderedCollection new.
- methods do:[:mth |
- (ParseTreeSearcher new)
- matches:searchPattern do:[:aNode :answer | matchingMethods add:mth ];
- executeTree:mth parseTree.
+ methods do:[:mth |
+ (ParseTreeSearcher new)
+ matches:searchPattern do:[:aNode :answer | matchingMethods add:mth ];
+ executeTree:mth parseTree.
].
^ matchingMethods
@@ -1603,17 +1603,17 @@
|methods matchingMethods|
rule isNil ifTrue:[
- Dialog warn:'No rule given'.
- AbortSignal raise
+ Dialog warn:'No rule given'.
+ AbortSignal raise
].
methods := self methodsToSearchOrAbortIfNone.
matchingMethods := OrderedCollection new.
- methods do:[:mth |
- |searcher|
+ methods do:[:mth |
+ |searcher|
- searcher := ParseTreeSearcher new.
- rule searches halt.
+ searcher := ParseTreeSearcher new.
+ rule searches halt.
"/ matches:searchPattern do:[:aNode :answer | matchingMethods add:mth ];
"/ executeTree:mth parseTree.
].
@@ -1622,23 +1622,23 @@
methodsToSearchOrAbortIfNone
(methods := self methods) isEmptyOrNil ifTrue:[
- Dialog warn:'No methods or classes defined for search'.
- AbortSignal raise.
+ Dialog warn:'No methods or classes defined for search'.
+ AbortSignal raise.
].
^ methods
!
showMethods: methods title: title
- NewSystemBrowser
- browseMethods:methods
- title:title
- sort:true
+ NewSystemBrowser
+ browseMethods:methods
+ title:title
+ sort:true
"Created: / 21-07-2007 / 06:51:36 / janfrog"
!
-withMethods: givenMethods do: methodBlock
+withMethods: givenMethods do: methodBlock
^self withMethods: givenMethods do: methodBlock finallyDo: []
@@ -1648,27 +1648,27 @@
withMethods: methods do: methodBlock finallyDo: finallyBlock
[
- |numMethods|
+ |numMethods|
- numMethods := methods size.
+ numMethods := methods size.
- self actionInProgress: true.
- self progress: 0.
+ self actionInProgress: true.
+ self progress: 0.
- self methods asArray keysAndValuesDo:[:idx :mth|
- numMethods > 100 ifTrue:[
- self info: mth mclass name.
- ] ifFalse:[
- self info: mth selector storeString.
- ].
- methodBlock value: mth.
- self progress: ((100 / methods size) * idx) rounded
- ].
- finallyBlock value
+ methods asArray keysAndValuesDo:[:idx :mth|
+ numMethods > 100 ifTrue:[
+ self info: mth mclass name.
+ ] ifFalse:[
+ self info: mth selector storeString.
+ ].
+ methodBlock value: mth.
+ self progress: ((100 / methods size) * idx) rounded
+ ].
+ finallyBlock value
] ensure:[
- "/self actionInProgress: false.
- self progress: 0.
- self info: ''
+ "/self actionInProgress: false.
+ self progress: 0.
+ self info: ''
]
"Created: / 12-12-2007 / 10:32:16 / janfrog"
@@ -1676,10 +1676,10 @@
withMethodsDo: methodBlock finallyDo: finallyBlock
- ^self
- withMethods: self methodsToSearchOrAbortIfNone asArray
- do: methodBlock
- finallyDo: finallyBlock
+ ^self
+ withMethods: self methodsToSearchOrAbortIfNone asArray
+ do: methodBlock
+ finallyDo: finallyBlock
"Modified: / 12-12-2007 / 10:32:48 / janfrog"
! !
@@ -1696,14 +1696,13 @@
!MethodRewriter class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/Tools__MethodRewriter.st,v 1.26 2015-05-23 12:47:03 cg Exp $'
+ ^ '$Header$'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libtool/Tools__MethodRewriter.st,v 1.26 2015-05-23 12:47:03 cg Exp $'
+ ^ '$Header$'
!
version_SVN
- ^ '$Id: Tools__MethodRewriter.st,v 1.26 2015-05-23 12:47:03 cg Exp $'
+ ^ '$Id$'
! !
-