author | Claus Gittinger <cg@exept.de> |
Sat, 07 May 2016 21:36:48 +0200 | |
changeset 16475 | 5206032f1a19 |
parent 16467 | c4582914a4be |
child 16476 | 307b09c517b9 |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1990 by Claus Gittinger |
6288 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2664
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
12 |
"{ Package: 'stx:libtool' }" |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
13 |
|
15082 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
0 | 16 |
StandardSystemView subclass:#ChangesBrowser |
16372 | 17 |
instanceVariableNames:'changesReader changeInfoList changeListView codeView diffView |
18 |
changeFileName anyChanges changeNrShown changeNrProcessed |
|
19 |
multipleApply autoCompare changeFileSize changeFileTimestamp |
|
20 |
checkBlock tabSpec autoUpdate editingClassSource lastSearchType |
|
4489 | 21 |
lastSearchString applyInOriginalNameSpace lastSaveFileName |
22 |
readOnly enforcedPackage enforcedNameSpace updateChangeSet |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
23 |
showingDiffs diffViewBox autoloadAsRequired |
10719 | 24 |
classesNotToBeAutoloaded encodingIfKnown |
11244 | 25 |
ignorePublicPrivateCategories changeListSelectionHolder |
16467 | 26 |
defaultApplicationForVAGEClasses infoHolder' |
7631
258e8ad34edf
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7625
diff
changeset
|
27 |
classVariableNames:'CompressSnapshotInfo NoColoring ShowWarningDialogs |
9168 | 28 |
DefaultAutoCompare DefaultShowingDiffs LastEnforcedNameSpace |
29 |
KeepEnforcedNameSpace' |
|
4489 | 30 |
poolDictionaries:'' |
31 |
category:'Interface-Browsers' |
|
0 | 32 |
! |
33 |
||
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
34 |
Object subclass:#ChangeFileReader |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
35 |
instanceVariableNames:'browser enforcedNameSpace changeFileName changeFileSize |
16372 | 36 |
changeFileTimestamp changeInfo changeChunks changeClassNames |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
37 |
changeHeaderLines changePositions changeTimeStamps |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
38 |
changeIsFollowupMethodChange autoCompare autoloadAsRequired |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
39 |
tabSpec anyChanges inStream thisIsAClassSource chunkText |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
40 |
chunkPosition sawExcla fullChunkText noColoring timeStampInfo |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
41 |
changeString changeType changeDelta headerLine maxLen' |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
42 |
classVariableNames:'NoColoring' |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
43 |
poolDictionaries:'' |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
44 |
privateIn:ChangesBrowser |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
45 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
46 |
|
16372 | 47 |
Object subclass:#ChangeInfo |
48 |
instanceVariableNames:'position chunk className selector headerLine timestamp |
|
49 |
isFollowupChange' |
|
50 |
classVariableNames:'' |
|
51 |
poolDictionaries:'' |
|
52 |
privateIn:ChangesBrowser |
|
53 |
! |
|
54 |
||
761 | 55 |
!ChangesBrowser class methodsFor:'documentation'! |
29 | 56 |
|
57 |
copyright |
|
58 |
" |
|
59 |
COPYRIGHT (c) 1990 by Claus Gittinger |
|
6288 | 60 |
All Rights Reserved |
0 | 61 |
|
29 | 62 |
This software is furnished under a license and may be used |
63 |
only in accordance with the terms of that license and with the |
|
64 |
inclusion of the above copyright notice. This software may not |
|
65 |
be provided or otherwise made available to, or used by, any |
|
66 |
other person. No title to or ownership of the software is |
|
67 |
hereby transferred. |
|
68 |
" |
|
69 |
! |
|
70 |
||
71 |
documentation |
|
72 |
" |
|
11397 | 73 |
this implements a browser for the changes-file |
74 |
(actually, it can display any sourceFile's contents). |
|
29 | 75 |
See the extra document 'doc/misc/cbrowser.doc' for how to use this browser. |
76 |
||
77 |
written jan 90 by claus |
|
51 | 78 |
|
11397 | 79 |
This is a very old leftover class (it was one of the very first apps in ST/X |
80 |
and the Merovingian has not yet detected this one ;-) |
|
5703 | 81 |
It will be completely replaced by the ChangeSetBrowser class in the near future. |
82 |
||
83 |
||
508 | 84 |
[Class variables:] |
11397 | 85 |
CompressSnapshotInfo if true (the default), snapshot entries |
86 |
are also compressed in the compress function. |
|
87 |
Some users prefer them to be not compressed. |
|
88 |
Set it to false for this. |
|
58 | 89 |
|
51 | 90 |
Notice: |
11397 | 91 |
this needs a total rewrite, to build up a changeSet from the file |
92 |
(which did not exist when the ChangesBrowser was originally written) |
|
93 |
and manipulate that changeSet. |
|
94 |
||
95 |
This way, we get a browser for any upcoming incore changeSets for |
|
96 |
free. Also, this will put the chunk analysation code into Change and |
|
97 |
subclasses (where it belongs) and give a better encapsulation and |
|
98 |
overall structure. Do not take this as an example for good style ;-) |
|
99 |
||
100 |
The Change hierarchy is currently been completed, and the changes browser |
|
101 |
will be adapted soon. |
|
508 | 102 |
|
103 |
[author:] |
|
11397 | 104 |
Claus Gittinger |
508 | 105 |
|
106 |
[start with:] |
|
11397 | 107 |
ChangesBrowser open |
1359 | 108 |
|
109 |
[see also:] |
|
11397 | 110 |
( Using the ChangesBrowser :html: tools/cbrowser/TOP.html ) |
6288 | 111 |
|
29 | 112 |
" |
113 |
! ! |
|
0 | 114 |
|
761 | 115 |
!ChangesBrowser class methodsFor:'instance creation'! |
45 | 116 |
|
8379 | 117 |
openOn:aFilename |
9525 | 118 |
"create & open a changes browser on a change file" |
5696 | 119 |
|
8379 | 120 |
|fileName browser| |
121 |
||
122 |
fileName := aFilename asFilename pathName. |
|
123 |
||
124 |
(self isXMLFile:fileName) ifTrue:[ |
|
125 |
browser := ChangeSetBrowser new |
|
5696 | 126 |
] ifFalse:[ |
8379 | 127 |
browser := self new |
128 |
]. |
|
129 |
||
130 |
browser label:(self defaultLabel , ': ', fileName). |
|
131 |
browser changeFileName:fileName. |
|
5696 | 132 |
browser open. |
133 |
^ browser |
|
9525 | 134 |
|
135 |
"Modified: / 18-07-2010 / 10:32:18 / cg" |
|
45 | 136 |
! ! |
137 |
||
761 | 138 |
!ChangesBrowser class methodsFor:'behavior'! |
0 | 139 |
|
140 |
autoSelectNext |
|
141 |
"returning true here, makes a Delete operation automatically |
|
142 |
select the next change" |
|
143 |
||
144 |
^ true |
|
145 |
! ! |
|
146 |
||
761 | 147 |
!ChangesBrowser class methodsFor:'defaults'! |
0 | 148 |
|
489 | 149 |
defaultIcon |
1153 | 150 |
"return the browsers default window icon" |
151 |
||
7631
258e8ad34edf
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7625
diff
changeset
|
152 |
<resource: #programImage> |
258e8ad34edf
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7625
diff
changeset
|
153 |
|
258e8ad34edf
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7625
diff
changeset
|
154 |
^ ToolbarIconLibrary startChangesBrowserIcon |
489 | 155 |
! |
156 |
||
73 | 157 |
defaultLabel |
5527 | 158 |
^ self classResources string:'Changes Browser' |
2417 | 159 |
! |
160 |
||
161 |
isVisualStartable |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
162 |
"return true, if this application can be started via #open. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
163 |
(to allow start of a change browser via double-click in the browser)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
164 |
|
2417 | 165 |
^ true |
166 |
||
167 |
"Created: / 27.9.1999 / 12:28:27 / cg" |
|
28 | 168 |
! ! |
169 |
||
16022 | 170 |
!ChangesBrowser class methodsFor:'help specs'! |
3202 | 171 |
|
10681 | 172 |
flyByHelpSpec |
16022 | 173 |
<resource: #help> |
174 |
||
175 |
^ Dictionary new |
|
176 |
addPairsFrom:#( |
|
177 |
||
178 |
#applyChange |
|
179 |
'Apply (install) the selected change' |
|
180 |
||
181 |
deleteAllForClass |
|
182 |
'Delete all changes for the selected change''s class' |
|
183 |
||
184 |
deleteForClassFromBegin |
|
185 |
'Delete all previous changes for the selected change''s class' |
|
186 |
||
187 |
deleteForClassToEnd |
|
188 |
'Delete this and all following changes for the selected change''s class' |
|
189 |
) |
|
190 |
! ! |
|
191 |
||
192 |
!ChangesBrowser class methodsFor:'menu specs'! |
|
10681 | 193 |
|
3202 | 194 |
menuSpec |
195 |
"This resource specification was automatically generated |
|
196 |
by the MenuEditor of ST/X." |
|
197 |
||
198 |
"Do not manually edit this!! If it is corrupted, |
|
199 |
the MenuEditor may not be able to read the specification." |
|
200 |
||
10719 | 201 |
|
3202 | 202 |
" |
203 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpec |
|
204 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpec)) startUp |
|
205 |
" |
|
206 |
||
207 |
<resource: #menu> |
|
208 |
||
7360 | 209 |
^ |
6216 | 210 |
#(Menu |
7096 | 211 |
( |
212 |
(MenuItem |
|
213 |
label: 'File' |
|
7360 | 214 |
submenu: |
7096 | 215 |
(Menu |
216 |
( |
|
217 |
(MenuItem |
|
218 |
label: 'Compress' |
|
219 |
itemValue: doCompress |
|
220 |
isVisible: notEditingClassSource |
|
221 |
) |
|
222 |
(MenuItem |
|
223 |
enabled: hasSingleSelection |
|
224 |
label: 'Compress for Class' |
|
225 |
itemValue: doCompressClass |
|
226 |
isVisible: notEditingClassSource |
|
227 |
) |
|
228 |
(MenuItem |
|
229 |
enabled: hasSingleSelection |
|
230 |
label: 'Compress for Class && Selector' |
|
231 |
itemValue: doCompressSelector |
|
232 |
isVisible: notEditingClassSource |
|
233 |
) |
|
234 |
(MenuItem |
|
235 |
label: 'Compare and Compress' |
|
236 |
itemValue: doCompareAndCompress |
|
237 |
isVisible: notEditingClassSource |
|
238 |
) |
|
239 |
(MenuItem |
|
240 |
label: '-' |
|
241 |
isVisible: notEditingClassSource |
|
242 |
) |
|
243 |
(MenuItem |
|
244 |
enabled: hasSingleSelection |
|
245 |
label: 'Fileout && Delete all Changes for Class' |
|
246 |
itemValue: doFileoutAndDeleteClassAll |
|
247 |
isVisible: notEditingClassSource |
|
248 |
) |
|
249 |
(MenuItem |
|
250 |
enabled: hasSelection |
|
251 |
label: 'CheckIn && Delete all Changes for Class' |
|
252 |
itemValue: doCheckinAndDeleteClassAll |
|
253 |
isVisible: notEditingClassSource |
|
254 |
) |
|
255 |
(MenuItem |
|
256 |
label: '-' |
|
257 |
isVisible: notEditingClassSource |
|
258 |
) |
|
259 |
(MenuItem |
|
260 |
enabled: hasSelection |
|
261 |
label: 'Save In...' |
|
262 |
itemValue: doSave |
|
263 |
) |
|
264 |
(MenuItem |
|
265 |
enabled: hasSingleSelection |
|
266 |
label: 'Save to End In...' |
|
267 |
itemValue: doSaveRest |
|
268 |
) |
|
269 |
(MenuItem |
|
270 |
enabled: hasSingleSelection |
|
271 |
label: 'Save for Class to End In...' |
|
272 |
itemValue: doSaveClassRest |
|
273 |
) |
|
274 |
(MenuItem |
|
275 |
enabled: hasSingleSelection |
|
276 |
label: 'Save all for Class In...' |
|
277 |
itemValue: doSaveClassAll |
|
278 |
) |
|
279 |
(MenuItem |
|
280 |
label: '-' |
|
281 |
) |
|
282 |
(MenuItem |
|
283 |
label: 'Writeback ClassFile' |
|
284 |
itemValue: doWriteBack |
|
285 |
isVisible: editingClassSource |
|
286 |
) |
|
287 |
(MenuItem |
|
288 |
label: 'Writeback ChangeFile' |
|
289 |
itemValue: doWriteBack |
|
290 |
isVisible: notEditingClassSource |
|
291 |
) |
|
292 |
(MenuItem |
|
293 |
label: '-' |
|
294 |
) |
|
295 |
(MenuItem |
|
296 |
label: 'Update' |
|
297 |
itemValue: doUpdate |
|
298 |
) |
|
299 |
(MenuItem |
|
300 |
label: '-' |
|
301 |
) |
|
302 |
(MenuItem |
|
303 |
label: 'Exit' |
|
304 |
itemValue: menuExit |
|
305 |
) |
|
306 |
) |
|
307 |
nil |
|
308 |
nil |
|
309 |
) |
|
310 |
) |
|
311 |
(MenuItem |
|
15082 | 312 |
label: 'CHANGE' |
7360 | 313 |
submenu: |
7096 | 314 |
(Menu |
315 |
( |
|
316 |
(MenuItem |
|
317 |
enabled: hasSelection |
|
318 |
label: 'Apply' |
|
319 |
itemValue: doApply |
|
320 |
) |
|
321 |
(MenuItem |
|
322 |
enabled: hasSingleSelection |
|
323 |
label: 'Apply to End' |
|
324 |
itemValue: doApplyRest |
|
325 |
) |
|
326 |
(MenuItem |
|
327 |
enabled: hasSingleSelection |
|
328 |
label: 'Apply from Begin' |
|
329 |
itemValue: doApplyFromBeginning |
|
330 |
) |
|
331 |
(MenuItem |
|
332 |
enabled: hasSingleSelection |
|
333 |
label: 'Apply for Class to End' |
|
334 |
itemValue: doApplyClassRest |
|
335 |
) |
|
336 |
(MenuItem |
|
337 |
enabled: hasSingleSelection |
|
338 |
label: 'Apply for Class from Begin' |
|
339 |
itemValue: doApplyClassFromBeginning |
|
340 |
) |
|
341 |
(MenuItem |
|
342 |
enabled: hasNoSelection |
|
343 |
label: 'Apply All' |
|
344 |
itemValue: doApplyAll |
|
345 |
) |
|
346 |
(MenuItem |
|
347 |
enabled: hasSingleSelection |
|
348 |
label: 'Apply to Conflict or End' |
|
349 |
itemValue: doApplyToConflictOrEnd |
|
350 |
) |
|
351 |
(MenuItem |
|
352 |
label: '-' |
|
353 |
) |
|
354 |
(MenuItem |
|
355 |
enabled: hasSelection |
|
356 |
label: 'Delete' |
|
357 |
itemValue: doDelete |
|
358 |
) |
|
359 |
(MenuItem |
|
360 |
enabled: hasSingleSelection |
|
361 |
label: 'Delete to End' |
|
362 |
itemValue: doDeleteRest |
|
363 |
) |
|
364 |
(MenuItem |
|
365 |
enabled: hasSingleSelection |
|
366 |
label: 'Delete from Begin' |
|
367 |
itemValue: doDeleteFromBeginning |
|
368 |
) |
|
369 |
(MenuItem |
|
370 |
enabled: hasSingleSelection |
|
371 |
label: 'Delete for Class to End' |
|
372 |
itemValue: doDeleteClassRest |
|
373 |
) |
|
374 |
(MenuItem |
|
375 |
enabled: hasSingleSelection |
|
376 |
label: 'Delete for Class from Begin' |
|
377 |
itemValue: doDeleteClassFromBeginning |
|
378 |
) |
|
379 |
(MenuItem |
|
380 |
enabled: hasSelection |
|
381 |
label: 'Delete all for Class' |
|
382 |
itemValue: doDeleteClassAll |
|
383 |
isVisible: hasNoMultiSelection |
|
384 |
) |
|
385 |
(MenuItem |
|
386 |
enabled: hasSelection |
|
387 |
label: 'Delete all for Class && its Private Classes' |
|
388 |
itemValue: doDeleteClassAndPrivateClassesAll |
|
389 |
isVisible: hasNoMultiSelection |
|
390 |
) |
|
391 |
(MenuItem |
|
392 |
enabled: hasSelection |
|
12428 | 393 |
label: 'Delete all for Namespace' |
394 |
itemValue: doDeleteAllForNamespace |
|
395 |
) |
|
396 |
(MenuItem |
|
397 |
enabled: hasSelection |
|
7096 | 398 |
label: 'Delete all for Classes' |
399 |
itemValue: doDeleteClassAll |
|
400 |
isVisible: hasMultiSelection |
|
401 |
) |
|
402 |
(MenuItem |
|
403 |
enabled: hasSelection |
|
404 |
label: 'Delete all for Classes && their Private Classes' |
|
405 |
itemValue: doDeleteClassAndPrivateClassesAll |
|
406 |
isVisible: hasMultiSelection |
|
407 |
) |
|
408 |
(MenuItem |
|
409 |
label: '-' |
|
410 |
) |
|
411 |
(MenuItem |
|
412 |
enabled: hasSelection |
|
16475 | 413 |
label: 'Delete older Versions of Selected Method' |
414 |
itemValue: doDeleteClassSelectorOlder |
|
415 |
isVisible: hasNoMultiSelectionHolder |
|
416 |
) |
|
417 |
(MenuItem |
|
418 |
enabled: hasSelection |
|
419 |
label: 'Delete older Versions of all Selected Methods' |
|
420 |
itemValue: doDeleteClassSelectorOlder |
|
421 |
isVisible: hasMultiSelectionHolder |
|
422 |
) |
|
423 |
(MenuItem |
|
424 |
enabled: hasSelection |
|
7096 | 425 |
label: 'Delete all Versions of Selected Method' |
426 |
itemValue: doDeleteClassSelectorAll |
|
11028 | 427 |
isVisible: hasNoMultiSelectionHolder |
7096 | 428 |
) |
429 |
(MenuItem |
|
430 |
enabled: hasSelection |
|
431 |
label: 'Delete all Versions of all Selected Methods' |
|
432 |
itemValue: doDeleteClassSelectorAll |
|
11028 | 433 |
isVisible: hasMultiSelectionHolder |
7096 | 434 |
) |
435 |
(MenuItem |
|
436 |
label: '-' |
|
437 |
) |
|
438 |
(MenuItem |
|
439 |
enabled: hasSingleSelection |
|
440 |
label: 'Compare with Current' |
|
441 |
itemValue: doCompare |
|
442 |
) |
|
443 |
(MenuItem |
|
444 |
label: '-' |
|
445 |
) |
|
446 |
(MenuItem |
|
447 |
enabled: hasSelection |
|
448 |
label: 'Make Change a Patch' |
|
449 |
itemValue: doMakePatch |
|
450 |
) |
|
451 |
) |
|
452 |
nil |
|
453 |
nil |
|
454 |
) |
|
455 |
) |
|
456 |
(MenuItem |
|
457 |
label: 'Search' |
|
7360 | 458 |
submenu: |
7096 | 459 |
(Menu |
460 |
( |
|
461 |
(MenuItem |
|
462 |
label: 'Class...' |
|
463 |
itemValue: findClass |
|
464 |
) |
|
465 |
(MenuItem |
|
466 |
enabled: hasSelection |
|
7527 | 467 |
label: 'First for Class' |
468 |
itemValue: findFirstForClass |
|
469 |
) |
|
470 |
(MenuItem |
|
471 |
enabled: hasSelection |
|
7096 | 472 |
label: 'Previous for Class' |
473 |
itemValue: findPreviousForClass |
|
474 |
) |
|
475 |
(MenuItem |
|
476 |
enabled: hasSelection |
|
477 |
label: 'Next for Class' |
|
478 |
itemValue: findNextForClass |
|
479 |
) |
|
480 |
(MenuItem |
|
7527 | 481 |
enabled: hasSelection |
482 |
label: 'Last for Class' |
|
483 |
itemValue: findLastForClass |
|
484 |
) |
|
485 |
(MenuItem |
|
7096 | 486 |
label: '-' |
487 |
) |
|
488 |
(MenuItem |
|
489 |
label: 'Selector...' |
|
490 |
itemValue: findSelector |
|
491 |
) |
|
492 |
(MenuItem |
|
493 |
enabled: hasSelection |
|
494 |
label: 'Previous for Selector' |
|
495 |
itemValue: findPreviousForSelector |
|
496 |
) |
|
497 |
(MenuItem |
|
498 |
enabled: hasSelection |
|
499 |
label: 'Next for Selector' |
|
500 |
itemValue: findNextForSelector |
|
501 |
) |
|
502 |
(MenuItem |
|
503 |
label: '-' |
|
504 |
) |
|
505 |
(MenuItem |
|
506 |
label: 'String...' |
|
507 |
itemValue: findString |
|
508 |
) |
|
509 |
(MenuItem |
|
510 |
enabled: hasSelection |
|
511 |
label: 'Previous with String' |
|
512 |
itemValue: findPreviousForString |
|
513 |
) |
|
514 |
(MenuItem |
|
515 |
enabled: hasSelection |
|
516 |
label: 'Next with String' |
|
517 |
itemValue: findNextForString |
|
518 |
) |
|
519 |
(MenuItem |
|
520 |
label: '-' |
|
521 |
) |
|
522 |
(MenuItem |
|
523 |
enabled: hasSelection |
|
524 |
label: 'Previous Difference' |
|
525 |
itemValue: findPreviousDifference |
|
526 |
) |
|
527 |
(MenuItem |
|
528 |
enabled: hasSelection |
|
529 |
label: 'Next Difference' |
|
530 |
itemValue: findNextDifference |
|
531 |
) |
|
532 |
(MenuItem |
|
533 |
label: '-' |
|
534 |
) |
|
535 |
(MenuItem |
|
536 |
enabled: hasSelection |
|
537 |
label: 'Previous Snapshot' |
|
538 |
itemValue: findPreviousSnapshot |
|
539 |
) |
|
540 |
(MenuItem |
|
541 |
enabled: hasSelection |
|
542 |
label: 'Next Snapshot' |
|
543 |
itemValue: findNextSnapshot |
|
544 |
) |
|
7360 | 545 |
(MenuItem |
546 |
label: 'Last Snapshot' |
|
547 |
itemValue: findLastSnapshot |
|
548 |
) |
|
7096 | 549 |
) |
550 |
nil |
|
551 |
nil |
|
552 |
) |
|
553 |
) |
|
554 |
(MenuItem |
|
555 |
label: 'Browse' |
|
7360 | 556 |
submenu: |
7096 | 557 |
(Menu |
558 |
( |
|
559 |
(MenuItem |
|
560 |
enabled: hasSingleSelection |
|
561 |
label: 'Class' |
|
562 |
itemValue: doBrowse |
|
563 |
) |
|
564 |
(MenuItem |
|
565 |
label: '-' |
|
566 |
) |
|
567 |
(MenuItem |
|
568 |
label: 'Senders...' |
|
569 |
itemValue: doBrowseSenders |
|
570 |
) |
|
571 |
(MenuItem |
|
572 |
label: 'Implementors...' |
|
573 |
itemValue: doBrowseImplementors |
|
574 |
) |
|
575 |
) |
|
576 |
nil |
|
577 |
nil |
|
578 |
) |
|
579 |
) |
|
580 |
(MenuItem |
|
581 |
label: 'Settings' |
|
7360 | 582 |
submenu: |
7096 | 583 |
(Menu |
584 |
( |
|
585 |
(MenuItem |
|
586 |
label: 'Auto Compare' |
|
587 |
indication: autoCompare |
|
588 |
) |
|
589 |
(MenuItem |
|
590 |
label: 'Autoload As Required' |
|
591 |
indication: autoloadAsRequired |
|
592 |
) |
|
593 |
(MenuItem |
|
594 |
label: 'Show Diffs' |
|
595 |
indication: showingDiffs |
|
596 |
) |
|
597 |
(MenuItem |
|
598 |
label: 'Auto Update' |
|
599 |
indication: autoUpdate |
|
600 |
) |
|
601 |
(MenuItem |
|
602 |
label: '-' |
|
603 |
) |
|
604 |
(MenuItem |
|
605 |
label: 'Add to ChangeSet when Applying' |
|
606 |
indication: updateChangeSet |
|
607 |
) |
|
608 |
(MenuItem |
|
16475 | 609 |
label: 'Ignore Public/Private in Categories (Dolphin code)' |
10719 | 610 |
itemValue: ignorePublicPrivateCategories: |
611 |
indication: ignorePublicPrivateCategories |
|
16475 | 612 |
isVisible: false |
10719 | 613 |
) |
614 |
(MenuItem |
|
7096 | 615 |
label: '-' |
616 |
) |
|
617 |
(MenuItem |
|
618 |
label: 'Apply into Package...' |
|
619 |
itemValue: setEnforcedPackage |
|
620 |
) |
|
621 |
(MenuItem |
|
622 |
label: 'Apply into NameSpace...' |
|
623 |
itemValue: setEnforcedNameSpace |
|
624 |
) |
|
9055 | 625 |
(MenuItem |
626 |
label: '-' |
|
627 |
) |
|
628 |
(MenuItem |
|
629 |
label: 'Settings...' |
|
630 |
itemValue: openSettingsDialog |
|
631 |
) |
|
7096 | 632 |
) |
633 |
nil |
|
634 |
nil |
|
635 |
) |
|
636 |
) |
|
637 |
(MenuItem |
|
7463
e8e74bdbfbda
support '?' as help (for now: controlled by resources)
Claus Gittinger <cg@exept.de>
parents:
7415
diff
changeset
|
638 |
label: 'MENU_Help' |
7415 | 639 |
startGroup: conditionalRight |
7360 | 640 |
submenu: |
7096 | 641 |
(Menu |
642 |
( |
|
643 |
(MenuItem |
|
644 |
label: 'ChangesBrowser Documentation' |
|
645 |
itemValue: openHTMLDocument: |
|
646 |
argument: 'tools/cbrowser/TOP.html' |
|
647 |
) |
|
648 |
(MenuItem |
|
649 |
label: '-' |
|
650 |
) |
|
651 |
(MenuItem |
|
652 |
label: 'About ChangesBrowser...' |
|
653 |
itemValue: openAboutThisApplication |
|
654 |
) |
|
655 |
) |
|
656 |
nil |
|
657 |
nil |
|
658 |
) |
|
659 |
) |
|
660 |
) |
|
661 |
nil |
|
662 |
nil |
|
3202 | 663 |
) |
10681 | 664 |
! |
665 |
||
666 |
toolbarMenuSpec |
|
667 |
"This resource specification was automatically generated |
|
668 |
by the MenuEditor of ST/X." |
|
669 |
||
670 |
"Do not manually edit this!! If it is corrupted, |
|
671 |
the MenuEditor may not be able to read the specification." |
|
672 |
||
673 |
||
674 |
" |
|
675 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#toolbarMenuSpec |
|
676 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser toolbarMenuSpec)) startUp |
|
677 |
" |
|
678 |
||
679 |
<resource: #menu> |
|
680 |
||
681 |
^ |
|
682 |
#(Menu |
|
683 |
( |
|
684 |
(MenuItem |
|
685 |
activeHelpKey: applyChange |
|
686 |
enabled: hasSelectionHolder |
|
687 |
label: 'Apply' |
|
688 |
itemValue: doApply |
|
689 |
translateLabel: true |
|
690 |
isButton: true |
|
691 |
labelImage: (ResourceRetriever ToolbarIconLibrary executeMethod20x20Icon) |
|
692 |
) |
|
693 |
(MenuItem |
|
694 |
label: '-' |
|
695 |
) |
|
696 |
(MenuItem |
|
697 |
activeHelpKey: deleteAllForClass |
|
698 |
enabled: hasSelectionHolder |
|
15016 | 699 |
isVisible: canDeleteChanges |
10681 | 700 |
label: 'Delete all for Class' |
701 |
itemValue: doDeleteClassAll |
|
702 |
translateLabel: true |
|
703 |
isButton: true |
|
704 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteClass24x24Icon) |
|
705 |
) |
|
13991 | 706 |
(MenuItem |
16022 | 707 |
activeHelpKey: deleteForClassFromBegin |
708 |
enabled: hasSelectionHolder |
|
709 |
isVisible: canDeleteChanges |
|
710 |
label: 'Delete for Class from Beginning' |
|
711 |
itemValue: doDeleteClassFromBeginning |
|
712 |
translateLabel: true |
|
713 |
isButton: true |
|
714 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteClassFromStart24x24Icon) |
|
715 |
) |
|
716 |
(MenuItem |
|
13991 | 717 |
activeHelpKey: deleteForClassToEnd |
718 |
enabled: hasSelectionHolder |
|
15016 | 719 |
isVisible: canDeleteChanges |
13991 | 720 |
label: 'Delete for Class to End' |
721 |
itemValue: doDeleteClassRest |
|
722 |
translateLabel: true |
|
723 |
isButton: true |
|
724 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteClassToEnd24x24Icon) |
|
725 |
) |
|
10681 | 726 |
) |
727 |
nil |
|
728 |
nil |
|
729 |
) |
|
3202 | 730 |
! ! |
731 |
||
3674 | 732 |
!ChangesBrowser class methodsFor:'private-changeFile access'! |
733 |
||
734 |
readXMLChangesFrom:aStream inBackground:inBackground |
|
735 |
"read an XML source file (format as in campSmalltalk DTD)" |
|
736 |
||
737 |
|changeSet| |
|
738 |
||
739 |
(XML isNil or:[XML::SourceNodeBuilder isNil or:[XML::XMLParser isNil]]) ifTrue:[ |
|
6288 | 740 |
Smalltalk loadPackage:'stx:goodies/xml/vw'. |
741 |
(XML isNil or:[XML::SourceNodeBuilder isNil or:[XML::XMLParser isNil]]) ifTrue:[ |
|
742 |
self error:'Could not load XML package(s) from ''stx:goodies/xml/vw'''. |
|
743 |
] |
|
3674 | 744 |
]. |
745 |
||
746 |
changeSet := ChangeSet new. |
|
6288 | 747 |
XML::SourceScannerNodeBuilder new |
748 |
scanFile:aStream |
|
749 |
do:[:eachChange | |
|
750 |
changeSet addChange:eachChange. |
|
751 |
]. |
|
3674 | 752 |
^ changeSet |
753 |
||
754 |
"/ builder := XML::SourceScannerNodeBuilder new. |
|
755 |
"/ parser := XML::XMLParser on:aStream. |
|
756 |
"/ parser builder:builder. |
|
757 |
"/ parser validate:false. |
|
758 |
"/ parser scanDocument. |
|
759 |
! |
|
760 |
||
761 |
readXMLChangesFromFile:changeFileName inBackground:inBackground |
|
14011 | 762 |
|set| |
763 |
||
764 |
changeFileName asFilename readingFileDo:[:s| |
|
765 |
set := self readXMLChangesFrom:s inBackground:false. |
|
766 |
]. |
|
3674 | 767 |
^ set. |
768 |
! ! |
|
769 |
||
770 |
!ChangesBrowser class methodsFor:'utilities'! |
|
771 |
||
772 |
isXMLFile:aFilename |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
773 |
|stream first| |
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
774 |
|
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
775 |
stream := aFilename asFilename readStreamOrNil. |
3674 | 776 |
stream isNil ifTrue:[^ false]. |
777 |
||
778 |
stream skipSeparators. |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
779 |
first := stream peek. |
3674 | 780 |
stream close. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
781 |
^ first == $< |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
782 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
783 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
784 |
methodDefinitionSelectors |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
785 |
^ #( |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
786 |
#'methodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
787 |
#'privateMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
788 |
#'publicMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
789 |
#'ignoredMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
790 |
#'protectedMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
791 |
#'methodsFor:stamp:' "/ Squeak support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
792 |
#'commentStamp:prior:' "/ Squeak support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
793 |
#methodsFor "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
794 |
#categoriesForClass "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
795 |
#'categoriesFor:' "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
796 |
#methods "/ STV support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
797 |
#publicMethods "/ STV / V'Age support |
6532 | 798 |
#privateMethods "/ STV / V'Age support |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
799 |
#'methodsForUndefined:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
800 |
) |
3674 | 801 |
! ! |
802 |
||
3202 | 803 |
!ChangesBrowser methodsFor:'aspects'! |
804 |
||
805 |
applyInOriginalNameSpace |
|
806 |
^ applyInOriginalNameSpace |
|
807 |
! |
|
808 |
||
3472 | 809 |
applyNotInOriginalNameSpace |
6288 | 810 |
^ BlockValue forLogicalNot:self applyInOriginalNameSpace |
3472 | 811 |
! |
812 |
||
3202 | 813 |
autoCompare |
814 |
^ autoCompare |
|
815 |
! |
|
816 |
||
817 |
autoUpdate |
|
818 |
"enabled/disable automatic update from the change-file (for monitoring)" |
|
819 |
||
820 |
^ autoUpdate |
|
821 |
||
822 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
823 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
824 |
! |
|
825 |
||
6216 | 826 |
autoloadAsRequired |
827 |
^ autoloadAsRequired |
|
828 |
! |
|
829 |
||
15016 | 830 |
canDeleteChanges |
831 |
"makes the delete buttons in the toolbar visible" |
|
832 |
||
833 |
^ true. |
|
834 |
! |
|
835 |
||
11048 | 836 |
changeListSelectionHolder |
837 |
changeListSelectionHolder isNil ifTrue:[ |
|
838 |
changeListSelectionHolder := nil asValue. |
|
839 |
]. |
|
840 |
^ changeListSelectionHolder |
|
841 |
||
842 |
"Created: / 03-01-2012 / 15:19:25 / cg" |
|
843 |
! |
|
844 |
||
3202 | 845 |
editingClassSource |
3203 | 846 |
^ editingClassSource ? false |
3202 | 847 |
! |
848 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
849 |
hasMultiSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
850 |
^ self hasSelection and:[self hasSingleSelection not] |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
851 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
852 |
|
11028 | 853 |
hasMultiSelectionHolder |
854 |
^ [ self hasMultiSelection ] |
|
855 |
||
856 |
"Created: / 25-12-2011 / 11:21:52 / cg" |
|
857 |
! |
|
858 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
859 |
hasNoMultiSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
860 |
^ self hasMultiSelection not |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
861 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
862 |
|
11028 | 863 |
hasNoMultiSelectionHolder |
864 |
^ [ self hasNoMultiSelection ] |
|
865 |
||
866 |
"Created: / 25-12-2011 / 11:21:20 / cg" |
|
867 |
! |
|
868 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
869 |
hasNoSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
870 |
^ self hasSelection not |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
871 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
872 |
|
3202 | 873 |
hasSelection |
6288 | 874 |
^ changeListView hasSelection |
3202 | 875 |
! |
876 |
||
11048 | 877 |
hasSelectionHolder |
878 |
^ BlockValue |
|
879 |
with:[:v | v notEmptyOrNil ] |
|
880 |
argument:(self changeListSelectionHolder) |
|
881 |
||
882 |
"Created: / 03-01-2012 / 15:15:47 / cg" |
|
883 |
! |
|
884 |
||
3211 | 885 |
hasSingleSelection |
886 |
changeListView multipleSelectOk ifTrue:[ |
|
6288 | 887 |
^ changeListView selection size == 1 |
3211 | 888 |
]. |
889 |
^ changeListView hasSelection |
|
890 |
! |
|
891 |
||
10719 | 892 |
ignorePublicPrivateCategories |
893 |
^ ignorePublicPrivateCategories |
|
894 |
||
895 |
"Created: / 23-09-2011 / 19:42:46 / cg" |
|
896 |
! |
|
897 |
||
3202 | 898 |
notEditingClassSource |
899 |
^ self editingClassSource not |
|
3211 | 900 |
! |
901 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
902 |
notEditingClassSourceAndNotReadOnly |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
903 |
^ (self editingClassSource or:[readOnly == true]) not |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
904 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
905 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
906 |
notReadOnly |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
907 |
^ (readOnly ~~ true) |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
908 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
909 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
910 |
readOnly:aBoolean |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
911 |
readOnly := aBoolean |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
912 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
913 |
|
4487 | 914 |
showingDiffs |
915 |
showingDiffs isNil ifTrue:[ |
|
6288 | 916 |
showingDiffs := self showingDiffsDefault asValue. |
917 |
showingDiffs |
|
918 |
onChangeEvaluate:[ |
|
919 |
showingDiffs value ifTrue:[ |
|
920 |
self updateDiffView. |
|
921 |
self makeDiffViewVisible |
|
922 |
] ifFalse:[ |
|
923 |
self makeDiffViewInvisible |
|
924 |
]. |
|
925 |
DefaultShowingDiffs := showingDiffs value. |
|
926 |
] |
|
4487 | 927 |
]. |
928 |
^ showingDiffs |
|
929 |
! |
|
930 |
||
4943 | 931 |
showingDiffsDefault |
932 |
^ (DefaultShowingDiffs ? true) |
|
933 |
! |
|
934 |
||
3211 | 935 |
theSingleSelection |
936 |
|sel| |
|
937 |
||
938 |
sel := changeListView selection. |
|
939 |
changeListView multipleSelectOk ifTrue:[ |
|
6288 | 940 |
sel size == 1 ifTrue:[ |
941 |
^ sel first |
|
942 |
]. |
|
943 |
^ nil |
|
3211 | 944 |
]. |
945 |
^ sel. |
|
3319 | 946 |
! |
947 |
||
948 |
updateChangeSet |
|
949 |
^ updateChangeSet |
|
3202 | 950 |
! ! |
951 |
||
202 | 952 |
!ChangesBrowser methodsFor:'compiler interface'! |
953 |
||
954 |
wantChangeLog |
|
955 |
"sent by the compiler to ask if a changeLog entry should |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
956 |
be written when compiling. Return false here." |
202 | 957 |
|
958 |
^ false |
|
959 |
! ! |
|
960 |
||
4869 | 961 |
!ChangesBrowser methodsFor:'compiler interface-error handling'! |
202 | 962 |
|
963 |
correctableError:aString position:relPos to:relEndPos from:aCompiler |
|
12656 | 964 |
"compiler notifies us of an error - this should really not happen since |
202 | 965 |
changes ought to be correct (did someone edit the changes file ??). |
966 |
Show the bad change in the codeView and let codeView hilight the error; |
|
967 |
no corrections allowed here therefore return false" |
|
968 |
||
2293 | 969 |
ShowWarningDialogs == true ifTrue:[ |
12656 | 970 |
self error:aString position:relPos to:relEndPos from:aCompiler. |
2293 | 971 |
] ifFalse:[ |
12656 | 972 |
Transcript showCR:aString. |
2293 | 973 |
]. |
202 | 974 |
^ false |
975 |
! |
|
976 |
||
2555 | 977 |
correctableSelectorWarning:aString position:relPos to:relEndPos from:aCompiler |
12656 | 978 |
"compiler notifies us of a warning" |
2555 | 979 |
|
980 |
^ false |
|
981 |
||
982 |
"Modified: / 19.1.2000 / 16:25:31 / cg" |
|
983 |
"Created: / 19.1.2000 / 16:27:23 / cg" |
|
984 |
! |
|
985 |
||
9621
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
986 |
correctableWarning:aString position:relPos to:relEndPos from:aCompiler |
12656 | 987 |
"compiler notifies us of an error - this should really not happen since |
9621
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
988 |
changes ought to be correct (did someone edit the changes file ??). |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
989 |
Show the bad change in the codeView and let codeView hilight the error; |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
990 |
no corrections allowed here therefore return false" |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
991 |
|
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
992 |
^ self correctableError:aString position:relPos to:relEndPos from:aCompiler |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
993 |
|
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
994 |
"Created: / 02-11-2010 / 13:29:52 / cg" |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
995 |
! |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
996 |
|
202 | 997 |
error:aString position:relPos to:relEndPos from:aCompiler |
12656 | 998 |
"compiler notifies us of an error - this should really not happen since |
202 | 999 |
changes ought to be correct (did someone edit the changes file ??). |
1000 |
Show the bad change in the codeView and let codeView hilight the error" |
|
1001 |
||
1002 |
|action| |
|
1003 |
||
1004 |
(changeNrProcessed ~~ changeNrShown) ifTrue:[ |
|
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1005 |
self changeSelection:changeNrProcessed |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1006 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1007 |
|
12973 | 1008 |
"if more than a single change is applied, |
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1009 |
ask the user if he wants to abort the whole sequence of operations..." |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1010 |
multipleApply == true ifTrue:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1011 |
codeView highlightingErrorPosition:relPos to:relEndPos do:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1012 |
|box| |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1013 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1014 |
" |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1015 |
start dialog - make certain cleanup is done |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1016 |
" |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1017 |
action := OptionBox |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1018 |
request:aString |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1019 |
label:'Error' |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1020 |
image:(WarningBox iconBitmap) |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1021 |
buttonLabels:#('Cancel All' 'Skip this Change' " 'Shut up' " 'Continue') |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1022 |
values:#(abortAll skip "shutUp" continue) |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1023 |
default:#continue |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1024 |
onCancel:#abort. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1025 |
]. |
2293 | 1026 |
|
1027 |
"/ action == #shutUp ifTrue:[ |
|
1028 |
"/ aCompiler ignoreWarnings. |
|
6288 | 1029 |
"/ ^ false |
2293 | 1030 |
"/ ]. |
1031 |
||
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1032 |
action == #abortAll ifTrue:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1033 |
AbortAllOperationRequest raise. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1034 |
^ false |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1035 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1036 |
action == #skip ifTrue:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1037 |
AbortOperationRequest raise. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1038 |
^ false |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1039 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1040 |
^ false |
202 | 1041 |
]. |
1042 |
^ codeView error:aString position:relPos to:relEndPos from:aCompiler |
|
373 | 1043 |
|
3436
c4fe19deba58
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3406
diff
changeset
|
1044 |
"Modified: / 16.11.2001 / 17:38:10 / cg" |
202 | 1045 |
! |
1046 |
||
3064 | 1047 |
unusedVariableWarning:aString position:relPos to:relEndPos from:aCompiler |
1048 |
"compiler notifies us of a (or some) unused variables; |
|
1049 |
hilight the error (relPos to relEndPos) and show a Box asking for continue/correct/abort; |
|
1050 |
this method should return true to the compiler if user wants the error |
|
1051 |
to be corrected; false otherwise" |
|
1052 |
||
1053 |
^ false |
|
1054 |
! |
|
1055 |
||
202 | 1056 |
warning:aString position:relPos to:relEndPos from:aCompiler |
12656 | 1057 |
"compiler notifies us of a warning - ignore it" |
202 | 1058 |
|
1059 |
^ self |
|
1060 |
! ! |
|
1061 |
||
2604 | 1062 |
!ChangesBrowser methodsFor:'event handling'! |
202 | 1063 |
|
1064 |
handlesKeyPress:key inView:view |
|
1065 |
"this method is reached via delegation: are we prepared to handle |
|
1066 |
a keyPress in some other view ?" |
|
1067 |
||
1127 | 1068 |
<resource: #keyboard (#Delete #BackSpace #Accept #Find #FindPrev #FindNext)> |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1069 |
|
202 | 1070 |
view == changeListView ifTrue:[ |
6288 | 1071 |
(key == #Delete |
1072 |
or:[key == #BackSpace |
|
1073 |
or:[key == #Accept |
|
1074 |
or:[key == #Find |
|
1075 |
or:[key == #FindPrev |
|
1076 |
or:[key == #FindNext]]]]]) ifTrue:[^ true]. |
|
202 | 1077 |
]. |
1078 |
^ false |
|
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1079 |
|
1127 | 1080 |
"Modified: 8.4.1997 / 11:01:42 / cg" |
0 | 1081 |
! |
1082 |
||
202 | 1083 |
keyPress:key x:x y:y view:view |
1084 |
"this method is reached via delegation from the changeListView" |
|
1085 |
||
1127 | 1086 |
<resource: #keyboard (#Delete #BackSpace #Accept #Find #FindPrev #FindNext)> |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1087 |
|
3249 | 1088 |
(key == #Delete) ifTrue:[ |
13078 | 1089 |
self sensor shiftDown ifTrue:[ |
1090 |
self doDeleteAndSelectPrevious. |
|
1091 |
] ifFalse:[ |
|
1092 |
self doDelete. |
|
1093 |
]. |
|
1094 |
^ self |
|
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1095 |
]. |
3249 | 1096 |
(key == #BackSpace) ifTrue:[ |
13078 | 1097 |
self doDelete. "/ doDeleteAndSelectPrevious. |
1098 |
^ self |
|
3249 | 1099 |
]. |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1100 |
(key == #Accept) ifTrue:[ |
13078 | 1101 |
self doApply. |
1102 |
^ self |
|
202 | 1103 |
]. |
1127 | 1104 |
(key == #Find) ifTrue:[ |
13078 | 1105 |
self findClass. |
1106 |
^ self |
|
1127 | 1107 |
]. |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1108 |
(key == #FindPrev) ifTrue:[ |
13078 | 1109 |
self findPrevious. |
1110 |
^ self |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1111 |
]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1112 |
(key == #FindNext) ifTrue:[ |
13078 | 1113 |
self findNext. |
1114 |
^ self |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1115 |
]. |
202 | 1116 |
changeListView keyPress:key x:x y:y |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1117 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1118 |
"Modified: / 18.6.1998 / 22:15:36 / cg" |
202 | 1119 |
! ! |
1120 |
||
3327 | 1121 |
!ChangesBrowser methodsFor:'help'! |
202 | 1122 |
|
16022 | 1123 |
flyByHelpSpec |
1124 |
^ self class flyByHelpSpec |
|
1125 |
! |
|
1126 |
||
394 | 1127 |
showActivity:someMessage |
502 | 1128 |
"some activityNotification to be forwarded to the user; |
1129 |
show it in the windows title area here." |
|
1130 |
||
11346 | 1131 |
someMessage isNil ifTrue:[ |
1132 |
self newLabel:'' |
|
11347 | 1133 |
] ifFalse:[ |
1134 |
self label:someMessage |
|
1135 |
]. |
|
394 | 1136 |
|
1137 |
"Created: 24.2.1996 / 19:35:42 / cg" |
|
502 | 1138 |
"Modified: 23.4.1996 / 21:39:36 / cg" |
202 | 1139 |
! ! |
1140 |
||
4868 | 1141 |
!ChangesBrowser methodsFor:'initialization & release'! |
202 | 1142 |
|
3202 | 1143 |
autoCompareChanged |
1144 |
"sent from the compare-toggle" |
|
1145 |
||
3534 | 1146 |
|doCompare| |
1147 |
||
13373 | 1148 |
self askIfChangesAreToBeWrittenBack. |
1149 |
||
3534 | 1150 |
doCompare := autoCompare value. |
1151 |
DefaultAutoCompare := doCompare. |
|
1152 |
self setupTabSpec. |
|
1153 |
doCompare ifTrue:[ |
|
13373 | 1154 |
self doUpdate |
3202 | 1155 |
] ifFalse:[ |
13373 | 1156 |
changeListView invalidate. "/ clear; redraw. |
3202 | 1157 |
] |
1158 |
! |
|
1159 |
||
202 | 1160 |
changeListMenu |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1161 |
"return the menu for the change (upper) list" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1162 |
|
586 | 1163 |
<resource: #keyboard ( #Accept #Delete ) > |
1359 | 1164 |
<resource: #programMenu > |
586 | 1165 |
|
3211 | 1166 |
|items m replNext replPrev sel| |
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1167 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1168 |
self sensor ctrlDown ifTrue:[ |
7360 | 1169 |
"/ notice - findNext/prev shortKeys will search for the same thing again. |
1170 |
items := #( |
|
1171 |
('Search Class...' findClass #Find ) |
|
1172 |
('Previous for this Class' findPreviousForClass #FindPrevClass ) |
|
1173 |
('Next for this Class' findNextForClass #FindNextClass ) |
|
1174 |
('-' ) |
|
1175 |
('Search Selector...' findSelector ) |
|
1176 |
('Previous with this Selector' findPreviousForSelector #FindPrevSelector ) |
|
1177 |
('Next with this Selector' findNextForSelector #FindNextSelector ) |
|
1178 |
('-' ) |
|
1179 |
('Search String...' findString ) |
|
1180 |
('Previous with this String' findPreviousForString #FindPrevString ) |
|
1181 |
('Next with this String' findNextForString #FindNextString ) |
|
1182 |
('-' ) |
|
1183 |
('Previous Snapshot' findPreviousSnapshot #FindPrevSnapshot ) |
|
1184 |
('Next Snapshot' findNextSnapshot #FindNextSnapshot ) |
|
1185 |
). |
|
1186 |
||
1187 |
lastSearchType == #selector ifTrue:[ |
|
1188 |
replNext := #FindNextSelector. |
|
1189 |
replPrev := #FindPrevSelector. |
|
1190 |
] ifFalse:[ |
|
1191 |
lastSearchType == #snapshot ifTrue:[ |
|
1192 |
replNext := #FindNextSnapshot. |
|
1193 |
replPrev := #FindPrevSnapshot. |
|
1194 |
] ifFalse:[ |
|
1195 |
lastSearchType == #string ifTrue:[ |
|
1196 |
replNext := #FindNextString. |
|
1197 |
replPrev := #FindPrevString. |
|
1198 |
] ifFalse:[ |
|
1199 |
replNext := #FindNextClass. |
|
1200 |
replPrev := #FindPrevClass. |
|
1201 |
] |
|
1202 |
] |
|
1203 |
]. |
|
1204 |
items := items deepCopy. |
|
1205 |
items do:[:each | |
|
1206 |
each replaceAll:replNext with:#FindNext. |
|
1207 |
each replaceAll:replPrev with:#FindPrev. |
|
1208 |
each replaceAny:#(FindNextClass FindPrevClass |
|
1209 |
FindNextSelector FindPrevSelector |
|
1210 |
FindNextSnapshot FindPrevSnapshot |
|
1211 |
FindNextString FindPrevString) |
|
1212 |
with:nil. |
|
1213 |
]. |
|
1214 |
||
1215 |
^ PopUpMenu itemList:items resources:resources. |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1216 |
]. |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1217 |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1218 |
items := #( |
7360 | 1219 |
('Apply' doApply Accept) |
1220 |
('Apply to End' doApplyRest ) |
|
1221 |
('Apply from Begin' doApplyFromBeginning ) |
|
1222 |
('Apply for Class to End' doApplyClassRest ) |
|
1223 |
('Apply for Class from Begin' doApplyClassFromBeginning ) |
|
1224 |
('Apply All' doApplyAll ) |
|
1225 |
('-' ) |
|
1226 |
('Delete' doDelete Delete) |
|
1227 |
('Delete to End' doDeleteRest ) |
|
1228 |
('Delete for Class to End' doDeleteClassRest ) |
|
1229 |
('Delete for Class from Begin' doDeleteClassFromBeginning ) |
|
1230 |
). |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1231 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1232 |
(self hasSelection and:[self hasSingleSelection not]) ifTrue:[ |
7360 | 1233 |
items := items , |
1234 |
#( |
|
15187 | 1235 |
('Delete all for Classes' doDeleteClassAll ) |
1236 |
('Delete all for Classes & their Private Classes' doDeleteClassAndPrivateClassesAll ) |
|
7360 | 1237 |
). |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1238 |
] ifFalse:[ |
7360 | 1239 |
items := items , |
1240 |
#( |
|
15187 | 1241 |
('Delete all for Class' doDeleteClassAll ) |
1242 |
('Delete all for Class & its Private Classes' doDeleteClassAndPrivateClassesAll ) |
|
7360 | 1243 |
). |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1244 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1245 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1246 |
items := items , |
7360 | 1247 |
#( |
1248 |
('-' ) |
|
1249 |
('Compress' doCompress ) |
|
1250 |
('Compress for Class' doCompressClass ) |
|
1251 |
('Compare and Compress' doCompareAndCompress ) |
|
1252 |
('-' ) |
|
1253 |
('Compare with current Version' doCompare ) |
|
1254 |
('Browse Class' doBrowse ) |
|
1255 |
('-' ) |
|
1256 |
('Make Change a Patch' doMakePatch ) |
|
1257 |
). |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1258 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1259 |
editingClassSource ifFalse:[ |
7360 | 1260 |
items := items , #( |
15187 | 1261 |
('Fileout & Delete all for Class' doFileoutAndDeleteClassAll ) |
1262 |
('CheckIn & Delete all for Class' doCheckinAndDeleteClassAll ) |
|
7360 | 1263 |
) |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1264 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1265 |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1266 |
items := items , #( |
7360 | 1267 |
('-' ) |
1268 |
('Save in...' doSave ) |
|
1269 |
('Save to End In...' doSaveRest ) |
|
1270 |
('Save for Class to End In...' doSaveClassRest ) |
|
1271 |
('Save all for Class In...' doSaveClassAll ) |
|
1272 |
('-' ) |
|
1273 |
). |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1274 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1275 |
editingClassSource ifTrue:[ |
7360 | 1276 |
items := items , #( |
1277 |
('Writeback ClassFile' doWriteBack ) |
|
1278 |
) |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1279 |
] ifFalse:[ |
7360 | 1280 |
items := items , #( |
1281 |
('Writeback ChangeFile' doWriteBack ) |
|
1282 |
) |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1283 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1284 |
|
1833
c9b1a30b326d
moved update item to the end
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
1285 |
items := items , #( |
7360 | 1286 |
('-' ) |
1287 |
('Update' doUpdate ) |
|
1288 |
). |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1289 |
|
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1290 |
m := PopUpMenu itemList:items resources:resources. |
202 | 1291 |
|
255 | 1292 |
"/ |
1293 |
"/ disable those that require a selected entry |
|
1294 |
"/ |
|
3202 | 1295 |
self hasSelection ifFalse:[ |
7360 | 1296 |
m disableAll:#(doApply doApplyClassRest doApplyRest doDelete doDeleteRest doDeleteClassRest |
1297 |
doDeleteClassFromBeginning doDeleteClassAll doDeleteClassAndPrivateClassesAll |
|
1298 |
doCompare doCompressClass doMakePatch doSaveChangeInFile doMakePermanent |
|
1299 |
doSave doSaveRest doSaveClassAll doSaveClassRest doBrowse |
|
1300 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll) |
|
1368 | 1301 |
] ifTrue:[ |
7360 | 1302 |
sel := self theSingleSelection. |
1303 |
sel isNil ifTrue:[ |
|
1304 |
"/ multiple selections |
|
1305 |
m disableAll:#(doApplyClassRest doApplyRest doDeleteClassRest doDeleteRest |
|
1306 |
doDeleteClassFromBeginning |
|
1307 |
doCompressClass doCompare |
|
1308 |
doSaveClassAll doSaveClassRest doSaveRest doBrowse |
|
1309 |
doFileoutAndDeleteClassAll) |
|
1310 |
] ifFalse:[ |
|
1311 |
(self classNameOfChange:sel) isNil ifTrue:[ |
|
1312 |
m disableAll:#(doApplyClassRest doDeleteClassRest |
|
1313 |
doDeleteClassFromBeginning doDeleteClassAll doDeleteClassAndPrivateClassesAll |
|
1314 |
doCompressClass doCompare doMakePatch |
|
1315 |
doSaveClassAll doSaveClassRest doBrowse |
|
1316 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll) |
|
1317 |
] |
|
1318 |
] |
|
255 | 1319 |
]. |
1320 |
||
1321 |
"/ |
|
1322 |
"/ disable those that do not make sense with autoUpdate |
|
1323 |
"/ ('cause this would be overwritten by next update operation) |
|
1324 |
"/ |
|
3202 | 1325 |
autoUpdate value ifTrue:[ |
7360 | 1326 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
1327 |
doDeleteClassAndPrivateClassesAll doCompress |
|
1328 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
|
1329 |
doWriteBack) |
|
202 | 1330 |
]. |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1331 |
readOnly == true ifTrue:[ |
7360 | 1332 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
1333 |
doDeleteClassAndPrivateClassesAll doCompress |
|
1334 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
|
1335 |
doWriteBack doSaveBack doUpdate |
|
1336 |
doApplyAll doApplyRest) |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1337 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1338 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1339 |
self hasSelection ifTrue:[ |
7360 | 1340 |
m disable:#doApplyAll |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1341 |
]. |
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1342 |
|
202 | 1343 |
^ m |
1344 |
||
7360 | 1345 |
"Modified: / 06-09-1995 / 17:14:22 / claus" |
1346 |
"Modified: / 06-10-2006 / 11:17:06 / cg" |
|
202 | 1347 |
! |
1348 |
||
2114 | 1349 |
destroy |
1350 |
"destroy the receiver; make certain, that boxes are destroyed too" |
|
1351 |
||
1352 |
Processor removeTimedBlock:checkBlock. |
|
1353 |
ObjectMemory removeDependent:self. |
|
1354 |
super destroy |
|
1355 |
! |
|
1356 |
||
202 | 1357 |
initialize |
16467 | 1358 |
|panel infoLabel v upperFrame buttonPanel menuPanel mH toolbarMenu tmH |
9168 | 1359 |
checkBox oldStyle codeViewBox lbl applyInOriginal| |
3202 | 1360 |
|
3211 | 1361 |
"/ oldStyle := true. |
3202 | 1362 |
oldStyle := false. |
202 | 1363 |
|
1364 |
super initialize. |
|
1365 |
||
5702 | 1366 |
changeFileName := ObjectMemory nameForChanges. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
1367 |
encodingIfKnown := nil. |
3534 | 1368 |
autoCompare := (DefaultAutoCompare ? false) asValue. |
3202 | 1369 |
autoCompare onChangeSend:#autoCompareChanged to:self. |
1370 |
autoUpdate := false asValue. |
|
6216 | 1371 |
autoloadAsRequired := false asValue. |
10719 | 1372 |
ignorePublicPrivateCategories := false asValue. |
9168 | 1373 |
|
1374 |
applyInOriginal := true. |
|
1375 |
KeepEnforcedNameSpace == true ifTrue:[ |
|
1376 |
enforcedNameSpace := LastEnforcedNameSpace. |
|
1377 |
applyInOriginal := false. |
|
1378 |
]. |
|
1379 |
||
1380 |
applyInOriginalNameSpace := applyInOriginal asValue. |
|
6288 | 1381 |
applyInOriginalNameSpace |
6357 | 1382 |
onChangeEvaluate:[ |
1383 |
autoCompare value ifTrue:[ |
|
1384 |
self doUpdate |
|
1385 |
]. |
|
1386 |
]. |
|
9168 | 1387 |
|
4897 | 1388 |
updateChangeSet := true "false" asValue. |
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
1389 |
classesNotToBeAutoloaded := Set new. |
221 | 1390 |
|
1099
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1391 |
" |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1392 |
checkBlock is executed by the Processor. |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1393 |
We use #pushEvent: to perform the update |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1394 |
in our windowgroups process. |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1395 |
" |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1396 |
checkBlock := [self pushEvent:#checkIfFileHasChanged]. |
202 | 1397 |
|
3202 | 1398 |
oldStyle ifFalse:[ |
6357 | 1399 |
menuPanel := MenuPanel in:self. |
1400 |
"/ menuPanel level:1. |
|
1401 |
menuPanel verticalLayout:false. |
|
1402 |
menuPanel receiver:self. |
|
1403 |
menuPanel menu:(self pullDownMenu). |
|
1404 |
||
8164
ee17624160a6
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8102
diff
changeset
|
1405 |
mH := menuPanel preferredHeight. |
6357 | 1406 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
1407 |
mH := mH + 1. |
|
10681 | 1408 |
|
1409 |
toolbarMenu := MenuPanel in:self. |
|
1410 |
toolbarMenu verticalLayout:false. |
|
1411 |
toolbarMenu receiver:self. |
|
1412 |
toolbarMenu menu:(self toolbarMenu). |
|
16022 | 1413 |
toolbarMenu flyByHelpSpecProvider:self. "/ for helpTexts |
10681 | 1414 |
|
1415 |
tmH := toolbarMenu preferredHeight. |
|
1416 |
toolbarMenu origin:(0.0 @ mH) corner:(1.0 @ (mH+tmH)). |
|
1417 |
mH := mH + tmH + 1. |
|
3202 | 1418 |
] ifTrue:[ |
6357 | 1419 |
mH := 0.0 |
3202 | 1420 |
]. |
1421 |
||
16467 | 1422 |
panel := VariableVerticalPanel in:self. |
1423 |
"/ panel origin:(0.0 @ mH) corner:(1.0 @ 1.0) |
|
1424 |
panel layout:(LayoutFrame |
|
1425 |
leftFraction:0.0 offset:0 |
|
1426 |
rightFraction:1.0 offset:0 |
|
1427 |
topFraction:0.0 offset:mH |
|
1428 |
bottomFraction:1.0 offset:-30). |
|
1429 |
panel borderWidth:0. |
|
1430 |
||
1431 |
infoLabel := Label in:self. |
|
1432 |
infoLabel layout:(LayoutFrame |
|
1433 |
leftFraction:0.0 offset:0 |
|
1434 |
rightFraction:1.0 offset:0 |
|
1435 |
topFraction:1.0 offset:-28 |
|
1436 |
bottomFraction:1.0 offset:-2). |
|
1437 |
infoLabel borderWidth:0. |
|
1438 |
infoLabel sizeFixed:true. |
|
1439 |
infoLabel level:-1. |
|
1440 |
infoLabel adjust:#left. |
|
1441 |
infoLabel labelChannel:(infoHolder := '' asValue). |
|
1442 |
||
3202 | 1443 |
upperFrame := panel. |
1444 |
oldStyle ifTrue:[ |
|
6357 | 1445 |
upperFrame := VariableHorizontalPanel origin:(0.0 @ 0.0) corner:(1.0 @ 0.3) in:panel. |
3202 | 1446 |
]. |
202 | 1447 |
|
1448 |
v := HVScrollableView for:SelectionInListView miniScrollerH:true in:upperFrame. |
|
3202 | 1449 |
oldStyle ifTrue:[ |
6357 | 1450 |
v origin:(0.0 @ 0.0) corner:(0.75 @ 1.0). |
3202 | 1451 |
] ifFalse:[ |
6357 | 1452 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.3). |
3202 | 1453 |
]. |
3090 | 1454 |
|
202 | 1455 |
changeListView := v scrolledView. |
1456 |
changeListView delegate:self. |
|
1457 |
changeListView menuHolder:self; menuPerformer:self; menuMessage:#changeListMenu. |
|
1471 | 1458 |
changeListView doubleClickAction:[:line | self doubleClickOnChange:line]. |
3211 | 1459 |
oldStyle ifFalse:[ |
6357 | 1460 |
changeListView multipleSelectOk:true. |
3211 | 1461 |
]. |
202 | 1462 |
|
3202 | 1463 |
oldStyle ifTrue:[ |
6357 | 1464 |
buttonPanel := VerticalPanelView in:upperFrame. |
1465 |
buttonPanel origin:(0.75 @ 0.0) corner:(1.0 @ 1.0). |
|
1466 |
buttonPanel verticalLayout:#topSpace; horizontalLayout:#leftSpace. |
|
1467 |
||
1468 |
checkBox := CheckBox new model:autoCompare. |
|
1469 |
checkBox label:(resources string:'Auto Compare'). |
|
1470 |
checkBox action:[:val | autoCompare value:val]. |
|
1471 |
buttonPanel addSubView:checkBox. |
|
1472 |
||
1473 |
checkBox := CheckBox new model:autoUpdate. |
|
1474 |
checkBox label:(resources string:'Auto Update'). |
|
1475 |
checkBox action:[:val | autoUpdate value:val]. |
|
1476 |
buttonPanel addSubView:checkBox. |
|
1477 |
||
1478 |
checkBox := CheckBox new. |
|
1479 |
checkBox label:(resources stringWithCRs:'Apply in original NameSpace'). |
|
1480 |
checkBox model:applyInOriginalNameSpace. |
|
1481 |
buttonPanel addSubView:checkBox. |
|
3202 | 1482 |
]. |
2301 | 1483 |
|
3090 | 1484 |
"/ protectExistingMethods := CheckBox new. |
1485 |
"/ protectExistingMethods label:(resources string:'Protect existing code' withCRs). |
|
1486 |
"/ protectExistingMethods model:protectExistingMethods. |
|
1487 |
"/ buttonPanel addSubView:protectExistingMethods. |
|
1488 |
||
4487 | 1489 |
codeViewBox := View in:panel. |
1490 |
codeViewBox origin:(0.0 @ 0.3) corner:(1.0 @ 1.0). |
|
1491 |
||
1492 |
v := HVScrollableView for:CodeView miniScrollerH:true miniScrollerV:false in:codeViewBox. |
|
1493 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
202 | 1494 |
codeView := v scrolledView. |
1996 | 1495 |
codeView readOnly:true. |
202 | 1496 |
|
4487 | 1497 |
diffViewBox := View in:codeViewBox. |
1498 |
diffViewBox origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
1499 |
||
1500 |
lbl := Label label:'Current' in:diffViewBox. |
|
1501 |
lbl layout:(LayoutFrame |
|
6357 | 1502 |
leftFraction:0.0 offset:0 |
1503 |
rightFraction:0.5 offset:0 |
|
1504 |
topFraction:0.0 offset:0 |
|
1505 |
bottomFraction:0.0 offset:20). |
|
4487 | 1506 |
lbl := Label label:'Change' in:diffViewBox. |
1507 |
lbl layout:(LayoutFrame |
|
6357 | 1508 |
leftFraction:0.5 offset:0 |
1509 |
rightFraction:1.0 offset:0 |
|
1510 |
topFraction:0.0 offset:0 |
|
1511 |
bottomFraction:0.0 offset:20). |
|
4487 | 1512 |
|
1513 |
"/ diffView := DiffTextView in:diffViewBox. |
|
1514 |
"/ diffView layout:(LayoutFrame |
|
1515 |
"/ leftFraction:0.0 offset:0 |
|
1516 |
"/ rightFraction:1.0 offset:0 |
|
1517 |
"/ topFraction:0.0 offset:20 |
|
1518 |
"/ bottomFraction:1.0 offset:0). |
|
1519 |
||
8102 | 1520 |
v := HVScrollableView for:DiffCodeView miniScrollerH:true miniScrollerV:false in:diffViewBox. |
4487 | 1521 |
v layout:(LayoutFrame |
6357 | 1522 |
leftFraction:0.0 offset:0 |
1523 |
rightFraction:1.0 offset:0 |
|
1524 |
topFraction:0.0 offset:20 |
|
1525 |
bottomFraction:1.0 offset:0). |
|
4487 | 1526 |
diffView := v scrolledView. |
1527 |
||
1528 |
self showingDiffs value ifFalse:[ |
|
6357 | 1529 |
self makeDiffViewInvisible |
4487 | 1530 |
]. |
1531 |
||
202 | 1532 |
anyChanges := false. |
1533 |
ObjectMemory addDependent:self. "to get shutdown-update" |
|
1534 |
||
1535 |
tabSpec := TabulatorSpecification new. |
|
1536 |
tabSpec unit:#inch. |
|
1537 |
tabSpec positions:#(-1 0 5 8.5 ). |
|
1538 |
" +/- cls>>sel type info" |
|
1539 |
tabSpec align: #(#left #left #left #left). |
|
1540 |
||
10681 | 1541 |
"Modified: / 27-03-1997 / 11:07:07 / stefan" |
11048 | 1542 |
"Modified: / 03-01-2012 / 15:28:45 / cg" |
202 | 1543 |
! |
1544 |
||
1246
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1545 |
postRealize |
3534 | 1546 |
self setupTabSpec. |
202 | 1547 |
self readChangesFileInBackground:true. |
1548 |
self setChangeList. |
|
16467 | 1549 |
changeListView action:[:lineNrOrCollection | self changeSelection:lineNrOrCollection]. |
202 | 1550 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
1246
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1551 |
|
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1552 |
"Created: 24.7.1997 / 18:06:12 / cg" |
202 | 1553 |
! |
1554 |
||
3202 | 1555 |
pullDownMenu |
1556 |
"return the top (pullDown) menu" |
|
1557 |
||
1558 |
<resource: #programMenu> |
|
1559 |
||
3330 | 1560 |
^ self menuFromSpec:self class menuSpec. |
1561 |
||
1562 |
"/ |m| |
|
1563 |
"/ |
|
1564 |
"/ m := self class menuSpec. |
|
1565 |
"/ m := m decodeAsLiteralArray. |
|
1566 |
"/ m receiver:self. |
|
1567 |
"/ m findGuiResourcesIn:self. |
|
1568 |
"/ ^ m. |
|
3202 | 1569 |
! |
1570 |
||
3534 | 1571 |
setupTabSpec |
1572 |
autoCompare value ifTrue:[ |
|
9515 | 1573 |
tabSpec positions:#(0 0.15 7 9.5 ). |
3534 | 1574 |
] ifFalse:[ |
9515 | 1575 |
"/ |
1576 |
"/ set tabs to hide compare-column |
|
1577 |
"/ |
|
1578 |
tabSpec positions:#(-1 0 7 9.5 ). |
|
3534 | 1579 |
] |
9515 | 1580 |
|
1581 |
"Modified: / 10-07-2010 / 10:59:49 / cg" |
|
3534 | 1582 |
! |
1583 |
||
10681 | 1584 |
toolbarMenu |
1585 |
"return the top (pullDown) menu" |
|
1586 |
||
1587 |
<resource: #programMenu> |
|
1588 |
||
1589 |
^ self menuFromSpec:self class toolbarMenuSpec. |
|
1590 |
||
1591 |
"Created: / 07-09-2011 / 16:03:41 / cg" |
|
1592 |
! |
|
1593 |
||
627 | 1594 |
update:what with:aParameter from:changedObject |
202 | 1595 |
|box| |
1596 |
||
8558
a85166102cb7
Wait for #aboutToQuit change message instead of obsolete #aboutToExit
Stefan Vogel <sv@exept.de>
parents:
8515
diff
changeset
|
1597 |
(what == #aboutToQuit) ifTrue:[ |
6639 | 1598 |
" |
1599 |
smalltalk is about to shut down - |
|
1600 |
- if change list was modified, ask user and save if requested. |
|
1601 |
" |
|
1602 |
anyChanges ifTrue:[ |
|
1603 |
self raiseDeiconified. |
|
1604 |
||
1605 |
box := YesNoBox new. |
|
1606 |
box title:('The modified changelist has not been written back to the change file.\\Write change file before exiting ?') withCRs. |
|
1607 |
box okText:(resources string:'Write') noText:(resources string:'Don''t write'). |
|
1608 |
box yesAction:[self writeBackChanges] |
|
1609 |
noAction:[]. |
|
1610 |
box showAtPointer. |
|
1611 |
box destroy |
|
1612 |
]. |
|
1613 |
^ self |
|
202 | 1614 |
]. |
11048 | 1615 |
|
8558
a85166102cb7
Wait for #aboutToQuit change message instead of obsolete #aboutToExit
Stefan Vogel <sv@exept.de>
parents:
8515
diff
changeset
|
1616 |
super update:what with:aParameter from:changedObject |
627 | 1617 |
|
11048 | 1618 |
"Created: / 15-06-1996 / 15:26:30 / cg" |
1619 |
"Modified: / 24-08-1999 / 09:45:06 / stefan" |
|
1620 |
"Modified: / 03-01-2012 / 15:23:13 / cg" |
|
202 | 1621 |
! ! |
1622 |
||
3202 | 1623 |
!ChangesBrowser methodsFor:'menu actions'! |
1624 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1625 |
doApply |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1626 |
"user wants a change to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1627 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1628 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1629 |
(self applyChange:changeNr) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1630 |
^ self "/ cancel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1631 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1632 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1633 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1634 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1635 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1636 |
doApplyAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1637 |
"user wants all changes to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1638 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1639 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1640 |
|lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1641 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1642 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1643 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1644 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1645 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1646 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1647 |
multipleApply := lastNr > 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1648 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1649 |
1 to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1650 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1651 |
self applyChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1652 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1653 |
self autoSelectLast |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1654 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1655 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1656 |
"Modified: 21.1.1997 / 22:26:30 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1657 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1658 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1659 |
doApplyClassFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1660 |
"user wants all changes for this class from 1 to changeNr to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1661 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1662 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1663 |
|thisClassName classNameToApply lastChange |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1664 |
lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1665 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1666 |
classNameToApply := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1667 |
classNameToApply notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1668 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1669 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1670 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1671 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1672 |
multipleApply := changeNr ~= 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1673 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1674 |
1 to:changeNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1675 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1676 |
thisClassName = classNameToApply ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1677 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1678 |
self applyChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1679 |
lastChange := changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1680 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1681 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1682 |
self autoSelect:changeNr+1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1683 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1684 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1685 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1686 |
"Modified: 21.1.1997 / 22:26:04 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1687 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1688 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1689 |
doApplyClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1690 |
"user wants all changes for this class from changeNr to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1691 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1692 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1693 |
|thisClassName classNameToApply lastChange |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1694 |
lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1695 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1696 |
classNameToApply := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1697 |
classNameToApply notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1698 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1699 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1700 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1701 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1702 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1703 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1704 |
multipleApply := (lastNr - changeNr) > 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1705 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1706 |
changeNr to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1707 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1708 |
thisClassName = classNameToApply ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1709 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1710 |
self applyChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1711 |
lastChange := changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1712 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1713 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1714 |
self autoSelect:lastChange. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1715 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1716 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1717 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1718 |
"Modified: 21.1.1997 / 22:26:04 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1719 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1720 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1721 |
doApplyFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1722 |
"user wants all changes from 1 to changeNr to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1723 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1724 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1725 |
|lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1726 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1727 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1728 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1729 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1730 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1731 |
multipleApply := changeNr ~= 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1732 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1733 |
1 to:changeNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1734 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1735 |
self applyChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1736 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1737 |
self autoSelect:changeNr+1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1738 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1739 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1740 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1741 |
doApplyRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1742 |
"apply all changes from changeNr to the end" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1743 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1744 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1745 |
|lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1746 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1747 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1748 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1749 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1750 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1751 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1752 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1753 |
multipleApply := (lastNr - changeNr) > 1. |
15087 | 1754 |
AbortAllOperationRequest handle:[:ex | |
1755 |
ex return |
|
1756 |
] do:[ |
|
1757 |
changeNr to:lastNr do:[:changeNr | |
|
1758 |
changeListView setSelection:changeNr. |
|
1759 |
self applyChange:changeNr |
|
1760 |
]. |
|
1761 |
self autoSelect:self numberOfChanges. |
|
1762 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1763 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1764 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1765 |
"Modified: 21.1.1997 / 22:25:29 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1766 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1767 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1768 |
doApplyToConflictOrEnd |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1769 |
"apply all changes from changeNr to either a conflict (i.e. method exists) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1770 |
or the end." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1771 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1772 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1773 |
|lastNr "{ Class: SmallInteger }"| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1774 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1775 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1776 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1777 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1778 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1779 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1780 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1781 |
multipleApply := (lastNr - changeNr) > 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1782 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1783 |
changeNr to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1784 |
| cls sel | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1785 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1786 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1787 |
((cls := self classOfChange:changeNr ifAbsent:[:className| nil]) notNil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1788 |
and:[(sel := self selectorOfMethodChange:changeNr) notNil]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1789 |
ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1790 |
(cls includesSelector:sel) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1791 |
self autoSelect:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1792 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1793 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1794 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1795 |
self applyChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1796 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1797 |
self autoSelect:self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1798 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1799 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1800 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1801 |
doBrowse |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1802 |
"user wants a browser on the class of a change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1803 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1804 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1805 |
|cls| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1806 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1807 |
cls := self classOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1808 |
cls notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1809 |
UserPreferences systemBrowserClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1810 |
openInClass:cls |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1811 |
selector:(self selectorOfMethodChange:changeNr) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1812 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1813 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1814 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1815 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1816 |
doBrowseImplementors |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1817 |
"open an implementors-browser" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1818 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1819 |
|changeNr initial selector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1820 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1821 |
(changeNr := self theSingleSelection) notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1822 |
initial := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1823 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1824 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1825 |
selector := Dialog |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1826 |
request:'Selector to browse implementors of:' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1827 |
initialAnswer:(initial ? ''). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1828 |
selector size ~~ 0 ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1829 |
UserPreferences systemBrowserClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1830 |
browseImplementorsMatching:selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1831 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1832 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1833 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1834 |
doBrowseSenders |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1835 |
"user wants a browser on the class of a change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1836 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1837 |
|changeNr initial selector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1838 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1839 |
(changeNr := self theSingleSelection) notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1840 |
initial := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1841 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1842 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1843 |
selector := Dialog |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1844 |
request:'Selector to browse senders of:' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1845 |
initialAnswer:(initial ? ''). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1846 |
selector size ~~ 0 ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1847 |
UserPreferences systemBrowserClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1848 |
browseAllCallsOn:selector asSymbol. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1849 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1850 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1851 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1852 |
doCheckinAndDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1853 |
"first checkin the selected changes class then delete all changes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1854 |
for it." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1855 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1856 |
|classes answer logTitle checkinInfo| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1857 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1858 |
"/ self theSingleSelection isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1859 |
"/ ^ self information:'Only possible if a single change is selected.'. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1860 |
"/ ]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1861 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1862 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1863 |
classes := IdentitySet new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1864 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1865 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1866 |
| className class | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1867 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1868 |
className := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1869 |
className notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1870 |
class := Smalltalk classNamed:className. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1871 |
class isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1872 |
self error:'oops - no class: ', className mayProceed:true. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1873 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1874 |
class notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1875 |
class := class theNonMetaclass. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1876 |
(classes includes:class) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1877 |
class isPrivate ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1878 |
(classes includes:class owningClass) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1879 |
answer := self confirmWithCancel:('This is a private class.\\CheckIn the owner ''%1'' and all of its private classes ?' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1880 |
bindWith:class owningClass name allBold) withCRs. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1881 |
answer isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1882 |
answer ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1883 |
classes add:class owningClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1884 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1885 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1886 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1887 |
classes add:class |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1888 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1889 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1890 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1891 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1892 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1893 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1894 |
classes size == 1 ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1895 |
logTitle := classes first name. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1896 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1897 |
logTitle := '%1 classes' bindWith:classes size. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1898 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1899 |
checkinInfo := SourceCodeManagerUtilities default |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1900 |
getCheckinInfoFor:logTitle |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1901 |
initialAnswer:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1902 |
checkinInfo isNil ifTrue:[^ self ]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1903 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1904 |
changeListView setSelection:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1905 |
classes do:[:eachClass | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1906 |
(SourceCodeManagerUtilities default checkinClass:eachClass withInfo:checkinInfo) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1907 |
ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1908 |
self silentDeleteChangesForClassAndPrivateClasses:eachClass name |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1909 |
from:1 to:(self numberOfChanges). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1910 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1911 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1912 |
self setChangeList. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1913 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1914 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1915 |
"Modified: / 6.9.1995 / 17:11:16 / claus" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1916 |
"Modified: / 17.11.2001 / 14:21:13 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1917 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1918 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1919 |
doCompare |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1920 |
"compare change with current system version" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1921 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1922 |
classesNotToBeAutoloaded removeAll. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1923 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1924 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1925 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1926 |
self compareChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1927 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1928 |
self newLabel:'' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1929 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1930 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1931 |
"Modified: 24.2.1996 / 19:37:19 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1932 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1933 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1934 |
doCompareAndCompress |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1935 |
"remove all changes, which are equivalent to the current image version" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1936 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1937 |
|toDelete| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1938 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1939 |
classesNotToBeAutoloaded removeAll. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1940 |
toDelete := OrderedCollection new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1941 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1942 |
1 to:self numberOfChanges do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1943 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1944 |
toDelete add:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1945 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1946 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1947 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1948 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1949 |
toDelete reverseDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1950 |
self silentDeleteChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1951 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1952 |
self setChangeList. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1953 |
" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1954 |
scroll back a bit, if we are left way behind the list |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1955 |
" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1956 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1957 |
changeListView makeLineVisible:self numberOfChanges |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1958 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1959 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1960 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1961 |
self newLabel:''. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1962 |
classesNotToBeAutoloaded removeAll. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1963 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1964 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1965 |
doCompress |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1966 |
"compress the change-set; this replaces multiple method-changes by the last |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1967 |
(i.e. the most recent) change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1968 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1969 |
self compressForClass:nil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1970 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1971 |
"Modified: / 29.10.1997 / 01:03:26 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1972 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1973 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1974 |
doCompressClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1975 |
"compress changes for the selected class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1976 |
this replaces multiple method-changes by the last (i.e. the most recent) change." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1977 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
1978 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1979 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1980 |
self selectedClassNames do:[:classNameToCompress | |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
1981 |
self compressForClass:classNameToCompress. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1982 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1983 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1984 |
"Created: / 29.10.1997 / 01:05:16 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1985 |
"Modified: / 19.11.2001 / 21:55:17 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1986 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1987 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1988 |
doCompressSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1989 |
"compress changes for the selected class & selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1990 |
this replaces multiple method-changes by the last (i.e. the most recent) change." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1991 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1992 |
|classSelectorPairs| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1993 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
1994 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1995 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1996 |
classSelectorPairs := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1997 |
self withSelectedChangesDo:[:changeNr | |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
1998 |
| classNameToCompress selector | |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
1999 |
|
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2000 |
classNameToCompress := self classNameOfChange:changeNr. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2001 |
classNameToCompress notNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2002 |
selector := self selectorOfMethodChange:changeNr. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2003 |
selector notNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2004 |
classSelectorPairs add:(classNameToCompress -> selector). |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2005 |
] |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2006 |
] |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2007 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2008 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2009 |
classSelectorPairs do:[:pair | |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2010 |
self compressForClass:pair key selector:pair value. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2011 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2012 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2013 |
"Created: / 19.11.2001 / 21:50:59 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2014 |
"Modified: / 19.11.2001 / 22:10:08 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2015 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2016 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2017 |
doDelete |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2018 |
"delete currently selected change(s)" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2019 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2020 |
|rangeEnd rangeStart firstDeleted| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2021 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2022 |
changeListView selection size <= 5 ifTrue:[ |
16467 | 2023 |
self withSelectedChangesReverseDo:[:changeNr | |
2024 |
self deleteChange:changeNr. |
|
2025 |
self autoSelectOrEnd:changeNr |
|
2026 |
]. |
|
2027 |
self showNumberOfChanges. |
|
2028 |
^ self |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2029 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2030 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2031 |
self withSelectedChangesReverseDo:[:changeNr | |
16467 | 2032 |
rangeEnd isNil ifTrue:[ |
2033 |
rangeEnd := rangeStart := changeNr |
|
2034 |
] ifFalse:[ |
|
2035 |
(changeNr = (rangeEnd + 1)) ifTrue:[ |
|
2036 |
rangeEnd := changeNr |
|
2037 |
] ifFalse:[ |
|
2038 |
(changeNr = (rangeStart - 1)) ifTrue:[ |
|
2039 |
rangeStart := changeNr |
|
2040 |
] ifFalse:[ |
|
2041 |
self deleteChangesFrom:rangeStart to:rangeEnd. |
|
2042 |
firstDeleted := (firstDeleted ? rangeStart) min:rangeStart. |
|
2043 |
rangeStart := rangeEnd := nil. |
|
2044 |
]. |
|
2045 |
]. |
|
2046 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2047 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2048 |
rangeStart notNil ifTrue:[ |
16467 | 2049 |
self deleteChangesFrom:rangeStart to:rangeEnd. |
2050 |
firstDeleted := (firstDeleted ? rangeStart) min:rangeStart. |
|
2051 |
]. |
|
2052 |
self autoSelectOrEnd:firstDeleted. |
|
2053 |
self showNumberOfChanges |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2054 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2055 |
|
12428 | 2056 |
doDeleteAllForNamespace |
2057 |
"delete all changes for classes with same namespace as currently selected change" |
|
2058 |
||
2059 |
|namespacesToDelete lastChangeNr overAllNumDeletedBefore| |
|
2060 |
||
2061 |
lastChangeNr := -1. |
|
2062 |
namespacesToDelete := Set new. |
|
2063 |
self withSelectedChangesDo:[:changeNr | |
|
2064 |
|namespaceToDelete| |
|
2065 |
||
2066 |
namespaceToDelete := self namespaceOfChange:changeNr. |
|
2067 |
namespaceToDelete notNil ifTrue:[ |
|
2068 |
namespacesToDelete add:namespaceToDelete |
|
2069 |
]. |
|
2070 |
lastChangeNr := lastChangeNr max:changeNr. |
|
2071 |
]. |
|
2072 |
namespacesToDelete isEmpty ifTrue:[^ self]. |
|
2073 |
||
2074 |
overAllNumDeletedBefore := 0. |
|
2075 |
changeListView setSelection:nil. |
|
2076 |
||
2077 |
self withExecuteCursorDo:[ |
|
2078 |
namespacesToDelete do:[:namespaceToDelete | |
|
2079 |
|numDeletedBefore| |
|
2080 |
||
2081 |
self |
|
2082 |
silentDeleteChangesForNamespace:namespaceToDelete |
|
2083 |
from:lastChangeNr |
|
2084 |
to:(self numberOfChanges). |
|
2085 |
numDeletedBefore := self |
|
2086 |
silentDeleteChangesForNamespace:namespaceToDelete |
|
2087 |
from:1 |
|
2088 |
to:(lastChangeNr-1). |
|
2089 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2090 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2091 |
]. |
|
2092 |
]. |
|
2093 |
||
2094 |
self setChangeList. |
|
16467 | 2095 |
self autoSelectOrEnd:lastChangeNr. |
12428 | 2096 |
! |
2097 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2098 |
doDeleteAndSelectPrevious |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2099 |
"delete currently selected change(s)" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2100 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2101 |
self withSelectedChangesReverseDo:[:changeNr | |
16467 | 2102 |
self deleteChange:changeNr. |
2103 |
self autoSelectOrEnd:changeNr-1 |
|
2104 |
]. |
|
2105 |
||
2106 |
"/mh - don't we need a |
|
2107 |
"/ self setChangeList |
|
2108 |
"/ here? |
|
2109 |
self showNumberOfChanges |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2110 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2111 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2112 |
doDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2113 |
"delete all changes with same class as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2114 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2115 |
|classNamesToDelete lastChangeNr overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2116 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2117 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2118 |
classNamesToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2119 |
self withSelectedChangesDo:[:changeNr | |
16467 | 2120 |
|classNameToDelete| |
2121 |
||
2122 |
classNameToDelete := self classNameOfChange:changeNr. |
|
2123 |
classNameToDelete notNil ifTrue:[ |
|
2124 |
classNamesToDelete add:classNameToDelete. |
|
2125 |
]. |
|
2126 |
lastChangeNr := lastChangeNr max:changeNr. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2127 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2128 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2129 |
overAllNumDeletedBefore := 0. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2130 |
changeListView setSelection:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2131 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2132 |
self withExecuteCursorDo:[ |
16467 | 2133 |
classNamesToDelete do:[:classNameToDelete | |
2134 |
|numDeletedBefore| |
|
2135 |
||
2136 |
self silentDeleteChangesFor:classNameToDelete |
|
2137 |
from:lastChangeNr |
|
2138 |
to:(self numberOfChanges). |
|
2139 |
numDeletedBefore := self |
|
2140 |
silentDeleteChangesFor:classNameToDelete |
|
2141 |
from:1 |
|
2142 |
to:(lastChangeNr-1). |
|
2143 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2144 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2145 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2146 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2147 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2148 |
self setChangeList. |
16467 | 2149 |
self autoSelectOrEnd:lastChangeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2150 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2151 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2152 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2153 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2154 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2155 |
doDeleteClassAndPrivateClassesAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2156 |
"delete all changes with same class and private classes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2157 |
as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2158 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2159 |
|lastChangeNr classNamesToDelete overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2160 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2161 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2162 |
classNamesToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2163 |
self withSelectedChangesDo:[:changeNr | |
16467 | 2164 |
|classNameToDelete| |
2165 |
||
2166 |
classNameToDelete := self ownerClassNameOfChange:changeNr. |
|
2167 |
classNameToDelete notNil ifTrue:[ |
|
2168 |
classNamesToDelete add:classNameToDelete. |
|
2169 |
]. |
|
2170 |
lastChangeNr := lastChangeNr max:changeNr. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2171 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2172 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2173 |
overAllNumDeletedBefore := 0. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2174 |
changeListView setSelection:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2175 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2176 |
self withExecuteCursorDo:[ |
16467 | 2177 |
classNamesToDelete do:[:classNameToDelete | |
2178 |
| changeNr numDeletedBefore| |
|
2179 |
||
2180 |
classNameToDelete notNil ifTrue:[ |
|
2181 |
changeListView setSelection:nil. |
|
2182 |
self silentDeleteChangesForClassAndPrivateClasses:classNameToDelete |
|
2183 |
from:lastChangeNr |
|
2184 |
to:(self numberOfChanges). |
|
2185 |
numDeletedBefore := self |
|
2186 |
silentDeleteChangesForClassAndPrivateClasses:classNameToDelete |
|
2187 |
from:1 |
|
2188 |
to:(lastChangeNr-1). |
|
2189 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2190 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2191 |
] |
|
2192 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2193 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2194 |
self setChangeList. |
16467 | 2195 |
self autoSelectOrEnd:lastChangeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2196 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2197 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2198 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2199 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2200 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2201 |
doDeleteClassFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2202 |
"delete changes with same class as currently selected change from the beginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2203 |
up to the selected change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2204 |
Useful to get rid of obsolete changes before a fileout or checkin entry." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2205 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2206 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2207 |
|classNameToDelete prevSelection numDeleted| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2208 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2209 |
classNameToDelete := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2210 |
classNameToDelete notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2211 |
prevSelection := changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2212 |
changeListView setSelection:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2213 |
numDeleted := self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2214 |
silentDeleteChangesFor:classNameToDelete |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2215 |
from:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2216 |
to:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2217 |
self setChangeList. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2218 |
self autoSelectOrEnd:(changeNr + 1 - numDeleted) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2219 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2220 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2221 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2222 |
"Created: 13.12.1995 / 15:41:58 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2223 |
"Modified: 25.5.1996 / 12:26:34 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2224 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2225 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2226 |
doDeleteClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2227 |
"delete rest of changes with same class as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2228 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2229 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2230 |
| classNameToDelete | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2231 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2232 |
classNameToDelete := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2233 |
classNameToDelete notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2234 |
changeListView setSelection:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2235 |
self silentDeleteChangesFor:classNameToDelete |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2236 |
from:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2237 |
to:(self numberOfChanges). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2238 |
self setChangeList. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2239 |
self autoSelectOrEnd:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2240 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2241 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2242 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2243 |
"Modified: / 18.5.1998 / 14:25:07 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2244 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2245 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2246 |
doDeleteClassSelectorAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2247 |
"delete all changes with same class and selector as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2248 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2249 |
|classNameSelectorPairsToDelete lastChangeNr overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2250 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2251 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2252 |
classNameSelectorPairsToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2253 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2254 |
|className selector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2255 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2256 |
className := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2257 |
selector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2258 |
selector notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2259 |
(className notNil and:[selector notNil]) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2260 |
classNameSelectorPairsToDelete add:(className -> selector). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2261 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2262 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2263 |
lastChangeNr := lastChangeNr max:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2264 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2265 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2266 |
overAllNumDeletedBefore := 0. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2267 |
changeListView setSelection:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2268 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2269 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2270 |
classNameSelectorPairsToDelete do:[:pair | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2271 |
|numDeletedBefore className selector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2272 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2273 |
className := pair key. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2274 |
selector := pair value. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2275 |
self silentDeleteChangesFor:className selector:selector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2276 |
from:lastChangeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2277 |
to:(self numberOfChanges). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2278 |
numDeletedBefore := self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2279 |
silentDeleteChangesFor:className selector:selector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2280 |
from:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2281 |
to:(lastChangeNr-1). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2282 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2283 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2284 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2285 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2286 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2287 |
self setChangeList. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2288 |
self autoSelectOrEnd:lastChangeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2289 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2290 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2291 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2292 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2293 |
|
16475 | 2294 |
doDeleteClassSelectorOlder |
2295 |
"delete older changes with same class and selector as currently selected change(s)" |
|
2296 |
||
2297 |
|classNameSelectorPairsToDelete upToPerClassAndSelector lastChangeNr overAllNumDeletedBefore| |
|
2298 |
||
2299 |
lastChangeNr := -1. |
|
2300 |
classNameSelectorPairsToDelete := Set new. |
|
2301 |
upToPerClassAndSelector := Dictionary new. |
|
2302 |
||
2303 |
"/ collect what is to be deleted |
|
2304 |
self withSelectedChangesDo:[:changeNr | |
|
2305 |
|className selector| |
|
2306 |
||
2307 |
className := self classNameOfChange:changeNr. |
|
2308 |
selector := self selectorOfMethodChange:changeNr. |
|
2309 |
selector notNil ifTrue:[ |
|
2310 |
(className notNil and:[selector notNil]) ifTrue:[ |
|
2311 |
classNameSelectorPairsToDelete add:(className -> selector). |
|
2312 |
upToPerClassAndSelector at:(className -> selector) put:changeNr. |
|
2313 |
] |
|
2314 |
]. |
|
2315 |
lastChangeNr := lastChangeNr max:changeNr. |
|
2316 |
]. |
|
2317 |
||
2318 |
overAllNumDeletedBefore := 0. |
|
2319 |
changeListView setSelection:nil. |
|
2320 |
||
2321 |
self withExecuteCursorDo:[ |
|
2322 |
classNameSelectorPairsToDelete do:[:pair | |
|
2323 |
|numDeletedBefore className selector lastToDelete| |
|
2324 |
||
2325 |
className := pair key. |
|
2326 |
selector := pair value. |
|
2327 |
lastToDelete := (upToPerClassAndSelector at:pair) - 1. |
|
2328 |
||
2329 |
numDeletedBefore := self |
|
2330 |
silentDeleteChangesFor:className selector:selector |
|
2331 |
from:1 |
|
2332 |
to:lastToDelete. |
|
2333 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2334 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2335 |
]. |
|
2336 |
]. |
|
2337 |
||
2338 |
self setChangeList. |
|
2339 |
self autoSelectOrEnd:lastChangeNr |
|
2340 |
! |
|
2341 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2342 |
doDeleteFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2343 |
"delete all changes from 1 to the current" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2344 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2345 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2346 |
self deleteChangesFrom:1 to:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2347 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2348 |
self autoSelectOrEnd:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2349 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2350 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2351 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2352 |
doDeleteRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2353 |
"delete all changes from current to the end" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2354 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2355 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2356 |
self deleteChangesFrom:changeNr to:(self numberOfChanges). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2357 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2358 |
self autoSelectOrEnd:changeNr-1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2359 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2360 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2361 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2362 |
doFileoutAndDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2363 |
"first fileOut the selected changes class then delete all changes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2364 |
for it." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2365 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2366 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2367 |
| className class | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2368 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2369 |
className := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2370 |
className notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2371 |
class := Smalltalk classNamed:className. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2372 |
class notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2373 |
Class fileOutErrorSignal handle:[:ex | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2374 |
self warn:('fileout failed: ' , ex description). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2375 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2376 |
class fileOut. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2377 |
self doDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2378 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2379 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2380 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2381 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2382 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2383 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2384 |
"Modified: 6.9.1995 / 17:11:16 / claus" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2385 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2386 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2387 |
doMakePatch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2388 |
"user wants a change to be made a patch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2389 |
- copy it over to the patches file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2390 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2391 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2392 |
self makeChangeAPatch:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2393 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2394 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2395 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2396 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2397 |
doMakePermanent |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2398 |
"user wants a change to be made permanent |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2399 |
- rewrite the source file where this change has to go" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2400 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2401 |
|yesNoBox| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2402 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2403 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2404 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2405 |
yesNoBox := YesNoBox new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2406 |
yesNoBox title:(resources string:'Warning: this operation cannot be undone'). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2407 |
yesNoBox okText:(resources string:'continue') noText:(resources string:'abort'). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2408 |
yesNoBox okAction:[ |changeNr| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2409 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2410 |
changeNr := self theSingleSelection. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2411 |
changeNr notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2412 |
self makeChangePermanent:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2413 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2414 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2415 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2416 |
yesNoBox showAtPointer. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2417 |
yesNoBox destroy |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2418 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2419 |
"Modified: 7.1.1997 / 23:03:33 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2420 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2421 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2422 |
doSave |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2423 |
"user wants a change to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2424 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2425 |
|fileName| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2426 |
|
13651 | 2427 |
fileName := Dialog |
2428 |
requestFileNameForSave:(resources string:'Append change to:') |
|
2429 |
default:(lastSaveFileName ? '') |
|
2430 |
ok:(resources string:'Append') |
|
2431 |
abort:(resources string:'Abort') |
|
2432 |
pattern:'*.chg'. |
|
2433 |
fileName isEmptyOrNil ifTrue:[ |
|
2434 |
^ self |
|
2435 |
]. |
|
2436 |
lastSaveFileName := fileName. |
|
2437 |
||
2438 |
self withWriteCursorDo:[ |
|
2439 |
self withSelectedChangesDo:[:changeNr | |
|
2440 |
self appendChange:changeNr toFile:fileName. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2441 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2442 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2443 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2444 |
|
11685 | 2445 |
"Modified: / 27-07-2012 / 09:46:14 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2446 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2447 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2448 |
doSaveClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2449 |
"user wants changes for some class from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2450 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2451 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2452 |
self doSaveClassFrom:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2453 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2454 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2455 |
doSaveClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2456 |
"user wants changes for some class from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2457 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2458 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2459 |
self doSaveClassFrom:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2460 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2461 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2462 |
doSaveClassFrom:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2463 |
"user wants changes from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2464 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2465 |
|changeNr classNameToSave| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2466 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2467 |
changeNr := self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2468 |
classNameToSave := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2469 |
classNameToSave notNil ifTrue:[ |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2470 |
self saveClass:classNameToSave from:startNr |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2471 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2472 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2473 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2474 |
doSaveClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2475 |
"user wants changes for some class from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2476 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2477 |
|changeNr| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2478 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2479 |
changeNr := self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2480 |
self doSaveClassFrom:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2481 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2482 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2483 |
"/ self changeSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2484 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2485 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2486 |
doSaveRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2487 |
"user wants changes from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2488 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2489 |
|changeNr fileName| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2490 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2491 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2492 |
^ self information:(resources string:'Only possible if a single change is selected.'). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2493 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2494 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2495 |
fileName := Dialog |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2496 |
requestFileNameForSave:(resources string:'Append changes to:') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2497 |
default:(lastSaveFileName ? '') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2498 |
ok:(resources string:'Append') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2499 |
abort:(resources string:'Abort') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2500 |
pattern:'*.chg'. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2501 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2502 |
fileName notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2503 |
lastSaveFileName := fileName. |
11685 | 2504 |
self withWriteCursorDo:[ |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2505 |
changeNr to:(self numberOfChanges) do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2506 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2507 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2508 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2509 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2510 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2511 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2512 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2513 |
|
11685 | 2514 |
"Modified: / 27-07-2012 / 09:46:09 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2515 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2516 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2517 |
doUpdate |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2518 |
"reread the changes-file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2519 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2520 |
self readChangesFileInBackground:true. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2521 |
self newLabel:''. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2522 |
realized ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2523 |
self setChangeList. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2524 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2525 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2526 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2527 |
doWriteBack |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2528 |
"write back the list onto the changes file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2529 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2530 |
anyChanges ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2531 |
(self writeBackChanges) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2532 |
realized ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2533 |
self readChangesFile. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2534 |
realized ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2535 |
self setChangeList |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2536 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2537 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2538 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2539 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2540 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2541 |
"Modified: 5.9.1996 / 17:19:46 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2542 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2543 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2544 |
findClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2545 |
"findClass menu action: let user enter a classes name, and select the next change for that class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2546 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2547 |
|current| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2548 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2549 |
changeNrShown notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2550 |
current := self classNameOfChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2551 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2552 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2553 |
self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2554 |
askForSearch:'Class to search for:' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2555 |
initialAnswer:current |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2556 |
thenSearchUsing:[:searchString :changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2557 |
|thisClassName| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2558 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2559 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2560 |
thisClassName notNil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2561 |
and:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2562 |
(thisClassName sameAs: searchString) |
13440 | 2563 |
or:[searchString includesMatchCharacters and:[searchString match:thisClassName caseSensitive:false]]] |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2564 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2565 |
onCancel:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2566 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2567 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2568 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2569 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2570 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2571 |
findFirstForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2572 |
"findNextForClass menu action: select the next change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2573 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2574 |
self findNextForClassStartingAt:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2575 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2576 |
"Created: / 20-11-2006 / 16:37:56 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2577 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2578 |
|
15674 | 2579 |
findFirstForClass:className |
2580 |
"findNextForClass menu action: select the next change for the selected changes class" |
|
2581 |
||
2582 |
self findNextForClass:className startingAt:1 |
|
2583 |
! |
|
2584 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2585 |
findLastForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2586 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2587 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2588 |
self findPreviousForClassStartingAt:(self numberOfChanges) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2589 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2590 |
"Created: / 20-11-2006 / 16:39:15 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2591 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2592 |
|
15674 | 2593 |
findLastForClass:className |
2594 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
|
2595 |
||
2596 |
self findPreviousForClass:className startingAt:(self numberOfChanges) |
|
2597 |
||
2598 |
"Created: / 20-11-2006 / 16:39:15 / cg" |
|
2599 |
! |
|
2600 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2601 |
findLastSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2602 |
"findLastSnapshot menu action: select the last change which is for a snapShot-image save action" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2603 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2604 |
"/ lastSearchType := #snapshot. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2605 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2606 |
self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2607 |
findPreviousForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2608 |
startingAt:(self numberOfChanges) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2609 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2610 |
"Created: / 06-10-2006 / 11:03:39 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2611 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2612 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2613 |
findNext |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2614 |
"findNext menu action: select the next change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2615 |
Searches for what the last search was for; i.e. either same class or same selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2616 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2617 |
lastSearchType == #selector ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2618 |
^ self findNextForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2619 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2620 |
lastSearchType == #snapshot ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2621 |
^ self findNextSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2622 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2623 |
lastSearchType == #string ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2624 |
^ self findNextForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2625 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2626 |
lastSearchType == #difference ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2627 |
^ self findNextDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2628 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2629 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2630 |
^ self findNextForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2631 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2632 |
"Created: / 18.6.1998 / 22:15:00 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2633 |
"Modified: / 18.6.1998 / 22:15:25 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2634 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2635 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2636 |
findNextDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2637 |
lastSearchType := #difference. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2638 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2639 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2640 |
self findNextForWhich:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2641 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2642 |
"/ same |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2643 |
false |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2644 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2645 |
"/ different |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2646 |
true |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2647 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2648 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2649 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2650 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2651 |
findNextForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2652 |
"findNextForClass menu action: select the next change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2653 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2654 |
self findNextForClassStartingAt: changeNrShown + 1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2655 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2656 |
"Modified: / 20-11-2006 / 16:37:49 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2657 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2658 |
|
15674 | 2659 |
findNextForClass:className startingAt:startNr |
2660 |
"findNextForClass menu action: select the next change for the selected changes class" |
|
2661 |
||
2662 |
lastSearchType := #class. |
|
2663 |
||
2664 |
self |
|
2665 |
findNextForWhich:[:changeNr | |
|
2666 |
|thisClass| |
|
2667 |
||
2668 |
thisClass := self classNameOfChange:changeNr. |
|
2669 |
(thisClass = className |
|
2670 |
or:[className includesMatchCharacters |
|
2671 |
and:[className match:thisClass]])] |
|
2672 |
startingAt:startNr |
|
2673 |
! |
|
2674 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2675 |
findNextForClassStartingAt:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2676 |
"findNextForClass menu action: select the next change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2677 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2678 |
|cls| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2679 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2680 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2681 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2682 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2683 |
cls := self classNameOfChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2684 |
cls isNil ifTrue:[^ self]. |
15674 | 2685 |
self findNextForClass:cls startingAt:startNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2686 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2687 |
"Created: / 20-11-2006 / 16:37:37 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2688 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2689 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2690 |
findNextForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2691 |
"findNextForSelector menu action: select the next change for the selected changes selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2692 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2693 |
|sel| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2694 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2695 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2696 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2697 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2698 |
sel := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2699 |
sel isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2700 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2701 |
self findNextForWhich: [:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2702 |
|thisSelector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2703 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2704 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2705 |
(thisSelector = sel or:[sel includesMatchCharacters and:[sel match:thisSelector]]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2706 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2707 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2708 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2709 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2710 |
findNextForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2711 |
lastSearchString isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2712 |
^ self findString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2713 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2714 |
self findNextWithString:lastSearchString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2715 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2716 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2717 |
findNextForWhich:aBlock |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2718 |
"helper: select the next change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2719 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2720 |
^ self findNextForWhich:aBlock startingAt:changeNrShown + 1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2721 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2722 |
"Modified: / 20-11-2006 / 16:34:23 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2723 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2724 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2725 |
findNextForWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2726 |
"helper: select the next change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2727 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2728 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2729 |
findNextOrPrevious:#next |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2730 |
forWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2731 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2732 |
"Created: / 20-11-2006 / 16:34:06 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2733 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2734 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2735 |
findNextOrPrevious:direction forWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2736 |
"helper: find and select the next or previous change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2737 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2738 |
self withCursor:Cursor questionMark do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2739 |
Object userInterruptSignal handle:[:ex | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2740 |
self beep. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2741 |
^ 0 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2742 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2743 |
|increment nr lastNr| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2744 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2745 |
increment := (direction == #previous) ifTrue:[-1] ifFalse:[1]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2746 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2747 |
nr := changeNrToStartSearch. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2748 |
[ (direction == #previous and:[nr >= 1]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2749 |
or:[ direction == #next and:[ nr <= lastNr]] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2750 |
] whileTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2751 |
(aBlock value:nr) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2752 |
changeListView setSelection:nr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2753 |
self changeSelection:nr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2754 |
^ nr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2755 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2756 |
nr := nr + increment. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2757 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2758 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2759 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2760 |
self showNotFound. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2761 |
self windowGroup sensor flushKeyboard. "/ avoid multiple beeps, in case of type ahead |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2762 |
^ 0 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2763 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2764 |
"Created: / 08-03-2012 / 11:57:26 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2765 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2766 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2767 |
findNextSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2768 |
"findNextSnapshot menu action: select the next change which is for a snapShot-image save action" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2769 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2770 |
lastSearchType := #snapshot. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2771 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2772 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2773 |
self findNextForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2774 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2775 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2776 |
findNextWithString:searchString |
14939 | 2777 |
|includesMatchCharacters| |
2778 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2779 |
lastSearchType := #string. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2780 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2781 |
lastSearchString := searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2782 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2783 |
changeNrShown isNil ifTrue:[ |
14939 | 2784 |
changeNrShown := 0. |
2785 |
]. |
|
2786 |
||
2787 |
includesMatchCharacters := searchString includesMatchCharacters. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2788 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2789 |
self findNextForWhich: |
14939 | 2790 |
[:changeNr | |
2791 |
|s| |
|
2792 |
||
2793 |
s := self sourceOfMethodChange:changeNr. |
|
2794 |
s notNil and:[ |
|
2795 |
(includesMatchCharacters not and:[(s findString:searchString) ~~ 0]) |
|
2796 |
or:[ includesMatchCharacters and:[('*' , searchString , '*') match:s ]]] |
|
2797 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2798 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2799 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2800 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2801 |
codeView setSearchPattern:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2802 |
codeView |
14939 | 2803 |
searchFwd:searchString |
2804 |
ignoreCase:false |
|
2805 |
startingAtLine:1 col:0 |
|
2806 |
ifAbsent:nil. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2807 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2808 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2809 |
findPrevious |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2810 |
"findPrevious menu action: select the previous change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2811 |
Searches for what the last search was for; i.e. either same class or same selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2812 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2813 |
lastSearchType == #selector ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2814 |
^ self findPreviousForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2815 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2816 |
lastSearchType == #snapshot ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2817 |
^ self findPreviousSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2818 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2819 |
lastSearchType == #string ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2820 |
^ self findPreviousForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2821 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2822 |
lastSearchType == #difference ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2823 |
^ self findPreviousDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2824 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2825 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2826 |
^ self findPreviousForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2827 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2828 |
"Created: / 18.6.1998 / 22:15:15 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2829 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2830 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2831 |
findPreviousDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2832 |
lastSearchType := #difference. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2833 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2834 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2835 |
self findPreviousForWhich:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2836 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2837 |
"/ same |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2838 |
false |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2839 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2840 |
"/ different |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2841 |
true |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2842 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2843 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2844 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2845 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2846 |
findPreviousForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2847 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2848 |
|
12738 | 2849 |
self findPreviousForClassStartingAt:((changeNrShown ? 1) - 1) |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2850 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2851 |
"Modified: / 20-11-2006 / 16:39:04 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2852 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2853 |
|
15674 | 2854 |
findPreviousForClass:className startingAt:startNr |
2855 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
|
2856 |
||
2857 |
lastSearchType := #class. |
|
2858 |
||
2859 |
self |
|
2860 |
findPreviousForWhich: |
|
2861 |
[:changeNr | |
|
2862 |
|thisClass| |
|
2863 |
||
2864 |
thisClass := self classNameOfChange:changeNr. |
|
2865 |
(thisClass = className |
|
2866 |
or:[className includesMatchCharacters |
|
2867 |
and:[className match:thisClass]])] |
|
2868 |
startingAt:startNr |
|
2869 |
! |
|
2870 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2871 |
findPreviousForClassStartingAt:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2872 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2873 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2874 |
|cls| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2875 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2876 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2877 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2878 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2879 |
cls := self classNameOfChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2880 |
cls isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2881 |
|
15674 | 2882 |
self findPreviousForClass:cls startingAt:startNr |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2883 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2884 |
"Created: / 20-11-2006 / 16:38:37 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2885 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2886 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2887 |
findPreviousForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2888 |
"findPreviousForSelector menu action: select the previous change for the selected changes selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2889 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2890 |
|sel| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2891 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2892 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2893 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2894 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2895 |
sel := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2896 |
sel isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2897 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2898 |
self findPreviousForWhich: |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2899 |
[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2900 |
|thisSelector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2901 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2902 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2903 |
(thisSelector = sel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2904 |
or:[sel includesMatchCharacters and:[sel match:thisSelector]]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2905 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2906 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2907 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2908 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2909 |
findPreviousForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2910 |
lastSearchString isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2911 |
^ self findString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2912 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2913 |
self findPreviousWithString:lastSearchString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2914 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2915 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2916 |
findPreviousForWhich:aBlock |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2917 |
"helper: select the previous change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2918 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2919 |
^ self findPreviousForWhich:aBlock startingAt:(changeNrShown - 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2920 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2921 |
"Modified: / 06-10-2006 / 11:01:38 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2922 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2923 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2924 |
findPreviousForWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2925 |
"helper: select the previous change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2926 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2927 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2928 |
findNextOrPrevious:#previous |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2929 |
forWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2930 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2931 |
"Created: / 06-10-2006 / 11:01:09 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2932 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2933 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2934 |
findPreviousSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2935 |
"findPreviousSnapshot menu action: select the previous change which is for a snapShot-image save action" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2936 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2937 |
lastSearchType := #snapshot. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2938 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2939 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2940 |
self findPreviousForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2941 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2942 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2943 |
findPreviousWithString:searchString |
14939 | 2944 |
|includesMatchCharacters| |
2945 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2946 |
lastSearchType := #string. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2947 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2948 |
lastSearchString := searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2949 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2950 |
changeNrShown isNil ifTrue:[ |
14939 | 2951 |
changeNrShown := 0. |
2952 |
]. |
|
2953 |
||
2954 |
includesMatchCharacters := searchString includesMatchCharacters. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2955 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2956 |
self findPreviousForWhich: |
14939 | 2957 |
[:changeNr | |
2958 |
|s | |
|
2959 |
||
2960 |
s := self sourceOfMethodChange:changeNr. |
|
2961 |
s notNil and:[ |
|
2962 |
(includesMatchCharacters not and:[(s findString:searchString) ~~ 0]) |
|
2963 |
or:[includesMatchCharacters and:[('*' , searchString , '*') match:s ]]] |
|
2964 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2965 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2966 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2967 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2968 |
codeView setSearchPattern:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2969 |
codeView |
14939 | 2970 |
searchFwd:searchString |
2971 |
ignoreCase:false |
|
2972 |
startingAtLine:1 col:0 |
|
2973 |
ifAbsent:nil. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2974 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2975 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2976 |
findSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2977 |
"findSelector menu action: let user enter a selector, and select the next change for that selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2978 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2979 |
|current| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2980 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2981 |
changeNrShown notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2982 |
current := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2983 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2984 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2985 |
self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2986 |
askForSearch:'Selector to search for:' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2987 |
initialAnswer:current |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2988 |
thenSearchUsing:[:searchString :changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2989 |
|thisSelector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2990 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2991 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2992 |
(thisSelector = searchString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2993 |
or:[searchString includesMatchCharacters and:[searchString match:thisSelector]]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2994 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2995 |
onCancel:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2996 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2997 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2998 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2999 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3000 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3001 |
findString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3002 |
|searchString directionHolder| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3003 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3004 |
lastSearchType := #string. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3005 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3006 |
searchString := codeView selection. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3007 |
searchString size == 0 ifTrue:[searchString := lastSearchString]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3008 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3009 |
searchString := self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3010 |
askForSearchString:'String to search for:' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3011 |
initialAnswer:(searchString ? '') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3012 |
directionInto:(directionHolder := ValueHolder new). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3013 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3014 |
searchString size == 0 ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3015 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3016 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3017 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3018 |
directionHolder value == #backward ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3019 |
self findPreviousWithString:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3020 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3021 |
self findNextWithString:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3022 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3023 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3024 |
|
10719 | 3025 |
ignorePublicPrivateCategories:aBoolean |
3026 |
UserPreferences current ignorePublicPrivateCategories:aBoolean |
|
3027 |
||
3028 |
"Created: / 23-09-2011 / 19:52:21 / cg" |
|
3029 |
! |
|
3030 |
||
3202 | 3031 |
menuExit |
3204 | 3032 |
self closeRequest |
3202 | 3033 |
! |
3034 |
||
3035 |
openAboutThisApplication |
|
3036 |
"opens an about box for this application." |
|
3037 |
||
7115 | 3038 |
Dialog aboutClass:self class. |
3039 |
||
3040 |
"Modified: / 12-09-2006 / 17:20:22 / cg" |
|
3202 | 3041 |
! |
3042 |
||
3043 |
openHTMLDocument:relativeDocPath |
|
3044 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
3045 |
! |
|
3046 |
||
9055 | 3047 |
openSettingsDialog |
14558 | 3048 |
|settingsList| |
9055 | 3049 |
|
3050 |
settingsList := |
|
3051 |
#( |
|
3052 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
|
3053 |
"/ #('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
3054 |
"/ #('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
3055 |
"/ #('System Browser' #'AbstractSettingsApplication::SystemBrowserSettingsAppl' ) |
|
3056 |
#('Compiler' #'AbstractSettingsApplication::GeneralCompilerSettingsAppl' ) |
|
3057 |
#('Compiler/ByteCode' #'AbstractSettingsApplication::ByteCodeCompilerSettingsAppl' ) |
|
3058 |
"/ #('Source Code Management' #'AbstractSettingsApplication::SourceCodeManagementSettingsAppl') |
|
3059 |
). |
|
3060 |
||
14558 | 3061 |
SettingsDialog |
3062 |
openWithList:settingsList |
|
3063 |
label:(resources string:'Change Browser Settings'). |
|
9055 | 3064 |
! |
3065 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3066 |
setEnforcedNameSpace |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3067 |
|nsName listOfKnownNameSpaces keepAsDefaultHolder| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3068 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3069 |
listOfKnownNameSpaces := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3070 |
NameSpace |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3071 |
allNameSpaces |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3072 |
do:[:eachNameSpace | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3073 |
listOfKnownNameSpaces add:eachNameSpace name |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3074 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3075 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3076 |
|
15450 | 3077 |
Dialog modifyingBoxWith:[:box | |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3078 |
keepAsDefaultHolder := true asValue. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3079 |
box verticalPanel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3080 |
add:((CheckBox |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3081 |
label:(resources string:'Use this as default in the future')) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3082 |
model:keepAsDefaultHolder). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3083 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3084 |
nsName := Dialog |
15450 | 3085 |
request:(resources string:'When applying, new classes are created in nameSpace:') |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3086 |
initialAnswer:(enforcedNameSpace ? LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3087 |
list:listOfKnownNameSpaces. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3088 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3089 |
nsName isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3090 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3091 |
(nsName isEmpty or:[nsName = 'Smalltalk']) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3092 |
applyInOriginalNameSpace value:true. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3093 |
LastEnforcedNameSpace := enforcedNameSpace := nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3094 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3095 |
applyInOriginalNameSpace value:false. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3096 |
LastEnforcedNameSpace := enforcedNameSpace := NameSpace name:nsName. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3097 |
autoCompare value ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3098 |
self doUpdate |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3099 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3100 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3101 |
KeepEnforcedNameSpace := keepAsDefaultHolder value. |
11680
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3102 |
codeView nameSpaceForDoits:enforcedNameSpace. |
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3103 |
diffView textViews do:[:each | each nameSpaceForDoits:enforcedNameSpace]. |
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3104 |
|
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3105 |
"Modified: / 26-07-2012 / 23:06:23 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3106 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3107 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3108 |
setEnforcedPackage |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3109 |
|pkg listOfKnownPackages| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3110 |
|
16207 | 3111 |
listOfKnownPackages := Smalltalk allPackageIDs. |
12645 | 3112 |
"/ Smalltalk allClassesDo:[:eachClass | |
3113 |
"/ |package| |
|
3114 |
"/ |
|
3115 |
"/ package := eachClass package. |
|
3116 |
"/ package size > 0 ifTrue:[ |
|
3117 |
"/ listOfKnownPackages add:package |
|
3118 |
"/ ] |
|
3119 |
"/ ]. |
|
3120 |
listOfKnownPackages := listOfKnownPackages asNewOrderedCollection sort. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3121 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3122 |
pkg := Dialog |
12645 | 3123 |
request:'When applying, changes go into package:' |
3124 |
initialAnswer:(enforcedPackage ? Class packageQuerySignal query) |
|
3125 |
list:listOfKnownPackages. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3126 |
pkg size ~~ 0 ifTrue:[ |
12645 | 3127 |
enforcedPackage := pkg |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3128 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3129 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3130 |
|
3202 | 3131 |
showAboutSTX |
3132 |
ToolApplicationModel openAboutSTX |
|
3133 |
! ! |
|
3134 |
||
202 | 3135 |
!ChangesBrowser methodsFor:'private'! |
3136 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3137 |
autoSelect:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3138 |
"select a change" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3139 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3140 |
self class autoSelectNext ifTrue:[ |
6288 | 3141 |
(changeNr <= self numberOfChanges) ifTrue:[ |
3142 |
changeListView setSelection:changeNr. |
|
3143 |
self changeSelection:changeNr. |
|
3144 |
^ self |
|
3145 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3146 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3147 |
self clearCodeView. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3148 |
changeListView setSelection:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3149 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3150 |
"Modified: / 18.5.1998 / 14:26:43 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3151 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3152 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3153 |
autoSelectLast |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3154 |
"select the last change" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3155 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3156 |
self autoSelect:(self numberOfChanges) |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3157 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3158 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3159 |
autoSelectOrEnd:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3160 |
"select the next change or the last" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3161 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3162 |
|last| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3163 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3164 |
last := self numberOfChanges. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3165 |
changeNr < last ifTrue:[ |
6288 | 3166 |
self autoSelect:changeNr |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3167 |
] ifFalse:[ |
6288 | 3168 |
last == 0 ifTrue:[ |
3169 |
last := nil |
|
3170 |
]. |
|
3171 |
changeListView setSelection:last . |
|
3172 |
self changeSelection:last. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3173 |
] |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3174 |
|
3406
8fe22b36fbc2
fixed autoselectNext if list is empty
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
3175 |
"Modified: / 13.11.2001 / 13:00:45 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3176 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3177 |
|
8619 | 3178 |
beep |
15136 | 3179 |
"output an audible beep or bell on my screen device" |
3180 |
||
8619 | 3181 |
UserPreferences current beepInEditor ifTrue:[ |
3182 |
super beep |
|
3183 |
] |
|
3184 |
! |
|
3185 |
||
16372 | 3186 |
changeChunkAt:index |
3187 |
^ (changeInfoList at:index) chunk |
|
3188 |
"/ ^ changeChunks at:index |
|
3189 |
||
3190 |
"Created: / 01-05-2016 / 18:24:28 / cg" |
|
3191 |
! |
|
3192 |
||
3193 |
changeClassNameAt:index |
|
3194 |
^ (changeInfoList at:index) className |
|
3195 |
||
3196 |
"Created: / 01-05-2016 / 18:28:13 / cg" |
|
3197 |
"Modified: / 01-05-2016 / 19:32:42 / cg" |
|
3198 |
! |
|
3199 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3200 |
checkClassIsLoaded:aClass |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3201 |
"check for and warn if a class is unloaded (helper for compare-change)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3202 |
|
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3203 |
|cls answer| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3204 |
|
3359
2cc7eff866e4
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
3341
diff
changeset
|
3205 |
cls := aClass theNonMetaclass. |
5825 | 3206 |
cls isLoaded ifTrue:[ |
6357 | 3207 |
^ true. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3208 |
]. |
11805 | 3209 |
(classesNotToBeAutoloaded includes:#all) ifTrue:[ |
3210 |
^ false. |
|
3211 |
]. |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3212 |
(classesNotToBeAutoloaded includes:cls) ifTrue:[ |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3213 |
^ false. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3214 |
]. |
5825 | 3215 |
|
6216 | 3216 |
autoloadAsRequired value == true ifTrue:[ |
6357 | 3217 |
answer := true |
6216 | 3218 |
] ifFalse:[ |
11805 | 3219 |
answer := Dialog |
3220 |
confirmWithCancel:(resources |
|
15079 | 3221 |
stringWithCRs:'%1 is an autoloaded class.\I can only compare the method''s source if its loaded first.\\Shall the class be loaded now ?' |
11805 | 3222 |
with:cls name allBold) |
3223 |
labels:(resources array:#('Cancel' 'No for All' 'No' 'Yes')) |
|
3224 |
values:#(nil #never false true) |
|
3225 |
default:4. |
|
3226 |
answer isNil ifTrue:[ |
|
3227 |
"cancel the operation" |
|
3228 |
AbortAllOperationRequest raise. |
|
3229 |
"not reached" |
|
3230 |
]. |
|
3231 |
answer == #never ifTrue:[ |
|
3232 |
classesNotToBeAutoloaded add:#all. |
|
3233 |
^ false. |
|
3234 |
]. |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3235 |
]. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3236 |
|
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3237 |
answer ifTrue:[ |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3238 |
Autoload autoloadFailedSignal catch:[ |
6357 | 3239 |
^ cls autoload isLoaded |
3240 |
] |
|
5825 | 3241 |
]. |
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3242 |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3243 |
classesNotToBeAutoloaded add:cls. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3244 |
|
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3245 |
^ false. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3246 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3247 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3248 |
checkSingleSelectedChange |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3249 |
"just a helper, check for a single selection" |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3250 |
|
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3251 |
|changeNr| |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3252 |
|
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3253 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3254 |
self information:'Only possible if a single change is selected.'. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3255 |
AbortSignal raise. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3256 |
^ nil. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3257 |
]. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3258 |
^ changeNr |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3259 |
! |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3260 |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3261 |
classFromEvaluatingTree:aParseTree |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3262 |
|thisClass| |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3263 |
|
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3264 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3265 |
do:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3266 |
thisClass := Parser undefinedVariableError handle:[:ex | ] do:[ aParseTree evaluate ]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3267 |
]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3268 |
^ thisClass |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3269 |
|
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3270 |
"Created: / 05-03-2012 / 14:28:01 / cg" |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3271 |
! |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3272 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3273 |
clearCodeView |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3274 |
"clear the (lower) code view." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3275 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3276 |
self unselect "changeListView deselect". |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3277 |
codeView contents:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3278 |
changeNrShown := nil |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3279 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3280 |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3281 |
currentSourceForParseTree:parseTree |
12845 | 3282 |
|selector thisClass method mClass thisClassSym ownerClass receiver classGlobalNode| |
4857 | 3283 |
|
6288 | 3284 |
(parseTree isNil |
3285 |
or:[parseTree == #Error |
|
4857 | 3286 |
or:[ parseTree isMessage not ]]) ifTrue:[ |
6614 | 3287 |
^ nil |
4857 | 3288 |
]. |
3289 |
||
3290 |
selector := parseTree selector. |
|
3291 |
receiver := parseTree receiver. |
|
3292 |
||
3293 |
selector == #'removeSelector:' ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3294 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3295 |
thisClass isBehavior ifTrue:[ |
3296 |
thisClass isLoaded ifTrue:[ |
|
3297 |
selector := (parseTree arg1 evaluate). |
|
3298 |
(thisClass includesSelector:selector) ifTrue:[ |
|
3299 |
^ (thisClass compiledMethodAt:selector) source. |
|
3300 |
] |
|
3301 |
] ifFalse:[ |
|
3302 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3303 |
] |
|
3304 |
] ifFalse:[ |
|
3305 |
^ 'Cannot compare this change (class not present)'. |
|
3306 |
]. |
|
4857 | 3307 |
]. |
3308 |
selector == #'comment:' ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3309 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3310 |
thisClass isBehavior ifTrue:[ |
3311 |
thisClass isLoaded ifTrue:[ |
|
3312 |
^ thisClass name , ' comment: ' , thisClass comment storeString. |
|
3313 |
] ifFalse:[ |
|
3314 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3315 |
] |
|
3316 |
] ifFalse:[ |
|
3317 |
^ 'Cannot compare this change (class not present)'. |
|
3318 |
]. |
|
4857 | 3319 |
]. |
3320 |
||
7953 | 3321 |
(#(#'category:' #'package:') includes:selector) ifTrue:[ |
6614 | 3322 |
receiver isMessage ifTrue:[ |
3323 |
receiver selector == #compiledMethodAt: ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3324 |
"/ thisClass := self classFromEvaluatingTree:receiver receiver. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3325 |
"/ thisClass isNil ifTrue:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3326 |
"/ ^ 'Class does not exist.'. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3327 |
"/ ]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3328 |
|
6614 | 3329 |
classGlobalNode := receiver receiver. |
3330 |
(classGlobalNode isMessage and:[classGlobalNode selector == #class]) ifTrue:[ |
|
3331 |
classGlobalNode := classGlobalNode receiver |
|
3332 |
]. |
|
3333 |
classGlobalNode isUndeclared ifTrue:[ |
|
3334 |
^ 'Class does not exist.'. |
|
3335 |
]. |
|
3336 |
Error handle:[method := nil] do:[method := receiver evaluate]. |
|
7953 | 3337 |
method isMethod ifFalse:[ |
3338 |
^ 'There is no such method'. |
|
3339 |
]. |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3340 |
mClass := method mclass. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3341 |
|
7953 | 3342 |
selector == #category: ifTrue:[ |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3343 |
"/ method category = parseTree arg1 evaluate ifFalse:[ |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3344 |
^ '(' , mClass name , ' compiledMethodAt: ' , method selector storeString , ') category: ' , method category storeString. |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3345 |
"/ ]. |
6614 | 3346 |
] ifFalse:[ |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3347 |
"/ method package = parseTree arg1 evaluate ifFalse:[ |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3348 |
^ '(' , mClass name , ' compiledMethodAt: ' , method selector storeString , ') package: ' , method package storeString. |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3349 |
"/ ]. |
7953 | 3350 |
]. |
3351 |
^ nil |
|
6614 | 3352 |
] |
3353 |
] |
|
4857 | 3354 |
]. |
3355 |
||
3356 |
selector == #'instanceVariableNames:' ifTrue:[ |
|
6614 | 3357 |
receiver isMessage ifTrue:[ |
3358 |
receiver selector == #class ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3359 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3360 |
thisClass isBehavior ifTrue:[ |
3361 |
thisClass isLoaded ifTrue:[ |
|
4857 | 3362 |
"/ varsHere := thisClass instanceVariableString asCollectionOfWords. |
3363 |
"/ varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords. |
|
6614 | 3364 |
^ thisClass definition. |
3365 |
] ifFalse:[ |
|
3366 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3367 |
]. |
|
3368 |
] ifFalse:[ |
|
3369 |
^ 'Cannot compare this change (class not present)'. |
|
3370 |
] |
|
3371 |
]. |
|
3372 |
] |
|
4857 | 3373 |
]. |
3374 |
||
3375 |
(Class definitionSelectors includes:selector) |
|
6288 | 3376 |
"/ selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' |
4857 | 3377 |
ifTrue:[ |
6614 | 3378 |
"/ Class nameSpaceQuerySignal |
3379 |
"/ answer:(self nameSpaceForApply) |
|
3380 |
"/ do:[ |
|
3381 |
"/ superClass := receiver evaluate. |
|
3382 |
"/ ]. |
|
3383 |
"/ superClass isBehavior ifFalse:[ |
|
3384 |
"/ self nameSpaceForApply classNamed:receiver name |
|
3385 |
"/ ]. |
|
3386 |
"/ superClass isBehavior ifFalse:[ |
|
3387 |
"/ |rest matchingKeys superClassName| |
|
3388 |
"/ |
|
3389 |
"/ rest := '::' , receiver name. |
|
3390 |
"/ matchingKeys := Smalltalk keys select:[:nm | nm endsWith:rest]. |
|
3391 |
"/ superClassName := Dialog choose:'Which Class ?' fromList:matchingKeys lines:10. |
|
3392 |
"/ superClassName notEmptyOrNil ifTrue:[ |
|
3393 |
"/ superClass := Smalltalk at:superClassName asSymbol. |
|
3394 |
"/ ]. |
|
3395 |
"/ ]. |
|
3396 |
"/ superClass isBehavior ifFalse:[ |
|
3397 |
"/ ^ 'Cannot compare this change\\(no such superclass).' withCRs. |
|
3398 |
"/ ]. |
|
3399 |
"/ superClass isLoaded ifFalse:[ |
|
3400 |
"/ ^ 'Cannot compare this change\\(superclass not loaded).' withCRs. |
|
3401 |
"/ ]. |
|
3402 |
||
3403 |
thisClassSym := (parseTree arguments at:1) evaluate. |
|
3404 |
||
3405 |
(selector endsWith:':privateIn:') ifTrue:[ |
|
3406 |
ownerClass := (parseTree arguments at:5). |
|
3407 |
ownerClass isUndeclared ifFalse:[ |
|
3408 |
ownerClass := ownerClass evaluate. |
|
3409 |
] ifTrue:[ |
|
3410 |
ownerClass := nil. |
|
3411 |
]. |
|
3412 |
ownerClass isNil ifTrue:[ |
|
3413 |
^ 'Cannot compare this change\\(owning class is not loaded).' withCRs. |
|
3414 |
]. |
|
3415 |
thisClass := ownerClass privateClassesAt:thisClassSym. |
|
3416 |
] ifFalse:[ |
|
3417 |
thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil. |
|
3418 |
]. |
|
3419 |
thisClass notNil ifTrue:[ |
|
3420 |
thisClass isLoaded ifFalse:[ |
|
3421 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3422 |
] ifTrue:[ |
|
3423 |
^ thisClass definition. |
|
3424 |
] |
|
3425 |
] |
|
4857 | 3426 |
]. |
3427 |
||
3428 |
^ nil. |
|
9570
f81993219003
changed: #oldSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
9548
diff
changeset
|
3429 |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3430 |
"Created: / 15-02-2012 / 15:11:15 / cg" |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3431 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3432 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3433 |
isChangeSetBrowser |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3434 |
^ false |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3435 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3436 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3437 |
makeDiffViewInvisible |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3438 |
diffViewBox lower |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3439 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3440 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3441 |
makeDiffViewVisible |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3442 |
diffViewBox raise |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3443 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3444 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3445 |
nameSpaceForApply |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3446 |
applyInOriginalNameSpace value ifFalse:[ |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3447 |
^ enforcedNameSpace ? Class nameSpaceQuerySignal query. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3448 |
]. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3449 |
^ Smalltalk. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3450 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3451 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3452 |
newLabel:how |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3453 |
|l| |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3454 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3455 |
l := self class defaultLabel. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3456 |
(changeFileName notNil and:[changeFileName ~= 'changes']) ifTrue:[ |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3457 |
l := l , ': ', changeFileName |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3458 |
]. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3459 |
l := l , ' ' , how. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3460 |
self label:l |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3461 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3462 |
"Created: / 08-09-1995 / 19:32:04 / claus" |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3463 |
"Modified: / 12-11-2006 / 16:23:53 / cg" |
4857 | 3464 |
! |
3465 |
||
8665 | 3466 |
parseExpression:chunk |
3467 |
^ self parseExpression:chunk inNameSpace:(self nameSpaceForApply). |
|
3468 |
! |
|
3469 |
||
3470 |
parseExpression:text inNameSpace:nameSpace |
|
3471 |
|parser p| |
|
3472 |
||
3473 |
"/ old: |
|
3474 |
"/ does not care for VW qualified names |
|
3475 |
"/ ^ Parser parseExpression:text inNameSpace:nameSpace. |
|
3476 |
||
3477 |
"/ new: |
|
3478 |
parser := Parser for:(ReadStream on:text). |
|
3479 |
parser parserFlags allowQualifiedNames:true. |
|
9228
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3480 |
Error handle:[:ex | |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3481 |
^ nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3482 |
] do:[ |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3483 |
p := parser |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3484 |
parseExpressionWithSelf:nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3485 |
notifying:nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3486 |
ignoreErrors:true |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3487 |
ignoreWarnings:true |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3488 |
inNameSpace:nameSpace. |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3489 |
]. |
8665 | 3490 |
^ p |
3491 |
! |
|
3492 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3493 |
queryCloseText |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3494 |
"made this a method for easy redefinition in subclasses" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3495 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3496 |
^ 'Quit without updating changeFile ?' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3497 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3498 |
|
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3499 |
selectedClassNames |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3500 |
|classes| |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3501 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3502 |
classes := Set new. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3503 |
self withSelectedChangesDo:[:changeNr | |
6288 | 3504 |
| classNameToCompress | |
3505 |
||
3506 |
classNameToCompress := self classNameOfChange:changeNr. |
|
3507 |
classNameToCompress notNil ifTrue:[ |
|
3508 |
classes add:classNameToCompress. |
|
3509 |
] |
|
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3510 |
]. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3511 |
^ classes |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3512 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3513 |
"Created: / 19.11.2001 / 21:54:59 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3514 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3515 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3516 |
setChangeList |
16467 | 3517 |
"update the selection-list; |
3518 |
called after the changeList has been modified" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3519 |
|
16372 | 3520 |
|headerList| |
3521 |
||
3522 |
headerList := changeInfoList collect:[:info | info headerLine]. |
|
3523 |
changeListView setList:headerList expandTabs:false redraw:false. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3524 |
changeListView invalidate. |
16467 | 3525 |
self showNumberOfChanges. |
3526 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3527 |
"/ changeListView deselect. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3528 |
|
16372 | 3529 |
"Modified: / 01-05-2016 / 19:27:35 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3530 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3531 |
|
3211 | 3532 |
setSingleSelection:changeNr |
3533 |
changeListView multipleSelectOk ifFalse:[ |
|
6288 | 3534 |
changeListView setSelection:changeNr. |
3211 | 3535 |
] ifTrue:[ |
6288 | 3536 |
changeListView setSelection:(Array with:changeNr). |
3211 | 3537 |
]. |
3538 |
! |
|
3539 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3540 |
showNotFound |
14483 | 3541 |
self withCursor:(Cursor cross) do:[ |
3542 |
self beep. |
|
3543 |
Delay waitForMilliseconds:300. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3544 |
] |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3545 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3546 |
"Modified: / 29.4.1999 / 22:36:54 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3547 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3548 |
|
16467 | 3549 |
showNumberOfChanges |
3550 |
infoHolder value:(resources string:'%1 changes.' with:changeInfoList size). |
|
3551 |
! |
|
3552 |
||
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3553 |
sourceOfChange:changeNr |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3554 |
|aStream sawExcla chunk| |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3555 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3556 |
aStream := self streamForChange:changeNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3557 |
aStream isNil ifTrue:[ |
6288 | 3558 |
^ nil |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3559 |
]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3560 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3561 |
chunk := aStream nextChunk. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3562 |
sawExcla ifTrue:[ |
6288 | 3563 |
chunk := aStream nextChunk |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3564 |
]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3565 |
aStream close. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3566 |
^ chunk |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3567 |
! |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3568 |
|
12599
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3569 |
timeStampPrintStringOf:ts |
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3570 |
^ ts printString |
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3571 |
! |
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3572 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3573 |
unselect |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3574 |
"common unselect" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3575 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3576 |
changeListView setSelection:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3577 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3578 |
"Modified: 25.5.1996 / 13:02:49 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3579 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3580 |
|
3211 | 3581 |
withSelectedChangesDo:aBlock |
3582 |
"just a helper, check for a selected change and evaluate aBlock |
|
3583 |
with busy cursor" |
|
3584 |
||
3585 |
self withSelectedChangesInOrder:nil do:aBlock |
|
3586 |
! |
|
3587 |
||
3588 |
withSelectedChangesInOrder:order do:aBlock |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3589 |
"just a helper, check for a selected change and evaluate aBlock |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3590 |
with busy cursor" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3591 |
|
3211 | 3592 |
|changeNrSelection| |
3593 |
||
3594 |
changeNrSelection := changeListView selection. |
|
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3595 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3596 |
"if we apply multiple changes, and an error occurs, |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3597 |
ask the user if all operations should be aborted..." |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3598 |
multipleApply := changeNrSelection size > 1. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3599 |
|
3211 | 3600 |
changeListView multipleSelectOk ifFalse:[ |
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3601 |
changeNrSelection notNil ifTrue:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3602 |
self withExecuteCursorDo:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3603 |
aBlock value:changeNrSelection |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3604 |
] |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3605 |
] |
3211 | 3606 |
] ifTrue:[ |
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3607 |
changeNrSelection size > 0 ifTrue:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3608 |
self withExecuteCursorDo:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3609 |
|changeNumbers| |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3610 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3611 |
changeNumbers := changeNrSelection copy sort. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3612 |
order == #reverse ifTrue:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3613 |
changeNumbers reverse |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3614 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3615 |
changeNumbers do:aBlock |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3616 |
] |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3617 |
] |
3211 | 3618 |
]. |
3619 |
! |
|
3620 |
||
3621 |
withSelectedChangesReverseDo:aBlock |
|
3622 |
"just a helper, check for a selected change and evaluate aBlock |
|
3623 |
with busy cursor" |
|
3624 |
||
3625 |
self withSelectedChangesInOrder:#reverse do:aBlock |
|
3668 | 3626 |
! |
3627 |
||
3628 |
withSingleSelectedChangeDo:aBlock |
|
3629 |
"just a helper, check for a single selection, and evaluate aBlock |
|
3630 |
with busy cursor" |
|
3631 |
||
3632 |
self theSingleSelection isNil ifTrue:[ |
|
6288 | 3633 |
^ self information:'Only possible if a single change is selected.'. |
3668 | 3634 |
]. |
3635 |
||
3636 |
self withSelectedChangesInOrder:nil do:aBlock |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3637 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3638 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3639 |
!ChangesBrowser methodsFor:'private-change access'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3640 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3641 |
changeIsFollowupMethodChange:changeNr |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3642 |
"return true, if a change is a followup change (i.e. a followup change |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3643 |
in a bunch of methodsFor-changes)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3644 |
|
16372 | 3645 |
^ (changeInfoList at:changeNr) isFollowupChange |
3646 |
||
3647 |
"Created: / 06-02-1998 / 13:03:39 / cg" |
|
3648 |
"Modified: / 01-05-2016 / 19:32:06 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3649 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3650 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3651 |
changeIsSnapShotInfo:changeNr |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3652 |
"return true, if a change is a snapShot info chunk" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3653 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3654 |
|words chunk| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3655 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3656 |
(self classNameOfChange:changeNr) isNil ifTrue:[ |
16372 | 3657 |
" |
3658 |
get the chunk |
|
3659 |
" |
|
3660 |
chunk := self changeChunkAt:changeNr. |
|
3661 |
"mhmh - empty ??" |
|
3662 |
chunk notNil ifTrue:[ |
|
3663 |
(chunk startsWith:'''---') ifTrue:[ |
|
3664 |
words := chunk asCollectionOfWords. |
|
3665 |
words size > 2 ifTrue:[ |
|
3666 |
(words at:2) = 'snapshot' ifTrue:[ |
|
3667 |
^ true |
|
3668 |
]. |
|
3669 |
]. |
|
3670 |
]. |
|
3671 |
]. |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3672 |
]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3673 |
^ false |
16372 | 3674 |
|
3675 |
"Modified: / 01-05-2016 / 18:25:25 / cg" |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3676 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3677 |
|
11396 | 3678 |
classNameFromAttributeChangeParseTree:aParseTree |
3679 |
"mhmh - seems to always return the name of the nonMeta class - is this OK?" |
|
3680 |
||
11397 | 3681 |
|recTree isMeta name| |
11396 | 3682 |
|
3683 |
recTree := aParseTree receiver. |
|
3684 |
||
3685 |
(recTree notNil |
|
3686 |
and:[recTree ~~ #Error |
|
3687 |
and:[recTree isMessage |
|
3688 |
and:[recTree selector == #compiledMethodAt:]]]) ifTrue:[ |
|
3689 |
isMeta := false. |
|
3690 |
recTree := recTree receiver. |
|
3691 |
recTree isUnaryMessage ifTrue:[ |
|
3692 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
3693 |
"id class " |
|
3694 |
recTree := recTree receiver |
|
3695 |
]. |
|
3696 |
recTree isPrimary ifTrue:[ |
|
3697 |
name := recTree name. |
|
3698 |
isMeta ifTrue:[ |
|
3699 |
^ name , ' class'. |
|
3700 |
]. |
|
3701 |
^ name |
|
3702 |
] |
|
3703 |
]. |
|
3704 |
"very strange" |
|
3705 |
^ nil |
|
3706 |
||
3707 |
"Created: / 08-03-2012 / 09:42:36 / cg" |
|
3708 |
! |
|
3709 |
||
3710 |
classNameFromClassDefinitionChange:changeNr |
|
11397 | 3711 |
|changeStream chunk fullParseTree sel arg1Tree ownerTree ownerName name| |
11396 | 3712 |
|
3713 |
"/ must parse the full changes text, to get privacy information. |
|
3714 |
||
3715 |
changeStream := self streamForChange:changeNr. |
|
3716 |
changeStream isNil ifTrue:[ ^ nil]. |
|
3717 |
||
3718 |
chunk := changeStream nextChunk. |
|
3719 |
changeStream close. |
|
3720 |
fullParseTree := self parseExpression:chunk. |
|
3721 |
(fullParseTree isNil or:[fullParseTree == #Error]) ifTrue:[ |
|
3722 |
^ nil |
|
3723 |
]. |
|
3724 |
fullParseTree isMessage ifFalse:[ |
|
3725 |
^ nil |
|
3726 |
]. |
|
3727 |
||
3728 |
sel := fullParseTree selector. |
|
3729 |
arg1Tree := fullParseTree arg1. |
|
16390 | 3730 |
(arg1Tree notNil and:[arg1Tree isLiteral]) ifTrue:[ |
11396 | 3731 |
name := arg1Tree value asString. |
3732 |
||
3733 |
"/ is it a private-class ? |
|
3734 |
('*privateIn:' match:sel) ifTrue:[ |
|
3735 |
ownerTree := fullParseTree args last. |
|
3736 |
ownerName := ownerTree name asString. |
|
3737 |
^ ownerName , '::' , name |
|
3738 |
]. |
|
3739 |
^ name |
|
3740 |
]. |
|
3741 |
"very strange" |
|
3742 |
^ nil |
|
3743 |
||
3744 |
"Created: / 08-03-2012 / 09:34:04 / cg" |
|
3745 |
! |
|
3746 |
||
3747 |
classNameFromReceiverInParseTree:aParseTree |
|
3748 |
"extrat the class name from a method-change, methodRemove or comment-change's |
|
3749 |
parse tree" |
|
3750 |
||
3751 |
|recTree isMeta cls name| |
|
3752 |
||
3753 |
recTree := aParseTree receiver. |
|
3754 |
(recTree isNil or:[recTree == #Error]) ifTrue:[ |
|
3755 |
"more strange things" |
|
3756 |
^ nil |
|
3757 |
]. |
|
3758 |
||
3759 |
isMeta := false. |
|
3760 |
recTree isUnaryMessage ifTrue:[ |
|
3761 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
3762 |
"id class methodsFor:..." |
|
3763 |
recTree := recTree receiver. |
|
3764 |
isMeta := true. |
|
3765 |
]. |
|
3766 |
recTree isPrimary ifTrue:[ |
|
3767 |
cls := self classFromEvaluatingTree:recTree. |
|
3768 |
cls notNil ifTrue:[^ cls name]. |
|
3769 |
||
3770 |
name := recTree name. |
|
3771 |
isMeta ifTrue:[ |
|
3772 |
^ name , ' class'. |
|
3773 |
]. |
|
3774 |
^ name |
|
3775 |
]. |
|
3776 |
||
3777 |
"more strange things" |
|
3778 |
^ nil |
|
3779 |
||
3780 |
"Created: / 08-03-2012 / 09:26:57 / cg" |
|
3781 |
! |
|
3782 |
||
3783 |
classNameFromRemoveClassParseTree:aParseTree |
|
11397 | 3784 |
"tree is: Smalltalk removeClass: class" |
3785 |
||
11396 | 3786 |
|recTree arg1Tree| |
3787 |
||
3788 |
recTree := aParseTree receiver. |
|
3789 |
||
3790 |
(recTree notNil |
|
3791 |
and:[recTree ~~ #Error |
|
3792 |
and:[recTree isPrimary |
|
3793 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
|
3794 |
arg1Tree := aParseTree arg1. |
|
13663 | 3795 |
(arg1Tree notNil and:[arg1Tree isVariable]) ifTrue:[ |
11397 | 3796 |
^ arg1Tree name. |
11396 | 3797 |
]. |
3798 |
]. |
|
3799 |
"very strange" |
|
3800 |
^ nil |
|
3801 |
||
3802 |
"Created: / 08-03-2012 / 09:36:59 / cg" |
|
3803 |
! |
|
3804 |
||
11397 | 3805 |
classNameFromRenameClassParseTree:aParseTree |
3806 |
"tree is: Smalltalk renameClass: oldClass to: 'newName'" |
|
3807 |
||
3808 |
|recTree arg1Tree arg2Tree oldName newName| |
|
3809 |
||
3810 |
recTree := aParseTree receiver. |
|
3811 |
||
3812 |
(recTree notNil |
|
3813 |
and:[recTree ~~ #Error |
|
3814 |
and:[recTree isPrimary |
|
3815 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
|
3816 |
arg1Tree := aParseTree arg1. |
|
3817 |
(arg1Tree notNil and:[arg1Tree isPrimary]) ifTrue:[ |
|
3818 |
oldName := arg1Tree name. |
|
3819 |
arg2Tree := aParseTree arg2. |
|
16390 | 3820 |
(arg2Tree notNil and:[arg2Tree isLiteral]) ifTrue:[ |
11397 | 3821 |
newName := arg2Tree evaluate. |
3822 |
(Smalltalk classNamed:oldName) notNil ifTrue:[^ oldName ]. |
|
3823 |
(Smalltalk classNamed:newName) notNil ifTrue:[^ newName ]. |
|
3824 |
]. |
|
3825 |
]. |
|
3826 |
]. |
|
3827 |
"very strange" |
|
3828 |
^ nil |
|
3829 |
||
3830 |
"Created: / 08-03-2012 / 11:42:25 / cg" |
|
3831 |
! |
|
3832 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3833 |
classNameOfChange:changeNr |
6288 | 3834 |
"return the classname of a change |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3835 |
(for classChanges (i.e. xxx class), the non-metaClassName (i.e. xxx) is returned)" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3836 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3837 |
|name| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3838 |
|
3364 | 3839 |
name := self realClassNameOfChange:changeNr. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3840 |
name isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3841 |
(name endsWith:' class') ifTrue:[ |
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
3842 |
name := name copyButLast:6 |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3843 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3844 |
^ name |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3845 |
|
3364 | 3846 |
"Modified: / 5.11.2001 / 18:10:25 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3847 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3848 |
|
3202 | 3849 |
extractSelectorOfMethodChange:changeNr |
3850 |
"return a method-changes selector, or nil if its not a methodChange" |
|
3851 |
||
3852 |
|source parser sel chunk aParseTree | |
|
3853 |
||
3854 |
source := self sourceOfMethodChange:changeNr. |
|
3855 |
source isNil ifTrue:[ |
|
8665 | 3856 |
(self classNameOfChange:changeNr) notNil ifTrue:[ |
16372 | 3857 |
chunk := self changeChunkAt:changeNr. |
8665 | 3858 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
3859 |
||
3860 |
aParseTree := self parseExpression:chunk. |
|
3861 |
(aParseTree isNil |
|
3862 |
or:[aParseTree == #Error |
|
3863 |
or:[aParseTree isMessage not]]) ifTrue:[ |
|
3864 |
^ nil "seems strange ... (could be a comment)" |
|
3865 |
]. |
|
3866 |
sel := aParseTree selector. |
|
3867 |
(#( |
|
3868 |
#'removeSelector:' |
|
3869 |
) includes:sel) ifTrue:[ |
|
3870 |
sel := aParseTree arguments at:1. |
|
16390 | 3871 |
sel isLiteral ifTrue:[ |
8665 | 3872 |
sel := sel evaluate. |
3873 |
sel isSymbol ifTrue:[ |
|
3874 |
^ sel |
|
3875 |
] |
|
3876 |
] |
|
3877 |
] |
|
3878 |
]. |
|
3879 |
^ nil |
|
3202 | 3880 |
]. |
3881 |
||
3882 |
||
6288 | 3883 |
parser := Parser |
8665 | 3884 |
parseMethodArgAndVarSpecification:source |
3885 |
in:nil |
|
3886 |
ignoreErrors:true |
|
3887 |
ignoreWarnings:true |
|
3888 |
parseBody:false. |
|
3202 | 3889 |
|
3890 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
8665 | 3891 |
sel := parser selector. |
3202 | 3892 |
]. |
3893 |
^ sel |
|
3894 |
||
16372 | 3895 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
3896 |
"Modified: / 01-05-2016 / 18:25:39 / cg" |
|
3202 | 3897 |
! |
3898 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3899 |
fullClassNameOfChange:changeNr |
6288 | 3900 |
"return the full classname of a change |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
3901 |
(for classChanges (i.e. xxx class), a string ending in ' class' is returned." |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3902 |
|
11396 | 3903 |
|chunk aParseTree sel name prevMethodDefNr words oldDollarSetting| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3904 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3905 |
changeNr isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3906 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3907 |
first look, if not already known |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3908 |
" |
16372 | 3909 |
name := self changeClassNameAt:changeNr. |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
3910 |
name notNil ifTrue:[ |
7953 | 3911 |
name == #nil ifTrue:[^ nil]. |
3912 |
^ name |
|
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
3913 |
]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3914 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3915 |
prevMethodDefNr := changeNr. |
16372 | 3916 |
[ (changeInfoList at:prevMethodDefNr) isFollowupChange ] whileTrue:[ |
7953 | 3917 |
prevMethodDefNr := prevMethodDefNr - 1. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3918 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3919 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3920 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3921 |
get the chunk |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3922 |
" |
16372 | 3923 |
chunk := self changeChunkAt:prevMethodDefNr. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3924 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3925 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3926 |
(chunk startsWith:'''---') ifTrue:[ |
7953 | 3927 |
words := chunk asCollectionOfWords. |
3928 |
words size > 2 ifTrue:[ |
|
3929 |
(words at:2) = 'checkin' ifTrue:[ |
|
3930 |
name := words at:3. |
|
3931 |
^ name |
|
3932 |
] |
|
3933 |
]. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3934 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3935 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3936 |
"/ fix it - otherwise, it cannot be parsed |
11396 | 3937 |
((chunk endsWith:'primitiveDefinitions:') |
3938 |
or:[(chunk endsWith:'primitiveFunctions:') |
|
3939 |
or:[(chunk endsWith:'primitiveVariables:')]]) ifTrue:[ |
|
7953 | 3940 |
chunk := chunk , '''''' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3941 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3942 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3943 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3944 |
use parser to construct a parseTree |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3945 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3946 |
oldDollarSetting := Parser allowDollarInIdentifier. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3947 |
[ |
7953 | 3948 |
Parser allowDollarInIdentifier:true. |
5014 | 3949 |
"/ Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
3950 |
"/ do:[ |
|
8665 | 3951 |
aParseTree := self parseExpression:chunk. |
5014 | 3952 |
"/ ]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3953 |
|
7953 | 3954 |
aParseTree == #Error ifTrue:[ |
3955 |
(chunk includesString:'comment') ifTrue:[ |
|
3956 |
"/ could be a comment ... |
|
8665 | 3957 |
aParseTree := self parseExpression:chunk , ''''. |
7953 | 3958 |
] |
3959 |
]. |
|
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
3960 |
] ensure:[ |
7953 | 3961 |
Parser allowDollarInIdentifier:oldDollarSetting |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3962 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3963 |
(aParseTree isNil or:[aParseTree == #Error]) ifTrue:[ |
7953 | 3964 |
^ nil "seems strange ... (could be a comment)" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3965 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3966 |
aParseTree isMessage ifFalse:[ |
7953 | 3967 |
^ nil "very strange ... (whats that ?)" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3968 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3969 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3970 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3971 |
ask parser for selector |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3972 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3973 |
sel := aParseTree selector. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3974 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3975 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3976 |
is it a method-change, methodRemove or comment-change ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3977 |
" |
6288 | 3978 |
(#(#'methodsFor:' |
3979 |
#'privateMethodsFor:' |
|
3980 |
#'protectedMethodsFor:' |
|
3981 |
#'ignoredMethodsFor:' |
|
3982 |
#'publicMethodsFor:' |
|
3983 |
#'removeSelector:' |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3984 |
#'comment:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3985 |
#'primitiveDefinitions:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3986 |
#'primitiveFunctions:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3987 |
#'primitiveVariables:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3988 |
#'renameCategory:to:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3989 |
#'instanceVariableNames:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3990 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3991 |
#'methodsFor:stamp:' "/ Squeak support |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3992 |
#'commentStamp:prior:' "/ Squeak support |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3993 |
#'addClassVarName:' "/ Squeak support |
2527
afa639104477
some support for dolphin source files
Claus Gittinger <cg@exept.de>
parents:
2511
diff
changeset
|
3994 |
#methodsFor "/ Dolphin support |
3472 | 3995 |
#categoriesForClass "/ Dolphin support |
3996 |
#categoriesFor: "/ Dolphin support |
|
2606 | 3997 |
#methods "/ STV support |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3998 |
) includes:sel) ifTrue:[ |
7953 | 3999 |
" |
4000 |
yes, the className is the receiver |
|
4001 |
" |
|
11396 | 4002 |
^ self classNameFromReceiverInParseTree:aParseTree |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4003 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4004 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4005 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4006 |
is it a change in a class-description ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4007 |
" |
6288 | 4008 |
(('subclass:*' match:sel) |
2322 | 4009 |
or:[('variable*ubclass:*' match:sel)]) ifTrue:[ |
7953 | 4010 |
"/ must parse the full changes text, to get |
4011 |
"/ privacy information. |
|
11396 | 4012 |
^ self classNameFromClassDefinitionChange:changeNr |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4013 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4014 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4015 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4016 |
is it a class remove ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4017 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4018 |
(sel == #removeClass:) ifTrue:[ |
11396 | 4019 |
^ self classNameFromRemoveClassParseTree:aParseTree |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4020 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4021 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4022 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4023 |
is it a method category change ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4024 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4025 |
((sel == #category:) |
7953 | 4026 |
or:[sel == #package: |
4027 |
or:[sel == #privacy:]]) ifTrue:[ |
|
11396 | 4028 |
^ self classNameFromAttributeChangeParseTree:aParseTree |
4029 |
]. |
|
4030 |
||
4031 |
sel == #renameClass:to: ifTrue:[ |
|
11397 | 4032 |
^ self classNameFromRenameClassParseTree:aParseTree |
11396 | 4033 |
]. |
4034 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4035 |
^ nil |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4036 |
|
16372 | 4037 |
"Modified: / 01-05-2016 / 19:29:14 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4038 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4039 |
|
12428 | 4040 |
namespaceOfChange:changeNr |
4041 |
"return the namespace of a change or nil" |
|
4042 |
||
15116 | 4043 |
|className namespace idx| |
12428 | 4044 |
|
4045 |
className := self classNameOfChange:changeNr. |
|
4046 |
className isNil ifTrue:[ ^ nil ]. |
|
4047 |
||
15116 | 4048 |
idx := className indexOfSubCollection:'::'. |
4049 |
idx == 0 ifTrue:[ ^ nil ]. |
|
4050 |
namespace := className copyTo:idx-1. |
|
12428 | 4051 |
^ namespace |
4052 |
! |
|
4053 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4054 |
numberOfChanges |
16372 | 4055 |
^ changeInfoList size |
4056 |
||
4057 |
"Created: / 03-12-1995 / 18:15:39 / cg" |
|
4058 |
"Modified: / 01-05-2016 / 19:24:05 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4059 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4060 |
|
2511 | 4061 |
ownerClassNameOfChange:changeNr |
6288 | 4062 |
"return the owner classname of a change |
2511 | 4063 |
For a normal class, this is the className; |
4064 |
for a private class, this is the name of the owning class" |
|
4065 |
||
4706 | 4066 |
|name "ns idx" cls| |
2511 | 4067 |
|
4068 |
name := self classNameOfChange:changeNr. |
|
4069 |
name isNil ifTrue:[^ nil]. |
|
4070 |
cls := Smalltalk at:name asSymbol. |
|
4071 |
(cls notNil and:[cls isBehavior]) ifTrue:[ |
|
6288 | 4072 |
cls owningClass notNil ifTrue:[ |
4073 |
^ cls owningClass name |
|
4074 |
]. |
|
4075 |
^ cls name |
|
2511 | 4076 |
]. |
4077 |
||
4078 |
"/ (name includes:$:) ifTrue:[ |
|
4079 |
"/ idx := name indexOf:$:. |
|
4080 |
"/ ns := name copyTo:idx-1. |
|
4081 |
"/ ns := Smalltalk at:ns asSymbol. |
|
4082 |
"/ ns notNil ifTrue:[ |
|
6288 | 4083 |
"/ |
2511 | 4084 |
"/ ]. |
4085 |
"/ |
|
4086 |
"/ name := name copyFrom:idx+2. |
|
4087 |
"/ (Smalltalk at:ns asSymbol) notNil ifTrue:[ |
|
4088 |
"/ cls |
|
4089 |
"/ ]. |
|
13851 | 4090 |
"/ ^ name copyButLast:6 |
2511 | 4091 |
"/ ]. |
4092 |
^ name |
|
4093 |
||
4094 |
"Modified: 6.12.1995 / 17:06:31 / cg" |
|
4095 |
! |
|
4096 |
||
3364 | 4097 |
realClassNameOfChange:changeNr |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4098 |
"return the classname of a change. |
6288 | 4099 |
- since parsing ascii methods is slow, keep result cached in |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4100 |
changeClassNames for the next query" |
3364 | 4101 |
|
4102 |
|name| |
|
4103 |
||
16372 | 4104 |
name := self changeClassNameAt:changeNr. |
3364 | 4105 |
name isNil ifTrue:[ |
16372 | 4106 |
name := self fullClassNameOfChange:changeNr. |
4107 |
name isNil ifTrue:[ |
|
4108 |
(changeInfoList at:changeNr) className:#nil. |
|
4109 |
]. |
|
3364 | 4110 |
]. |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4111 |
name == #nil ifTrue:[^ nil]. |
3364 | 4112 |
^ name |
4113 |
||
16372 | 4114 |
"Created: / 05-11-2001 / 18:09:46 / cg" |
4115 |
"Modified: / 01-05-2016 / 19:24:53 / cg" |
|
3364 | 4116 |
! |
4117 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4118 |
selectorOfMethodChange:changeNr |
16467 | 4119 |
"return a method-changes selector, |
4120 |
or nil if it's not a methodChange" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4121 |
|
3202 | 4122 |
|sel | |
4123 |
||
16372 | 4124 |
changeInfoList size >= changeNr ifTrue:[ |
4125 |
sel := (changeInfoList at:changeNr) selector. |
|
15652 | 4126 |
sel notNil ifTrue:[ ^ sel ]. |
3202 | 4127 |
]. |
4128 |
||
4129 |
sel := self extractSelectorOfMethodChange:changeNr. |
|
4130 |
sel notNil ifTrue:[ |
|
16372 | 4131 |
(changeInfoList at:changeNr) selector:sel. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4132 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4133 |
^ sel |
16372 | 4134 |
|
4135 |
"Modified: / 01-05-2016 / 19:26:21 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4136 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4137 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4138 |
sourceOfMethodChange:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4139 |
"return a method-changes source code, or nil if its not a methodChange." |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4140 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4141 |
|aStream chunk sawExcla parseTree sourceChunk sel| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4142 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4143 |
aStream := self streamForChange:changeNr. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4144 |
aStream isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4145 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4146 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
8665 | 4147 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
4148 |
chunk := aStream nextChunk. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4149 |
] ifTrue:[ |
16372 | 4150 |
chunk := self changeChunkAt:changeNr. |
8665 | 4151 |
sawExcla := true. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4152 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4153 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4154 |
sawExcla ifTrue:[ |
8665 | 4155 |
parseTree := self parseExpression:chunk. |
4156 |
(parseTree notNil |
|
4157 |
and:[parseTree ~~ #Error |
|
4158 |
and:[parseTree isMessage]]) ifTrue:[ |
|
4159 |
sel := parseTree selector. |
|
4160 |
(#( |
|
4161 |
#methodsFor: |
|
4162 |
#privateMethodsFor: |
|
4163 |
#publicMethodsFor: |
|
4164 |
#ignoredMethodsFor: |
|
4165 |
#protectedMethodsFor: |
|
4166 |
||
4167 |
#methodsFor:stamp: "/ Squeak support |
|
4168 |
#commentStamp:prior: "/ Squeak support |
|
4169 |
#methodsFor "/ Dolphin support |
|
4170 |
#methods "/ STV support |
|
4171 |
) |
|
4172 |
includes:sel) ifTrue:[ |
|
4173 |
sourceChunk := aStream nextChunk. |
|
4174 |
] |
|
4175 |
]. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4176 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4177 |
aStream close. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4178 |
^ sourceChunk |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4179 |
|
16372 | 4180 |
"Created: / 05-09-1996 / 17:11:32 / cg" |
4181 |
"Modified: / 01-05-2016 / 18:25:53 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4182 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4183 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4184 |
streamForChange:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4185 |
"answer a stream for change" |
6288 | 4186 |
|
15858 | 4187 |
|aStream encoding| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4188 |
|
16372 | 4189 |
(changeNr between:1 and:changeInfoList size) ifFalse:[^ nil]. |
5702 | 4190 |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
4191 |
aStream := changeFileName asFilename readStreamOrNil. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4192 |
aStream isNil ifTrue:[^ nil]. |
5702 | 4193 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4194 |
encodingIfKnown isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4195 |
encoding := CharacterEncoder guessEncodingOfStream:aStream. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4196 |
encodingIfKnown := encoding ? #none |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4197 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4198 |
(encodingIfKnown notNil and:[encodingIfKnown ~~ #none]) ifTrue:[ |
15858 | 4199 |
aStream := EncodedStream stream:aStream encoding:encodingIfKnown. |
5702 | 4200 |
]. |
4201 |
||
16372 | 4202 |
aStream position:((changeInfoList at:changeNr) position)-1. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4203 |
^ aStream |
16372 | 4204 |
|
4205 |
"Modified: / 01-05-2016 / 19:24:17 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4206 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4207 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4208 |
!ChangesBrowser methodsFor:'private-changeFile access'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4209 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4210 |
changeFileName:aFileName |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4211 |
"set the name of the changeFile" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4212 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4213 |
changeFileName := aFileName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4214 |
encodingIfKnown := nil. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4215 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4216 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4217 |
checkIfFileHasChanged |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4218 |
"check if the changeFile has been modified since the last check; |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4219 |
install a timeout for rechecking after some time." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4220 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4221 |
|f info | |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4222 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4223 |
Processor removeTimedBlock:checkBlock. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4224 |
f := changeFileName asFilename. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4225 |
(info := f info) isNil ifTrue:[ |
16092 | 4226 |
self newLabel:'(unaccessible)' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4227 |
] ifFalse:[ |
16092 | 4228 |
(info modificationTime) > changeFileTimestamp ifTrue:[ |
4229 |
self newLabel:'(outdated)'. |
|
4230 |
autoUpdate value ifTrue:[ |
|
4231 |
self doUpdate |
|
4232 |
] |
|
4233 |
] ifFalse:[ |
|
4234 |
self newLabel:'' |
|
4235 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4236 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4237 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4238 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4239 |
"Created: 8.9.1995 / 19:30:19 / claus" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4240 |
"Modified: 8.9.1995 / 19:38:18 / claus" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4241 |
"Modified: 1.11.1996 / 20:22:56 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4242 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4243 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4244 |
readChangesFile |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4245 |
"read the changes file, create a list of header-lines (changeChunks) |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4246 |
and a list of chunk-positions (changePositions)" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4247 |
|
5178 | 4248 |
self readChangesFileInBackground:false. |
4249 |
self newLabel:''. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4250 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4251 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4252 |
readChangesFileInBackground:inBackground |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4253 |
"read the changes file, create a list of header-lines (changeChunks) |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4254 |
and a list of chunk-positions (changePositions). |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4255 |
Starting with 2.10.3, the entries are multi-col entries; |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4256 |
the cols are: |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4257 |
1 delta (only if comparing) |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4258 |
'+' -> new method (w.r.t. current state) |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4259 |
'-' -> removed method (w.r.t. current state) |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4260 |
'?' -> class does not exist currently |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4261 |
'=' -> change is the same as current methods source |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4262 |
'~' -> change is almost the same as current methods source |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4263 |
2 class/selector |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4264 |
3 type of change |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4265 |
doit |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4266 |
method |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4267 |
category change |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4268 |
4 timestamp |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4269 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4270 |
since comparing slows down startup time, it is now disabled by |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4271 |
default and can be enabled via a toggle." |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4272 |
|
12635 | 4273 |
|inStream i f askedForEditingClassSource myProcess myPriority myPrioRange| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4274 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4275 |
editingClassSource := false. |
2641 | 4276 |
askedForEditingClassSource := false. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4277 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4278 |
"/ maxLen := 60. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4279 |
|
3674 | 4280 |
self newLabel:'updating ...'. |
4281 |
||
4282 |
(self class isXMLFile:changeFileName) ifTrue:[ |
|
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4283 |
^ self class readXMLChangesFromFile:changeFileName inBackground:inBackground |
3674 | 4284 |
]. |
4285 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4286 |
f := changeFileName asFilename. |
7346 | 4287 |
f exists ifFalse:[^ self]. |
12635 | 4288 |
inStream := EncodedStream decodedStreamFor:(f readStream). |
5696 | 4289 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4290 |
i := f info. |
3965
e499c0dae8fc
use #fileSize instead of #size
Claus Gittinger <cg@exept.de>
parents:
3962
diff
changeset
|
4291 |
changeFileSize := i fileSize. |
3962
3906b10c42fd
modified -> modificationTime
Claus Gittinger <cg@exept.de>
parents:
3930
diff
changeset
|
4292 |
changeFileTimestamp := i modificationTime. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4293 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4294 |
self withReadCursorDo:[ |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4295 |
" |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4296 |
this is a time consuming operation (especially, if reading an |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4297 |
NFS-mounted directory; therefore lower my priority ... |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4298 |
" |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4299 |
inBackground ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4300 |
myProcess := Processor activeProcess. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4301 |
myPriority := myProcess priority. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4302 |
myPrioRange := myProcess priorityRange. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4303 |
myProcess priorityRange:(Processor userBackgroundPriority to:Processor activePriority). |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4304 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4305 |
|
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4306 |
[ |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4307 |
|reader| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4308 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4309 |
reader := ChangeFileReader new. |
6516
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
4310 |
reader changeFileName:changeFileName. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4311 |
reader browser:self. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4312 |
reader enforcedNameSpace:enforcedNameSpace. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4313 |
reader autoCompare:autoCompare. |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
4314 |
reader autoloadAsRequired:autoloadAsRequired. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4315 |
reader tabSpec:tabSpec. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4316 |
reader inStream:inStream. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4317 |
reader noColoring:(NoColoring == true). |
16467 | 4318 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4319 |
reader readChangesFile. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4320 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4321 |
editingClassSource := reader thisIsAClassSource. |
16372 | 4322 |
changeInfoList := reader changeInfo. |
16467 | 4323 |
|
4324 |
self showNumberOfChanges. |
|
7360 | 4325 |
anyChanges := false. |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4326 |
] ensure:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4327 |
inStream close. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4328 |
inBackground ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4329 |
myProcess priority:myPriority. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4330 |
myProcess priorityRange:myPrioRange. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4331 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4332 |
]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4333 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4334 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4335 |
self checkIfFileHasChanged |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4336 |
|
7360 | 4337 |
"Modified: / 27-08-1995 / 23:06:55 / claus" |
16372 | 4338 |
"Modified: / 01-05-2016 / 19:13:09 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4339 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4340 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4341 |
writeBackChanges |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4342 |
"write back the changes file. To avoid problems when the disk is full |
6288 | 4343 |
or a crash occurs while writing (well, or someone kills us), |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4344 |
first write the stuff to a new temporary file. If this works ok, |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4345 |
rename the old change-file to a .bak file and finally rename the |
6288 | 4346 |
tempfile back to the change-file. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4347 |
That way, if anything happens, either the original file is left unchanged, |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4348 |
or we have at least a backup of the previous change file." |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4349 |
|
15858 | 4350 |
|inFilename inStream outStream stamp encoding tempFilename| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4351 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4352 |
editingClassSource ifTrue:[ |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4353 |
(self confirm:'You are editing a classes sourceFile (not a changeFile) !!\\Are you certain, you want to overwrite it ?' withCRs) |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4354 |
ifFalse:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4355 |
^ false |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4356 |
] |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4357 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4358 |
|
13123 | 4359 |
inFilename := changeFileName asFilename. |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4360 |
[ |
13123 | 4361 |
inStream := inFilename readStream. |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4362 |
] on:FileStream openErrorSignal do:[:ex| |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4363 |
self warn:'Cannot open old changesFile.'. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4364 |
^ false |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4365 |
]. |
9020 | 4366 |
[ |
4367 |
[ |
|
13123 | 4368 |
outStream := FileStream newTemporaryIn:inFilename directory. |
4369 |
tempFilename := outStream fileName. |
|
9020 | 4370 |
] on:FileStream openErrorSignal do:[:ex| |
4371 |
self warn:'Cannot create temp file in current directory.'. |
|
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4372 |
^ false |
9020 | 4373 |
]. |
4374 |
||
11234 | 4375 |
outStream nextPutLine:'''---- encoding: utf8 ----''!!'. |
9020 | 4376 |
outStream := EncodedStream stream:outStream encoder:(CharacterEncoder encoderForUTF8). |
4377 |
||
4378 |
encoding := CharacterEncoder guessEncodingOfStream:inStream. |
|
4379 |
encoding notNil ifTrue:[ |
|
15858 | 4380 |
inStream := EncodedStream stream:inStream encoding:encoding. |
9020 | 4381 |
]. |
4382 |
||
11685 | 4383 |
self withWriteCursorDo:[ |
9020 | 4384 |
|excla sawExcla done first chunk |
4385 |
nChanges "{Class:SmallInteger}" | |
|
4386 |
||
4387 |
Stream writeErrorSignal handle:[:ex | |
|
4388 |
self warn:('Could not update the changes file.\\' , ex description) withCRs. |
|
13123 | 4389 |
outStream close. |
4390 |
tempFilename remove. |
|
9020 | 4391 |
^ false |
4392 |
] do:[ |
|
4393 |
excla := inStream class chunkSeparator. |
|
4394 |
nChanges := self numberOfChanges. |
|
4395 |
||
4396 |
1 to:nChanges do:[:index | |
|
16372 | 4397 |
inStream position:((changeInfoList at:index) position)-1. |
9020 | 4398 |
sawExcla := inStream peekFor:excla. |
4399 |
chunk := inStream nextChunk. |
|
4400 |
||
4401 |
(chunk notNil |
|
4402 |
and:[(chunk startsWith:'''---- snap') not]) ifTrue:[ |
|
16372 | 4403 |
(stamp := (changeInfoList at:index) timestamp) notNil ifTrue:[ |
9020 | 4404 |
outStream nextPutAll:'''---- timestamp ' , stamp , ' ----'''. |
4405 |
outStream nextPut:excla; cr. |
|
4406 |
]. |
|
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4407 |
]. |
9020 | 4408 |
|
4409 |
sawExcla ifTrue:[ |
|
4410 |
outStream nextPut:excla. |
|
4411 |
outStream nextChunkPut:chunk. |
|
4412 |
outStream cr; cr. |
|
4413 |
" |
|
4414 |
a method-definition chunk - output followups |
|
4415 |
" |
|
4416 |
done := false. |
|
4417 |
first := true. |
|
4418 |
[done] whileFalse:[ |
|
4419 |
chunk := inStream nextChunk. |
|
4420 |
chunk isNil ifTrue:[ |
|
4421 |
outStream cr; cr. |
|
4422 |
done := true |
|
4423 |
] ifFalse:[ |
|
4424 |
chunk isEmpty ifTrue:[ |
|
4425 |
outStream space; nextChunkPut:chunk; cr; cr. |
|
4426 |
done := true. |
|
4427 |
] ifFalse:[ |
|
4428 |
first ifFalse:[ |
|
4429 |
outStream cr; cr. |
|
4430 |
]. |
|
4431 |
outStream nextChunkPut:chunk. |
|
4432 |
]. |
|
4433 |
]. |
|
4434 |
first := false. |
|
4435 |
]. |
|
4436 |
] ifFalse:[ |
|
4437 |
outStream nextChunkPut:chunk. |
|
4438 |
outStream cr |
|
4439 |
] |
|
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4440 |
]. |
9020 | 4441 |
outStream syncData; close. |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4442 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4443 |
inStream close. |
9020 | 4444 |
|
13123 | 4445 |
inFilename renameTo:(inFilename withSuffix:'bak'). |
4446 |
tempFilename renameTo:changeFileName. |
|
9020 | 4447 |
anyChanges := false |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4448 |
]. |
9020 | 4449 |
] ensure:[ |
4450 |
inStream close. |
|
4451 |
]. |
|
4452 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4453 |
^ true |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4454 |
|
11234 | 4455 |
"Modified: / 02-12-1996 / 22:29:15 / stefan" |
16372 | 4456 |
"Modified: / 01-05-2016 / 19:30:34 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4457 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4458 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4459 |
!ChangesBrowser methodsFor:'private-user interaction ops'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4460 |
|
5735 | 4461 |
appendChange:changeNr toFile:aFileNameOrFileNameString |
202 | 4462 |
"append change to a file. return true if ok." |
4463 |
||
5735 | 4464 |
|fileName changeInStream outStream chunk chunk2 sawExcla separator encoding| |
4465 |
||
4466 |
changeInStream := self streamForChange:changeNr. |
|
4467 |
changeInStream isNil ifTrue:[ |
|
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4468 |
self warn:'Cannot read change'. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4469 |
^ false |
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4470 |
]. |
5735 | 4471 |
changeInStream skipSeparators. |
4472 |
||
4473 |
separator := changeInStream class chunkSeparator. |
|
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4474 |
|
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4475 |
(self changeIsFollowupMethodChange:changeNr) ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4476 |
sawExcla := true. |
16372 | 4477 |
chunk := self changeChunkAt:changeNr. |
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4478 |
] ifFalse:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4479 |
sawExcla := changeInStream peekFor:separator. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4480 |
chunk := changeInStream nextChunk. |
3991 | 4481 |
]. |
4482 |
chunk withoutSeparators isEmpty ifTrue:[ |
|
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4483 |
self error:'Empty chunk - should not happen' mayProceed:true. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4484 |
^ false. |
5735 | 4485 |
]. |
4486 |
||
4487 |
fileName := aFileNameOrFileNameString asFilename. |
|
202 | 4488 |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
4489 |
[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4490 |
outStream := fileName readWriteStream. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
4491 |
] on:FileStream openErrorSignal do:[:ex| |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4492 |
self warn:'Cannot update file: ''%1''' with:fileName. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4493 |
^ false |
73 | 4494 |
]. |
202 | 4495 |
|
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4496 |
outStream fileSize = 0 ifTrue:[ |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4497 |
encoding := #utf8. |
15090 | 4498 |
outStream nextPutLine:'"{ Encoding: utf8 }" !!'. |
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4499 |
] ifFalse:[ |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4500 |
encoding := CharacterEncoder guessEncodingOfStream:outStream. |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4501 |
]. |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4502 |
|
5735 | 4503 |
encoding notNil ifTrue:[ |
15858 | 4504 |
outStream := EncodedStream stream:outStream encoding:encoding. |
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4505 |
]. |
202 | 4506 |
outStream setToEnd. |
4507 |
||
4508 |
sawExcla ifTrue:[ |
|
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4509 |
outStream nextPut:separator |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4510 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4511 |
outStream nextChunkPut:chunk; cr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4512 |
sawExcla ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4513 |
chunk2 := changeInStream nextChunk. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4514 |
chunk2 withoutSeparators isEmpty ifTrue:[ |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4515 |
self error:'Empty chunk - should not happen'. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4516 |
]. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4517 |
outStream nextChunkPut:chunk2; space |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4518 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4519 |
sawExcla ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4520 |
outStream nextPut:separator |
202 | 4521 |
]. |
4522 |
outStream cr. |
|
5735 | 4523 |
|
4524 |
changeInStream close. |
|
202 | 4525 |
outStream close. |
4526 |
^ true |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4527 |
|
16372 | 4528 |
"Modified: / 01-05-2016 / 18:25:00 / cg" |
73 | 4529 |
! |
4530 |
||
51 | 4531 |
applyChange:changeNr |
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4532 |
"fileIn a change. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4533 |
Answer true, if everything went ok." |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4534 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4535 |
|aStream applyAction nameSpace className changeClass ownerName ownerClass reader doItChunk methodsForChunk pkg |
4877 | 4536 |
alternativeClass shortName orgClassName nsClass aborted| |
45 | 4537 |
|
51 | 4538 |
aStream := self streamForChange:changeNr. |
12973 | 4539 |
aStream isNil ifTrue:[^ false]. |
51 | 4540 |
|
2965 | 4541 |
className := self classNameOfChange:changeNr. |
4542 |
className notNil ifTrue:[ |
|
6378 | 4543 |
className := className asSymbol. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4544 |
enforcedNameSpace notNil ifTrue:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4545 |
changeClass := enforcedNameSpace at:className ifAbsent:nil. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4546 |
] ifFalse:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4547 |
changeClass := Smalltalk at:className ifAbsent:nil. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4548 |
]. |
6378 | 4549 |
changeClass isNil ifTrue:[ |
4550 |
changeClass := self classOfChange:changeNr. |
|
4551 |
]. |
|
8351
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4552 |
changeClass notNil ifTrue:[ |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4553 |
"load unloaded class. Otherwise a class definition change |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4554 |
will create a class without methods" |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4555 |
changeClass autoload. |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4556 |
]. |
51 | 4557 |
]. |
45 | 4558 |
|
51 | 4559 |
changeNrProcessed := changeNr. |
4877 | 4560 |
aborted := false. |
45 | 4561 |
|
6288 | 4562 |
applyAction := |
6378 | 4563 |
[ |
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4564 |
AbortOperationRequest handle:[:ex | |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4565 |
"catch the abort of a single apply here. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4566 |
Send AbortAllOperationRequest to abort multiple operations" |
6378 | 4567 |
aborted := true. |
4568 |
ex return. |
|
4569 |
] do:[ |
|
4570 |
nameSpace := self nameSpaceForApply. |
|
4571 |
||
4572 |
pkg := enforcedPackage ? Class packageQuerySignal query. |
|
4573 |
Class packageQuerySignal answer:pkg |
|
4574 |
do:[ |
|
4575 |
Class nameSpaceQuerySignal answer:nameSpace |
|
4576 |
do:[ |
|
11244 | 4577 |
Class defaultApplicationQuerySignal handle:[:ex | |
4578 |
ex proceedWith:defaultApplicationForVAGEClasses |
|
4579 |
] do:[ |
|
4580 |
Class changeDefaultApplicationNotificationSignal handle:[:ex | |
|
4581 |
defaultApplicationForVAGEClasses := ex parameter. |
|
4582 |
] do:[ |
|
4583 |
||
4584 |
"/ a followup methodsFor: chunk ... |
|
4585 |
(self changeIsFollowupMethodChange:changeNr) ifTrue:[ |
|
16372 | 4586 |
methodsForChunk := self changeChunkAt:changeNr. |
11244 | 4587 |
] ifFalse:[ |
4588 |
doItChunk := aStream nextChunk. "/ an empty chunk sometimes ... |
|
4589 |
doItChunk notEmpty ifTrue:[ |
|
4590 |
doItChunk first = (Character value:16rFEFF) ifTrue:[ |
|
4591 |
doItChunk := doItChunk copyFrom:2. |
|
4592 |
]. |
|
4593 |
Compiler evaluate:doItChunk notifying:self. |
|
6378 | 4594 |
] ifFalse:[ |
11244 | 4595 |
methodsForChunk := aStream nextChunk. "/ the real one |
6378 | 4596 |
] |
4597 |
]. |
|
11244 | 4598 |
methodsForChunk notNil ifTrue:[ |
4599 |
changeClass isNil ifTrue:[ |
|
4600 |
orgClassName := className. |
|
4601 |
||
4602 |
(className includes:$:) ifTrue:[ |
|
4603 |
ownerName := className copyTo:(className lastIndexOf:$:) - 1. |
|
4604 |
(ownerName endsWith:$:) ifTrue:[ |
|
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
4605 |
ownerName := ownerName copyButLast:1. |
11244 | 4606 |
]. |
4607 |
||
4608 |
ownerClass := Smalltalk at:(ownerName asSymbol) ifAbsent:[]. |
|
4609 |
ownerClass notNil ifTrue:[ |
|
4610 |
ownerClass autoload |
|
4611 |
]. |
|
4612 |
]. |
|
4613 |
(nameSpace notNil and:[nameSpace ~~ Smalltalk]) ifTrue:[ |
|
4614 |
changeClass := nameSpace at:className ifAbsent:[]. |
|
4615 |
]. |
|
4616 |
changeClass isNil ifTrue:[ |
|
4617 |
changeClass := Smalltalk at:className ifAbsent:[]. |
|
4618 |
]. |
|
4619 |
[changeClass isNil] whileTrue:[ |
|
4620 |
(NameSpace allNameSpaces |
|
15683 | 4621 |
contains:[:ns | (nsClass := (ns at:className asSymbol)) notNil]) |
11244 | 4622 |
ifTrue:[ |
4623 |
shortName := nsClass name. |
|
4624 |
] ifFalse:[ |
|
4625 |
shortName := className copyFrom:(className lastIndexOf:$:) + 1. |
|
4626 |
shortName = className ifTrue:[ |
|
4627 |
shortName := '' |
|
4628 |
]. |
|
4629 |
]. |
|
4630 |
className := Dialog |
|
12973 | 4631 |
request:'No class ''' , className , ''' for change. Add to which class? (enter empty string to skip this change)' |
11244 | 4632 |
initialAnswer:shortName. |
4633 |
||
12973 | 4634 |
className isNil ifTrue:[ |
4635 |
AbortAllOperationRequest raise. |
|
4636 |
]. |
|
4637 |
className isEmpty ifTrue:[ |
|
4638 |
^ false |
|
11244 | 4639 |
]. |
4640 |
alternativeClass := Smalltalk classNamed:className. |
|
4641 |
alternativeClass notNil ifTrue:[ |
|
4642 |
changeClass := alternativeClass |
|
4643 |
] |
|
4644 |
]. |
|
4645 |
methodsForChunk := methodsForChunk copyFrom:(methodsForChunk indexOfSeparator). |
|
4646 |
methodsForChunk := changeClass name , methodsForChunk. |
|
4647 |
]. |
|
4648 |
reader := Compiler evaluate:methodsForChunk notifying:self. |
|
4649 |
reader fileInFrom:aStream notifying:self passChunk:false single:true. |
|
4650 |
] |
|
4651 |
] |
|
6378 | 4652 |
] |
4653 |
] |
|
4654 |
] |
|
4655 |
]. |
|
4656 |
changeNrProcessed := nil. |
|
4657 |
]. |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
4658 |
|
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
4659 |
"/ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
4660 |
"/ if I am showing the changes file, dont update it |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
4661 |
"/ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
4662 |
changeFileName = ObjectMemory nameForChanges ifTrue:[ |
6378 | 4663 |
Class withoutUpdatingChangesDo:[ |
4664 |
Class updateChangeListQuerySignal answer:updateChangeSet value do:applyAction |
|
4665 |
] |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
4666 |
] ifFalse:[ |
6378 | 4667 |
applyAction value |
45 | 4668 |
]. |
4877 | 4669 |
aStream close. |
4670 |
||
4671 |
^ aborted not |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
4672 |
|
16372 | 4673 |
"Modified: / 01-05-2016 / 18:25:18 / cg" |
45 | 4674 |
! |
4675 |
||
7953 | 4676 |
compareCategoryChange:parseTree |
9888 | 4677 |
|receiverExpression method thisClass| |
7953 | 4678 |
|
4679 |
receiverExpression := parseTree receiver. |
|
4680 |
receiverExpression isMessage ifTrue:[ |
|
4681 |
receiverExpression selector == #compiledMethodAt: ifTrue:[ |
|
9888 | 4682 |
[ |
4683 |
thisClass := receiverExpression receiver evaluate. |
|
4684 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
4685 |
||
4686 |
(thisClass isBehavior |
|
7953 | 4687 |
and:[(method := receiverExpression evaluate) isMethod]) ifTrue:[ |
4688 |
method category = parseTree arg1 evaluate ifTrue:[ |
|
4689 |
^ true -> 'Change has no effect\\(same category)'. |
|
4690 |
] ifFalse:[ |
|
8173 | 4691 |
^ false -> ('Category is different (''' , method category , ''' vs. ''' , parseTree arg1 evaluate , ''')'). |
7953 | 4692 |
] |
4693 |
] ifFalse:[ |
|
4694 |
^ nil -> 'There is no such method'. |
|
4695 |
] |
|
4696 |
] |
|
4697 |
]. |
|
4698 |
^ nil -> 'Unhandled receiver' |
|
4699 |
! |
|
4700 |
||
255 | 4701 |
compareChange:changeNr |
2835 | 4702 |
"compare a change with the current (in-image) version; show the result of the compare (as dialog)" |
4703 |
||
4704 |
^ self compareChange:changeNr showResult:true |
|
4705 |
! |
|
4706 |
||
4707 |
compareChange:changeNr showResult:doShowResult |
|
4708 |
"compare a change with current version. |
|
4709 |
Return the result of the compare (same -> true, different -> false, uncomparable -> nil). |
|
4710 |
If doShowResult is true, the outcome is shown in a dialog/diffViewer." |
|
255 | 4711 |
|
15016 | 4712 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource outcome showDiff d selector isLoaded beep superClass thisClassSym varsHere varsInChange addedVars removedVars |
9888 | 4713 |
isSame ownerClass superClassHere superClassInChange sameAndOutcome| |
255 | 4714 |
|
4715 |
aStream := self streamForChange:changeNr. |
|
2835 | 4716 |
aStream isNil ifTrue:[^ nil]. |
255 | 4717 |
|
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
4718 |
showDiff := false. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
4719 |
|
1472 | 4720 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
6357 | 4721 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
4722 |
chunk := aStream nextChunk. |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4723 |
] ifTrue:[ |
16372 | 4724 |
chunk := self changeChunkAt:changeNr. |
6357 | 4725 |
sawExcla := true. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4726 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4727 |
|
2835 | 4728 |
isSame := nil. |
4729 |
||
761 | 4730 |
beep := false. |
255 | 4731 |
sawExcla ifFalse:[ |
6357 | 4732 |
outcome := 'cannot compare this change\\(i.e. this is not a method change).'. |
4733 |
||
4734 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
4735 |
do:[ |
|
8665 | 4736 |
parseTree := self parseExpression:chunk. |
6357 | 4737 |
]. |
4738 |
(parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[ |
|
4739 |
selector := parseTree selector. |
|
4740 |
||
4741 |
selector == #'removeSelector:' ifTrue:[ |
|
7953 | 4742 |
sameAndOutcome := self compareRemoveSelectorChange:parseTree. |
4743 |
isSame := sameAndOutcome key. |
|
4744 |
outcome := sameAndOutcome value. |
|
4745 |
]. |
|
4746 |
selector == #'package:' ifTrue:[ |
|
4747 |
sameAndOutcome := self comparePackageChange:parseTree. |
|
4748 |
isSame := sameAndOutcome key. |
|
4749 |
outcome := sameAndOutcome value. |
|
6357 | 4750 |
]. |
4751 |
selector == #'category:' ifTrue:[ |
|
7953 | 4752 |
sameAndOutcome := self compareCategoryChange:parseTree. |
4753 |
isSame := sameAndOutcome key. |
|
4754 |
outcome := sameAndOutcome value. |
|
6357 | 4755 |
]. |
4756 |
selector == #'comment:' ifTrue:[ |
|
7953 | 4757 |
sameAndOutcome := self compareCommentChange:parseTree. |
4758 |
isSame := sameAndOutcome key. |
|
4759 |
outcome := sameAndOutcome value. |
|
6357 | 4760 |
]. |
4761 |
||
4762 |
selector == #'instanceVariableNames:' ifTrue:[ |
|
7953 | 4763 |
sameAndOutcome := self compareInstanceVariableNamesChange:parseTree. |
4764 |
isSame := sameAndOutcome key. |
|
4765 |
outcome := sameAndOutcome value. |
|
6357 | 4766 |
]. |
4767 |
||
4768 |
(Class definitionSelectors includes:selector) |
|
4769 |
"/ selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' |
|
4770 |
ifTrue:[ |
|
9888 | 4771 |
[ |
4772 |
superClass := parseTree receiver evaluate. |
|
4773 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
6357 | 4774 |
superClass isBehavior ifFalse:[ |
4775 |
outcome := 'Cannot compare this change\\(superclass not loaded).'. |
|
4776 |
isSame := nil. |
|
4777 |
] ifTrue:[ |
|
4778 |
(self checkClassIsLoaded:superClass) ifTrue:[ |
|
4779 |
thisClassSym := (parseTree arguments at:1) evaluate. |
|
4780 |
||
4781 |
(selector endsWith:':privateIn:') ifTrue:[ |
|
11475
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
4782 |
Parser undefinedVariableError catch:[ |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
4783 |
ownerClass := (parseTree arguments at:5) evaluate. |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
4784 |
ownerClass isBehavior ifTrue:[ |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
4785 |
thisClass := ownerClass privateClassesAt:thisClassSym. |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
4786 |
]. |
6357 | 4787 |
]. |
4788 |
] ifFalse:[ |
|
4789 |
thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil. |
|
4790 |
]. |
|
4791 |
thisClass isNil ifTrue:[ |
|
4792 |
outcome := 'Change defines the class: ' , thisClassSym allBold. |
|
4793 |
isSame := false. |
|
4794 |
] ifFalse:[ |
|
4795 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
4796 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
4797 |
isSame := nil. |
|
4798 |
] ifTrue:[ |
|
4799 |
superClassHere := thisClass superclass name. |
|
4800 |
superClassInChange := parseTree receiver name. |
|
4801 |
superClassHere ~~ superClassInChange ifTrue:[ |
|
4802 |
outcome := 'Superclass is different.'. |
|
4803 |
isSame := false. |
|
4804 |
] ifFalse:[ |
|
4805 |
varsHere := thisClass instanceVariableString asCollectionOfWords. |
|
4806 |
varsInChange := (parseTree arguments at:2) evaluate asCollectionOfWords. |
|
4807 |
varsHere = varsInChange ifTrue:[ |
|
4808 |
thisClass classVariableString asCollectionOfWords = (parseTree arguments at:3) evaluate asCollectionOfWords ifTrue:[ |
|
9689
72819fbf329a
changed: #compareChange:showResult:
Claus Gittinger <cg@exept.de>
parents:
9621
diff
changeset
|
4809 |
((thisClass sharedPoolNames size == 0) and:[(parseTree arguments at:4) evaluate = '']) ifTrue:[ |
6357 | 4810 |
((selector endsWith:':category:') |
4811 |
and:[thisClass category ~= (parseTree arguments at:5) evaluate]) ifTrue:[ |
|
4812 |
outcome := 'Category is different'. |
|
4813 |
isSame := false. |
|
4814 |
] ifFalse:[ |
|
4815 |
outcome := 'Change has no effect\\(same definition)'. |
|
4816 |
isSame := true. |
|
4817 |
] |
|
4296
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
4818 |
"/ thisClass category = (parseTree arguments at:5) evaluate ifTrue:[ |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
4819 |
"/ outcome := 'Change has no effect\\(same definition)'. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
4820 |
"/ isSame := true. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
4821 |
"/ ] ifFalse:[ |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
4822 |
"/ outcome := 'Category is different'. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
4823 |
"/ isSame := false. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
4824 |
"/ ] |
6357 | 4825 |
] ifFalse:[ |
4826 |
outcome := 'SharedPool definition is different'. |
|
4827 |
isSame := false. |
|
4828 |
]. |
|
4829 |
] ifFalse:[ |
|
4830 |
outcome := 'ClassVariable definition is different'. |
|
4831 |
isSame := false. |
|
4832 |
] |
|
4833 |
] ifFalse:[ |
|
4834 |
outcome := 'InstanceVariable definition is different'. |
|
4835 |
isSame := false. |
|
12825 | 4836 |
addedVars := varsInChange reject:[:eachVar | (varsHere includes:eachVar)]. |
4837 |
removedVars := varsHere reject:[:eachVar | (varsInChange includes:eachVar)]. |
|
6357 | 4838 |
addedVars isEmpty ifTrue:[ |
4839 |
removedVars isEmpty ifTrue:[ |
|
4840 |
outcome := 'Change reorders instanceVariable(s)'. |
|
4841 |
] ifFalse:[ |
|
4842 |
removedVars := removedVars collect:[:eachVar | '''' , eachVar , '''']. |
|
4843 |
outcome := 'Change removes instanceVariable(s): ' , (removedVars asStringWith:Character space) allBold. |
|
4844 |
] |
|
4845 |
] ifFalse:[ |
|
4846 |
removedVars isEmpty ifTrue:[ |
|
4847 |
addedVars := addedVars collect:[:eachVar | '''' , eachVar , '''']. |
|
4848 |
outcome := 'Change adds instanceVariable(s): ' , (addedVars asStringWith:Character space) allBold. |
|
4849 |
]. |
|
4850 |
]. |
|
4851 |
] |
|
4852 |
] |
|
4853 |
] |
|
4854 |
] |
|
4855 |
] |
|
4856 |
] |
|
4857 |
] |
|
4858 |
] |
|
255 | 4859 |
] ifTrue:[ |
15016 | 4860 |
Class nameSpaceQuerySignal |
4861 |
answer:(self nameSpaceForApply) |
|
4862 |
do:[ |
|
4863 |
parseTree := self parseExpression:chunk. |
|
4864 |
]. |
|
4865 |
||
6357 | 4866 |
(parseTree notNil |
4867 |
and:[parseTree ~~ #Error |
|
4868 |
and:[parseTree isMessage]]) ifTrue:[ |
|
4869 |
"/ Squeak support (#methodsFor:***) |
|
4870 |
(#( |
|
4871 |
#methodsFor: |
|
4872 |
#privateMethodsFor: |
|
4873 |
#publicMethodsFor: |
|
4874 |
#ignoredMethodsFor: |
|
4875 |
#protectedMethodsFor: |
|
4876 |
||
4877 |
#methodsFor:stamp: "/ Squeak support |
|
4878 |
#methodsFor "/ Dolphin support |
|
4879 |
#methods "/ STV support |
|
4880 |
) |
|
4881 |
includes:parseTree selector) ifTrue:[ |
|
9888 | 4882 |
[ |
4883 |
thisClass := parseTree receiver evaluate. |
|
4884 |
] on:Parser undefinedVariableError do:[:ex| |
|
4885 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
4886 |
isSame := nil. |
|
4887 |
]. |
|
4888 |
thisClass notNil ifTrue:[ |
|
4889 |
(thisClass isKindOf:UndefinedVariable) ifTrue:[ |
|
6357 | 4890 |
|thisName path| |
4891 |
||
4892 |
thisName := thisClass name. |
|
4893 |
path := thisName asCollectionOfSubstringsSeparatedByAll:'::'. |
|
4894 |
1 to:path size do:[:length | |
|
4895 |
|ownerName owner| |
|
4896 |
||
4897 |
ownerName := (path copyTo:length) asStringCollection asStringWith:'::'. |
|
6820
4e8815b9e661
Do not autoload class when comparing changes.
Stefan Vogel <sv@exept.de>
parents:
6682
diff
changeset
|
4898 |
owner := Smalltalk loadedClassNamed:ownerName. |
6357 | 4899 |
(owner notNil and:[owner isBehavior and:[owner isLoaded not]]) ifTrue:[ |
4900 |
self checkClassIsLoaded:owner. |
|
4901 |
]. |
|
4902 |
]. |
|
9888 | 4903 |
thisClass := parseTree receiver evaluate. |
6357 | 4904 |
]. |
4905 |
||
4906 |
thisClass isBehavior ifTrue:[ |
|
4907 |
parseTree selector == #methodsFor ifTrue:[ |
|
4908 |
cat := 'Dolphin methods'. |
|
4909 |
] ifFalse:[ |
|
4910 |
parseTree selector == #methods ifTrue:[ |
|
4911 |
cat := 'STV methods'. |
|
4912 |
] ifFalse:[ |
|
4913 |
cat := parseTree arg1 evaluate. |
|
4914 |
]. |
|
4915 |
]. |
|
4916 |
newSource := aStream nextChunk. |
|
4917 |
||
15016 | 4918 |
isSame := self |
4919 |
compareMethodSource:newSource |
|
4920 |
withVersionInClass:thisClass |
|
4921 |
into:[:outcomeResult :beepResult :oldSourceResult| |
|
4922 |
outcome := outcomeResult. |
|
4923 |
beep := beepResult. |
|
4924 |
oldSource := oldSourceResult. |
|
4925 |
]. |
|
4926 |
||
4927 |
isSame isNil ifTrue:[ |
|
4928 |
showDiff := false. |
|
4929 |
] ifFalse:[ |
|
4930 |
showDiff := isSame not. |
|
6357 | 4931 |
]. |
15016 | 4932 |
|
6357 | 4933 |
doShowResult ifTrue:[ |
4934 |
(showDiff and:[oldSource notNil and:[newSource notNil]]) ifTrue:[ |
|
8102 | 4935 |
d := DiffCodeView |
6639 | 4936 |
openOn:oldSource label:(resources string:'Current version (in image)') |
4937 |
and:newSource label:(resources string:'Change version'). |
|
6357 | 4938 |
d label:'method differences'. |
4939 |
] |
|
4940 |
] |
|
4941 |
] ifFalse:[ |
|
4942 |
beep := true. |
|
4943 |
outcome := 'Class does not exist.'. |
|
4944 |
isSame := nil. |
|
4945 |
] |
|
9888 | 4946 |
]] ifFalse:[ |
6357 | 4947 |
beep := true. |
4948 |
outcome := 'Not comparable.'. |
|
4949 |
isSame := nil. |
|
4950 |
] |
|
4951 |
] ifFalse:[ |
|
4952 |
beep := true. |
|
4953 |
outcome := 'Not comparable.'. |
|
4954 |
isSame := nil. |
|
4955 |
] |
|
255 | 4956 |
]. |
4957 |
aStream close. |
|
2835 | 4958 |
|
4959 |
doShowResult ifTrue:[ |
|
6357 | 4960 |
showDiff ifFalse:[ |
4961 |
outcome := (resources stringWithCRs:outcome). |
|
4962 |
beep ifTrue:[ |
|
4963 |
self warn:outcome. |
|
4964 |
] ifFalse:[ |
|
4965 |
self information:outcome. |
|
4966 |
] |
|
4967 |
]. |
|
255 | 4968 |
]. |
2835 | 4969 |
^ isSame. |
255 | 4970 |
|
9689
72819fbf329a
changed: #compareChange:showResult:
Claus Gittinger <cg@exept.de>
parents:
9621
diff
changeset
|
4971 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
16372 | 4972 |
"Modified: / 01-05-2016 / 18:25:32 / cg" |
255 | 4973 |
! |
4974 |
||
7953 | 4975 |
compareCommentChange:parseTree |
4976 |
|thisClass| |
|
4977 |
||
9888 | 4978 |
[ |
4979 |
thisClass := parseTree receiver evaluate. |
|
4980 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
4981 |
||
7953 | 4982 |
thisClass isBehavior ifTrue:[ |
4983 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
4984 |
(thisClass comment = parseTree arg1 evaluate) ifTrue:[ |
|
4985 |
^ true -> 'Change has no effect\\(same comment)'. |
|
4986 |
] ifFalse:[ |
|
4987 |
^ false -> 'Comment is different'. |
|
4988 |
] |
|
4989 |
] ifFalse:[ |
|
4990 |
^ nil -> 'Cannot compare this change (compare requires class to be loaded).'. |
|
4991 |
] |
|
4992 |
]. |
|
4993 |
^ nil -> 'Cannot compare this change (class not present)'. |
|
4994 |
! |
|
4995 |
||
4996 |
compareInstanceVariableNamesChange:parseTree |
|
4997 |
|receiverExpression thisClass varsHere varsInChange | |
|
4998 |
||
4999 |
receiverExpression := parseTree receiver. |
|
5000 |
receiverExpression isMessage ifTrue:[ |
|
5001 |
receiverExpression selector == #class ifTrue:[ |
|
9888 | 5002 |
[ |
5003 |
thisClass := receiverExpression evaluate. |
|
5004 |
] on:Parser undefinedVariableError do:[:ex| |
|
5005 |
^ nil -> 'Class is not loaded'. |
|
5006 |
]. |
|
5007 |
||
7953 | 5008 |
varsHere := thisClass instanceVariableString asCollectionOfWords. |
5009 |
varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords. |
|
5010 |
varsHere = varsInChange ifTrue:[ |
|
5011 |
^ true -> 'Change has no effect\\(same definition)'. |
|
5012 |
] ifFalse:[ |
|
5013 |
^ false -> 'Class-instanceVariable definition is different'. |
|
5014 |
]. |
|
5015 |
]. |
|
5016 |
]. |
|
5017 |
^ nil -> 'Unhandled receiver' |
|
5018 |
! |
|
5019 |
||
15016 | 5020 |
compareMethodSource:newSource withVersionInClass:thisClass into:aThreeArgBlock |
5021 |
"returns true/false/nil if same,different,undecided; |
|
5022 |
also provides a message and a beep-boolean via the passed in block" |
|
5023 |
||
5024 |
|parser sel oldMethod oldSource outcome t1 t2 isLoaded| |
|
5025 |
||
5026 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
5027 |
do:[ |
|
5028 |
parser := Parser parseMethod:newSource in:thisClass. |
|
5029 |
]. |
|
5030 |
(parser isNil or:[parser == #Error]) ifTrue:[ |
|
5031 |
outcome := 'Change is unparsable (parse error).'. |
|
5032 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5033 |
^ nil. |
|
5034 |
]. |
|
5035 |
||
5036 |
sel := parser selector. |
|
5037 |
oldMethod := thisClass compiledMethodAt:sel. |
|
5038 |
oldMethod isNil ifTrue:[ |
|
5039 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
5040 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
5041 |
] ifTrue:[ |
|
5042 |
outcome := 'Method does not exist.'. |
|
5043 |
]. |
|
5044 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5045 |
^ nil. |
|
5046 |
]. |
|
5047 |
||
5048 |
oldSource := oldMethod source. |
|
5049 |
oldSource isNil ifTrue:[ |
|
5050 |
outcome := 'No source for compare.'. |
|
5051 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5052 |
^ nil. |
|
5053 |
]. |
|
5054 |
(oldSource = newSource) ifTrue:[ |
|
5055 |
outcome := 'Same source'. |
|
5056 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5057 |
^ true. |
|
5058 |
]. |
|
5059 |
||
5060 |
"/ |
|
5061 |
"/ compare for tabulator <-> space changes |
|
5062 |
"/ before showing diff ... |
|
5063 |
"/ |
|
5064 |
t1 := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5065 |
t2 := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5066 |
t1 = t2 ifTrue:[ |
|
5067 |
outcome := 'Same source'. |
|
5068 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5069 |
^ true. |
|
5070 |
]. |
|
5071 |
||
5072 |
"/ |
|
5073 |
"/ check if only historyLine diffs |
|
5074 |
"/ |
|
5075 |
(HistoryManager notNil |
|
5076 |
and:[HistoryManager isActive]) ifTrue:[ |
|
5077 |
(HistoryManager withoutHistoryLines:newSource) |
|
5078 |
= |
|
5079 |
(HistoryManager withoutHistoryLines:oldSource) |
|
5080 |
ifTrue:[ |
|
5081 |
outcome := 'Same source (history only)'. |
|
5082 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5083 |
^ true. |
|
5084 |
] |
|
5085 |
]. |
|
5086 |
||
5087 |
outcome := 'Source changed.'. |
|
5088 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5089 |
^ false. |
|
5090 |
! |
|
5091 |
||
7953 | 5092 |
comparePackageChange:parseTree |
9888 | 5093 |
|receiverExpression method thisClass| |
7953 | 5094 |
|
5095 |
receiverExpression := parseTree receiver. |
|
5096 |
receiverExpression isMessage ifTrue:[ |
|
5097 |
receiverExpression selector == #compiledMethodAt: ifTrue:[ |
|
9888 | 5098 |
[ |
5099 |
thisClass := receiverExpression receiver evaluate. |
|
5100 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5101 |
(thisClass isBehavior |
|
7953 | 5102 |
and:[(method := receiverExpression evaluate) isMethod]) ifTrue:[ |
5103 |
method package = parseTree arg1 evaluate ifTrue:[ |
|
5104 |
^ true -> 'Change has no effect\\(same package)'. |
|
5105 |
] ifFalse:[ |
|
8000 | 5106 |
^ false -> ('Package is different (''<1p>'' vs. ''<2p>'')' expandMacrosWith:method package with:parseTree arg1 evaluate). |
7953 | 5107 |
] |
5108 |
] ifFalse:[ |
|
5109 |
^ nil -> 'There is no such method'. |
|
5110 |
] |
|
5111 |
] |
|
5112 |
]. |
|
5113 |
^ nil -> 'Unhandled receiver' |
|
5114 |
! |
|
5115 |
||
5116 |
compareRemoveSelectorChange:parseTree |
|
5117 |
|thisClass selector| |
|
5118 |
||
9888 | 5119 |
[ |
5120 |
thisClass := parseTree receiver evaluate. |
|
5121 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5122 |
||
7953 | 5123 |
thisClass isBehavior ifTrue:[ |
5124 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
5125 |
selector := (parseTree arg1 evaluate). |
|
5126 |
(thisClass includesSelector:selector) ifTrue:[ |
|
8000 | 5127 |
^ false -> ('Change removes the #' , selector , ' method from ' , thisClass name). |
7953 | 5128 |
] ifFalse:[ |
8000 | 5129 |
^ true -> ('Change has no effect\\(there is no method for #' , selector , ' in ' , thisClass name , ')'). |
7953 | 5130 |
] |
5131 |
] ifFalse:[ |
|
5132 |
^ nil -> 'Cannot compare this change (compare requires class to be loaded).'. |
|
5133 |
] |
|
5134 |
]. |
|
5135 |
^ nil -> 'Cannot compare this change (class not present)'. |
|
5136 |
! |
|
5137 |
||
1359 | 5138 |
compressForClass:aClassNameOrNil |
6288 | 5139 |
"compress the change-set; |
1359 | 5140 |
this replaces multiple method-changes by the last (i.e. the most recent) change. |
5141 |
If the class argument is nil, compress for all classes. |
|
5142 |
otherwise, only changes for that class are compressed." |
|
5143 |
||
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5144 |
self |
6288 | 5145 |
compressForClass:aClassNameOrNil selector:nil |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5146 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5147 |
"Modified: / 19.11.2001 / 22:04:12 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5148 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5149 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5150 |
compressForClass:aClassNameOrNil selector:selectorToCompressOrNil |
6288 | 5151 |
"compress the change-set; |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5152 |
this replaces multiple method-changes by the last (i.e. the most recent) change. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5153 |
If the class argument is nil, compress for all classes. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5154 |
otherwise, only changes for that class are compressed." |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5155 |
|
6288 | 5156 |
|lbl aStream searchIndex anyMore deleteSet index |
7507 | 5157 |
str snapshotProto snapshotPrefix snapshotNameIndex| |
5158 |
||
5159 |
changeFileName notNil ifTrue:[ |
|
5160 |
aStream := changeFileName asFilename readStreamOrNil. |
|
5161 |
aStream isNil ifTrue:[^ self]. |
|
5162 |
]. |
|
1359 | 5163 |
|
4762 | 5164 |
lbl := 'compressing'. |
1359 | 5165 |
aClassNameOrNil isNil ifTrue:[ |
7507 | 5166 |
selectorToCompressOrNil notNil ifTrue:[ |
5167 |
lbl := lbl , ' for ' , selectorToCompressOrNil. |
|
5168 |
] |
|
1359 | 5169 |
] ifFalse:[ |
7507 | 5170 |
selectorToCompressOrNil isNil ifTrue:[ |
5171 |
lbl := lbl , ' for ' , aClassNameOrNil. |
|
5172 |
] ifFalse:[ |
|
5173 |
lbl := lbl , ' for ' , aClassNameOrNil , '>>' , selectorToCompressOrNil. |
|
5174 |
] |
|
1359 | 5175 |
]. |
6288 | 5176 |
lbl := lbl , '...'. |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5177 |
self newLabel:lbl. |
1359 | 5178 |
|
5179 |
CompressSnapshotInfo == true ifTrue:[ |
|
7507 | 5180 |
" |
5181 |
get a prototype snapshot record (to be independent of |
|
5182 |
the actual format .. |
|
5183 |
" |
|
5184 |
str := WriteStream on:String new. |
|
5185 |
Class addChangeRecordForSnapshot:'foo' to:str. |
|
5186 |
snapshotProto := str contents. |
|
5187 |
snapshotPrefix := snapshotProto copyTo:10. |
|
5188 |
snapshotNameIndex := snapshotProto findString:'foo'. |
|
1359 | 5189 |
]. |
5190 |
||
5191 |
self withExecuteCursorDo:[ |
|
7507 | 5192 |
|numChanges classes selectors types excla sawExcla |
5193 |
chunk aParseTree parseTreeChunk |
|
5194 |
thisClass thisSelector codeChunk codeParser |
|
5195 |
compressThis fileName| |
|
5196 |
||
5197 |
numChanges := self numberOfChanges. |
|
5198 |
classes := Array new:numChanges. |
|
5199 |
selectors := Array new:numChanges. |
|
5200 |
types := Array new:numChanges. |
|
5201 |
||
5202 |
"starting at the end, get the change class and change selector; |
|
5203 |
collect all in classes / selectors" |
|
5204 |
||
5205 |
aStream notNil ifTrue:[ |
|
5206 |
excla := aStream class chunkSeparator. |
|
5207 |
numChanges to:1 by:-1 do:[:changeNr | |
|
16372 | 5208 |
aStream position:((changeInfoList at:changeNr) position)-1. |
7507 | 5209 |
sawExcla := aStream peekFor:excla. |
5210 |
chunk := aStream nextChunk. |
|
5211 |
sawExcla ifTrue:[ |
|
5212 |
"optimize a bit if multiple methods for same category arrive" |
|
5213 |
(chunk = parseTreeChunk) ifFalse:[ |
|
8665 | 5214 |
aParseTree := self parseExpression:chunk. |
7507 | 5215 |
parseTreeChunk := chunk |
5216 |
]. |
|
5217 |
(aParseTree notNil |
|
5218 |
and:[(aParseTree ~~ #Error) |
|
5219 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
5220 |
(#( |
|
5221 |
#methodsFor: |
|
5222 |
#privateMethodsFor: |
|
5223 |
#publicMethodsFor: |
|
5224 |
#ignoredMethodsFor: |
|
5225 |
#protectedMethodsFor: |
|
5226 |
#methodsFor:stamp: "/ Squeak support |
|
5227 |
#methodsFor "/ Dolphin support |
|
5228 |
#methods "/ STV support |
|
5229 |
) |
|
5230 |
includes:aParseTree selector) ifTrue:[ |
|
5231 |
codeChunk := aStream nextChunk. |
|
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5232 |
[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5233 |
thisClass := aParseTree receiver evaluate. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5234 |
codeParser := Parser |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5235 |
parseMethodSpecification:codeChunk |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5236 |
in:thisClass |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5237 |
ignoreErrors:true |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5238 |
ignoreWarnings:true. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5239 |
(codeParser notNil and:[codeParser ~~ #Error]) ifTrue:[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5240 |
selectors at:changeNr put:(codeParser selector). |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5241 |
classes at:changeNr put:thisClass. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5242 |
types at:changeNr put:#methodsFor |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5243 |
] |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5244 |
] on:Parser parseErrorSignal do:[:ex| |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5245 |
"ignore chunk" |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5246 |
ex return. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5247 |
]. |
7507 | 5248 |
] |
5249 |
] |
|
5250 |
] ifFalse:[ |
|
8665 | 5251 |
aParseTree := self parseExpression:chunk. |
7507 | 5252 |
parseTreeChunk := chunk. |
5253 |
(aParseTree notNil |
|
5254 |
and:[(aParseTree ~~ #Error) |
|
5255 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
5256 |
(aParseTree selector == #removeSelector:) ifTrue:[ |
|
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5257 |
[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5258 |
thisClass := aParseTree receiver evaluate. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5259 |
selectors at:changeNr put:(aParseTree arg1 value). |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5260 |
classes at:changeNr put:thisClass. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5261 |
types at:changeNr put:#removeSelector |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5262 |
] on:Parser parseErrorSignal do:[:ex| |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5263 |
"ignore chunk" |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5264 |
ex return. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5265 |
]. |
7507 | 5266 |
] |
5267 |
] ifFalse:[ |
|
5268 |
CompressSnapshotInfo == true ifTrue:[ |
|
5269 |
(chunk startsWith:snapshotPrefix) ifTrue:[ |
|
13314 | 5270 |
str := chunk readStream position:snapshotNameIndex-1. |
7507 | 5271 |
fileName := str upTo:(Character space). |
5272 |
" |
|
5273 |
kludge to allow use of match-check below |
|
5274 |
" |
|
5275 |
selectors at:changeNr put:snapshotPrefix. |
|
5276 |
classes at:changeNr put:fileName. |
|
5277 |
] |
|
5278 |
] |
|
5279 |
] |
|
5280 |
]. |
|
5281 |
]. |
|
5282 |
aStream close. |
|
5283 |
] ifFalse:[ |
|
5284 |
numChanges to:1 by:-1 do:[:changeNr | |
|
5285 |
|change| |
|
5286 |
||
5287 |
classes at:changeNr put:(self classOfChange:changeNr ifAbsent:[:className| nil]). |
|
5288 |
selectors at:changeNr put:(self selectorOfMethodChange:changeNr). |
|
5289 |
]. |
|
5290 |
]. |
|
5291 |
||
5292 |
"for all changes, look for another class/selector occurrence later |
|
5293 |
in the list and, if there is one, add change number to the delete set" |
|
5294 |
||
5295 |
deleteSet := OrderedCollection new. |
|
5296 |
1 to:self numberOfChanges-1 do:[:changeNr | |
|
5297 |
thisClass := classes at:changeNr. |
|
5298 |
||
5299 |
compressThis := false. |
|
5300 |
aClassNameOrNil isNil ifTrue:[ |
|
5301 |
compressThis := true |
|
5302 |
] ifFalse:[ |
|
5303 |
"/ skipping unloaded/unknown classes |
|
5304 |
thisClass isBehavior ifTrue:[ |
|
5305 |
compressThis := aClassNameOrNil = thisClass theNonMetaclass name. |
|
5306 |
] |
|
5307 |
]. |
|
5308 |
compressThis ifTrue:[ |
|
5309 |
thisSelector := selectors at:changeNr. |
|
5310 |
compressThis := (selectorToCompressOrNil isNil or:[thisSelector == selectorToCompressOrNil]). |
|
5311 |
compressThis ifTrue:[ |
|
5312 |
searchIndex := changeNr. |
|
5313 |
anyMore := true. |
|
5314 |
[anyMore] whileTrue:[ |
|
5315 |
searchIndex := classes indexOf:thisClass startingAt:(searchIndex + 1). |
|
5316 |
(searchIndex ~~ 0) ifTrue:[ |
|
5317 |
((selectors at:searchIndex) == thisSelector) ifTrue:[ |
|
5318 |
thisClass notNil ifTrue:[ |
|
5319 |
deleteSet add:changeNr. |
|
5320 |
anyMore := false |
|
5321 |
] |
|
5322 |
] |
|
5323 |
] ifFalse:[ |
|
5324 |
anyMore := false |
|
5325 |
] |
|
5326 |
]. |
|
5327 |
]. |
|
5328 |
]. |
|
5329 |
]. |
|
5330 |
||
5331 |
"finally delete what has been found" |
|
5332 |
||
5333 |
(deleteSet size > 0) ifTrue:[ |
|
5334 |
changeListView setSelection:nil. |
|
5335 |
index := deleteSet size. |
|
5336 |
[index > 0] whileTrue:[ |
|
5337 |
self silentDeleteChange:(deleteSet at:index). |
|
5338 |
index := index - 1 |
|
5339 |
]. |
|
5340 |
self setChangeList. |
|
5341 |
" |
|
5342 |
scroll back a bit, if we are left way behind the list |
|
5343 |
" |
|
5344 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
|
5345 |
changeListView makeLineVisible:self numberOfChanges |
|
5346 |
]. |
|
5347 |
self clearCodeView |
|
5348 |
] |
|
1359 | 5349 |
]. |
5350 |
self newLabel:''. |
|
5351 |
||
7507 | 5352 |
"Created: / 19-11-2001 / 22:03:42 / cg" |
16372 | 5353 |
"Modified: / 01-05-2016 / 19:23:54 / cg" |
1359 | 5354 |
! |
5355 |
||
255 | 5356 |
deleteChange:changeNr |
5357 |
"delete a change" |
|
5358 |
||
5359 |
self deleteChangesFrom:changeNr to:changeNr |
|
5360 |
! |
|
5361 |
||
5362 |
deleteChangesFrom:start to:stop |
|
5363 |
"delete a range of changes" |
|
5364 |
||
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
5365 |
changeListView setSelection:nil. |
255 | 5366 |
stop to:start by:-1 do:[:changeNr | |
6288 | 5367 |
self silentDeleteInternalChange:changeNr. |
255 | 5368 |
]. |
6255 | 5369 |
changeListView removeFromIndex:start toIndex:stop. |
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5370 |
|
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5371 |
"/ changeListView contentsChanged. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5372 |
"/ changeListView redrawFromLine:start. |
255 | 5373 |
|
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5374 |
"/ self setChangeList |
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5375 |
|
1648 | 5376 |
"Modified: / 18.5.1998 / 14:22:27 / cg" |
255 | 5377 |
! |
5378 |
||
202 | 5379 |
makeChangeAPatch:changeNr |
5380 |
"append change to patchfile" |
|
5381 |
||
5382 |
self appendChange:changeNr toFile:'patches' |
|
5383 |
! |
|
5384 |
||
5385 |
makeChangePermanent:changeNr |
|
5386 |
"rewrite the source file where change changeNr lies" |
|
5387 |
||
5388 |
self notify:'this is not yet implemented' |
|
5389 |
! |
|
5390 |
||
73 | 5391 |
silentDeleteChange:changeNr |
5392 |
"delete a change do not update changeListView" |
|
57 | 5393 |
|
73 | 5394 |
anyChanges := true. |
16372 | 5395 |
changeInfoList removeIndex:changeNr. |
5396 |
"/ changeChunks removeIndex:changeNr. |
|
5397 |
"/ changePositions size >= changeNr ifTrue:[ changePositions removeIndex:changeNr ]. |
|
5398 |
"/ changeClassNames size >= changeNr ifTrue:[ changeClassNames removeIndex:changeNr ]. |
|
5399 |
"/ changeSelectors size >= changeNr ifTrue:[ changeSelectors removeIndex:changeNr ]. |
|
5400 |
"/ changeHeaderLines size >= changeNr ifTrue:[ changeHeaderLines removeIndex:changeNr ]. |
|
5401 |
"/ changeTimeStamps size >= changeNr ifTrue:[ changeTimeStamps removeIndex:changeNr ]. |
|
5402 |
"/ changeIsFollowupMethodChange size >= changeNr ifTrue:[ changeIsFollowupMethodChange removeIndex:changeNr ]. |
|
5403 |
||
5404 |
"Modified: / 01-05-2016 / 19:20:40 / cg" |
|
45 | 5405 |
! |
5406 |
||
202 | 5407 |
silentDeleteChangesFor:aClassName from:start to:stop |
1428
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5408 |
"delete changes for a given class in a range. |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5409 |
Return the number of deleted changes." |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5410 |
|
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5411 |
|thisClassName index numDeleted| |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5412 |
|
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5413 |
numDeleted := 0. |
202 | 5414 |
index := stop. |
5415 |
[index >= start] whileTrue:[ |
|
6288 | 5416 |
thisClassName := self classNameOfChange:index. |
5417 |
thisClassName = aClassName ifTrue:[ |
|
5418 |
self silentDeleteChange:index. |
|
5419 |
numDeleted := numDeleted + 1. |
|
5420 |
]. |
|
5421 |
index := index - 1 |
|
1428
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5422 |
]. |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5423 |
^ numDeleted |
51 | 5424 |
|
45 | 5425 |
! |
5426 |
||
3607 | 5427 |
silentDeleteChangesFor:aClassName selector:selector from:start to:stop |
5428 |
"delete changes for given class/selector in a range. |
|
5429 |
Return the number of deleted changes." |
|
5430 |
||
5431 |
|thisClassName index numDeleted| |
|
5432 |
||
5433 |
numDeleted := 0. |
|
5434 |
index := stop. |
|
5435 |
[index >= start] whileTrue:[ |
|
6288 | 5436 |
thisClassName := self classNameOfChange:index. |
5437 |
thisClassName = aClassName ifTrue:[ |
|
5438 |
(self selectorOfMethodChange:index) == selector ifTrue:[ |
|
5439 |
self silentDeleteChange:index. |
|
5440 |
numDeleted := numDeleted + 1. |
|
5441 |
] |
|
5442 |
]. |
|
5443 |
index := index - 1 |
|
3607 | 5444 |
]. |
5445 |
^ numDeleted |
|
5446 |
! |
|
5447 |
||
2511 | 5448 |
silentDeleteChangesForClassAndPrivateClasses:aClassName from:start to:stop |
5449 |
"delete changes for a given class and its private classes in a range. |
|
5450 |
Return the number of deleted changes." |
|
5451 |
||
5452 |
|thisClassName index numDeleted| |
|
5453 |
||
5454 |
numDeleted := 0. |
|
5455 |
index := stop. |
|
5456 |
[index >= start] whileTrue:[ |
|
6288 | 5457 |
thisClassName := self ownerClassNameOfChange:index. |
5458 |
thisClassName = aClassName ifTrue:[ |
|
5459 |
self silentDeleteChange:index. |
|
5460 |
numDeleted := numDeleted + 1. |
|
5461 |
]. |
|
5462 |
index := index - 1 |
|
2511 | 5463 |
]. |
5464 |
^ numDeleted |
|
5465 |
||
5466 |
! |
|
5467 |
||
12428 | 5468 |
silentDeleteChangesForNamespace:aNamespace from:start to:stop |
5469 |
"delete changes for a given namespace in a range. |
|
5470 |
Return the number of deleted changes." |
|
5471 |
||
5472 |
|thisNamespace index numDeleted| |
|
5473 |
||
5474 |
numDeleted := 0. |
|
5475 |
index := stop. |
|
5476 |
[index >= start] whileTrue:[ |
|
5477 |
thisNamespace := self namespaceOfChange:index. |
|
5478 |
thisNamespace = aNamespace ifTrue:[ |
|
5479 |
self silentDeleteChange:index. |
|
5480 |
numDeleted := numDeleted + 1. |
|
5481 |
]. |
|
5482 |
index := index - 1 |
|
5483 |
]. |
|
5484 |
^ numDeleted |
|
5485 |
! |
|
5486 |
||
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5487 |
silentDeleteInternalChange:changeNr |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5488 |
"delete a change do not update changeListView" |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5489 |
|
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5490 |
anyChanges := true. |
16372 | 5491 |
changeInfoList removeIndex:changeNr. |
5492 |
"/ changeChunks removeIndex:changeNr. |
|
5493 |
"/ changePositions size >= changeNr ifTrue:[changePositions removeIndex:changeNr]. |
|
5494 |
"/ changeClassNames size >= changeNr ifTrue:[changeClassNames removeIndex:changeNr]. |
|
5495 |
"/ changeSelectors size >= changeNr ifTrue:[ changeSelectors removeIndex:changeNr ]. |
|
5496 |
"/ changeTimeStamps size >= changeNr ifTrue:[changeTimeStamps removeIndex:changeNr]. |
|
5497 |
"/ changeIsFollowupMethodChange size >= changeNr ifTrue:[changeIsFollowupMethodChange removeIndex:changeNr]. |
|
5498 |
||
5499 |
"Created: / 07-03-1997 / 16:28:32 / cg" |
|
5500 |
"Modified: / 26-02-1998 / 18:20:48 / stefan" |
|
5501 |
"Modified: / 01-05-2016 / 19:20:59 / cg" |
|
4487 | 5502 |
! |
5503 |
||
5504 |
updateDiffView |
|
5505 |
self withSelectedChangesDo:[:changeNr | |
|
6288 | 5506 |
self updateDiffViewFor:changeNr. |
5507 |
^ self. |
|
4487 | 5508 |
]. |
5509 |
||
5510 |
diffView text1:'' text2:'' |
|
5511 |
! |
|
5512 |
||
5513 |
updateDiffViewFor:changeNr |
|
5514 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource |
|
8675
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5515 |
parser sel showDiff selector oldMethod i| |
4487 | 5516 |
|
5517 |
aStream := self streamForChange:changeNr. |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5518 |
aStream isNil ifTrue:[ |
6317 | 5519 |
^ self |
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5520 |
]. |
4487 | 5521 |
|
5522 |
showDiff := false. |
|
5523 |
||
5524 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
|
6317 | 5525 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
5526 |
chunk := aStream nextChunk. |
|
4487 | 5527 |
] ifTrue:[ |
16372 | 5528 |
chunk := self changeChunkAt:changeNr. |
6317 | 5529 |
sawExcla := true. |
4487 | 5530 |
]. |
5531 |
||
4857 | 5532 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
5533 |
do:[ |
|
8665 | 5534 |
parseTree := self parseExpression:chunk. |
6317 | 5535 |
(parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[ |
5536 |
selector := parseTree selector. |
|
5537 |
] |
|
4857 | 5538 |
]. |
5539 |
||
5540 |
selector isNil ifTrue:[ |
|
6317 | 5541 |
newSource := chunk. |
5542 |
oldSource := 'Not comparable.'. |
|
4857 | 5543 |
] ifFalse:[ |
6317 | 5544 |
sawExcla ifFalse:[ |
5545 |
"/ not a method-change |
|
5546 |
newSource := chunk. |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
5547 |
oldSource := self currentSourceForParseTree:parseTree. |
6317 | 5548 |
] ifTrue:[ |
5549 |
"/ a method-change |
|
5550 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5551 |
(self class methodDefinitionSelectors includes:selector) ifTrue:[ |
6317 | 5552 |
newSource := aStream nextChunk. |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5553 |
thisClass := self classFromEvaluatingTree:parseTree receiver. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5554 |
"/ Error |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5555 |
"/ handle:[ ] |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5556 |
"/ do:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5557 |
"/ thisClass := parseTree receiver evaluate. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5558 |
"/ ]. |
6378 | 5559 |
thisClass isBehavior ifFalse:[ |
5560 |
thisClass := self classOfChange:changeNr. |
|
5561 |
]. |
|
6317 | 5562 |
thisClass isBehavior ifTrue:[ |
5563 |
(thisClass isLoaded |
|
5564 |
or:[ autoloadAsRequired value |
|
5565 |
and:[self checkClassIsLoaded:thisClass]]) ifFalse:[ |
|
5566 |
oldSource := 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
5567 |
] ifTrue:[ |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5568 |
selector numArgs == 0 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5569 |
cat := '* as yet uncategorized *'. |
6532 | 5570 |
cat := selector. |
6317 | 5571 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5572 |
cat := parseTree arg1 evaluate. |
6317 | 5573 |
]. |
5574 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
5575 |
do:[ |
|
7709 | 5576 |
parser := Parser new. |
6639 | 5577 |
Error catch:[ |
7709 | 5578 |
parser |
5579 |
parseMethod:newSource in:thisClass |
|
5580 |
ignoreErrors:true ignoreWarnings:true. |
|
6317 | 5581 |
] |
5582 |
]. |
|
7709 | 5583 |
sel := parser selector. |
5584 |
(sel notNil) ifTrue:[ |
|
6317 | 5585 |
oldMethod := thisClass compiledMethodAt:sel. |
5586 |
oldMethod notNil ifTrue:[ |
|
5587 |
(oldMethod category = cat) ifFalse:[ |
|
6447 | 5588 |
"/ Transcript showCR:'category changed.'. |
6317 | 5589 |
]. |
5590 |
oldSource := oldMethod source. |
|
5591 |
(oldSource = newSource) ifFalse:[ |
|
5592 |
oldSource isNil ifTrue:[ |
|
5593 |
oldSource := 'No source for compare.'. |
|
5594 |
] ifFalse:[ |
|
5595 |
"/ |
|
5596 |
"/ compare for tabulator <-> space changes |
|
5597 |
"/ before showing diff ... |
|
5598 |
"/ |
|
5599 |
oldSource := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5600 |
newSource := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5601 |
oldSource = newSource ifFalse:[ |
|
5602 |
"/ |
|
5603 |
"/ check if only historyLine diffs |
|
5604 |
"/ |
|
5605 |
(HistoryManager notNil |
|
5606 |
and:[HistoryManager isActive]) ifTrue:[ |
|
5607 |
oldSource := oldSource asStringCollection asString. |
|
5608 |
newSource := newSource asStringCollection asString. |
|
5609 |
(HistoryManager withoutHistoryLines:oldSource) |
|
5610 |
= |
|
5611 |
(HistoryManager withoutHistoryLines:newSource) |
|
5612 |
ifTrue:[ |
|
5613 |
oldSource := (HistoryManager withoutHistoryLines:oldSource). |
|
5614 |
newSource := (HistoryManager withoutHistoryLines:newSource). |
|
5615 |
] |
|
5616 |
]. |
|
5617 |
] |
|
5618 |
] |
|
5619 |
] |
|
5620 |
] ifFalse:[ |
|
5621 |
oldSource := 'Method does not exist.'. |
|
5622 |
] |
|
5623 |
] ifFalse:[ |
|
5624 |
oldSource := 'Change is unparsable (parse error).'. |
|
5625 |
]. |
|
5626 |
]. |
|
5627 |
] ifFalse:[ |
|
5628 |
oldSource := 'Class does not exist.'. |
|
5629 |
] |
|
5630 |
] ifFalse:[ |
|
5631 |
newSource := chunk. "/ aStream contents. |
|
5632 |
oldSource := 'Not comparable.'. |
|
5633 |
] |
|
5634 |
] |
|
4487 | 5635 |
]. |
5636 |
aStream close. |
|
5637 |
||
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5638 |
oldSource := oldSource ? ''. |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5639 |
newSource := newSource ? ''. |
8675
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5640 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5641 |
oldSource := oldSource asStringCollection asString. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5642 |
newSource := newSource asStringCollection asString. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5643 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5644 |
"/ unify cr, crlf and lf into lf |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5645 |
(oldSource includes:Character return) ifTrue: [ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5646 |
i := oldSource indexOf:Character return. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5647 |
(oldSource at:i+1) == Character nl ifTrue:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5648 |
"/ crnl endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5649 |
oldSource := oldSource copyReplaceString:(String crlf) withString:(String lf). |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5650 |
] ifFalse:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5651 |
"/ cr endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5652 |
oldSource := oldSource copyReplaceAll:Character return with:Character nl. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5653 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5654 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5655 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5656 |
"/ unify cr, crlf and lf into lf |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5657 |
(newSource includes:Character return) ifTrue: [ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5658 |
i := newSource indexOf:Character return. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5659 |
(newSource at:i+1) == Character nl ifTrue:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5660 |
"/ crnl endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5661 |
newSource := newSource copyReplaceString:(String crlf) withString:(String lf). |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5662 |
] ifFalse:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5663 |
"/ cr endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5664 |
newSource := newSource copyReplaceAll:Character return with:Character nl. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5665 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5666 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5667 |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5668 |
(oldSource = newSource |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5669 |
or:[ oldSource asStringCollection withTabsExpanded = newSource asStringCollection withTabsExpanded]) ifTrue:[ |
6317 | 5670 |
self makeDiffViewInvisible |
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5671 |
] ifFalse:[ |
6317 | 5672 |
self makeDiffViewVisible. |
5673 |
diffView text1:oldSource text2:newSource. |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5674 |
]. |
4487 | 5675 |
|
7709 | 5676 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
16372 | 5677 |
"Modified: / 01-05-2016 / 18:26:01 / cg" |
202 | 5678 |
! ! |
0 | 5679 |
|
202 | 5680 |
!ChangesBrowser methodsFor:'termination'! |
51 | 5681 |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5682 |
askIfChangesAreToBeWrittenBack |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5683 |
|action again| |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5684 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5685 |
anyChanges ifFalse:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5686 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5687 |
again := true. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5688 |
[again] whileTrue:[ |
6357 | 5689 |
action := OptionBox |
5690 |
request:(resources stringWithCRs:'The modified changelist has not been written back to the change file.\\Write change file before closing ?') |
|
5691 |
label:'ChangesBrowser' |
|
5692 |
image:(WarningBox iconBitmap) |
|
5693 |
buttonLabels:(resources array:#('Cancel' 'Don''t Write' 'Write')) |
|
5694 |
values:#(#abort #ignore #save) |
|
5695 |
default:#save |
|
5696 |
onCancel:#abort. |
|
5697 |
||
5698 |
again := false. |
|
5699 |
action == #abort ifTrue:[AbortSignal raise. ^ self]. |
|
5700 |
action == #save ifTrue:[ |
|
5701 |
again := self writeBackChanges not |
|
5702 |
]. |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5703 |
]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5704 |
! |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5705 |
|
1787 | 5706 |
closeRequest |
5707 |
"window manager wants us to go away" |
|
5708 |
||
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5709 |
self askIfChangesAreToBeWrittenBack. |
1787 | 5710 |
super closeRequest |
5711 |
! |
|
5712 |
||
202 | 5713 |
saveAndTerminate |
5714 |
"update the changes file and quit. |
|
5715 |
Dont depend on this being sent, not all window managers |
|
5716 |
send it; instead, they simply destroy the view." |
|
28 | 5717 |
|
202 | 5718 |
anyChanges ifTrue:[ |
6288 | 5719 |
self writeBackChanges. |
0 | 5720 |
]. |
1787 | 5721 |
super saveAndTerminate |
5722 |
||
5723 |
"Modified: / 3.8.1998 / 19:54:00 / cg" |
|
0 | 5724 |
! ! |
5725 |
||
73 | 5726 |
!ChangesBrowser methodsFor:'user interaction'! |
51 | 5727 |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5728 |
askForSearch:msg initialAnswer:initial thenSearchUsing:searchBlock2 onCancel:cancelBlock |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5729 |
|searchString directionHolder searchBlock| |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5730 |
|
6288 | 5731 |
searchString := self |
15674 | 5732 |
askForSearchString:msg |
5733 |
initialAnswer:initial |
|
5734 |
directionInto:(directionHolder := ValueHolder new). |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5735 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5736 |
searchString isNil ifTrue:[ |
15674 | 5737 |
^ cancelBlock value |
5738 |
]. |
|
5739 |
directionHolder value == #first ifTrue:[ |
|
5740 |
self findFirstForClass:searchString. |
|
5741 |
^ self. |
|
5742 |
]. |
|
5743 |
directionHolder value == #last ifTrue:[ |
|
5744 |
self findLastForClass:searchString. |
|
5745 |
^ self. |
|
5746 |
]. |
|
5747 |
||
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5748 |
searchBlock := [:changeNr | searchBlock2 value:searchString value:changeNr]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5749 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5750 |
directionHolder value == #backward ifTrue:[ |
15674 | 5751 |
changeNrShown isNil ifTrue:[ |
5752 |
changeNrShown := self numberOfChanges. |
|
5753 |
]. |
|
5754 |
self findPreviousForWhich:searchBlock |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5755 |
] ifFalse:[ |
15674 | 5756 |
changeNrShown isNil ifTrue:[ |
5757 |
changeNrShown := 0. |
|
5758 |
]. |
|
5759 |
self findNextForWhich:searchBlock |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5760 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5761 |
! |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5762 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5763 |
askForSearchString:msg initialAnswer:initial directionInto:aValueHolder |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5764 |
"common code to open a search box" |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5765 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5766 |
|searchString direction| |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5767 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5768 |
direction := #forward. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5769 |
|
15449 | 5770 |
"/ take a normal request box, but add an additional 'previous' button |
5771 |
Dialog modifyingBoxWith:[:box | |
|
15674 | 5772 |
|nextButton prevButton firstButton lastButton| |
15449 | 5773 |
|
13343 | 5774 |
nextButton := box okButton. |
15674 | 5775 |
|
5776 |
firstButton := Button label:(resources string:'First'). |
|
5777 |
firstButton action:[direction := #first. box okPressed.]. |
|
5778 |
box addButton:firstButton after:nextButton. |
|
5779 |
||
5780 |
lastButton := Button label:(resources string:'Last'). |
|
5781 |
lastButton action:[direction := #last. box okPressed.]. |
|
5782 |
box addButton:lastButton after:nextButton. |
|
5783 |
||
13343 | 5784 |
prevButton := Button label:(resources string:'Previous'). |
5785 |
prevButton action:[direction := #backward. box okPressed.]. |
|
5786 |
box addButton:prevButton after:nextButton. |
|
15674 | 5787 |
|
13343 | 5788 |
nextButton label:(resources string:'Next'). |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5789 |
] do:[ |
13343 | 5790 |
searchString := Dialog |
5791 |
request:msg |
|
5792 |
initialAnswer:initial |
|
5793 |
onCancel:nil. |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5794 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5795 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5796 |
searchString isNil ifTrue:[ |
13343 | 5797 |
^ nil |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5798 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5799 |
aValueHolder value:direction. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5800 |
^ searchString |
15449 | 5801 |
|
5802 |
" |
|
5803 |
self new askForSearchString:'foo' initialAnswer:'bla' directionInto:(false asValue) |
|
5804 |
" |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5805 |
! |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5806 |
|
221 | 5807 |
autoUpdate:aBoolean |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5808 |
"enabled/disable automatic update from the change-file (for monitoring)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5809 |
|
6216 | 5810 |
autoUpdate value:aBoolean |
221 | 5811 |
|
5812 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
5813 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
5814 |
! |
|
5815 |
||
6216 | 5816 |
autoloadAsRequired:aBoolean |
5817 |
"enabled/disable automatic load of unloaded classes" |
|
5818 |
||
5819 |
autoloadAsRequired value:aBoolean |
|
5820 |
! |
|
5821 |
||
3211 | 5822 |
changeSelection:lineNrCollection |
0 | 5823 |
"show a change in the codeView" |
5824 |
||
11048 | 5825 |
|chunk lineNr lineNumbers| |
3211 | 5826 |
|
5827 |
lineNrCollection isInteger ifTrue:[ |
|
11048 | 5828 |
lineNr := lineNrCollection. |
5829 |
lineNumbers := Array with:lineNr. |
|
3211 | 5830 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5831 |
changeListView multipleSelectOk ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5832 |
lineNrCollection size == 1 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5833 |
lineNr := lineNrCollection first. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5834 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5835 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5836 |
lineNr := lineNrCollection |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5837 |
]. |
11048 | 5838 |
lineNumbers := lineNrCollection. |
5839 |
]. |
|
5840 |
||
5841 |
self changeListSelectionHolder value:lineNumbers. |
|
16467 | 5842 |
|
2293 | 5843 |
lineNr isNil ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5844 |
codeView contents:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5845 |
codeView initializeDoITAction. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5846 |
changeNrShown := nil. |
16467 | 5847 |
infoHolder value:nil. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5848 |
^ self |
2293 | 5849 |
]. |
5850 |
||
16467 | 5851 |
changeNrShown := lineNr. |
5852 |
self sensor |
|
5853 |
enqueueMessage:#updateSourceCodeAfterChangedSelection for:self arguments:nil; |
|
5854 |
enqueueMessage:#updateInfoAfterChangedSelection for:self arguments:nil. |
|
5855 |
^ self. |
|
5856 |
||
3211 | 5857 |
"/ display the changes code |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
5858 |
chunk := self sourceOfChange:lineNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
5859 |
chunk isNil ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5860 |
codeView initializeDoITAction. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5861 |
^ self |
2044 | 5862 |
]. |
8391 | 5863 |
|
0 | 5864 |
codeView contents:chunk. |
13 | 5865 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
2043
66b5276b2760
set self in changesBrowsers doIt.
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
5866 |
codeView doItAction:[:theCode | |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5867 |
|clsName cls| |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5868 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5869 |
clsName := self classNameOfChange:lineNr. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5870 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5871 |
clsName := clsName asSymbolIfInterned. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5872 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5873 |
cls := Smalltalk at:clsName ifAbsent:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5874 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5875 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5876 |
Compiler |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5877 |
evaluate:theCode |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5878 |
in:nil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5879 |
receiver:cls |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5880 |
notifying:self |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5881 |
logged:true |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5882 |
ifFail:nil |
2043
66b5276b2760
set self in changesBrowsers doIt.
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
5883 |
]. |
15 | 5884 |
changeNrShown := lineNr. |
0 | 5885 |
|
4487 | 5886 |
self showingDiffs value ifTrue:[ |
8391 | 5887 |
self withWaitCursorDo:[ |
5888 |
AbortOperationRequest catch:[ |
|
5889 |
self updateDiffViewFor:changeNrShown. |
|
5890 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5891 |
] |
4487 | 5892 |
]. |
5893 |
||
11048 | 5894 |
"Modified: / 03-01-2012 / 15:30:23 / cg" |
51 | 5895 |
! |
5896 |
||
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
5897 |
classOfChange:changeNr |
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
5898 |
^ self |
6386 | 5899 |
classOfChange:changeNr |
5900 |
ifAbsent:[:className | |
|
5901 |
|msg| |
|
5902 |
||
5903 |
className isNil ifTrue:[ |
|
5904 |
msg := 'Could not extract classname from change'. |
|
5905 |
] ifFalse:[ |
|
5906 |
msg := 'Class not found: ''' , className , ''''. |
|
5907 |
]. |
|
8320
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
5908 |
Transcript showCR:msg. |
6386 | 5909 |
"/ self warn:msg. |
5910 |
nil |
|
5911 |
] |
|
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
5912 |
! |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
5913 |
|
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
5914 |
classOfChange:changeNr ifAbsent:exceptionBlock |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5915 |
"answer the class that is subject to the chamge at changeNr. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5916 |
The classes owning class may be autoloaded, if autoloadAsRequired is true." |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5917 |
|
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
5918 |
|className cls isMeta nameSpaceForApply path ownerName owner| |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
5919 |
|
5014 | 5920 |
className := self realClassNameOfChange:changeNr. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
5921 |
className isNil ifTrue:[ |
6378 | 5922 |
^ exceptionBlock value:nil |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
5923 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
5924 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
5925 |
isMeta := false. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
5926 |
(className endsWith:' class') ifTrue:[ |
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
5927 |
className := className copyButLast:6. |
6378 | 5928 |
isMeta := true. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
5929 |
]. |
3472 | 5930 |
|
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
5931 |
autoloadAsRequired value ifTrue:[ |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
5932 |
path := className asCollectionOfSubstringsSeparatedByAll:'::'. |
8320
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
5933 |
path size >= 2 ifTrue:[ |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
5934 |
1 to:path size-1 do:[:l | |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
5935 |
"/ ensure that the owningClass is loaded - this will load the private classes as well |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
5936 |
"/ Transcript showCR:'loading owner'. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
5937 |
ownerName := (path copyTo:l) asStringCollection asStringWith:'::'. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
5938 |
owner := Smalltalk classNamed:ownerName. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
5939 |
owner notNil ifTrue:[ |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
5940 |
owner autoload. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
5941 |
]. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
5942 |
]. |
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
5943 |
]. |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
5944 |
]. |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
5945 |
|
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5946 |
nameSpaceForApply := self nameSpaceForApply. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5947 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5948 |
cls := nameSpaceForApply classNamed:className. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5949 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5950 |
cls := nameSpaceForApply loadedClassNamed:className |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5951 |
]. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5952 |
(cls isNil and:[nameSpaceForApply ~~ Smalltalk]) ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5953 |
"if not found in special name space, fall back to the Smalltalk name space" |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5954 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5955 |
cls := Smalltalk classNamed:className. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5956 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5957 |
cls := Smalltalk loadedClassNamed:className |
6378 | 5958 |
]. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
5959 |
]. |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
5960 |
|
6378 | 5961 |
cls isNil ifTrue:[ |
5962 |
^ exceptionBlock value:className |
|
5963 |
]. |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
5964 |
isMeta ifTrue:[ |
6378 | 5965 |
cls := cls class |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
5966 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
5967 |
^ cls |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
5968 |
! |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
5969 |
|
1471 | 5970 |
doubleClickOnChange:lineNr |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5971 |
"action performed when a change-list entry is doubleClicked" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5972 |
|
1471 | 5973 |
self doBrowse |
5974 |
||
5975 |
"Created: / 6.2.1998 / 13:08:49 / cg" |
|
5976 |
! |
|
5977 |
||
202 | 5978 |
noChangesAllowed |
5979 |
"show a warning that changes cannot be changed" |
|
93 | 5980 |
|
3211 | 5981 |
self warn:'Changes are not allowed to be changed.' |
0 | 5982 |
! |
5983 |
||
202 | 5984 |
saveClass:aClassName from:startNr |
5985 |
"user wants changes from current to end to be appended to a file" |
|
51 | 5986 |
|
202 | 5987 |
|changeNr fileName| |
51 | 5988 |
|
202 | 5989 |
changeNr := changeListView selection. |
5990 |
changeNr notNil ifTrue:[ |
|
9604 | 5991 |
fileName := Dialog |
5992 |
requestFileNameForSave:(resources string:'Append changes for class to:') |
|
5993 |
default:(lastSaveFileName ? '') |
|
5994 |
ok:(resources string:'Append') |
|
5995 |
abort:(resources string:'Abort') |
|
5996 |
pattern:'*.chg'. |
|
5997 |
||
5998 |
fileName notNil ifTrue:[ |
|
5999 |
lastSaveFileName := fileName. |
|
11685 | 6000 |
self withWriteCursorDo:[ |
9604 | 6001 |
startNr to:(self numberOfChanges) do:[:changeNr | |
6002 |
|thisClassName| |
|
6003 |
||
6004 |
thisClassName := self classNameOfChange:changeNr. |
|
6005 |
thisClassName = aClassName ifTrue:[ |
|
6006 |
self setSingleSelection:changeNr. |
|
6007 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
|
6008 |
^ self |
|
6009 |
] |
|
6010 |
] |
|
6011 |
] |
|
6012 |
] |
|
6013 |
]. |
|
202 | 6014 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
6015 |
|
11685 | 6016 |
"Modified: / 27-07-2012 / 09:46:04 / cg" |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
6017 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
6018 |
|
11477 | 6019 |
selectionChanged |
12946 | 6020 |
self halt:'should not be here' |
11048 | 6021 |
|
6022 |
"Created: / 03-01-2012 / 15:26:36 / cg" |
|
16467 | 6023 |
! |
6024 |
||
6025 |
updateInfoAfterChangedSelection |
|
6026 |
"update the info label" |
|
6027 |
||
6028 |
|selection lineNr className nClassChanges nMethodChanges uniqueSelectors |
|
6029 |
lastLineNr countAfterLast moreInfo| |
|
6030 |
||
6031 |
selection := lineNr := changeListView selection. |
|
6032 |
selection isNumber ifFalse:[ |
|
6033 |
lineNr := nil. |
|
6034 |
selection notEmptyOrNil ifTrue:[ |
|
6035 |
lineNr := selection first |
|
6036 |
]. |
|
6037 |
]. |
|
6038 |
||
6039 |
lineNr isNil ifTrue:[ |
|
6040 |
infoHolder value:nil. |
|
6041 |
^ self |
|
6042 |
]. |
|
6043 |
||
6044 |
"/ |
|
6045 |
"/ now, this info is computed so fast, |
|
6046 |
"/ we can do it each time the selection changes |
|
6047 |
"/ (can we?) |
|
6048 |
className := self realClassNameOfChange:lineNr. |
|
6049 |
||
6050 |
nClassChanges := nMethodChanges := 0. |
|
6051 |
uniqueSelectors := Set new. |
|
6052 |
lastLineNr := nil. |
|
6053 |
countAfterLast := 0. |
|
6054 |
||
6055 |
"/ count them all |
|
6056 |
1 to:changeInfoList size do:[:i | |
|
6057 |
|sel| |
|
6058 |
||
6059 |
(self realClassNameOfChange:i) = className ifTrue:[ |
|
6060 |
lastLineNr := i. |
|
6061 |
i > lineNr ifTrue:[ countAfterLast := countAfterLast + 1 ]. |
|
6062 |
||
6063 |
nClassChanges := nClassChanges + 1. |
|
6064 |
(sel := self selectorOfMethodChange:i) notNil ifTrue:[ |
|
6065 |
uniqueSelectors add:sel. |
|
6066 |
nMethodChanges := nMethodChanges + 1. |
|
6067 |
]. |
|
6068 |
]. |
|
6069 |
]. |
|
6070 |
lastLineNr == lineNr ifTrue:[ |
|
6071 |
moreInfo := resources string:'. This is the last for this class.'. |
|
6072 |
] ifFalse:[ |
|
6073 |
countAfterLast > 0 ifTrue:[ |
|
6074 |
moreInfo := resources string:'. %1 more for this class.' with:countAfterLast. |
|
6075 |
]. |
|
6076 |
]. |
|
6077 |
||
6078 |
infoHolder value:(resources |
|
6079 |
string:'%1 changes. %2 for %3 (%4 methods / %5 selectors)%6' |
|
6080 |
with:(changeInfoList size) |
|
6081 |
with:nClassChanges |
|
6082 |
with:className |
|
6083 |
with:nMethodChanges |
|
6084 |
with:uniqueSelectors size |
|
6085 |
with:moreInfo). |
|
6086 |
! |
|
6087 |
||
6088 |
updateSourceCodeAfterChangedSelection |
|
6089 |
"show a change in the codeView" |
|
6090 |
||
6091 |
|selection lineNr chunk| |
|
6092 |
||
6093 |
selection := lineNr := changeListView selection. |
|
6094 |
selection isNumber ifFalse:[ |
|
6095 |
lineNr := nil. |
|
6096 |
selection notEmptyOrNil ifTrue:[ |
|
6097 |
lineNr := selection first |
|
6098 |
]. |
|
6099 |
]. |
|
6100 |
||
6101 |
lineNr isNil ifTrue:[ |
|
6102 |
^ self |
|
6103 |
]. |
|
6104 |
||
6105 |
"/ display the changes code |
|
6106 |
chunk := self sourceOfChange:lineNr. |
|
6107 |
chunk isNil ifTrue:[ |
|
6108 |
codeView initializeDoITAction. |
|
6109 |
^ self |
|
6110 |
]. |
|
6111 |
||
6112 |
codeView contents:chunk. |
|
6113 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
|
6114 |
codeView doItAction:[:theCode | |
|
6115 |
|clsName cls| |
|
6116 |
||
6117 |
clsName := self classNameOfChange:lineNr. |
|
6118 |
clsName notNil ifTrue:[ |
|
6119 |
clsName := clsName asSymbolIfInterned. |
|
6120 |
clsName notNil ifTrue:[ |
|
6121 |
cls := Smalltalk at:clsName ifAbsent:nil. |
|
6122 |
] |
|
6123 |
]. |
|
6124 |
Compiler |
|
6125 |
evaluate:theCode |
|
6126 |
in:nil |
|
6127 |
receiver:cls |
|
6128 |
notifying:self |
|
6129 |
logged:true |
|
6130 |
ifFail:nil |
|
6131 |
]. |
|
6132 |
||
6133 |
||
6134 |
changeNrShown := lineNr. |
|
6135 |
||
6136 |
self showingDiffs value ifTrue:[ |
|
6137 |
self withWaitCursorDo:[ |
|
6138 |
AbortOperationRequest catch:[ |
|
6139 |
self updateDiffViewFor:changeNrShown. |
|
6140 |
] |
|
6141 |
] |
|
6142 |
]. |
|
202 | 6143 |
! ! |
0 | 6144 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6145 |
!ChangesBrowser::ChangeFileReader methodsFor:'accessing'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6146 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6147 |
autoCompare:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6148 |
autoCompare := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6149 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6150 |
|
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6151 |
autoloadAsRequired |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6152 |
^ autoloadAsRequired |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6153 |
! |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6154 |
|
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6155 |
autoloadAsRequired:something |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6156 |
autoloadAsRequired := something. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6157 |
! |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6158 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6159 |
browser:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6160 |
browser := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6161 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6162 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6163 |
changeChunks |
16372 | 6164 |
self halt. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6165 |
^ changeChunks |
16372 | 6166 |
|
6167 |
"Modified: / 01-05-2016 / 19:10:52 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6168 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6169 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6170 |
changeClassNames |
16372 | 6171 |
self halt. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6172 |
^ changeClassNames |
16372 | 6173 |
|
6174 |
"Modified: / 01-05-2016 / 19:10:47 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6175 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6176 |
|
6516
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6177 |
changeFileName |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6178 |
^ changeFileName |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6179 |
! |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6180 |
|
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6181 |
changeFileName:something |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6182 |
changeFileName := something. |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6183 |
! |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6184 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6185 |
changeHeaderLines |
16372 | 6186 |
self halt. |
6187 |
^ changeHeaderLines |
|
6188 |
||
6189 |
"Modified: / 01-05-2016 / 19:10:41 / cg" |
|
6190 |
! |
|
6191 |
||
6192 |
changeInfo |
|
6193 |
^ changeInfo |
|
6194 |
||
6195 |
"Created: / 01-05-2016 / 19:10:05 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6196 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6197 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6198 |
changeIsFollowupMethodChange |
16372 | 6199 |
self halt. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6200 |
^ changeIsFollowupMethodChange |
16372 | 6201 |
|
6202 |
"Modified: / 01-05-2016 / 19:10:24 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6203 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6204 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6205 |
changePositions |
16372 | 6206 |
self halt. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6207 |
^ changePositions |
16372 | 6208 |
|
6209 |
"Modified: / 01-05-2016 / 19:10:29 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6210 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6211 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6212 |
changeTimeStamps |
16372 | 6213 |
self halt. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6214 |
^ changeTimeStamps |
16372 | 6215 |
|
6216 |
"Modified: / 01-05-2016 / 19:10:34 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6217 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6218 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6219 |
enforcedNameSpace:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6220 |
enforcedNameSpace := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6221 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6222 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6223 |
inStream:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6224 |
inStream := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6225 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6226 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6227 |
noColoring:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6228 |
noColoring := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6229 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6230 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6231 |
tabSpec:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6232 |
tabSpec := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6233 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6234 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6235 |
thisIsAClassSource |
7360 | 6236 |
^ thisIsAClassSource ? false |
6237 |
||
6238 |
"Modified: / 06-10-2006 / 11:18:49 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6239 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6240 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6241 |
!ChangesBrowser::ChangeFileReader methodsFor:'private'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6242 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6243 |
contractClass:className selector:selector to:maxLen |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6244 |
"contract a class>>selector string (for display in the changeList)." |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6245 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6246 |
|s l| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6247 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6248 |
s := className , ' ', selector. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6249 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6250 |
l := maxLen - 1 - selector size max:20. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6251 |
s := (className contractTo:l) , ' ' , selector. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6252 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6253 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6254 |
l := maxLen - 1 - className size max:20. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6255 |
s := className , ' ', (selector contractTo:l). |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6256 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6257 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6258 |
s := (className contractTo:(maxLen // 2 - 1)) , ' ' , (selector contractTo:maxLen // 2) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6259 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6260 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6261 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6262 |
^ s |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6263 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6264 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6265 |
extractClassAndClassNameFromParseTree:rec |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6266 |
|isUnaryMessage className changeClass| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6267 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6268 |
isUnaryMessage := rec isUnaryMessage. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6269 |
|
9019 | 6270 |
Error |
6271 |
handle:[:ex | ^ '?' -> nil] |
|
6843 | 6272 |
do:[ |
9019 | 6273 |
isUnaryMessage ifTrue:[ |
6274 |
className := rec receiver name. |
|
6275 |
] ifFalse:[ |
|
6276 |
className := rec name. |
|
6277 |
]. |
|
6843 | 6278 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6279 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6280 |
enforcedNameSpace notNil ifTrue:[ |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6281 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6282 |
changeClass := enforcedNameSpace classNamed:className. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6283 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6284 |
changeClass := enforcedNameSpace loadedClassNamed:className. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6285 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6286 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6287 |
changeClass isNil ifTrue:[ |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6288 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6289 |
changeClass := Smalltalk classNamed:className. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6290 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6291 |
changeClass := Smalltalk loadedClassNamed:className. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6292 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6293 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6294 |
isUnaryMessage ifTrue:[ |
6843 | 6295 |
changeClass notNil ifTrue:[ |
6296 |
changeClass := changeClass class. |
|
6297 |
]. |
|
6298 |
className := className , ' class'. |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6299 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6300 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6301 |
^ className -> changeClass |
6843 | 6302 |
|
6303 |
"Modified: / 03-08-2006 / 14:02:31 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6304 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6305 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6306 |
nameSpaceForApply |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6307 |
^ browser nameSpaceForApply |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6308 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6309 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6310 |
!ChangesBrowser::ChangeFileReader methodsFor:'reading'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6311 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6312 |
addHeaderLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo |
16372 | 6313 |
changeHeaderLines add:(self headerLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo) |
6314 |
||
6315 |
"Modified: / 01-05-2016 / 19:07:49 / cg" |
|
6316 |
! |
|
6317 |
||
6318 |
headerLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6319 |
|entry| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6320 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6321 |
entry := MultiColListEntry new. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6322 |
entry tabulatorSpecification:tabSpec. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6323 |
entry colAt:1 put:changeDelta. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6324 |
entry colAt:2 put:changeString. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6325 |
entry colAt:3 put:changeType. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6326 |
timeStampInfo notNil ifTrue:[ |
12599
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
6327 |
entry colAt:4 put:(browser timeStampPrintStringOf:timeStampInfo). |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6328 |
]. |
16372 | 6329 |
^ entry |
6330 |
||
6331 |
"Created: / 01-05-2016 / 19:07:20 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6332 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6333 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6334 |
processChunk |
16372 | 6335 |
|info| |
6336 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6337 |
(chunkText startsWith:'''---- timestamp ') ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6338 |
timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6339 |
^ self. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6340 |
]. |
11234 | 6341 |
(chunkText asLowercase startsWith:'''---- encoding: ') ifTrue:[ |
6342 |
^ self. |
|
6343 |
]. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6344 |
|
16372 | 6345 |
changeInfo add:(info := |
6346 |
ChangesBrowser::ChangeInfo new |
|
6347 |
position:chunkPosition chunk:chunkText className:nil selector:nil headerLine:nil |
|
6348 |
timestamp:timeStampInfo isFollowupChange:false). |
|
6349 |
"/ changeChunks add:chunkText. |
|
6350 |
"/ changeClassNames add:nil. |
|
6351 |
"/ changePositions add:chunkPosition. |
|
6352 |
"/ changeTimeStamps add:timeStampInfo. |
|
6353 |
"/ changeIsFollowupMethodChange add:false. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6354 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6355 |
headerLine := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6356 |
changeDelta := ' '. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6357 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6358 |
sawExcla ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6359 |
self processNonMethodChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6360 |
] ifTrue:[ |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6361 |
self processMethodChunkIfNone: |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6362 |
[ |
16372 | 6363 |
changeInfo removeLast. |
6364 |
"/ changeChunks removeLast. |
|
6365 |
"/ changeClassNames removeLast. |
|
6366 |
"/ changePositions removeLast. |
|
6367 |
"/ changeTimeStamps removeLast. |
|
6368 |
"/ changeIsFollowupMethodChange removeLast. |
|
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6369 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6370 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6371 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6372 |
changeString notNil ifTrue:[ |
16372 | 6373 |
"/ self addHeaderLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo. |
6374 |
info headerLine:(self headerLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo) |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6375 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6376 |
headerLine notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6377 |
changeHeaderLines add:headerLine |
16372 | 6378 |
info headerLine:headerLine. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6379 |
] |
16372 | 6380 |
]. |
6381 |
||
6382 |
"Modified: / 01-05-2016 / 19:13:59 / cg" |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6383 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6384 |
|
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6385 |
processMethodChunkIfNone:emptyBlock |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6386 |
"sawExcla" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6387 |
|
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6388 |
|askedForEditingClassSource changeClass category anyMethod |
15012 | 6389 |
sel p rec clsName done first text methodPos |
16372 | 6390 |
singleJunkOnly methodChunks classCategoryChunks methodCategoryChunks singleInfo methodSelector nameAndClass |
6391 |
info| |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6392 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6393 |
singleJunkOnly := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6394 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6395 |
classCategoryChunks := methodCategoryChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6396 |
singleInfo := false. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6397 |
anyMethod := false. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6398 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6399 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6400 |
method definitions actually consist of |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6401 |
two (or more) chunks; skip next chunk(s) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6402 |
up to an empty one. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6403 |
The system only writes one chunk, |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6404 |
and we cannot handle more in this ChangesBrowser .... |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6405 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6406 |
clsName := nil. |
8665 | 6407 |
|
6408 |
p := browser parseExpression:chunkText inNameSpace:(self nameSpaceForApply). |
|
6835
87e0844b7e12
Avoid debugger on timestamp information whenn doing autocompare
Stefan Vogel <sv@exept.de>
parents:
6820
diff
changeset
|
6409 |
(p notNil and:[p ~~ #Error and:[p isMessage]]) ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6410 |
rec := p receiver. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6411 |
sel := p selector. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6412 |
(ChangesBrowser methodDefinitionSelectors includes:sel) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6413 |
methodChunks := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6414 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6415 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6416 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6417 |
sel == #categoriesForClass ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6418 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6419 |
classCategoryChunks := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6420 |
changeType := '(class category change)'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6421 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6422 |
sel == #categoriesFor: ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6423 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6424 |
methodCategoryChunks := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6425 |
changeType := '(category change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6426 |
methodSelector := (p args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6427 |
] ifFalse:[ |
6532 | 6428 |
(sel numArgs == 0) ifTrue:[ |
6429 |
category := '* As yet uncategorized *'. |
|
6430 |
category := sel. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6431 |
] ifFalse:[ |
6532 | 6432 |
category := (p args at:1) evaluate. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6433 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6434 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6435 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6436 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6437 |
sel == #'methodsFor:stamp:' ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6438 |
"/ Squeak timeStamp |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6439 |
timeStampInfo := (p args at:2) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6440 |
singleInfo := true |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6441 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6442 |
sel == #'commentStamp:prior:' ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6443 |
singleJunkOnly := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6444 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6445 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6446 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6447 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6448 |
sel == #reorganize ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6449 |
singleJunkOnly := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6450 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6451 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6452 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6453 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6454 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6455 |
done := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6456 |
first := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6457 |
[done] whileFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6458 |
changeDelta := ' '. |
13314 | 6459 |
methodPos := inStream position + 1. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6460 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6461 |
text := inStream nextChunk. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6462 |
done := text isEmptyOrNil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6463 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6464 |
done ifFalse:[ |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6465 |
anyMethod := true. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6466 |
first ifFalse:[ |
16372 | 6467 |
info := ChangesBrowser::ChangeInfo new |
6468 |
position:methodPos chunk:chunkText className:clsName |
|
6469 |
selector:nil headerLine:nil timestamp:timeStampInfo isFollowupChange:true. |
|
6470 |
changeInfo add:info. |
|
6471 |
||
6472 |
"/ changeChunks add:chunkText. |
|
6473 |
"/ changeClassNames add:clsName. |
|
6474 |
"/ changePositions add:methodPos. |
|
6475 |
"/ changeTimeStamps add:timeStampInfo. |
|
6476 |
"/ changeIsFollowupMethodChange add:true. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6477 |
askedForEditingClassSource ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6478 |
thisIsAClassSource := (changeFileName asFilename hasSuffix:'st'). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6479 |
askedForEditingClassSource := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6480 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6481 |
] ifTrue:[ |
16372 | 6482 |
"/ changeClassNames at:changeClassNames size put:clsName. |
6483 |
changeInfo last className:clsName |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6484 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6485 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6486 |
first := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6487 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6488 |
(classCategoryChunks or:[methodCategoryChunks]) ifTrue:[ |
6639 | 6489 |
text := text firstLine. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6490 |
classCategoryChunks ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6491 |
changeClass isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6492 |
changeDelta := '?'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6493 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6494 |
changeClass category = text ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6495 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6496 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6497 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6498 |
changeString := clsName , ' category: ' , text storeString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6499 |
]ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6500 |
changeString := '(' , clsName , ' compiledMethodAt:' , methodSelector storeString , ') category: ' , text storeString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6501 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6502 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6503 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6504 |
try to find the selector |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6505 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6506 |
methodSelector := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6507 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6508 |
methodChunks ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6509 |
p := Parser |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6510 |
parseMethodSpecification:text |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6511 |
in:nil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6512 |
ignoreErrors:true |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6513 |
ignoreWarnings:true. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6514 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6515 |
methodSelector := p selector. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6516 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6517 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6518 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6519 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6520 |
methodSelector isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6521 |
changeString := (chunkText contractTo:maxLen). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6522 |
changeType := '(change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6523 |
headerLine := chunkText , ' (change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6524 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6525 |
changeString := self contractClass:clsName selector:methodSelector to:maxLen. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6526 |
changeType := '{ ' , category , ' }'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6527 |
headerLine := clsName , ' ' , methodSelector , ' ' , '(change category: ''' , category , ''')'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6528 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6529 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6530 |
autoCompare value ifTrue:[ |
15012 | 6531 |
changeDelta := ChangeDeltaInformation changeDeltaFor:text changeClass:changeClass selector:methodSelector. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6532 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6533 |
]. |
16372 | 6534 |
changeInfo last headerLine:(self headerLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo). |
6535 |
"/ self addHeaderLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6536 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6537 |
changeString := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6538 |
headerLine := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6539 |
singleJunkOnly ifTrue:[done := true] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6540 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6541 |
singleInfo ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6542 |
timeStampInfo := nil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6543 |
]. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6544 |
anyMethod ifFalse:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6545 |
emptyBlock value |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6546 |
]. |
16372 | 6547 |
|
6548 |
"Modified: / 01-05-2016 / 19:15:00 / cg" |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6549 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6550 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6551 |
processNonMethodChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6552 |
|s changeClass sel cls p rec clsName ownerTree ownerName |
15087 | 6553 |
m nameAndClass args instVarsArg classVarsArg categoryArg| |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6554 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6555 |
(chunkText startsWith:'''---- snap') ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6556 |
self processSnapshotChunk. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6557 |
^ self |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6558 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6559 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6560 |
headerLine := chunkText , ' (doIt)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6561 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6562 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6563 |
first, assume doIt - then lets have a more detailed look ... |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6564 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6565 |
((chunkText startsWith:'''---- file') |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6566 |
or:[(chunkText startsWith:'''---- check')]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6567 |
changeType := ''. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6568 |
timeStampInfo := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6569 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6570 |
changeType := '(doIt)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6571 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6572 |
changeString := (chunkText contractTo:maxLen) withoutSeparators. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6573 |
|
8665 | 6574 |
p := browser parseExpression:fullChunkText inNameSpace:Smalltalk. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6575 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6576 |
p isMessage ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6577 |
sel := p selector. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6578 |
rec := p receiver. |
15087 | 6579 |
args := p args. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6580 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6581 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6582 |
sel := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6583 |
(Scanner new scanTokens:fullChunkText) size == 0 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6584 |
"/ a comment only |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6585 |
changeType := '(comment)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6586 |
NoColoring ~~ true ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6587 |
changeType := changeType allItalic. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6588 |
"/ changeString := changeString allItalic. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6589 |
changeType emphasisAllAdd:(#color -> UserPreferences current commentColor). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6590 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6591 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6592 |
changeType := '(???)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6593 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6594 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6595 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6596 |
(sel == #comment:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6597 |
changeType := '(comment)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6598 |
clsName := rec name. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6599 |
changeClass := (self nameSpaceForApply) classNamed:clsName. |
16372 | 6600 |
(changeInfo last) className:clsName. |
6601 |
"/ changeClassNames at:changeClassNames size put:clsName. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6602 |
NoColoring ~~ true ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6603 |
changeType := changeType allItalic. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6604 |
changeType emphasisAllAdd:(#color -> UserPreferences current commentColor). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6605 |
"/ changeString := clsName allItalic. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6606 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6607 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6608 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6609 |
changeDelta := '?' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6610 |
] ifFalse:[ |
15087 | 6611 |
(changeClass comment = (args at:1) evaluate) ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6612 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6613 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6614 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6615 |
]. |
15087 | 6616 |
"/ sel := nil. |
6617 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6618 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6619 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6620 |
(sel == #removeSelector:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6621 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6622 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6623 |
|
15087 | 6624 |
sel := (args at:1) evaluate. |
16372 | 6625 |
(changeInfo last) className:clsName. |
6626 |
"/ changeClassNames at:changeClassNames size put:clsName. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6627 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6628 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6629 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6630 |
changeDelta := '?' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6631 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6632 |
(changeClass includesSelector:sel asSymbol) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6633 |
changeDelta := '-'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6634 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6635 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6636 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6637 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6638 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6639 |
changeType := '(remove)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6640 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
15087 | 6641 |
"/ sel := nil. |
6642 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6643 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6644 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6645 |
(p notNil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6646 |
and:[p ~~ #Error |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6647 |
and:[p isMessage |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6648 |
and:[rec isMessage |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6649 |
and:[rec selector == #compiledMethodAt:]]]]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6650 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec receiver. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6651 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6652 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6653 |
(sel == #category:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6654 |
sel := (rec args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6655 |
changeType := '(category change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6656 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
16372 | 6657 |
(changeInfo last) className:clsName. |
6658 |
"/ changeClassNames at:changeClassNames size put:clsName. |
|
15012 | 6659 |
autoCompare value ifTrue:[ |
6660 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
|
6661 |
changeDelta := '?' |
|
6662 |
] ifFalse:[ |
|
6663 |
m := changeClass compiledMethodAt:sel asSymbol. |
|
6664 |
m notNil ifTrue:[ |
|
6665 |
m category = (p args at:1) evaluate ifTrue:[ |
|
6666 |
changeDelta := '='. |
|
6667 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6668 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6669 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6670 |
]. |
15087 | 6671 |
^ self. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6672 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6673 |
(sel == #privacy:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6674 |
sel := (rec args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6675 |
changeType := '(privacy change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6676 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
16372 | 6677 |
(changeInfo last) className:clsName. |
6678 |
"/ changeClassNames at:changeClassNames size put:clsName. |
|
15012 | 6679 |
autoCompare value ifTrue:[ |
6680 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
|
6681 |
changeDelta := '?' |
|
6682 |
] ifFalse:[ |
|
6683 |
changeDelta := ' ' |
|
6684 |
] |
|
6685 |
]. |
|
15087 | 6686 |
^ self. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6687 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6688 |
sel := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6689 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6690 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6691 |
(Class definitionSelectors includes:sel) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6692 |
changeType := '(class definition)'. |
15087 | 6693 |
clsName := (args at:1) evaluate. |
16372 | 6694 |
(changeInfo last) className:clsName. |
6695 |
"/ changeClassNames at:changeClassNames size put:clsName. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6696 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6697 |
"/ is it a private-class ? |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6698 |
('*privateIn:' match:sel) ifTrue:[ |
15087 | 6699 |
ownerTree := args last. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6700 |
ownerName := ownerTree name asString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6701 |
clsName := ownerName , '::' , clsName |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6702 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6703 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6704 |
changeString := clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6705 |
NoColoring ~~ true ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6706 |
changeType := changeType allBold. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6707 |
changeString := changeString allBold. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6708 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6709 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6710 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6711 |
cls := (self nameSpaceForApply) at:clsName asSymbol ifAbsent:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6712 |
cls isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6713 |
changeDelta := '+'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6714 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6715 |
(cls definitionSelector = sel |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6716 |
or:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6717 |
"/ could be an ST/V, VAge or Dolphin definition |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6718 |
cls definitionSelector = (sel , 'category:') |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6719 |
]) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6720 |
ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6721 |
((cls superclass isNil |
16390 | 6722 |
and:[p receiver isLiteral |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6723 |
and:[p receiver evaluate isNil]]) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6724 |
or:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6725 |
cls superclass notNil |
16390 | 6726 |
and:[p receiver isLiteral not |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6727 |
and:[cls superclass name = p receiver name]] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6728 |
]) ifTrue:[ |
15087 | 6729 |
(sel == #'variableByteSubclass:classVariableNames:poolDictionaries:category:') |
6730 |
ifTrue:[ |
|
6731 |
"/ VSE definition message |
|
6732 |
instVarsArg := ''. |
|
6733 |
classVarsArg := (args at:2) evaluate. |
|
6734 |
categoryArg := (args at:4) evaluate. |
|
6735 |
] ifFalse:[ |
|
6736 |
instVarsArg := (args at:2) evaluate. |
|
6737 |
classVarsArg := (args at:3) evaluate. |
|
6738 |
categoryArg := (args at:5) evaluate. |
|
6739 |
]. |
|
6740 |
cls instanceVariableString asCollectionOfWords = instVarsArg asCollectionOfWords ifTrue:[ |
|
6741 |
cls classVariableString asCollectionOfWords = classVarsArg asCollectionOfWords ifTrue:[ |
|
6742 |
cls definitionSelector = (sel , 'category:') |
|
6743 |
ifTrue:[ |
|
6744 |
"/ ST/V, VAge or Dolphin definition |
|
6745 |
changeDelta := '='. |
|
6746 |
] ifFalse:[ |
|
6747 |
cls category = categoryArg ifTrue:[ |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6748 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6749 |
] ifFalse:[ |
15087 | 6750 |
changeType := '(class category change)'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6751 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6752 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6753 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6754 |
] |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6755 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6756 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6757 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6758 |
]. |
15087 | 6759 |
"/ sel := nil. |
6760 |
^ self. |
|
6761 |
]. |
|
6762 |
||
6763 |
(#( |
|
6764 |
#'primitiveDefinitions:' |
|
6765 |
#'primitiveFunctions:' |
|
6766 |
#'primitiveVariables:' |
|
6767 |
) includes:sel) ifTrue:[ |
|
6768 |
changeType := '(class definition)'. |
|
6769 |
clsName := rec name. |
|
6770 |
^ self. |
|
6771 |
]. |
|
6772 |
||
6773 |
((sel == #instanceVariableNames:) |
|
6774 |
and:[rec isMessage |
|
6775 |
and:[rec selector == #class]]) ifTrue:[ |
|
6776 |
clsName := rec receiver name. |
|
6777 |
changeClass := (self nameSpaceForApply) classNamed:clsName. |
|
6778 |
changeType := '(class definition)'. |
|
16372 | 6779 |
(changeInfo last) className:clsName. |
6780 |
"/ changeClassNames at:changeClassNames size put:clsName. |
|
15087 | 6781 |
|
6782 |
autoCompare value ifTrue:[ |
|
6783 |
changeClass isNil ifTrue:[ |
|
6784 |
changeDelta := '?'. |
|
6785 |
] ifFalse:[ |
|
6786 |
s := (p args at:1) evaluate. |
|
6787 |
s = changeClass class instanceVariableString ifTrue:[ |
|
6788 |
changeDelta := '='. |
|
6789 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6790 |
] |
15087 | 6791 |
]. |
6792 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6793 |
]. |
9548 | 6794 |
|
16372 | 6795 |
"Modified: / 01-05-2016 / 19:19:54 / cg" |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6796 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6797 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6798 |
processSnapshotChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6799 |
changeType := ''. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6800 |
headerLine := chunkText. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6801 |
changeString := (chunkText contractTo:maxLen) withoutSeparators. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6802 |
timeStampInfo := nil. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6803 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6804 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6805 |
readChangesFile |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6806 |
"read the changes file, create a list of header-lines (changeChunks) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6807 |
and a list of chunk-positions (changePositions). |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6808 |
Starting with 2.10.3, the entries are multi-col entries; |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6809 |
the cols are: |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6810 |
1 delta (only if comparing) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6811 |
'+' -> new method (w.r.t. current state) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6812 |
'-' -> removed method (w.r.t. current state) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6813 |
'?' -> class does not exist currently |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6814 |
'=' -> change is the same as current methods source |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6815 |
'~' -> change is almost the same as current methods source |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6816 |
2 class/selector |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6817 |
3 type of change |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6818 |
doit |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6819 |
method |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6820 |
category change |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6821 |
4 timestamp |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6822 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6823 |
since comparing slows down startup time, it is now disabled by |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6824 |
default and can be enabled via a toggle." |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6825 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6826 |
|excla| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6827 |
|
16372 | 6828 |
changeInfo := OrderedCollection new. |
6829 |
||
6830 |
"/ changeChunks := OrderedCollection new. |
|
6831 |
"/ changeClassNames := OrderedCollection new. |
|
6832 |
"/ changeHeaderLines := OrderedCollection new. |
|
6833 |
"/ changePositions := OrderedCollection new. |
|
6834 |
"/ changeTimeStamps := OrderedCollection new. |
|
6835 |
"/ changeIsFollowupMethodChange := OrderedCollection new. |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6836 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6837 |
excla := inStream class chunkSeparator. |
9515 | 6838 |
maxLen := 100. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6839 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6840 |
[inStream atEnd] whileFalse:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6841 |
" |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6842 |
get a chunk (separated by excla) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6843 |
" |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6844 |
inStream skipSeparators. |
13314 | 6845 |
chunkPosition := inStream position + 1. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6846 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6847 |
sawExcla := inStream peekFor:excla. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6848 |
chunkText := fullChunkText := inStream nextChunk. |
7619
95943c1bc289
Ignore empty chunks when reading from changes file
Stefan Vogel <sv@exept.de>
parents:
7618
diff
changeset
|
6849 |
chunkText notEmptyOrNil ifTrue:[ |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6850 |
self processChunk. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6851 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6852 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6853 |
|
9515 | 6854 |
"Modified: / 27-08-1995 / 23:06:55 / claus" |
16372 | 6855 |
"Modified: / 01-05-2016 / 18:33:36 / cg" |
6856 |
! ! |
|
6857 |
||
6858 |
!ChangesBrowser::ChangeInfo methodsFor:'accessing'! |
|
6859 |
||
6860 |
chunk |
|
6861 |
^ chunk |
|
6862 |
! |
|
6863 |
||
6864 |
className |
|
6865 |
^ className |
|
6866 |
! |
|
6867 |
||
6868 |
className:something |
|
6869 |
className := something. |
|
6870 |
! |
|
6871 |
||
6872 |
headerLine |
|
6873 |
^ headerLine |
|
6874 |
! |
|
6875 |
||
6876 |
headerLine:something |
|
6877 |
headerLine := something. |
|
6878 |
! |
|
6879 |
||
6880 |
isFollowupChange |
|
6881 |
^ isFollowupChange |
|
6882 |
! |
|
6883 |
||
6884 |
position |
|
6885 |
^ position |
|
6886 |
! |
|
6887 |
||
6888 |
position:positionArg chunk:chunkArg className:classNameArg selector:selectorArg headerLine:headerLineArg |
|
6889 |
timestamp:timestampArg isFollowupChange:isFollowupChangeArg |
|
6890 |
||
6891 |
position := positionArg. |
|
6892 |
chunk := chunkArg. |
|
6893 |
className := classNameArg. |
|
6894 |
selector := selectorArg. |
|
6895 |
headerLine := headerLineArg. |
|
6896 |
timestamp := timestampArg. |
|
6897 |
isFollowupChange := isFollowupChangeArg. |
|
6898 |
||
6899 |
"Created: / 01-05-2016 / 19:01:03 / cg" |
|
6900 |
! |
|
6901 |
||
6902 |
selector |
|
6903 |
^ selector |
|
6904 |
! |
|
6905 |
||
6906 |
selector:something |
|
6907 |
selector := something. |
|
6908 |
! |
|
6909 |
||
6910 |
timestamp |
|
6911 |
^ timestamp |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6912 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6913 |
|
761 | 6914 |
!ChangesBrowser class methodsFor:'documentation'! |
202 | 6915 |
|
6916 |
version |
|
15683 | 6917 |
^ '$Header$' |
8978 | 6918 |
! |
6919 |
||
6920 |
version_CVS |
|
15683 | 6921 |
^ '$Header$' |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
6922 |
! ! |
12428 | 6923 |