author | Claus Gittinger <cg@exept.de> |
Tue, 05 Jul 2011 11:31:51 +0200 | |
changeset 10153 | c8677bcfda56 |
parent 10140 | 2df2dde55877 |
child 10170 | 3239c0b672eb |
permissions | -rw-r--r-- |
9988 | 1 |
" |
10097 | 2 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
3 |
Copyright (c) 2009-2010 eXept Software AG |
|
9988 | 4 |
|
10097 | 5 |
Permission is hereby granted, free of charge, to any person |
6 |
obtaining a copy of this software and associated documentation |
|
7 |
files (the 'Software'), to deal in the Software without |
|
8 |
restriction, including without limitation the rights to use, |
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10 |
copies of the Software, and to permit persons to whom the |
|
11 |
Software is furnished to do so, subject to the following |
|
12 |
conditions: |
|
13 |
||
14 |
The above copyright notice and this permission notice shall be |
|
15 |
included in all copies or substantial portions of the Software. |
|
16 |
||
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
24 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9988 | 25 |
" |
26 |
"{ Package: 'stx:libtool' }" |
|
8776 | 27 |
|
28 |
"{ NameSpace: Tools }" |
|
29 |
||
30 |
ApplicationModel subclass:#MethodRewriter |
|
10126 | 31 |
instanceVariableNames:'replaceTextView classes searchTextView actionInProgresHolder |
32 |
infoHolder progressHolder templateSearchPatternHolder |
|
33 |
templateReplacePatternHolder selectedTemplateIndex templates |
|
34 |
selectedTabIndex selectedClassesHolder' |
|
35 |
classVariableNames:'' |
|
36 |
poolDictionaries:'' |
|
37 |
category:'Interface-MethodRewriter' |
|
8776 | 38 |
! |
39 |
||
9988 | 40 |
!MethodRewriter class methodsFor:'documentation'! |
41 |
||
42 |
copyright |
|
43 |
" |
|
10097 | 44 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
45 |
Copyright (c) 2009-2010 eXept Software AG |
|
46 |
||
47 |
Permission is hereby granted, free of charge, to any person |
|
48 |
obtaining a copy of this software and associated documentation |
|
49 |
files (the 'Software'), to deal in the Software without |
|
50 |
restriction, including without limitation the rights to use, |
|
51 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
52 |
copies of the Software, and to permit persons to whom the |
|
53 |
Software is furnished to do so, subject to the following |
|
54 |
conditions: |
|
9988 | 55 |
|
10097 | 56 |
The above copyright notice and this permission notice shall be |
57 |
included in all copies or substantial portions of the Software. |
|
58 |
||
59 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
60 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
61 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
62 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
63 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
64 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
65 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
66 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9988 | 67 |
" |
68 |
! ! |
|
8776 | 69 |
|
10126 | 70 |
!MethodRewriter class methodsFor:'example templates'! |
8776 | 71 |
|
72 |
templateReplaceAtIfAbsentByAtAifAbsentPut |
|
73 |
||
74 |
^Array |
|
10126 | 75 |
with:('Replace ','Dictionary>>#at:ifAbsent:'allBold,' by ','#at:ifAbsentPut:' allBold) |
8776 | 76 |
with: '``@dictionary |
77 |
at: ``@key |
|
78 |
ifAbsent: |
|
79 |
[| `@temps | |
|
80 |
`@.statements. |
|
81 |
``@dictionary at: ``@key put: ``@object]' |
|
82 |
with:'``@dictionary |
|
83 |
at: ``@key |
|
84 |
ifAbsentPut: |
|
85 |
[| `@temps | |
|
86 |
`@.statements. |
|
87 |
``@object]' |
|
88 |
||
89 |
"Created: / 12-12-2007 / 11:08:01 / janfrog" |
|
90 |
"Modified: / 17-02-2008 / 08:35:17 / janfrog" |
|
10126 | 91 |
"Modified: / 04-07-2011 / 17:41:21 / cg" |
8776 | 92 |
! |
93 |
||
10140
2df2dde55877
added: #templateReplaceIfNilByIsNilIfTrue
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
94 |
templateReplaceIfNilByIsNilIfTrue |
2df2dde55877
added: #templateReplaceIfNilByIsNilIfTrue
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
95 |
|
2df2dde55877
added: #templateReplaceIfNilByIsNilIfTrue
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
96 |
^Array |
2df2dde55877
added: #templateReplaceIfNilByIsNilIfTrue
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
97 |
with:('Replace ','ifNil:' allBold,' by ','isNil ifTrue:' allBold) |
10153 | 98 |
with: '``@receiver ifNil: ``@block' |
99 |
with: '``@receiver isNil ifTrue: ``@block' |
|
10140
2df2dde55877
added: #templateReplaceIfNilByIsNilIfTrue
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
100 |
|
2df2dde55877
added: #templateReplaceIfNilByIsNilIfTrue
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
101 |
"Created: / 04-07-2011 / 19:25:06 / cg" |
2df2dde55877
added: #templateReplaceIfNilByIsNilIfTrue
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
102 |
! |
2df2dde55877
added: #templateReplaceIfNilByIsNilIfTrue
Claus Gittinger <cg@exept.de>
parents:
10128
diff
changeset
|
103 |
|
10111
97f2db2aca32
added: #templateReplaceIsNilOrEmptyCollectionByIsEmptyOrNil
Claus Gittinger <cg@exept.de>
parents:
10110
diff
changeset
|
104 |
templateReplaceIsNilOrEmptyCollectionByIsEmptyOrNil |
97f2db2aca32
added: #templateReplaceIsNilOrEmptyCollectionByIsEmptyOrNil
Claus Gittinger <cg@exept.de>
parents:
10110
diff
changeset
|
105 |
|
97f2db2aca32
added: #templateReplaceIsNilOrEmptyCollectionByIsEmptyOrNil
Claus Gittinger <cg@exept.de>
parents:
10110
diff
changeset
|
106 |
^Array |
10126 | 107 |
with:('Replace ','isNilOrEmptyCollection' allBold,' by ','isEmptyOrNil' allBold) |
10153 | 108 |
with: '``@receiver isNilOrEmptyCollection' |
109 |
with: '``@receiver isEmptyOrNil''' |
|
10111
97f2db2aca32
added: #templateReplaceIsNilOrEmptyCollectionByIsEmptyOrNil
Claus Gittinger <cg@exept.de>
parents:
10110
diff
changeset
|
110 |
|
97f2db2aca32
added: #templateReplaceIsNilOrEmptyCollectionByIsEmptyOrNil
Claus Gittinger <cg@exept.de>
parents:
10110
diff
changeset
|
111 |
"Created: / 03-07-2011 / 21:59:47 / cg" |
97f2db2aca32
added: #templateReplaceIsNilOrEmptyCollectionByIsEmptyOrNil
Claus Gittinger <cg@exept.de>
parents:
10110
diff
changeset
|
112 |
! |
97f2db2aca32
added: #templateReplaceIsNilOrEmptyCollectionByIsEmptyOrNil
Claus Gittinger <cg@exept.de>
parents:
10110
diff
changeset
|
113 |
|
10128
4bd98e161a68
added: #templateReplaceSelfHaltBySelfBreakPoint
Claus Gittinger <cg@exept.de>
parents:
10126
diff
changeset
|
114 |
templateReplaceSelfHaltBySelfBreakPoint |
4bd98e161a68
added: #templateReplaceSelfHaltBySelfBreakPoint
Claus Gittinger <cg@exept.de>
parents:
10126
diff
changeset
|
115 |
|initials| |
4bd98e161a68
added: #templateReplaceSelfHaltBySelfBreakPoint
Claus Gittinger <cg@exept.de>
parents:
10126
diff
changeset
|
116 |
|
4bd98e161a68
added: #templateReplaceSelfHaltBySelfBreakPoint
Claus Gittinger <cg@exept.de>
parents:
10126
diff
changeset
|
117 |
initials := OperatingSystem getLoginName. |
4bd98e161a68
added: #templateReplaceSelfHaltBySelfBreakPoint
Claus Gittinger <cg@exept.de>
parents:
10126
diff
changeset
|
118 |
|
4bd98e161a68
added: #templateReplaceSelfHaltBySelfBreakPoint
Claus Gittinger <cg@exept.de>
parents:
10126
diff
changeset
|
119 |
^Array |
4bd98e161a68
added: #templateReplaceSelfHaltBySelfBreakPoint
Claus Gittinger <cg@exept.de>
parents:
10126
diff
changeset
|
120 |
with:('Replace ','self halt' allBold,' by ','self breakPoint: #' allBold ,initials) |
4bd98e161a68
added: #templateReplaceSelfHaltBySelfBreakPoint
Claus Gittinger <cg@exept.de>
parents:
10126
diff
changeset
|
121 |
with: 'self halt' |
4bd98e161a68
added: #templateReplaceSelfHaltBySelfBreakPoint
Claus Gittinger <cg@exept.de>
parents:
10126
diff
changeset
|
122 |
with: 'self breakPoint: #',initials |
4bd98e161a68
added: #templateReplaceSelfHaltBySelfBreakPoint
Claus Gittinger <cg@exept.de>
parents:
10126
diff
changeset
|
123 |
|
4bd98e161a68
added: #templateReplaceSelfHaltBySelfBreakPoint
Claus Gittinger <cg@exept.de>
parents:
10126
diff
changeset
|
124 |
"Modified: / 17-02-2008 / 08:35:09 / janfrog" |
4bd98e161a68
added: #templateReplaceSelfHaltBySelfBreakPoint
Claus Gittinger <cg@exept.de>
parents:
10126
diff
changeset
|
125 |
"Created: / 04-07-2011 / 17:43:46 / cg" |
4bd98e161a68
added: #templateReplaceSelfHaltBySelfBreakPoint
Claus Gittinger <cg@exept.de>
parents:
10126
diff
changeset
|
126 |
! |
4bd98e161a68
added: #templateReplaceSelfHaltBySelfBreakPoint
Claus Gittinger <cg@exept.de>
parents:
10126
diff
changeset
|
127 |
|
8776 | 128 |
templateReplaceSelfHaltBySelfError |
129 |
||
130 |
^Array |
|
10126 | 131 |
with:('Replace ','self halt'allBold,' by ','self error:''was: self halt''' allBold) |
8776 | 132 |
with: 'self halt' |
133 |
with: 'self error:''was: self error''' |
|
134 |
||
135 |
"Created: / 12-12-2007 / 11:29:51 / janfrog" |
|
136 |
"Modified: / 17-02-2008 / 08:35:09 / janfrog" |
|
10126 | 137 |
"Modified: / 04-07-2011 / 17:41:33 / cg" |
8776 | 138 |
! |
139 |
||
140 |
templates |
|
141 |
||
142 |
|templateSelectors| |
|
143 |
||
144 |
templateSelectors := |
|
145 |
(self class selectors select:[:e|(e startsWith:'template') |
|
146 |
and:[e ~= #templates and:[e ~= #templatesSpec]]]). |
|
147 |
^templateSelectors |
|
148 |
collect:[:e|self perform:e] |
|
149 |
||
150 |
" |
|
151 |
self templates |
|
152 |
" |
|
153 |
||
154 |
"Created: / 12-12-2007 / 11:03:32 / janfrog" |
|
155 |
! ! |
|
156 |
||
157 |
!MethodRewriter class methodsFor:'interface specs'! |
|
158 |
||
159 |
classesSpec |
|
160 |
"This resource specification was automatically generated |
|
161 |
by the UIPainter of ST/X." |
|
162 |
||
163 |
"Do not manually edit this!! If it is corrupted, |
|
164 |
the UIPainter may not be able to read the specification." |
|
165 |
||
166 |
" |
|
167 |
UIPainter new openOnClass:Tools::MethodRewriter andSelector:#classesSpec |
|
168 |
Tools::MethodRewriter new openInterface:#classesSpec |
|
169 |
" |
|
170 |
||
171 |
<resource: #canvas> |
|
172 |
||
173 |
^ |
|
174 |
#(FullSpec |
|
175 |
name: classesSpec |
|
176 |
window: |
|
177 |
(WindowSpec |
|
178 |
label: 'Classes' |
|
179 |
name: 'Classes' |
|
180 |
min: (Point 10 10) |
|
181 |
bounds: (Rectangle 0 0 300 300) |
|
182 |
) |
|
183 |
component: |
|
184 |
(SpecCollection |
|
185 |
collection: ( |
|
186 |
(LabelSpec |
|
187 |
label: 'Hint: drag''n''drop classes from browser' |
|
188 |
name: 'HintLabel' |
|
189 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
190 |
translateLabel: true |
|
191 |
adjust: left |
|
192 |
) |
|
193 |
(SelectionInListModelViewSpec |
|
194 |
name: 'ClassesList' |
|
195 |
layout: (LayoutFrame 0 0 30 0 0 1 -30 1) |
|
196 |
model: selectedClassesHolder |
|
197 |
hasHorizontalScrollBar: true |
|
198 |
hasVerticalScrollBar: true |
|
199 |
listModel: classes |
|
200 |
multipleSelectOk: true |
|
201 |
useIndex: false |
|
202 |
highlightMode: line |
|
203 |
properties: |
|
204 |
(PropertyListDictionary |
|
205 |
dragArgument: nil |
|
206 |
dropArgument: nil |
|
207 |
canDropSelector: canDropClasses: |
|
208 |
dropSelector: doDropClasses: |
|
209 |
) |
|
210 |
) |
|
211 |
(ActionButtonSpec |
|
212 |
label: 'Remove selected classes' |
|
213 |
name: 'RemoveClassesButton' |
|
214 |
layout: (LayoutFrame 5 0 -25 1 -5 1 -5 1) |
|
215 |
translateLabel: true |
|
216 |
model: removeSeletedClassesAction |
|
217 |
) |
|
218 |
) |
|
219 |
||
220 |
) |
|
221 |
) |
|
222 |
||
223 |
"Modified: / 12-12-2007 / 12:07:17 / janfrog" |
|
224 |
! |
|
225 |
||
226 |
searchAndReplaceSpec |
|
227 |
"This resource specification was automatically generated |
|
228 |
by the UIPainter of ST/X." |
|
229 |
||
230 |
"Do not manually edit this!! If it is corrupted, |
|
231 |
the UIPainter may not be able to read the specification." |
|
232 |
||
233 |
" |
|
234 |
UIPainter new openOnClass:Tools::MethodRewriter andSelector:#searchAndReplaceSpec |
|
235 |
Tools::MethodRewriter new openInterface:#searchAndReplaceSpec |
|
236 |
" |
|
237 |
||
238 |
<resource: #canvas> |
|
239 |
||
240 |
^ |
|
241 |
#(FullSpec |
|
242 |
name: searchAndReplaceSpec |
|
243 |
window: |
|
244 |
(WindowSpec |
|
245 |
label: 'Method Rewriter' |
|
246 |
name: 'Method Rewriter' |
|
247 |
min: (Point 10 10) |
|
248 |
bounds: (Rectangle 0 0 418 294) |
|
249 |
) |
|
250 |
component: |
|
251 |
(SpecCollection |
|
252 |
collection: ( |
|
253 |
(VariableVerticalPanelSpec |
|
254 |
name: 'FindAndReplacePanel' |
|
255 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1) |
|
256 |
showHandle: true |
|
257 |
snapMode: both |
|
258 |
component: |
|
259 |
(SpecCollection |
|
260 |
collection: ( |
|
261 |
(ViewSpec |
|
262 |
name: 'FindBox' |
|
263 |
component: |
|
264 |
(SpecCollection |
|
265 |
collection: ( |
|
266 |
(LabelSpec |
|
267 |
label: 'Find:' |
|
268 |
name: 'FindLabel' |
|
269 |
layout: (LayoutFrame 0 0 0 0 0 1 20 0) |
|
270 |
translateLabel: true |
|
271 |
adjust: left |
|
272 |
) |
|
273 |
(TextEditorSpec |
|
274 |
name: 'FindText' |
|
275 |
layout: (LayoutFrame 0 0 20 0 0 1 0 1) |
|
276 |
hasHorizontalScrollBar: true |
|
277 |
hasVerticalScrollBar: true |
|
278 |
postBuildCallback: postBuildFindTextView: |
|
279 |
) |
|
280 |
) |
|
281 |
||
282 |
) |
|
283 |
) |
|
284 |
(ViewSpec |
|
285 |
name: 'ReplaceBox' |
|
286 |
component: |
|
287 |
(SpecCollection |
|
288 |
collection: ( |
|
289 |
(LabelSpec |
|
290 |
label: 'Replace with:' |
|
291 |
name: 'ReplaceLabel' |
|
292 |
layout: (LayoutFrame 0 0 0 0 0 1 20 0) |
|
293 |
translateLabel: true |
|
294 |
adjust: left |
|
295 |
) |
|
296 |
(TextEditorSpec |
|
297 |
name: 'ReplaceText' |
|
298 |
layout: (LayoutFrame 0 0 20 0 0 1 0 1) |
|
299 |
hasHorizontalScrollBar: true |
|
300 |
hasVerticalScrollBar: true |
|
301 |
postBuildCallback: postBuildReplaceTextView: |
|
302 |
) |
|
303 |
) |
|
304 |
||
305 |
) |
|
306 |
) |
|
307 |
) |
|
308 |
||
309 |
) |
|
310 |
handles: (Any 0.5 1.0) |
|
311 |
) |
|
312 |
(LabelSpec |
|
313 |
label: 'Enjoy' |
|
314 |
name: 'InfoLabel' |
|
315 |
layout: (LayoutFrame 5 0 -25 1 205 0 -5 1) |
|
316 |
visibilityChannel: actionInProgresHolder |
|
317 |
translateLabel: true |
|
318 |
labelChannel: infoHolder |
|
319 |
adjust: left |
|
320 |
) |
|
321 |
(ProgressIndicatorSpec |
|
322 |
name: 'ProgressIndicator' |
|
323 |
layout: (LayoutFrame 210 0 -25 1 -215 1 -5 1) |
|
324 |
visibilityChannel: actionInProgresHolder |
|
325 |
model: progressHolder |
|
326 |
) |
|
327 |
(ActionButtonSpec |
|
328 |
label: 'Search' |
|
329 |
name: 'SearchButton' |
|
330 |
layout: (LayoutFrame -210 1 -25 1 -110 1 -5 1) |
|
331 |
translateLabel: true |
|
332 |
model: doSearchAction |
|
333 |
) |
|
334 |
(ActionButtonSpec |
|
335 |
label: 'Rewrite' |
|
336 |
name: 'RewriteButton' |
|
337 |
layout: (LayoutFrame -105 1 -25 1 -5 1 -5 1) |
|
338 |
translateLabel: true |
|
339 |
model: doRewriteAction |
|
340 |
) |
|
341 |
) |
|
342 |
||
343 |
) |
|
344 |
) |
|
345 |
||
346 |
"Modified: / 12-12-2007 / 11:15:58 / janfrog" |
|
347 |
! |
|
348 |
||
349 |
templatesSpec |
|
350 |
"This resource specification was automatically generated |
|
351 |
by the UIPainter of ST/X." |
|
352 |
||
353 |
"Do not manually edit this!! If it is corrupted, |
|
354 |
the UIPainter may not be able to read the specification." |
|
355 |
||
356 |
" |
|
357 |
UIPainter new openOnClass:Tools::MethodRewriter andSelector:#templatesSpec |
|
358 |
Tools::MethodRewriter new openInterface:#templatesSpec |
|
359 |
" |
|
360 |
||
361 |
<resource: #canvas> |
|
362 |
||
363 |
^ |
|
364 |
#(FullSpec |
|
365 |
name: templatesSpec |
|
366 |
window: |
|
367 |
(WindowSpec |
|
368 |
label: 'Method Rewriter' |
|
369 |
name: 'Method Rewriter' |
|
370 |
min: (Point 10 10) |
|
371 |
bounds: (Rectangle 0 0 472 354) |
|
372 |
) |
|
373 |
component: |
|
374 |
(SpecCollection |
|
375 |
collection: ( |
|
376 |
(VariableVerticalPanelSpec |
|
377 |
name: 'FindAndReplacePanel' |
|
378 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1) |
|
379 |
showHandle: true |
|
380 |
snapMode: both |
|
381 |
component: |
|
382 |
(SpecCollection |
|
383 |
collection: ( |
|
384 |
(SelectionInListModelViewSpec |
|
385 |
name: 'SelectionInListModelView1' |
|
386 |
model: selectedTemplateIndex |
|
387 |
hasHorizontalScrollBar: true |
|
388 |
hasVerticalScrollBar: true |
|
389 |
listModel: templateNameList |
|
390 |
highlightMode: line |
|
391 |
) |
|
392 |
(ViewSpec |
|
393 |
name: 'FindBox' |
|
394 |
component: |
|
395 |
(SpecCollection |
|
396 |
collection: ( |
|
397 |
(LabelSpec |
|
398 |
label: 'Find:' |
|
399 |
name: 'FindLabel' |
|
400 |
layout: (LayoutFrame 0 0 0 0 0 1 20 0) |
|
401 |
translateLabel: true |
|
402 |
adjust: left |
|
403 |
) |
|
404 |
(TextEditorSpec |
|
405 |
name: 'FindText' |
|
406 |
layout: (LayoutFrame 0 0 20 0 0 1 0 1) |
|
407 |
model: templateSearchPatternHolder |
|
408 |
hasHorizontalScrollBar: true |
|
409 |
hasVerticalScrollBar: true |
|
410 |
) |
|
411 |
) |
|
412 |
||
413 |
) |
|
414 |
) |
|
415 |
(ViewSpec |
|
416 |
name: 'ReplaceBox' |
|
417 |
component: |
|
418 |
(SpecCollection |
|
419 |
collection: ( |
|
420 |
(LabelSpec |
|
421 |
label: 'Replace with:' |
|
422 |
name: 'ReplaceLabel' |
|
423 |
layout: (LayoutFrame 0 0 0 0 0 1 20 0) |
|
424 |
translateLabel: true |
|
425 |
adjust: left |
|
426 |
) |
|
427 |
(TextEditorSpec |
|
428 |
name: 'ReplaceText' |
|
429 |
layout: (LayoutFrame 0 0 20 0 0 1 0 1) |
|
430 |
model: templateReplacePatternHolder |
|
431 |
hasHorizontalScrollBar: true |
|
432 |
hasVerticalScrollBar: true |
|
433 |
) |
|
434 |
) |
|
435 |
||
436 |
) |
|
437 |
) |
|
438 |
) |
|
439 |
||
440 |
) |
|
441 |
handles: (Any 0.2 0.6 1.0) |
|
442 |
) |
|
443 |
(ActionButtonSpec |
|
444 |
label: 'Use as template' |
|
445 |
name: 'UseAsTemplateButton' |
|
446 |
layout: (LayoutFrame 0 0 -25 1 -5 1 -5 1) |
|
447 |
translateLabel: true |
|
448 |
model: useAsTemplateAction |
|
449 |
) |
|
450 |
) |
|
451 |
||
452 |
) |
|
453 |
) |
|
454 |
||
455 |
"Modified: / 12-12-2007 / 11:23:34 / janfrog" |
|
456 |
! |
|
457 |
||
458 |
windowSpec |
|
459 |
"This resource specification was automatically generated |
|
460 |
by the UIPainter of ST/X." |
|
461 |
||
462 |
"Do not manually edit this!! If it is corrupted, |
|
463 |
the UIPainter may not be able to read the specification." |
|
464 |
||
465 |
" |
|
466 |
UIPainter new openOnClass:Tools::MethodRewriter andSelector:#windowSpec |
|
467 |
Tools::MethodRewriter new openInterface:#windowSpec |
|
468 |
Tools::MethodRewriter open |
|
469 |
" |
|
470 |
||
471 |
<resource: #canvas> |
|
472 |
||
473 |
^ |
|
474 |
#(FullSpec |
|
475 |
name: windowSpec |
|
476 |
window: |
|
477 |
(WindowSpec |
|
478 |
label: 'Method Rewriter' |
|
479 |
name: 'Method Rewriter' |
|
480 |
min: (Point 10 10) |
|
481 |
bounds: (Rectangle 0 0 658 490) |
|
482 |
) |
|
483 |
component: |
|
484 |
(SpecCollection |
|
485 |
collection: ( |
|
486 |
(NoteBookViewSpec |
|
487 |
name: 'NoteBook' |
|
488 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
489 |
model: selectedTabIndex |
|
490 |
menu: tabList |
|
491 |
useIndex: true |
|
492 |
fitLastRow: false |
|
493 |
) |
|
494 |
) |
|
495 |
||
496 |
) |
|
497 |
) |
|
498 |
||
499 |
"Modified: / 12-12-2007 / 11:39:31 / janfrog" |
|
500 |
! ! |
|
501 |
||
502 |
!MethodRewriter class methodsFor:'list specs'! |
|
503 |
||
504 |
tabList |
|
505 |
"This resource specification was automatically generated |
|
506 |
by the TabListEditor of ST/X." |
|
507 |
||
508 |
"Do not manually edit this!! If it is corrupted, |
|
509 |
the TabListEditor may not be able to read the specification." |
|
510 |
||
511 |
" |
|
512 |
TabListEditor new openOnClass: self andSelector:#tabList |
|
513 |
" |
|
514 |
||
515 |
<resource: #tabList> |
|
516 |
||
517 |
^ #( |
|
518 |
(TabItem |
|
519 |
label: 'Search and Replace' |
|
520 |
createNewBuilder: false |
|
521 |
minorKey: searchAndReplaceSpec |
|
522 |
) |
|
523 |
(TabItem |
|
524 |
label: 'Classes' |
|
525 |
createNewBuilder: false |
|
526 |
minorKey: classesSpec |
|
527 |
) |
|
528 |
(TabItem |
|
529 |
label: 'Templates' |
|
530 |
createNewBuilder: false |
|
531 |
minorKey: templatesSpec |
|
532 |
) |
|
533 |
) |
|
534 |
||
535 |
collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ] |
|
536 |
||
537 |
"Modified: / 12-12-2007 / 11:21:27 / janfrog" |
|
538 |
! ! |
|
539 |
||
540 |
!MethodRewriter methodsFor:'accessing'! |
|
541 |
||
542 |
actionInProgress: aBoolean |
|
543 |
||
544 |
^self actionInProgresHolder value: aBoolean |
|
545 |
||
546 |
"Created: / 12-12-2007 / 10:06:16 / janfrog" |
|
547 |
! |
|
548 |
||
549 |
classes |
|
550 |
^ classes ifNil:[classes := List new] |
|
551 |
||
552 |
"Created: / 20-07-2007 / 16:31:18 / janfrog" |
|
553 |
! |
|
554 |
||
555 |
classes: aCollection |
|
556 |
classes := (aCollection collect:[:cls|cls theNonMetaclass]) asList |
|
557 |
||
558 |
"Created: / 20-07-2007 / 16:31:18 / janfrog" |
|
559 |
"Modified: / 12-12-2007 / 09:47:01 / janfrog" |
|
560 |
! |
|
561 |
||
562 |
info: aString |
|
563 |
||
564 |
self infoHolder value: aString |
|
565 |
||
566 |
"Created: / 12-12-2007 / 10:00:50 / janfrog" |
|
567 |
! |
|
568 |
||
569 |
progress: anInteger |
|
570 |
||
571 |
self progressHolder value: anInteger |
|
572 |
||
573 |
"Created: / 12-12-2007 / 10:01:03 / janfrog" |
|
574 |
! |
|
575 |
||
576 |
replacePattern |
|
577 |
^ replaceTextView contents trimSeparators |
|
578 |
||
579 |
"Created: / 21-07-2007 / 06:29:22 / janfrog" |
|
580 |
! |
|
581 |
||
582 |
replacePattern: pattern |
|
583 |
^ replaceTextView contents: pattern trimSeparators |
|
584 |
||
585 |
"Created: / 12-12-2007 / 11:38:22 / janfrog" |
|
586 |
! |
|
587 |
||
588 |
searchPattern |
|
589 |
^ searchTextView contents trimSeparators |
|
590 |
||
591 |
"Created: / 20-07-2007 / 16:51:49 / janfrog" |
|
592 |
"Modified: / 21-07-2007 / 06:29:29 / janfrog" |
|
593 |
! |
|
594 |
||
595 |
searchPattern: pattern |
|
596 |
^ searchTextView contents: pattern trimSeparators |
|
597 |
||
598 |
"Created: / 12-12-2007 / 11:38:12 / janfrog" |
|
599 |
! |
|
600 |
||
601 |
selectedClasses |
|
602 |
||
603 |
^self selectedClassesHolder value |
|
604 |
||
605 |
"Created: / 12-12-2007 / 12:02:03 / janfrog" |
|
606 |
! |
|
607 |
||
608 |
selectedTemplate |
|
609 |
||
610 |
^self templates at:self selectedTemplateIndex value |
|
611 |
||
612 |
"Created: / 12-12-2007 / 11:20:32 / janfrog" |
|
613 |
! |
|
614 |
||
615 |
templates |
|
616 |
templates isNil ifTrue:[ |
|
617 |
templates := self class templates. |
|
618 |
]. |
|
619 |
^ templates |
|
620 |
||
621 |
"Created: / 12-12-2007 / 11:17:55 / janfrog" |
|
622 |
! ! |
|
623 |
||
624 |
!MethodRewriter methodsFor:'actions'! |
|
625 |
||
626 |
doRewrite |
|
627 |
||
628 |
| methodsMatching | |
|
629 |
methodsMatching := self methodsMatching. |
|
630 |
methodsMatching isNilOrEmptyCollection ifTrue:[^Dialog warn:'No methods matching']. |
|
631 |
methodsMatching do: |
|
632 |
[:mth| |
|
633 |
| newTree | |
|
634 |
newTree := ParseTreeRewriter new |
|
635 |
replace: self searchPattern with: self replacePattern; |
|
636 |
executeTree: mth parseTree; |
|
637 |
tree. |
|
638 |
mth mclass |
|
639 |
compile: newTree formattedCode |
|
640 |
classified: mth category |
|
641 |
]. |
|
642 |
||
643 |
"Created: / 20-07-2007 / 16:03:47 / janfrog" |
|
644 |
"Modified: / 21-07-2007 / 06:55:42 / janfrog" |
|
645 |
! |
|
646 |
||
647 |
doRewriteAction |
|
648 |
||
649 |
self |
|
650 |
doSearch: self searchPattern |
|
651 |
withResultDo: |
|
652 |
[:methodsMatching| |
|
653 |
self |
|
654 |
withMethods:methodsMatching |
|
655 |
do: |
|
656 |
[:mth| |
|
657 |
| newTree | |
|
658 |
newTree := ParseTreeRewriter new |
|
659 |
replace: self searchPattern with: self replacePattern; |
|
660 |
executeTree: mth parseTree; |
|
661 |
tree. |
|
662 |
mth mclass ifNotNil: |
|
663 |
[mth mclass |
|
664 |
compile: newTree formattedCode |
|
665 |
classified: mth category]] |
|
666 |
finallyDo:[]] |
|
667 |
||
668 |
"Created: / 12-12-2007 / 11:14:19 / janfrog" |
|
669 |
! |
|
670 |
||
671 |
doSearch |
|
672 |
|methods| |
|
673 |
||
674 |
methods := self methodsMatching. |
|
675 |
methods isEmpty |
|
676 |
ifTrue: |
|
677 |
[Dialog warn:'Nothing found'] |
|
678 |
ifFalse: |
|
679 |
[self showMethods:methods |
|
680 |
title:'Methods matching ' , self searchPattern] |
|
681 |
||
682 |
"Created: / 20-07-2007 / 16:08:08 / janfrog" |
|
683 |
"Modified: / 21-07-2007 / 06:51:58 / janfrog" |
|
684 |
! |
|
685 |
||
686 |
doSearchAction |
|
687 |
||
688 |
self |
|
689 |
doSearch: self searchPattern |
|
690 |
withResultDo: |
|
691 |
[:matchingMethods| |
|
692 |
matchingMethods isEmpty |
|
693 |
ifTrue:[Dialog warn:'No methods found'] |
|
694 |
ifFalse: |
|
695 |
[self |
|
696 |
showMethods: matchingMethods asArray |
|
697 |
title: 'Methods matching ', self searchPattern]] |
|
698 |
||
699 |
"Created: / 12-12-2007 / 11:14:25 / janfrog" |
|
700 |
! |
|
701 |
||
702 |
removeSeletedClassesAction |
|
703 |
||
704 |
self classes removeAll: self selectedClasses |
|
705 |
||
706 |
"Created: / 12-12-2007 / 12:05:15 / janfrog" |
|
707 |
! |
|
708 |
||
709 |
useAsTemplateAction |
|
710 |
||
711 |
self searchPattern: self templateSearchPatternHolder value. |
|
712 |
self replacePattern: self templateReplacePatternHolder value. |
|
713 |
self selectedTabIndex value:1 |
|
714 |
||
715 |
"Created: / 12-12-2007 / 11:14:15 / janfrog" |
|
716 |
! ! |
|
717 |
||
718 |
!MethodRewriter methodsFor:'aspects'! |
|
719 |
||
720 |
actionInProgresHolder |
|
721 |
"automatically generated by UIPainter ..." |
|
722 |
||
723 |
"*** the code below creates a default model when invoked." |
|
724 |
"*** (which may not be the one you wanted)" |
|
725 |
"*** Please change as required and accept it in the browser." |
|
726 |
"*** (and replace this comment by something more useful ;-)" |
|
727 |
||
728 |
actionInProgresHolder isNil ifTrue:[ |
|
729 |
actionInProgresHolder := true asValue. |
|
730 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
731 |
"/ actionInProgresHolder addDependent:self. |
|
732 |
"/ actionInProgresHolder onChangeSend:#actionInProgresHolderChanged to:self. |
|
733 |
]. |
|
734 |
^ actionInProgresHolder. |
|
735 |
||
736 |
"Created: / 12-12-2007 / 10:00:05 / janfrog" |
|
737 |
! |
|
738 |
||
739 |
infoHolder |
|
740 |
"automatically generated by UIPainter ..." |
|
741 |
||
742 |
"*** the code below creates a default model when invoked." |
|
743 |
"*** (which may not be the one you wanted)" |
|
744 |
"*** Please change as required and accept it in the browser." |
|
745 |
"*** (and replace this comment by something more useful ;-)" |
|
746 |
||
747 |
infoHolder isNil ifTrue:[ |
|
748 |
infoHolder := 'Really cool tool!!' asValue. |
|
749 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
750 |
"/ infoHolder addDependent:self. |
|
751 |
"/ infoHolder onChangeSend:#infoHolderChanged to:self. |
|
752 |
]. |
|
753 |
^ infoHolder. |
|
754 |
||
755 |
"Created: / 12-12-2007 / 10:00:05 / janfrog" |
|
756 |
"Modified: / 12-12-2007 / 11:40:17 / janfrog" |
|
757 |
! |
|
758 |
||
759 |
progressHolder |
|
760 |
"automatically generated by UIPainter ..." |
|
761 |
||
762 |
"*** the code below creates a default model when invoked." |
|
763 |
"*** (which may not be the one you wanted)" |
|
764 |
"*** Please change as required and accept it in the browser." |
|
765 |
"*** (and replace this comment by something more useful ;-)" |
|
766 |
||
767 |
progressHolder isNil ifTrue:[ |
|
768 |
progressHolder := 0 asValue |
|
769 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
770 |
"/ progressHolder addDependent:self. |
|
771 |
"/ progressHolder onChangeSend:#progressHolderChanged to:self. |
|
772 |
]. |
|
773 |
^ progressHolder. |
|
774 |
||
775 |
"Created: / 12-12-2007 / 10:00:05 / janfrog" |
|
776 |
! |
|
777 |
||
778 |
selectedClassesHolder |
|
779 |
"automatically generated by UIPainter ..." |
|
780 |
||
781 |
"*** the code below creates a default model when invoked." |
|
782 |
"*** (which may not be the one you wanted)" |
|
783 |
"*** Please change as required and accept it in the browser." |
|
784 |
"*** (and replace this comment by something more useful ;-)" |
|
785 |
||
786 |
selectedClassesHolder isNil ifTrue:[ |
|
787 |
selectedClassesHolder := ValueHolder new. |
|
788 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
789 |
"/ selectedClassesHolder addDependent:self. |
|
790 |
"/ selectedClassesHolder onChangeSend:#selectedClassesHolderChanged to:self. |
|
791 |
]. |
|
792 |
^ selectedClassesHolder. |
|
793 |
||
794 |
"Created: / 12-12-2007 / 12:01:40 / janfrog" |
|
795 |
! |
|
796 |
||
797 |
selectedTabIndex |
|
798 |
"automatically generated by UIPainter ..." |
|
799 |
||
800 |
"*** the code below creates a default model when invoked." |
|
801 |
"*** (which may not be the one you wanted)" |
|
802 |
"*** Please change as required and accept it in the browser." |
|
803 |
"*** (and replace this comment by something more useful ;-)" |
|
804 |
||
805 |
selectedTabIndex isNil ifTrue:[ |
|
806 |
selectedTabIndex := ValueHolder new. |
|
807 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
808 |
"/ selectedTabIndex addDependent:self. |
|
809 |
"/ selectedTabIndex onChangeSend:#selectedTabIndexChanged to:self. |
|
810 |
]. |
|
811 |
^ selectedTabIndex. |
|
812 |
||
813 |
"Created: / 12-12-2007 / 11:39:29 / janfrog" |
|
814 |
! |
|
815 |
||
816 |
selectedTemplateIndex |
|
817 |
||
818 |
selectedTemplateIndex isNil ifTrue:[ |
|
819 |
selectedTemplateIndex := ValueHolder new. |
|
820 |
selectedTemplateIndex onChangeSend:#selectedTemplateIndexChanged to:self. |
|
821 |
]. |
|
822 |
^ selectedTemplateIndex. |
|
823 |
||
824 |
"Created: / 12-12-2007 / 11:17:16 / janfrog" |
|
825 |
! |
|
826 |
||
827 |
tabList |
|
828 |
"Generated by the TabListEditor" |
|
829 |
||
830 |
|list| |
|
831 |
||
832 |
(list := builder bindingAt:#tabList) isNil ifTrue:[ |
|
833 |
builder aspectAt:#tabList put:(list := self class tabList). |
|
834 |
]. |
|
835 |
^ list |
|
836 |
||
837 |
"Created: / 20-07-2007 / 16:54:27 / janfrog" |
|
838 |
! |
|
839 |
||
840 |
templateNameList |
|
841 |
||
842 |
^self templates collect:[:tmpl|tmpl first] |
|
843 |
||
844 |
"Created: / 12-12-2007 / 11:17:16 / janfrog" |
|
845 |
! |
|
846 |
||
847 |
templateReplacePatternHolder |
|
848 |
"automatically generated by UIPainter ..." |
|
849 |
||
850 |
"*** the code below creates a default model when invoked." |
|
851 |
"*** (which may not be the one you wanted)" |
|
852 |
"*** Please change as required and accept it in the browser." |
|
853 |
"*** (and replace this comment by something more useful ;-)" |
|
854 |
||
855 |
templateReplacePatternHolder isNil ifTrue:[ |
|
856 |
templateReplacePatternHolder := '' asValue. |
|
857 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
858 |
"/ templateReplacePatternHolder addDependent:self. |
|
859 |
"/ templateReplacePatternHolder onChangeSend:#templateReplacePatternHolderChanged to:self. |
|
860 |
]. |
|
861 |
^ templateReplacePatternHolder. |
|
862 |
||
863 |
"Created: / 12-12-2007 / 11:17:16 / janfrog" |
|
864 |
! |
|
865 |
||
866 |
templateSearchPatternHolder |
|
867 |
"automatically generated by UIPainter ..." |
|
868 |
||
869 |
"*** the code below creates a default model when invoked." |
|
870 |
"*** (which may not be the one you wanted)" |
|
871 |
"*** Please change as required and accept it in the browser." |
|
872 |
"*** (and replace this comment by something more useful ;-)" |
|
873 |
||
874 |
templateSearchPatternHolder isNil ifTrue:[ |
|
875 |
templateSearchPatternHolder := '' asValue. |
|
876 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
877 |
"/ templateSearchPatternHolder addDependent:self. |
|
878 |
"/ templateSearchPatternHolder onChangeSend:#templateSearchPatternHolderChanged to:self. |
|
879 |
]. |
|
880 |
^ templateSearchPatternHolder. |
|
881 |
||
882 |
"Created: / 12-12-2007 / 11:17:16 / janfrog" |
|
883 |
! ! |
|
884 |
||
885 |
!MethodRewriter methodsFor:'change & update'! |
|
886 |
||
887 |
selectedTemplateIndexChanged |
|
888 |
||
889 |
self templateSearchPatternHolder value: self selectedTemplate second. |
|
890 |
self templateReplacePatternHolder value: self selectedTemplate third. |
|
891 |
||
892 |
"Created: / 12-12-2007 / 11:20:16 / janfrog" |
|
893 |
! ! |
|
894 |
||
895 |
!MethodRewriter methodsFor:'drag & drop'! |
|
896 |
||
897 |
canDropClasses: dropContext |
|
898 |
||
899 |
^dropContext dropObjects allSatisfy: [:obj|obj isClassObject] |
|
900 |
||
901 |
"Created: / 20-07-2007 / 16:58:13 / janfrog" |
|
902 |
! |
|
903 |
||
904 |
doDropClasses: dropContext |
|
905 |
||
906 |
| newClasses | |
|
907 |
newClasses := dropContext dropObjects |
|
908 |
select:[:obj|obj isClassObject] |
|
909 |
thenCollect:[:obj|obj theObject]. |
|
910 |
newClasses := newClasses reject:[:cls|self classes includes:cls]. |
|
911 |
self classes |
|
912 |
addAll: newClasses; |
|
913 |
changed:#content |
|
914 |
||
915 |
"Created: / 20-07-2007 / 16:58:16 / janfrog" |
|
916 |
! ! |
|
917 |
||
918 |
!MethodRewriter methodsFor:'hooks'! |
|
919 |
||
920 |
postBuildFindTextView: scrollableView |
|
921 |
||
922 |
searchTextView := scrollableView scrolledView |
|
923 |
||
924 |
"Created: / 20-07-2007 / 15:55:16 / janfrog" |
|
925 |
! |
|
926 |
||
927 |
postBuildReplaceTextView: scrollableView |
|
928 |
||
929 |
replaceTextView := scrollableView scrolledView |
|
930 |
||
931 |
"Created: / 20-07-2007 / 15:55:29 / janfrog" |
|
932 |
! ! |
|
933 |
||
934 |
!MethodRewriter methodsFor:'private'! |
|
935 |
||
936 |
doSearch: pattern withResultDo: block |
|
937 |
||
938 |
| matchingMethods | |
|
939 |
matchingMethods := Set new. |
|
940 |
self |
|
941 |
withMethodsDo: |
|
9988 | 942 |
[:mth| | tree | |
943 |
tree := mth parseTree. |
|
944 |
tree ifNil:[self breakPoint: #jv] ifNotNil:[ |
|
8776 | 945 |
(ParseTreeSearcher new) |
946 |
matches:self searchPattern do:[:aNode :answer | matchingMethods add:mth ]; |
|
9988 | 947 |
executeTree: tree] |
948 |
] |
|
8776 | 949 |
finallyDo: |
950 |
[block value: matchingMethods] |
|
951 |
||
952 |
"Created: / 12-12-2007 / 10:34:50 / janfrog" |
|
9988 | 953 |
"Modified: / 07-04-2011 / 22:02:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8776 | 954 |
! |
955 |
||
956 |
methods |
|
957 |
||
958 |
^self methodsFor: classes |
|
959 |
||
960 |
"Modified: / 21-07-2007 / 06:24:07 / janfrog" |
|
961 |
! |
|
962 |
||
963 |
methodsFor: aColletion |
|
964 |
||
965 |
^classes |
|
966 |
inject: Set new |
|
967 |
into: |
|
968 |
[:methods :cls| |
|
969 |
methods |
|
970 |
addAll: cls methodDictionary values; |
|
971 |
addAll: cls class methodDictionary values; |
|
972 |
yourself] |
|
973 |
||
974 |
"Created: / 21-07-2007 / 06:25:42 / janfrog" |
|
975 |
! |
|
976 |
||
977 |
methodsMatching |
|
978 |
||
979 |
^self methodsMatching: self searchPattern |
|
980 |
||
981 |
"Created: / 21-07-2007 / 06:26:44 / janfrog" |
|
982 |
! |
|
983 |
||
984 |
methodsMatching: searchPattern |
|
985 |
|matchingMethods| |
|
986 |
||
987 |
matchingMethods := OrderedCollection new. |
|
988 |
self methods do:[:mth | |
|
989 |
(ParseTreeSearcher new) |
|
990 |
matches:searchPattern do:[:aNode :answer | matchingMethods add:mth ]; |
|
991 |
executeTree:mth parseTree. |
|
992 |
]. |
|
993 |
^ matchingMethods |
|
994 |
||
995 |
"Created: / 21-07-2007 / 06:26:19 / janfrog" |
|
996 |
! |
|
997 |
||
998 |
showMethods: methods title: title |
|
999 |
||
1000 |
NewSystemBrowser |
|
1001 |
browseMethods:methods |
|
1002 |
title:title |
|
1003 |
sort:true |
|
1004 |
||
1005 |
"Created: / 21-07-2007 / 06:51:36 / janfrog" |
|
1006 |
! |
|
1007 |
||
1008 |
withMethods: methods do: methodBlock finallyDo: finallyBlock |
|
1009 |
||
1010 |
[ |
|
1011 |
self actionInProgress: true. |
|
1012 |
methods asArray keysAndValuesDo: |
|
1013 |
[:idx :mth| |
|
1014 |
self info: mth selector storeString. |
|
1015 |
methodBlock value: mth. |
|
1016 |
self progress: ((100 / methods size) * idx) rounded]. |
|
1017 |
finallyBlock value |
|
1018 |
] ensure:[ |
|
1019 |
"/self actionInProgress: false. |
|
1020 |
self progress: 0. |
|
1021 |
self info: '' |
|
1022 |
] |
|
1023 |
||
1024 |
"Created: / 12-12-2007 / 10:32:16 / janfrog" |
|
1025 |
! |
|
1026 |
||
1027 |
withMethodsDo: methodBlock finallyDo: finallyBlock |
|
1028 |
||
1029 |
^self |
|
1030 |
withMethods: self methods asArray |
|
1031 |
do: methodBlock |
|
1032 |
finallyDo: finallyBlock |
|
1033 |
||
1034 |
"Modified: / 12-12-2007 / 10:32:48 / janfrog" |
|
1035 |
! ! |
|
1036 |
||
1037 |
!MethodRewriter methodsFor:'testing method'! |
|
1038 |
||
1039 |
testXXX |
|
1040 |
self halt:'Was halt' |
|
1041 |
||
1042 |
"Created: / 21-07-2007 / 07:55:24 / janfrog" |
|
1043 |
"Modified: / 12-12-2007 / 10:45:20 / janfrog" |
|
1044 |
! ! |
|
1045 |
||
1046 |
!MethodRewriter class methodsFor:'documentation'! |
|
1047 |
||
8803 | 1048 |
version_CVS |
10153 | 1049 |
^ '$Header: /cvs/stx/stx/libtool/Tools__MethodRewriter.st,v 1.12 2011-07-05 09:31:51 cg Exp $' |
9988 | 1050 |
! |
1051 |
||
1052 |
version_SVN |
|
1053 |
^ '§Id: Tools__MethodRewriter.st 7486 2009-10-26 22:06:24Z vranyj1 §' |
|
8776 | 1054 |
! ! |