author | Claus Gittinger <cg@exept.de> |
Tue, 07 Jun 2005 18:28:48 +0200 | |
changeset 6317 | 055a38c8a566 |
parent 6288 | 4767ba5caf5b |
child 6357 | 95e37428f3aa |
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 |
" |
|
12 |
||
2664
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
13 |
"{ Package: 'stx:libtool' }" |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
14 |
|
0 | 15 |
StandardSystemView subclass:#ChangesBrowser |
4489 | 16 |
instanceVariableNames:'changeListView codeView diffView changeFileName changeChunks |
17 |
changePositions changeClassNames changeSelectors |
|
18 |
changeHeaderLines changeIsFollowupMethodChange anyChanges |
|
19 |
changeNrShown changeNrProcessed skipSignal autoCompare |
|
20 |
changeFileSize changeFileTimestamp checkBlock changeTimeStamps |
|
21 |
tabSpec autoUpdate editingClassSource lastSearchType |
|
22 |
lastSearchString applyInOriginalNameSpace lastSaveFileName |
|
23 |
readOnly enforcedPackage enforcedNameSpace updateChangeSet |
|
6216 | 24 |
showingDiffs diffViewBox autoloadAsRequired' |
4489 | 25 |
classVariableNames:'CompressSnapshotInfo NoColoring ShowWarningDialogs DefaultIcon |
26 |
DefaultAutoCompare DefaultShowingDiffs' |
|
27 |
poolDictionaries:'' |
|
28 |
category:'Interface-Browsers' |
|
0 | 29 |
! |
30 |
||
761 | 31 |
!ChangesBrowser class methodsFor:'documentation'! |
29 | 32 |
|
33 |
copyright |
|
34 |
" |
|
35 |
COPYRIGHT (c) 1990 by Claus Gittinger |
|
6288 | 36 |
All Rights Reserved |
0 | 37 |
|
29 | 38 |
This software is furnished under a license and may be used |
39 |
only in accordance with the terms of that license and with the |
|
40 |
inclusion of the above copyright notice. This software may not |
|
41 |
be provided or otherwise made available to, or used by, any |
|
42 |
other person. No title to or ownership of the software is |
|
43 |
hereby transferred. |
|
44 |
" |
|
45 |
! |
|
46 |
||
47 |
documentation |
|
48 |
" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
49 |
this implements a browser for the changes-file (actually, it can display |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
50 |
any sourceFiles contents). |
29 | 51 |
See the extra document 'doc/misc/cbrowser.doc' for how to use this browser. |
52 |
||
53 |
written jan 90 by claus |
|
51 | 54 |
|
5703 | 55 |
This is a very old leftover class (The Merovingian has not yet detected this one ;-) |
56 |
It will be completely replaced by the ChangeSetBrowser class in the near future. |
|
57 |
||
58 |
||
508 | 59 |
[Class variables:] |
6288 | 60 |
CompressSnapshotInfo if true (the default), snapshot entries |
61 |
are also compressed in the compress function. |
|
62 |
Some users prefer them to be not compressed. |
|
63 |
Set it to false for this. |
|
58 | 64 |
|
51 | 65 |
Notice: |
6288 | 66 |
this needs a total rewrite, to build up a changeSet from the file |
67 |
(which did not exist when the ChangesBrowser was originally written) |
|
68 |
and manipulate that changeSet. |
|
69 |
||
70 |
This way, we get a browser for any upcoming incore changeSets for |
|
71 |
free. Also, this will put the chunk analyzation code into Change and |
|
72 |
subclasses (where it belongs) and give a better encapsulation and |
|
73 |
overall structure. Do not take this as an example for good style ;-) |
|
74 |
||
75 |
The Change hierarchy is currently been completed, and the changes browser |
|
76 |
will be adapted soon. |
|
508 | 77 |
|
78 |
[author:] |
|
6288 | 79 |
Claus Gittinger |
508 | 80 |
|
81 |
[start with:] |
|
6288 | 82 |
ChangesBrowser open |
1359 | 83 |
|
84 |
[see also:] |
|
6288 | 85 |
( Using the ChangesBrowser :html: tools/cbrowser/TOP.html ) |
86 |
||
29 | 87 |
" |
88 |
! ! |
|
0 | 89 |
|
761 | 90 |
!ChangesBrowser class methodsFor:'instance creation'! |
45 | 91 |
|
92 |
new |
|
93 |
"create a new changes browser" |
|
94 |
||
6288 | 95 |
^ super |
96 |
label:(self defaultLabel) |
|
97 |
icon:(self defaultIcon) |
|
1470 | 98 |
|
99 |
"Modified: / 6.2.1998 / 13:25:18 / cg" |
|
45 | 100 |
! |
101 |
||
102 |
openOn:aFileName |
|
5696 | 103 |
"create a changes browser on a change file" |
104 |
||
105 |
|browser| |
|
45 | 106 |
|
3674 | 107 |
(self isXMLFile:aFileName) ifTrue:[ |
6288 | 108 |
browser := ChangeSetBrowser new |
5696 | 109 |
] ifFalse:[ |
6288 | 110 |
browser := self new |
3674 | 111 |
]. |
5696 | 112 |
|
113 |
browser label:(self defaultLabel , ': ', aFileName). |
|
114 |
browser changeFileName:aFileName. |
|
115 |
browser open. |
|
116 |
^ browser |
|
45 | 117 |
! ! |
118 |
||
761 | 119 |
!ChangesBrowser class methodsFor:'behavior'! |
0 | 120 |
|
121 |
autoSelectNext |
|
122 |
"returning true here, makes a Delete operation automatically |
|
123 |
select the next change" |
|
124 |
||
125 |
^ true |
|
126 |
! ! |
|
127 |
||
761 | 128 |
!ChangesBrowser class methodsFor:'defaults'! |
0 | 129 |
|
489 | 130 |
defaultIcon |
1153 | 131 |
"return the browsers default window icon" |
132 |
||
133 |
<resource: #style (#ICON #ICON_FILE)> |
|
134 |
||
135 |
|nm i| |
|
136 |
||
137 |
(i := DefaultIcon) isNil ifTrue:[ |
|
6288 | 138 |
i := self classResources at:'ICON' default:nil. |
139 |
i isNil ifTrue:[ |
|
140 |
nm := ClassResources at:'ICON_FILE' default:'CBrowser.xbm'. |
|
141 |
i := Smalltalk imageFromFileNamed:nm inPackage:#'stx:libtool'. |
|
142 |
i isNil ifTrue:[ |
|
143 |
i := StandardSystemView defaultIcon |
|
144 |
] |
|
145 |
]. |
|
146 |
i notNil ifTrue:[ |
|
147 |
DefaultIcon := i := i onDevice:Display |
|
148 |
] |
|
1084 | 149 |
]. |
150 |
^ i |
|
151 |
||
1153 | 152 |
"Modified: 19.3.1997 / 20:48:34 / ca" |
153 |
"Modified: 18.4.1997 / 15:16:24 / cg" |
|
489 | 154 |
! |
155 |
||
73 | 156 |
defaultLabel |
5527 | 157 |
^ self classResources string:'Changes Browser' |
2417 | 158 |
! |
159 |
||
160 |
isVisualStartable |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
161 |
"return true, if this application can be started via #open. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
162 |
(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
|
163 |
|
2417 | 164 |
^ true |
165 |
||
166 |
"Created: / 27.9.1999 / 12:28:27 / cg" |
|
28 | 167 |
! ! |
168 |
||
3202 | 169 |
!ChangesBrowser class methodsFor:'menu specs'! |
170 |
||
171 |
menuSpec |
|
172 |
"This resource specification was automatically generated |
|
173 |
by the MenuEditor of ST/X." |
|
174 |
||
175 |
"Do not manually edit this!! If it is corrupted, |
|
176 |
the MenuEditor may not be able to read the specification." |
|
177 |
||
178 |
" |
|
179 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpec |
|
180 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpec)) startUp |
|
181 |
" |
|
182 |
||
183 |
<resource: #menu> |
|
184 |
||
6288 | 185 |
^ |
6216 | 186 |
#(Menu |
6288 | 187 |
( |
188 |
(MenuItem |
|
189 |
label: 'File' |
|
190 |
translateLabel: true |
|
191 |
submenu: |
|
192 |
(Menu |
|
193 |
( |
|
194 |
(MenuItem |
|
195 |
label: 'Compress' |
|
196 |
itemValue: doCompress |
|
197 |
translateLabel: true |
|
198 |
isVisible: notEditingClassSource |
|
199 |
) |
|
200 |
(MenuItem |
|
201 |
enabled: hasSingleSelection |
|
202 |
label: 'Compress for Class' |
|
203 |
itemValue: doCompressClass |
|
204 |
translateLabel: true |
|
205 |
isVisible: notEditingClassSource |
|
206 |
) |
|
207 |
(MenuItem |
|
208 |
enabled: hasSingleSelection |
|
209 |
label: 'Compress for Class && Selector' |
|
210 |
itemValue: doCompressSelector |
|
211 |
translateLabel: true |
|
212 |
isVisible: notEditingClassSource |
|
213 |
) |
|
214 |
(MenuItem |
|
215 |
label: 'Compare and Compress' |
|
216 |
itemValue: doCompareAndCompress |
|
217 |
translateLabel: true |
|
218 |
isVisible: notEditingClassSource |
|
219 |
) |
|
220 |
(MenuItem |
|
221 |
label: '-' |
|
222 |
isVisible: notEditingClassSource |
|
223 |
) |
|
224 |
(MenuItem |
|
225 |
enabled: hasSingleSelection |
|
226 |
label: 'Fileout && Delete all Changes for Class' |
|
227 |
itemValue: doFileoutAndDeleteClassAll |
|
228 |
translateLabel: true |
|
229 |
isVisible: notEditingClassSource |
|
230 |
) |
|
231 |
(MenuItem |
|
232 |
enabled: hasSelection |
|
233 |
label: 'CheckIn && Delete all Changes for Class' |
|
234 |
itemValue: doCheckinAndDeleteClassAll |
|
235 |
translateLabel: true |
|
236 |
isVisible: notEditingClassSource |
|
237 |
) |
|
238 |
(MenuItem |
|
239 |
label: '-' |
|
240 |
isVisible: notEditingClassSource |
|
241 |
) |
|
242 |
(MenuItem |
|
243 |
enabled: hasSelection |
|
244 |
label: 'Save In...' |
|
245 |
itemValue: doSave |
|
246 |
translateLabel: true |
|
247 |
) |
|
248 |
(MenuItem |
|
249 |
enabled: hasSingleSelection |
|
250 |
label: 'Save to End In...' |
|
251 |
itemValue: doSaveRest |
|
252 |
translateLabel: true |
|
253 |
) |
|
254 |
(MenuItem |
|
255 |
enabled: hasSingleSelection |
|
256 |
label: 'Save for Class to End In...' |
|
257 |
itemValue: doSaveClassRest |
|
258 |
translateLabel: true |
|
259 |
) |
|
260 |
(MenuItem |
|
261 |
enabled: hasSingleSelection |
|
262 |
label: 'Save all for Class In...' |
|
263 |
itemValue: doSaveClassAll |
|
264 |
translateLabel: true |
|
265 |
) |
|
266 |
(MenuItem |
|
267 |
label: '-' |
|
268 |
) |
|
269 |
(MenuItem |
|
270 |
label: 'Writeback ClassFile' |
|
271 |
itemValue: doWriteBack |
|
272 |
translateLabel: true |
|
273 |
isVisible: editingClassSource |
|
274 |
) |
|
275 |
(MenuItem |
|
276 |
label: 'Writeback ChangeFile' |
|
277 |
itemValue: doWriteBack |
|
278 |
translateLabel: true |
|
279 |
isVisible: notEditingClassSource |
|
280 |
) |
|
281 |
(MenuItem |
|
282 |
label: '-' |
|
283 |
) |
|
284 |
(MenuItem |
|
285 |
label: 'Update' |
|
286 |
itemValue: doUpdate |
|
287 |
translateLabel: true |
|
288 |
) |
|
289 |
(MenuItem |
|
290 |
label: '-' |
|
291 |
) |
|
292 |
(MenuItem |
|
293 |
label: 'Exit' |
|
294 |
itemValue: menuExit |
|
295 |
translateLabel: true |
|
296 |
) |
|
297 |
) |
|
298 |
nil |
|
299 |
nil |
|
300 |
) |
|
301 |
) |
|
302 |
(MenuItem |
|
303 |
label: 'Change' |
|
304 |
translateLabel: true |
|
305 |
submenu: |
|
306 |
(Menu |
|
307 |
( |
|
308 |
(MenuItem |
|
309 |
enabled: hasSelection |
|
310 |
label: 'Apply' |
|
311 |
itemValue: doApply |
|
312 |
translateLabel: true |
|
313 |
) |
|
314 |
(MenuItem |
|
315 |
enabled: hasSingleSelection |
|
316 |
label: 'Apply to End' |
|
317 |
itemValue: doApplyRest |
|
318 |
translateLabel: true |
|
319 |
) |
|
320 |
(MenuItem |
|
321 |
enabled: hasSingleSelection |
|
322 |
label: 'Apply from Begin' |
|
323 |
itemValue: doApplyFromBeginning |
|
324 |
translateLabel: true |
|
325 |
) |
|
326 |
(MenuItem |
|
327 |
enabled: hasSingleSelection |
|
328 |
label: 'Apply for Class to End' |
|
329 |
itemValue: doApplyClassRest |
|
330 |
translateLabel: true |
|
331 |
) |
|
332 |
(MenuItem |
|
333 |
enabled: hasSingleSelection |
|
334 |
label: 'Apply for Class from Begin' |
|
335 |
itemValue: doApplyClassFromBeginning |
|
336 |
translateLabel: true |
|
337 |
) |
|
338 |
(MenuItem |
|
339 |
enabled: hasNoSelection |
|
340 |
label: 'Apply All' |
|
341 |
itemValue: doApplyAll |
|
342 |
translateLabel: true |
|
343 |
) |
|
344 |
(MenuItem |
|
345 |
enabled: hasSingleSelection |
|
346 |
label: 'Apply to Conflict or End' |
|
347 |
itemValue: doApplyToConflictOrEnd |
|
348 |
translateLabel: true |
|
349 |
) |
|
350 |
(MenuItem |
|
351 |
label: '-' |
|
352 |
) |
|
353 |
(MenuItem |
|
354 |
enabled: hasSelection |
|
355 |
label: 'Delete' |
|
356 |
itemValue: doDelete |
|
357 |
translateLabel: true |
|
358 |
) |
|
359 |
(MenuItem |
|
360 |
enabled: hasSingleSelection |
|
361 |
label: 'Delete to End' |
|
362 |
itemValue: doDeleteRest |
|
363 |
translateLabel: true |
|
364 |
) |
|
365 |
(MenuItem |
|
366 |
enabled: hasSingleSelection |
|
367 |
label: 'Delete from Begin' |
|
368 |
itemValue: doDeleteFromBeginning |
|
369 |
translateLabel: true |
|
370 |
) |
|
371 |
(MenuItem |
|
372 |
enabled: hasSingleSelection |
|
373 |
label: 'Delete for Class to End' |
|
374 |
itemValue: doDeleteClassRest |
|
375 |
translateLabel: true |
|
376 |
) |
|
377 |
(MenuItem |
|
378 |
enabled: hasSingleSelection |
|
379 |
label: 'Delete for Class from Begin' |
|
380 |
itemValue: doDeleteClassFromBeginning |
|
381 |
translateLabel: true |
|
382 |
) |
|
383 |
(MenuItem |
|
384 |
enabled: hasSelection |
|
385 |
label: 'Delete all for Class' |
|
386 |
itemValue: doDeleteClassAll |
|
387 |
translateLabel: true |
|
388 |
isVisible: hasNoMultiSelection |
|
389 |
) |
|
390 |
(MenuItem |
|
391 |
enabled: hasSelection |
|
392 |
label: 'Delete all for Class && its Private Classes' |
|
393 |
itemValue: doDeleteClassAndPrivateClassesAll |
|
394 |
translateLabel: true |
|
395 |
isVisible: hasNoMultiSelection |
|
396 |
) |
|
397 |
(MenuItem |
|
398 |
enabled: hasSelection |
|
399 |
label: 'Delete all for Classes' |
|
400 |
itemValue: doDeleteClassAll |
|
401 |
translateLabel: true |
|
402 |
isVisible: hasMultiSelection |
|
403 |
) |
|
404 |
(MenuItem |
|
405 |
enabled: hasSelection |
|
406 |
label: 'Delete all for Classes && their Private Classes' |
|
407 |
itemValue: doDeleteClassAndPrivateClassesAll |
|
408 |
translateLabel: true |
|
409 |
isVisible: hasMultiSelection |
|
410 |
) |
|
411 |
(MenuItem |
|
412 |
label: '-' |
|
413 |
) |
|
414 |
(MenuItem |
|
415 |
enabled: hasSelection |
|
416 |
label: 'Delete all Versions of Selected Method' |
|
417 |
itemValue: doDeleteClassSelectorAll |
|
418 |
translateLabel: true |
|
419 |
isVisible: hasNoMultiSelection |
|
420 |
) |
|
421 |
(MenuItem |
|
422 |
enabled: hasSelection |
|
423 |
label: 'Delete all Versions of all Selected Methods' |
|
424 |
itemValue: doDeleteClassSelectorAll |
|
425 |
translateLabel: true |
|
426 |
isVisible: hasMultiSelection |
|
427 |
) |
|
428 |
(MenuItem |
|
429 |
label: '-' |
|
430 |
) |
|
431 |
(MenuItem |
|
432 |
enabled: hasSingleSelection |
|
433 |
label: 'Compare with Current' |
|
434 |
itemValue: doCompare |
|
435 |
translateLabel: true |
|
436 |
) |
|
437 |
(MenuItem |
|
438 |
label: '-' |
|
439 |
) |
|
440 |
(MenuItem |
|
441 |
enabled: hasSelection |
|
442 |
label: 'Make Change a Patch' |
|
443 |
itemValue: doMakePatch |
|
444 |
translateLabel: true |
|
445 |
) |
|
446 |
) |
|
447 |
nil |
|
448 |
nil |
|
449 |
) |
|
450 |
) |
|
451 |
(MenuItem |
|
452 |
label: 'Search' |
|
453 |
translateLabel: true |
|
454 |
submenu: |
|
455 |
(Menu |
|
456 |
( |
|
457 |
(MenuItem |
|
458 |
label: 'Class...' |
|
459 |
itemValue: findClass |
|
460 |
translateLabel: true |
|
461 |
) |
|
462 |
(MenuItem |
|
463 |
enabled: hasSelection |
|
464 |
label: 'Previous for Class' |
|
465 |
itemValue: findPreviousForClass |
|
466 |
translateLabel: true |
|
467 |
) |
|
468 |
(MenuItem |
|
469 |
enabled: hasSelection |
|
470 |
label: 'Next for Class' |
|
471 |
itemValue: findNextForClass |
|
472 |
translateLabel: true |
|
473 |
) |
|
474 |
(MenuItem |
|
475 |
label: '-' |
|
476 |
) |
|
477 |
(MenuItem |
|
478 |
label: 'Selector...' |
|
479 |
itemValue: findSelector |
|
480 |
translateLabel: true |
|
481 |
) |
|
482 |
(MenuItem |
|
483 |
enabled: hasSelection |
|
484 |
label: 'Previous for Selector' |
|
485 |
itemValue: findPreviousForSelector |
|
486 |
translateLabel: true |
|
487 |
) |
|
488 |
(MenuItem |
|
489 |
enabled: hasSelection |
|
490 |
label: 'Next for Selector' |
|
491 |
itemValue: findNextForSelector |
|
492 |
translateLabel: true |
|
493 |
) |
|
494 |
(MenuItem |
|
495 |
label: '-' |
|
496 |
) |
|
497 |
(MenuItem |
|
498 |
label: 'String...' |
|
499 |
itemValue: findString |
|
500 |
translateLabel: true |
|
501 |
) |
|
502 |
(MenuItem |
|
503 |
enabled: hasSelection |
|
504 |
label: 'Previous with String' |
|
505 |
itemValue: findPreviousForString |
|
506 |
translateLabel: true |
|
507 |
) |
|
508 |
(MenuItem |
|
509 |
enabled: hasSelection |
|
510 |
label: 'Next with String' |
|
511 |
itemValue: findNextForString |
|
512 |
translateLabel: true |
|
513 |
) |
|
514 |
(MenuItem |
|
515 |
label: '-' |
|
516 |
) |
|
517 |
(MenuItem |
|
518 |
enabled: hasSelection |
|
519 |
label: 'Previous Difference' |
|
520 |
itemValue: findPreviousDifference |
|
521 |
translateLabel: true |
|
522 |
) |
|
523 |
(MenuItem |
|
524 |
enabled: hasSelection |
|
525 |
label: 'Next Difference' |
|
526 |
itemValue: findNextDifference |
|
527 |
translateLabel: true |
|
528 |
) |
|
529 |
(MenuItem |
|
530 |
label: '-' |
|
531 |
) |
|
532 |
(MenuItem |
|
533 |
enabled: hasSelection |
|
534 |
label: 'Previous Snapshot' |
|
535 |
itemValue: findPreviousSnapshot |
|
536 |
translateLabel: true |
|
537 |
) |
|
538 |
(MenuItem |
|
539 |
enabled: hasSelection |
|
540 |
label: 'Next Snapshot' |
|
541 |
itemValue: findNextSnapshot |
|
542 |
translateLabel: true |
|
543 |
) |
|
544 |
) |
|
545 |
nil |
|
546 |
nil |
|
547 |
) |
|
548 |
) |
|
549 |
(MenuItem |
|
550 |
label: 'Browse' |
|
551 |
translateLabel: true |
|
552 |
submenu: |
|
553 |
(Menu |
|
554 |
( |
|
555 |
(MenuItem |
|
556 |
enabled: hasSingleSelection |
|
557 |
label: 'Class' |
|
558 |
itemValue: doBrowse |
|
559 |
translateLabel: true |
|
560 |
) |
|
561 |
(MenuItem |
|
562 |
label: '-' |
|
563 |
) |
|
564 |
(MenuItem |
|
565 |
label: 'Senders...' |
|
566 |
itemValue: doBrowseSenders |
|
567 |
translateLabel: true |
|
568 |
) |
|
569 |
(MenuItem |
|
570 |
label: 'Implementors...' |
|
571 |
itemValue: doBrowseImplementors |
|
572 |
translateLabel: true |
|
573 |
) |
|
574 |
) |
|
575 |
nil |
|
576 |
nil |
|
577 |
) |
|
578 |
) |
|
579 |
(MenuItem |
|
580 |
label: 'Settings' |
|
581 |
translateLabel: true |
|
582 |
submenu: |
|
583 |
(Menu |
|
584 |
( |
|
585 |
(MenuItem |
|
586 |
label: 'Auto Compare' |
|
587 |
translateLabel: true |
|
588 |
indication: autoCompare |
|
589 |
) |
|
590 |
(MenuItem |
|
591 |
label: 'Autoload As Required' |
|
592 |
translateLabel: true |
|
593 |
indication: autoloadAsRequired |
|
594 |
) |
|
595 |
(MenuItem |
|
596 |
label: 'Show Diffs' |
|
597 |
translateLabel: true |
|
598 |
indication: showingDiffs |
|
599 |
) |
|
600 |
(MenuItem |
|
601 |
label: 'Auto Update' |
|
602 |
translateLabel: true |
|
603 |
indication: autoUpdate |
|
604 |
) |
|
605 |
(MenuItem |
|
606 |
label: '-' |
|
607 |
) |
|
608 |
(MenuItem |
|
609 |
label: 'Add to ChangeSet when Applying' |
|
610 |
translateLabel: true |
|
611 |
indication: updateChangeSet |
|
612 |
) |
|
613 |
(MenuItem |
|
614 |
label: 'Apply in Original NameSpace' |
|
615 |
translateLabel: true |
|
616 |
indication: applyInOriginalNameSpace |
|
617 |
) |
|
618 |
(MenuItem |
|
619 |
label: '-' |
|
620 |
) |
|
621 |
(MenuItem |
|
622 |
label: 'Apply into Package...' |
|
623 |
itemValue: setEnforcedPackage |
|
624 |
translateLabel: true |
|
625 |
) |
|
626 |
(MenuItem |
|
627 |
enabled: applyNotInOriginalNameSpace |
|
628 |
label: 'Apply into NameSpace...' |
|
629 |
itemValue: setEnforcedNameSpace |
|
630 |
translateLabel: true |
|
631 |
) |
|
632 |
) |
|
633 |
nil |
|
634 |
nil |
|
635 |
) |
|
636 |
) |
|
637 |
(MenuItem |
|
638 |
label: 'Help' |
|
639 |
translateLabel: true |
|
640 |
startGroup: right |
|
641 |
submenu: |
|
642 |
(Menu |
|
643 |
( |
|
644 |
(MenuItem |
|
645 |
label: 'ChangesBrowser Documentation' |
|
646 |
itemValue: openHTMLDocument: |
|
647 |
translateLabel: true |
|
648 |
argument: 'tools/cbrowser/TOP.html' |
|
649 |
) |
|
650 |
(MenuItem |
|
651 |
label: '-' |
|
652 |
) |
|
653 |
(MenuItem |
|
654 |
label: 'About ChangesBrowser...' |
|
655 |
itemValue: openAboutThisApplication |
|
656 |
translateLabel: true |
|
657 |
) |
|
658 |
) |
|
659 |
nil |
|
660 |
nil |
|
661 |
) |
|
662 |
) |
|
663 |
) |
|
664 |
nil |
|
665 |
nil |
|
3202 | 666 |
) |
667 |
! ! |
|
668 |
||
3674 | 669 |
!ChangesBrowser class methodsFor:'private-changeFile access'! |
670 |
||
671 |
readXMLChangesFrom:aStream inBackground:inBackground |
|
672 |
"read an XML source file (format as in campSmalltalk DTD)" |
|
673 |
||
674 |
|changeSet| |
|
675 |
||
676 |
(XML isNil or:[XML::SourceNodeBuilder isNil or:[XML::XMLParser isNil]]) ifTrue:[ |
|
6288 | 677 |
Smalltalk loadPackage:'stx:goodies/xml/vw'. |
678 |
(XML isNil or:[XML::SourceNodeBuilder isNil or:[XML::XMLParser isNil]]) ifTrue:[ |
|
679 |
self error:'Could not load XML package(s) from ''stx:goodies/xml/vw'''. |
|
680 |
] |
|
3674 | 681 |
]. |
682 |
||
683 |
changeSet := ChangeSet new. |
|
6288 | 684 |
XML::SourceScannerNodeBuilder new |
685 |
scanFile:aStream |
|
686 |
do:[:eachChange | |
|
687 |
changeSet addChange:eachChange. |
|
688 |
]. |
|
3674 | 689 |
^ changeSet |
690 |
||
691 |
"/ builder := XML::SourceScannerNodeBuilder new. |
|
692 |
"/ parser := XML::XMLParser on:aStream. |
|
693 |
"/ parser builder:builder. |
|
694 |
"/ parser validate:false. |
|
695 |
"/ parser scanDocument. |
|
696 |
! |
|
697 |
||
698 |
readXMLChangesFromFile:changeFileName inBackground:inBackground |
|
699 |
|s set| |
|
700 |
||
701 |
s := changeFileName asFilename readStream. |
|
702 |
set := self readXMLChangesFrom:s inBackground:inBackground. |
|
703 |
s close. |
|
704 |
^ set. |
|
705 |
! ! |
|
706 |
||
707 |
!ChangesBrowser class methodsFor:'utilities'! |
|
708 |
||
709 |
isXMLFile:aFilename |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
710 |
|stream first| |
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
711 |
|
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
712 |
stream := aFilename asFilename readStreamOrNil. |
3674 | 713 |
stream isNil ifTrue:[^ false]. |
714 |
||
715 |
stream skipSeparators. |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
716 |
first := stream peek. |
3674 | 717 |
stream close. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
718 |
^ first == $< |
3674 | 719 |
! ! |
720 |
||
3202 | 721 |
!ChangesBrowser methodsFor:'aspects'! |
722 |
||
723 |
applyInOriginalNameSpace |
|
724 |
^ applyInOriginalNameSpace |
|
725 |
! |
|
726 |
||
3472 | 727 |
applyNotInOriginalNameSpace |
6288 | 728 |
^ BlockValue forLogicalNot:self applyInOriginalNameSpace |
3472 | 729 |
! |
730 |
||
3202 | 731 |
autoCompare |
732 |
^ autoCompare |
|
733 |
! |
|
734 |
||
735 |
autoUpdate |
|
736 |
"enabled/disable automatic update from the change-file (for monitoring)" |
|
737 |
||
738 |
^ autoUpdate |
|
739 |
||
740 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
741 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
742 |
! |
|
743 |
||
6216 | 744 |
autoloadAsRequired |
745 |
^ autoloadAsRequired |
|
746 |
! |
|
747 |
||
3202 | 748 |
editingClassSource |
3203 | 749 |
^ editingClassSource ? false |
3202 | 750 |
! |
751 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
752 |
hasMultiSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
753 |
^ self hasSelection and:[self hasSingleSelection not] |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
754 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
755 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
756 |
hasNoMultiSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
757 |
^ self hasMultiSelection not |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
758 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
759 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
760 |
hasNoSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
761 |
^ self hasSelection not |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
762 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
763 |
|
3202 | 764 |
hasSelection |
6288 | 765 |
^ changeListView hasSelection |
3202 | 766 |
! |
767 |
||
3211 | 768 |
hasSingleSelection |
769 |
changeListView multipleSelectOk ifTrue:[ |
|
6288 | 770 |
^ changeListView selection size == 1 |
3211 | 771 |
]. |
772 |
^ changeListView hasSelection |
|
773 |
! |
|
774 |
||
3202 | 775 |
notEditingClassSource |
776 |
^ self editingClassSource not |
|
3211 | 777 |
! |
778 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
779 |
notEditingClassSourceAndNotReadOnly |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
780 |
^ (self editingClassSource or:[readOnly == true]) not |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
781 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
782 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
783 |
notReadOnly |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
784 |
^ (readOnly ~~ true) |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
785 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
786 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
787 |
readOnly:aBoolean |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
788 |
readOnly := aBoolean |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
789 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
790 |
|
4487 | 791 |
showingDiffs |
792 |
showingDiffs isNil ifTrue:[ |
|
6288 | 793 |
showingDiffs := self showingDiffsDefault asValue. |
794 |
showingDiffs |
|
795 |
onChangeEvaluate:[ |
|
796 |
showingDiffs value ifTrue:[ |
|
797 |
self updateDiffView. |
|
798 |
self makeDiffViewVisible |
|
799 |
] ifFalse:[ |
|
800 |
self makeDiffViewInvisible |
|
801 |
]. |
|
802 |
DefaultShowingDiffs := showingDiffs value. |
|
803 |
] |
|
4487 | 804 |
]. |
805 |
^ showingDiffs |
|
806 |
! |
|
807 |
||
4943 | 808 |
showingDiffsDefault |
809 |
^ (DefaultShowingDiffs ? true) |
|
810 |
! |
|
811 |
||
3211 | 812 |
theSingleSelection |
813 |
|sel| |
|
814 |
||
815 |
sel := changeListView selection. |
|
816 |
changeListView multipleSelectOk ifTrue:[ |
|
6288 | 817 |
sel size == 1 ifTrue:[ |
818 |
^ sel first |
|
819 |
]. |
|
820 |
^ nil |
|
3211 | 821 |
]. |
822 |
^ sel. |
|
3319 | 823 |
! |
824 |
||
825 |
updateChangeSet |
|
826 |
^ updateChangeSet |
|
3202 | 827 |
! ! |
828 |
||
202 | 829 |
!ChangesBrowser methodsFor:'compiler interface'! |
830 |
||
831 |
wantChangeLog |
|
832 |
"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
|
833 |
be written when compiling. Return false here." |
202 | 834 |
|
835 |
^ false |
|
836 |
! ! |
|
837 |
||
4869 | 838 |
!ChangesBrowser methodsFor:'compiler interface-error handling'! |
202 | 839 |
|
840 |
correctableError:aString position:relPos to:relEndPos from:aCompiler |
|
841 |
"compiler notifys us of an error - this should really not happen since |
|
842 |
changes ought to be correct (did someone edit the changes file ??). |
|
843 |
Show the bad change in the codeView and let codeView hilight the error; |
|
844 |
no corrections allowed here therefore return false" |
|
845 |
||
2293 | 846 |
ShowWarningDialogs == true ifTrue:[ |
6288 | 847 |
self error:aString position:relPos to:relEndPos from:aCompiler. |
2293 | 848 |
] ifFalse:[ |
6288 | 849 |
Transcript showCR:aString. |
2293 | 850 |
]. |
202 | 851 |
^ false |
852 |
! |
|
853 |
||
2555 | 854 |
correctableSelectorWarning:aString position:relPos to:relEndPos from:aCompiler |
855 |
"compiler notifys us of a warning" |
|
856 |
||
857 |
^ false |
|
858 |
||
859 |
"Modified: / 19.1.2000 / 16:25:31 / cg" |
|
860 |
"Created: / 19.1.2000 / 16:27:23 / cg" |
|
861 |
! |
|
862 |
||
202 | 863 |
error:aString position:relPos to:relEndPos from:aCompiler |
864 |
"compiler notifys us of an error - this should really not happen since |
|
865 |
changes ought to be correct (did someone edit the changes file ??). |
|
866 |
Show the bad change in the codeView and let codeView hilight the error" |
|
867 |
||
868 |
|action| |
|
869 |
||
870 |
(changeNrProcessed ~~ changeNrShown) ifTrue:[ |
|
6288 | 871 |
self changeSelection:changeNrProcessed |
202 | 872 |
]. |
873 |
(skipSignal notNil) ifTrue:[ |
|
874 |
||
6288 | 875 |
codeView highlightingErrorPosition:relPos to:relEndPos do:[ |
876 |
|box| |
|
877 |
||
878 |
" |
|
879 |
start dialog - make certain cleanup is done |
|
880 |
" |
|
881 |
action := OptionBox |
|
882 |
request:aString |
|
883 |
label:'Error' |
|
884 |
image:(WarningBox iconBitmap) |
|
885 |
buttonLabels:#('Cancel' 'Skip' " 'Shut up' " 'Continue') |
|
886 |
values:#(#abort #skip " #shutUp " #continue) |
|
887 |
default:#continue |
|
888 |
onCancel:#abort. |
|
889 |
]. |
|
2293 | 890 |
|
891 |
"/ action == #shutUp ifTrue:[ |
|
892 |
"/ aCompiler ignoreWarnings. |
|
6288 | 893 |
"/ ^ false |
2293 | 894 |
"/ ]. |
895 |
||
6288 | 896 |
(action == #abort) ifTrue:[ |
897 |
AbortOperationRequest raise. |
|
898 |
^ false |
|
899 |
]. |
|
900 |
action == #skip ifTrue:[ |
|
901 |
skipSignal raise. |
|
902 |
^ false |
|
903 |
]. |
|
904 |
^ false |
|
202 | 905 |
]. |
906 |
^ codeView error:aString position:relPos to:relEndPos from:aCompiler |
|
373 | 907 |
|
3436
c4fe19deba58
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3406
diff
changeset
|
908 |
"Modified: / 16.11.2001 / 17:38:10 / cg" |
202 | 909 |
! |
910 |
||
3064 | 911 |
unusedVariableWarning:aString position:relPos to:relEndPos from:aCompiler |
912 |
"compiler notifies us of a (or some) unused variables; |
|
913 |
hilight the error (relPos to relEndPos) and show a Box asking for continue/correct/abort; |
|
914 |
this method should return true to the compiler if user wants the error |
|
915 |
to be corrected; false otherwise" |
|
916 |
||
917 |
^ false |
|
918 |
! |
|
919 |
||
202 | 920 |
warning:aString position:relPos to:relEndPos from:aCompiler |
921 |
"compiler notifys us of a warning - ignore it" |
|
922 |
||
923 |
^ self |
|
924 |
! ! |
|
925 |
||
2604 | 926 |
!ChangesBrowser methodsFor:'event handling'! |
202 | 927 |
|
928 |
handlesKeyPress:key inView:view |
|
929 |
"this method is reached via delegation: are we prepared to handle |
|
930 |
a keyPress in some other view ?" |
|
931 |
||
1127 | 932 |
<resource: #keyboard (#Delete #BackSpace #Accept #Find #FindPrev #FindNext)> |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
933 |
|
202 | 934 |
view == changeListView ifTrue:[ |
6288 | 935 |
(key == #Delete |
936 |
or:[key == #BackSpace |
|
937 |
or:[key == #Accept |
|
938 |
or:[key == #Find |
|
939 |
or:[key == #FindPrev |
|
940 |
or:[key == #FindNext]]]]]) ifTrue:[^ true]. |
|
202 | 941 |
]. |
942 |
^ false |
|
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
943 |
|
1127 | 944 |
"Modified: 8.4.1997 / 11:01:42 / cg" |
0 | 945 |
! |
946 |
||
202 | 947 |
keyPress:key x:x y:y view:view |
948 |
"this method is reached via delegation from the changeListView" |
|
949 |
||
1127 | 950 |
<resource: #keyboard (#Delete #BackSpace #Accept #Find #FindPrev #FindNext)> |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
951 |
|
3249 | 952 |
(key == #Delete) ifTrue:[ |
6288 | 953 |
self sensor shiftDown ifTrue:[ |
954 |
self doDeleteAndSelectPrevious. |
|
955 |
] ifFalse:[ |
|
956 |
self doDelete. |
|
957 |
]. |
|
958 |
^ self |
|
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
959 |
]. |
3249 | 960 |
(key == #BackSpace) ifTrue:[ |
6288 | 961 |
self doDeleteAndSelectPrevious. |
962 |
^ self |
|
3249 | 963 |
]. |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
964 |
(key == #Accept) ifTrue:[ |
6288 | 965 |
self doApply. |
966 |
^ self |
|
202 | 967 |
]. |
1127 | 968 |
(key == #Find) ifTrue:[ |
6288 | 969 |
self findClass. |
970 |
^ self |
|
1127 | 971 |
]. |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
972 |
(key == #FindPrev) ifTrue:[ |
6288 | 973 |
self findPrevious. |
974 |
^ self |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
975 |
]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
976 |
(key == #FindNext) ifTrue:[ |
6288 | 977 |
self findNext. |
978 |
^ self |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
979 |
]. |
202 | 980 |
changeListView keyPress:key x:x y:y |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
981 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
982 |
"Modified: / 18.6.1998 / 22:15:36 / cg" |
202 | 983 |
! ! |
984 |
||
3327 | 985 |
!ChangesBrowser methodsFor:'help'! |
202 | 986 |
|
394 | 987 |
showActivity:someMessage |
502 | 988 |
"some activityNotification to be forwarded to the user; |
989 |
show it in the windows title area here." |
|
990 |
||
394 | 991 |
self label:someMessage |
992 |
||
993 |
"Created: 24.2.1996 / 19:35:42 / cg" |
|
502 | 994 |
"Modified: 23.4.1996 / 21:39:36 / cg" |
202 | 995 |
! ! |
996 |
||
4868 | 997 |
!ChangesBrowser methodsFor:'initialization & release'! |
202 | 998 |
|
3202 | 999 |
autoCompareChanged |
1000 |
"sent from the compare-toggle" |
|
1001 |
||
3534 | 1002 |
|doCompare| |
1003 |
||
1004 |
doCompare := autoCompare value. |
|
1005 |
DefaultAutoCompare := doCompare. |
|
1006 |
self setupTabSpec. |
|
1007 |
doCompare ifTrue:[ |
|
6288 | 1008 |
self doUpdate |
3202 | 1009 |
] ifFalse:[ |
6288 | 1010 |
changeListView invalidate. "/ clear; redraw. |
3202 | 1011 |
] |
1012 |
! |
|
1013 |
||
202 | 1014 |
changeListMenu |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1015 |
"return the menu for the change (upper) list" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1016 |
|
586 | 1017 |
<resource: #keyboard ( #Accept #Delete ) > |
1359 | 1018 |
<resource: #programMenu > |
586 | 1019 |
|
3211 | 1020 |
|items m replNext replPrev sel| |
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1021 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1022 |
self sensor ctrlDown ifTrue:[ |
6288 | 1023 |
"/ notice - findNext/prev shortKeys will search for the same thing again. |
1024 |
items := #( |
|
1025 |
('Search Class...' findClass #Find ) |
|
1026 |
('Previous for this Class' findPreviousForClass #FindPrevClass ) |
|
1027 |
('Next for this Class' findNextForClass #FindNextClass ) |
|
1028 |
('-' ) |
|
1029 |
('Search Selector...' findSelector ) |
|
1030 |
('Previous with this Selector' findPreviousForSelector #FindPrevSelector ) |
|
1031 |
('Next with this Selector' findNextForSelector #FindNextSelector ) |
|
1032 |
('-' ) |
|
1033 |
('Search String...' findString ) |
|
1034 |
('Previous with this String' findPreviousForString #FindPrevString ) |
|
1035 |
('Next with this String' findNextForString #FindNextString ) |
|
1036 |
('-' ) |
|
1037 |
('Previous Snapshot' findPreviousSnapshot #FindPrevSnapshot ) |
|
1038 |
('Next Snapshot' findNextSnapshot #FindNextSnapshot ) |
|
1039 |
). |
|
1040 |
||
1041 |
lastSearchType == #selector ifTrue:[ |
|
1042 |
replNext := #FindNextSelector. |
|
1043 |
replPrev := #FindPrevSelector. |
|
1044 |
] ifFalse:[ |
|
1045 |
lastSearchType == #snapshot ifTrue:[ |
|
1046 |
replNext := #FindNextSnapshot. |
|
1047 |
replPrev := #FindPrevSnapshot. |
|
1048 |
] ifFalse:[ |
|
1049 |
lastSearchType == #string ifTrue:[ |
|
1050 |
replNext := #FindNextString. |
|
1051 |
replPrev := #FindPrevString. |
|
1052 |
] ifFalse:[ |
|
1053 |
replNext := #FindNextClass. |
|
1054 |
replPrev := #FindPrevClass. |
|
1055 |
] |
|
1056 |
] |
|
1057 |
]. |
|
1058 |
items := items deepCopy. |
|
1059 |
items do:[:each | |
|
1060 |
each replaceAll:replNext with:#FindNext. |
|
1061 |
each replaceAll:replPrev with:#FindPrev. |
|
1062 |
each replaceAny:#(FindNextClass FindPrevClass |
|
1063 |
FindNextSelector FindPrevSelector |
|
1064 |
FindNextSnapshot FindPrevSnapshot |
|
1065 |
FindNextString FindPrevString) |
|
1066 |
with:nil. |
|
1067 |
]. |
|
1068 |
||
1069 |
^ PopUpMenu itemList:items resources:resources. |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1070 |
]. |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1071 |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1072 |
items := #( |
6288 | 1073 |
('Apply' doApply Accept) |
1074 |
('Apply to End' doApplyRest ) |
|
1075 |
('Apply from Begin' doApplyFromBeginning ) |
|
1076 |
('Apply for Class to End' doApplyClassRest ) |
|
1077 |
('Apply for Class from Begin' doApplyClassFromBeginning ) |
|
1078 |
('Apply All' doApplyAll ) |
|
1079 |
('-' ) |
|
1080 |
('Delete' doDelete Delete) |
|
1081 |
('Delete to End' doDeleteRest ) |
|
1082 |
('Delete for Class to End' doDeleteClassRest ) |
|
1083 |
('Delete for Class from Begin' doDeleteClassFromBeginning ) |
|
1084 |
). |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1085 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1086 |
(self hasSelection and:[self hasSingleSelection not]) ifTrue:[ |
6288 | 1087 |
items := items , |
1088 |
#( |
|
1089 |
('Delete All for Classes' doDeleteClassAll ) |
|
1090 |
('Delete All for Classes & their Private Classes' doDeleteClassAndPrivateClassesAll ) |
|
1091 |
). |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1092 |
] ifFalse:[ |
6288 | 1093 |
items := items , |
1094 |
#( |
|
1095 |
('Delete All for Class' doDeleteClassAll ) |
|
1096 |
('Delete All for Class & its Private Classes' doDeleteClassAndPrivateClassesAll ) |
|
1097 |
). |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1098 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1099 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1100 |
items := items , |
6288 | 1101 |
#( |
1102 |
('-' ) |
|
1103 |
('Compress' doCompress ) |
|
1104 |
('Compress for Class' doCompressClass ) |
|
1105 |
('Compare and Compress' doCompareAndCompress ) |
|
1106 |
('-' ) |
|
1107 |
('Compare with current Version' doCompare ) |
|
1108 |
('Browse Class' doBrowse ) |
|
1109 |
('-' ) |
|
1110 |
('Make Change a Patch' doMakePatch ) |
|
1111 |
). |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1112 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1113 |
editingClassSource ifFalse:[ |
6288 | 1114 |
items := items , #( |
1115 |
('Fileout & Delete All for Class' doFileoutAndDeleteClassAll ) |
|
1116 |
('CheckIn & Delete All for Class' doCheckinAndDeleteClassAll ) |
|
1117 |
) |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1118 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1119 |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1120 |
items := items , #( |
6288 | 1121 |
('-' ) |
1122 |
('Save in...' doSave ) |
|
1123 |
('Save to End In...' doSaveRest ) |
|
1124 |
('Save for Class to End In...' doSaveClassRest ) |
|
1125 |
('Save All for Class In...' doSaveClassAll ) |
|
1126 |
('-' ) |
|
1127 |
). |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1128 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1129 |
editingClassSource ifTrue:[ |
6288 | 1130 |
items := items , #( |
1131 |
('Writeback ClassFile' doWriteBack ) |
|
1132 |
) |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1133 |
] ifFalse:[ |
6288 | 1134 |
items := items , #( |
1135 |
('Writeback ChangeFile' doWriteBack ) |
|
1136 |
) |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1137 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1138 |
|
1833
c9b1a30b326d
moved update item to the end
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
1139 |
items := items , #( |
6288 | 1140 |
('-' ) |
1141 |
('Update' doUpdate ) |
|
1142 |
). |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1143 |
|
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1144 |
m := PopUpMenu itemList:items resources:resources. |
202 | 1145 |
|
255 | 1146 |
"/ |
1147 |
"/ disable those that require a selected entry |
|
1148 |
"/ |
|
3202 | 1149 |
self hasSelection ifFalse:[ |
6288 | 1150 |
m disableAll:#(doApply doApplyClassRest doApplyRest doDelete doDeleteRest doDeleteClassRest |
1151 |
doDeleteClassFromBeginning doDeleteClassAll doDeleteClassAndPrivateClassesAll |
|
1152 |
doCompare doCompressClass doMakePatch doSaveChangeInFile doMakePermanent |
|
1153 |
doSave doSaveRest doSaveClassAll doSaveClassRest doBrowse |
|
1154 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll) |
|
1368 | 1155 |
] ifTrue:[ |
6288 | 1156 |
sel := self theSingleSelection. |
1157 |
sel isNil ifTrue:[ |
|
1158 |
"/ multiple selections |
|
1159 |
m disableAll:#(doApplyClassRest doApplyRest doDeleteClassRest doDeleteRest |
|
1160 |
doDeleteClassFromBeginning |
|
1161 |
doCompressClass doCompare |
|
1162 |
doSaveClassAll doSaveClassRest doSaveRest doBrowse |
|
1163 |
doFileoutAndDeleteClassAll) |
|
1164 |
] ifFalse:[ |
|
1165 |
(self classNameOfChange:sel) isNil ifTrue:[ |
|
1166 |
m disableAll:#(doApplyClassRest doDeleteClassRest |
|
1167 |
doDeleteClassFromBeginning doDeleteClassAll doDeleteClassAndPrivateClassesAll |
|
1168 |
doCompressClass doCompare doMakePatch |
|
1169 |
doSaveClassAll doSaveClassRest doBrowse |
|
1170 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll) |
|
1171 |
] |
|
1172 |
] |
|
255 | 1173 |
]. |
1174 |
||
1175 |
"/ |
|
1176 |
"/ disable those that do not make sense with autoUpdate |
|
1177 |
"/ ('cause this would be overwritten by next update operation) |
|
1178 |
"/ |
|
3202 | 1179 |
autoUpdate value ifTrue:[ |
6288 | 1180 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
1181 |
doDeleteClassAndPrivateClassesAll doCompress |
|
1182 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
|
1183 |
doWriteBack) |
|
202 | 1184 |
]. |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1185 |
readOnly == true ifTrue:[ |
6288 | 1186 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
1187 |
doDeleteClassAndPrivateClassesAll doCompress |
|
1188 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
|
1189 |
doWriteBack doSaveBack doUpdate |
|
1190 |
doApplyAll doApplyRest) |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1191 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1192 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1193 |
self hasSelection ifTrue:[ |
6288 | 1194 |
m disable:#doApplyAll |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1195 |
]. |
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1196 |
|
202 | 1197 |
^ m |
1198 |
||
1359 | 1199 |
"Modified: / 6.9.1995 / 17:14:22 / claus" |
3442 | 1200 |
"Modified: / 17.11.2001 / 14:16:14 / cg" |
202 | 1201 |
! |
1202 |
||
2114 | 1203 |
destroy |
1204 |
"destroy the receiver; make certain, that boxes are destroyed too" |
|
1205 |
||
1206 |
Processor removeTimedBlock:checkBlock. |
|
1207 |
ObjectMemory removeDependent:self. |
|
1208 |
super destroy |
|
1209 |
! |
|
1210 |
||
202 | 1211 |
focusSequence |
1212 |
^ Array with:changeListView with:codeView |
|
1213 |
! |
|
1214 |
||
1215 |
initialize |
|
3202 | 1216 |
|panel v upperFrame buttonPanel menuPanel mH |
4487 | 1217 |
checkBox oldStyle codeViewBox lbl| |
3202 | 1218 |
|
3211 | 1219 |
"/ oldStyle := true. |
3202 | 1220 |
oldStyle := false. |
202 | 1221 |
|
1222 |
super initialize. |
|
1223 |
||
5702 | 1224 |
changeFileName := ObjectMemory nameForChanges. |
3534 | 1225 |
autoCompare := (DefaultAutoCompare ? false) asValue. |
3202 | 1226 |
autoCompare onChangeSend:#autoCompareChanged to:self. |
1227 |
autoUpdate := false asValue. |
|
6216 | 1228 |
autoloadAsRequired := false asValue. |
2343 | 1229 |
applyInOriginalNameSpace := true asValue. |
6288 | 1230 |
applyInOriginalNameSpace |
1231 |
onChangeEvaluate:[ |
|
1232 |
autoCompare value ifTrue:[ |
|
1233 |
self doUpdate |
|
1234 |
]. |
|
1235 |
]. |
|
4897 | 1236 |
updateChangeSet := true "false" asValue. |
221 | 1237 |
|
1099
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1238 |
" |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1239 |
checkBlock is executed by the Processor. |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1240 |
We use #pushEvent: to perform the update |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1241 |
in our windowgroups process. |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1242 |
" |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1243 |
checkBlock := [self pushEvent:#checkIfFileHasChanged]. |
202 | 1244 |
|
3202 | 1245 |
oldStyle ifFalse:[ |
6288 | 1246 |
menuPanel := MenuPanel in:self. |
1247 |
"/ menuPanel level:1. |
|
1248 |
menuPanel verticalLayout:false. |
|
1249 |
menuPanel receiver:self. |
|
1250 |
menuPanel menu:(self pullDownMenu). |
|
1251 |
||
1252 |
mH := menuPanel preferredExtent y. |
|
1253 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
|
1254 |
mH := mH + 1. |
|
3202 | 1255 |
] ifTrue:[ |
6288 | 1256 |
mH := 0.0 |
3202 | 1257 |
]. |
1258 |
||
1259 |
panel := VariableVerticalPanel origin:(0.0 @ mH) |
|
6288 | 1260 |
corner:(1.0 @ 1.0) |
1261 |
borderWidth:0 |
|
1262 |
in:self. |
|
202 | 1263 |
|
3202 | 1264 |
upperFrame := panel. |
1265 |
oldStyle ifTrue:[ |
|
6288 | 1266 |
upperFrame := VariableHorizontalPanel origin:(0.0 @ 0.0) corner:(1.0 @ 0.3) in:panel. |
3202 | 1267 |
]. |
202 | 1268 |
|
1269 |
v := HVScrollableView for:SelectionInListView miniScrollerH:true in:upperFrame. |
|
3202 | 1270 |
oldStyle ifTrue:[ |
6288 | 1271 |
v origin:(0.0 @ 0.0) corner:(0.75 @ 1.0). |
3202 | 1272 |
] ifFalse:[ |
6288 | 1273 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.3). |
3202 | 1274 |
]. |
3090 | 1275 |
|
202 | 1276 |
changeListView := v scrolledView. |
1277 |
changeListView delegate:self. |
|
1278 |
changeListView menuHolder:self; menuPerformer:self; menuMessage:#changeListMenu. |
|
1471 | 1279 |
changeListView doubleClickAction:[:line | self doubleClickOnChange:line]. |
3211 | 1280 |
oldStyle ifFalse:[ |
6288 | 1281 |
changeListView multipleSelectOk:true. |
3211 | 1282 |
]. |
202 | 1283 |
|
3202 | 1284 |
oldStyle ifTrue:[ |
6288 | 1285 |
buttonPanel := VerticalPanelView in:upperFrame. |
1286 |
buttonPanel origin:(0.75 @ 0.0) corner:(1.0 @ 1.0). |
|
1287 |
buttonPanel verticalLayout:#topSpace; horizontalLayout:#leftSpace. |
|
1288 |
||
1289 |
checkBox := CheckBox new model:autoCompare. |
|
1290 |
checkBox label:(resources string:'Auto Compare'). |
|
1291 |
checkBox action:[:val | autoCompare value:val]. |
|
1292 |
buttonPanel addSubView:checkBox. |
|
1293 |
||
1294 |
checkBox := CheckBox new model:autoUpdate. |
|
1295 |
checkBox label:(resources string:'Auto Update'). |
|
1296 |
checkBox action:[:val | autoUpdate value:val]. |
|
1297 |
buttonPanel addSubView:checkBox. |
|
1298 |
||
1299 |
checkBox := CheckBox new. |
|
1300 |
checkBox label:(resources string:'Apply in original NameSpace' withCRs). |
|
1301 |
checkBox model:applyInOriginalNameSpace. |
|
1302 |
buttonPanel addSubView:checkBox. |
|
3202 | 1303 |
]. |
2301 | 1304 |
|
3090 | 1305 |
"/ protectExistingMethods := CheckBox new. |
1306 |
"/ protectExistingMethods label:(resources string:'Protect existing code' withCRs). |
|
1307 |
"/ protectExistingMethods model:protectExistingMethods. |
|
1308 |
"/ buttonPanel addSubView:protectExistingMethods. |
|
1309 |
||
4487 | 1310 |
codeViewBox := View in:panel. |
1311 |
codeViewBox origin:(0.0 @ 0.3) corner:(1.0 @ 1.0). |
|
1312 |
||
1313 |
v := HVScrollableView for:CodeView miniScrollerH:true miniScrollerV:false in:codeViewBox. |
|
1314 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
202 | 1315 |
codeView := v scrolledView. |
1996 | 1316 |
codeView readOnly:true. |
202 | 1317 |
|
4487 | 1318 |
diffViewBox := View in:codeViewBox. |
1319 |
diffViewBox origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
1320 |
||
1321 |
lbl := Label label:'Current' in:diffViewBox. |
|
1322 |
lbl layout:(LayoutFrame |
|
6288 | 1323 |
leftFraction:0.0 offset:0 |
1324 |
rightFraction:0.5 offset:0 |
|
1325 |
topFraction:0.0 offset:0 |
|
1326 |
bottomFraction:0.0 offset:20). |
|
4487 | 1327 |
lbl := Label label:'Change' in:diffViewBox. |
1328 |
lbl layout:(LayoutFrame |
|
6288 | 1329 |
leftFraction:0.5 offset:0 |
1330 |
rightFraction:1.0 offset:0 |
|
1331 |
topFraction:0.0 offset:0 |
|
1332 |
bottomFraction:0.0 offset:20). |
|
4487 | 1333 |
|
1334 |
"/ diffView := DiffTextView in:diffViewBox. |
|
1335 |
"/ diffView layout:(LayoutFrame |
|
1336 |
"/ leftFraction:0.0 offset:0 |
|
1337 |
"/ rightFraction:1.0 offset:0 |
|
1338 |
"/ topFraction:0.0 offset:20 |
|
1339 |
"/ bottomFraction:1.0 offset:0). |
|
1340 |
||
1341 |
v := HVScrollableView for:DiffTextView miniScrollerH:true miniScrollerV:false in:diffViewBox. |
|
1342 |
v layout:(LayoutFrame |
|
6288 | 1343 |
leftFraction:0.0 offset:0 |
1344 |
rightFraction:1.0 offset:0 |
|
1345 |
topFraction:0.0 offset:20 |
|
1346 |
bottomFraction:1.0 offset:0). |
|
4487 | 1347 |
diffView := v scrolledView. |
1348 |
||
1349 |
self showingDiffs value ifFalse:[ |
|
6288 | 1350 |
self makeDiffViewInvisible |
4487 | 1351 |
]. |
1352 |
||
202 | 1353 |
anyChanges := false. |
1354 |
ObjectMemory addDependent:self. "to get shutdown-update" |
|
1355 |
||
1356 |
tabSpec := TabulatorSpecification new. |
|
1357 |
tabSpec unit:#inch. |
|
1358 |
tabSpec positions:#(-1 0 5 8.5 ). |
|
1359 |
" +/- cls>>sel type info" |
|
1360 |
tabSpec align: #(#left #left #left #left). |
|
1361 |
||
1471 | 1362 |
"Modified: / 27.3.1997 / 11:07:07 / stefan" |
3297 | 1363 |
"Modified: / 11.10.2001 / 21:20:48 / cg" |
202 | 1364 |
! |
1365 |
||
1246
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1366 |
postRealize |
3534 | 1367 |
self setupTabSpec. |
202 | 1368 |
self readChangesFileInBackground:true. |
1369 |
self setChangeList. |
|
1370 |
changeListView action:[:lineNr | self changeSelection:lineNr]. |
|
1371 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
|
1246
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1372 |
|
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1373 |
"Created: 24.7.1997 / 18:06:12 / cg" |
202 | 1374 |
! |
1375 |
||
3202 | 1376 |
pullDownMenu |
1377 |
"return the top (pullDown) menu" |
|
1378 |
||
1379 |
<resource: #programMenu> |
|
1380 |
||
3330 | 1381 |
^ self menuFromSpec:self class menuSpec. |
1382 |
||
1383 |
"/ |m| |
|
1384 |
"/ |
|
1385 |
"/ m := self class menuSpec. |
|
1386 |
"/ m := m decodeAsLiteralArray. |
|
1387 |
"/ m receiver:self. |
|
1388 |
"/ m findGuiResourcesIn:self. |
|
1389 |
"/ ^ m. |
|
3202 | 1390 |
! |
1391 |
||
3534 | 1392 |
setupTabSpec |
1393 |
autoCompare value ifTrue:[ |
|
6288 | 1394 |
tabSpec positions:#(0 0.15 5 8.5 ). |
3534 | 1395 |
] ifFalse:[ |
6288 | 1396 |
"/ |
1397 |
"/ set tabs to hide compare-column |
|
1398 |
"/ |
|
1399 |
tabSpec positions:#(-1 0 5 8.5 ). |
|
3534 | 1400 |
] |
1401 |
! |
|
1402 |
||
627 | 1403 |
update:what with:aParameter from:changedObject |
202 | 1404 |
|box| |
1405 |
||
1406 |
(what == #aboutToExit) ifTrue:[ |
|
6288 | 1407 |
" |
1408 |
smalltalk is about to shut down - |
|
1409 |
- if change list was modified, ask user and save if requested. |
|
1410 |
" |
|
1411 |
anyChanges ifTrue:[ |
|
1412 |
self raiseDeiconified. |
|
1413 |
||
1414 |
box := YesNoBox new. |
|
1415 |
box title:('The modified changelist has not been written back to the change file.\\Write change file before exiting ?') withCRs. |
|
1416 |
box okText:(resources at:'write') noText:(resources at:'don''t write'). |
|
1417 |
box yesAction:[self writeBackChanges] |
|
1418 |
noAction:[]. |
|
1419 |
box showAtPointer. |
|
1420 |
box destroy |
|
1421 |
]. |
|
1422 |
^ self |
|
202 | 1423 |
]. |
1424 |
super update:what |
|
627 | 1425 |
|
2353
707dd9391c02
Consistent use of 'update' and 'write' in the user interface
Stefan Vogel <sv@exept.de>
parents:
2343
diff
changeset
|
1426 |
"Created: / 15.6.1996 / 15:26:30 / cg" |
707dd9391c02
Consistent use of 'update' and 'write' in the user interface
Stefan Vogel <sv@exept.de>
parents:
2343
diff
changeset
|
1427 |
"Modified: / 7.1.1997 / 23:03:47 / cg" |
707dd9391c02
Consistent use of 'update' and 'write' in the user interface
Stefan Vogel <sv@exept.de>
parents:
2343
diff
changeset
|
1428 |
"Modified: / 24.8.1999 / 09:45:06 / stefan" |
202 | 1429 |
! ! |
1430 |
||
3202 | 1431 |
!ChangesBrowser methodsFor:'menu actions'! |
1432 |
||
1433 |
menuExit |
|
3204 | 1434 |
self closeRequest |
3202 | 1435 |
! |
1436 |
||
1437 |
openAboutThisApplication |
|
1438 |
"opens an about box for this application." |
|
1439 |
||
3503 | 1440 |
DialogBox aboutClass:self class. |
1441 |
"/ |rev myClass clsRev msg| |
|
1442 |
"/ |
|
1443 |
"/ rev := ''. |
|
1444 |
"/ myClass := self class. |
|
1445 |
"/ |
|
1446 |
"/ (clsRev := myClass revision) notNil ifTrue: [rev := ' (rev: ', clsRev printString, ')']. |
|
1447 |
"/ |
|
1448 |
"/ msg := '\' withCRs , myClass name asBoldText, rev. |
|
1449 |
"/ |
|
1450 |
"/ Dialog |
|
1451 |
"/ about:(resources string:msg) |
|
1452 |
"/ label:(resources string:'About ChangesBrowser') |
|
1453 |
"/ icon:self class defaultIcon |
|
1454 |
"/ |
|
1455 |
"/ "Modified: / 17.11.2001 / 23:07:33 / cg" |
|
3202 | 1456 |
! |
1457 |
||
1458 |
openHTMLDocument:relativeDocPath |
|
1459 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
1460 |
! |
|
1461 |
||
1462 |
showAboutSTX |
|
1463 |
ToolApplicationModel openAboutSTX |
|
1464 |
! ! |
|
1465 |
||
202 | 1466 |
!ChangesBrowser methodsFor:'private'! |
1467 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1468 |
autoSelect:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1469 |
"select a change" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1470 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1471 |
self class autoSelectNext ifTrue:[ |
6288 | 1472 |
(changeNr <= self numberOfChanges) ifTrue:[ |
1473 |
changeListView setSelection:changeNr. |
|
1474 |
self changeSelection:changeNr. |
|
1475 |
^ self |
|
1476 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1477 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1478 |
self clearCodeView. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1479 |
changeListView setSelection:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1480 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1481 |
"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
|
1482 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1483 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1484 |
autoSelectLast |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1485 |
"select the last change" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1486 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1487 |
self autoSelect:(self numberOfChanges) |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1488 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1489 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1490 |
autoSelectOrEnd:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1491 |
"select the next change or the last" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1492 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1493 |
|last| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1494 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1495 |
last := self numberOfChanges. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1496 |
changeNr < last ifTrue:[ |
6288 | 1497 |
self autoSelect:changeNr |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1498 |
] ifFalse:[ |
6288 | 1499 |
last == 0 ifTrue:[ |
1500 |
last := nil |
|
1501 |
]. |
|
1502 |
changeListView setSelection:last . |
|
1503 |
self changeSelection:last. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1504 |
] |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1505 |
|
3406
8fe22b36fbc2
fixed autoselectNext if list is empty
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
1506 |
"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
|
1507 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1508 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1509 |
checkClassIsLoaded:aClass |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1510 |
"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
|
1511 |
|
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1512 |
|cls answer| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1513 |
|
3359
2cc7eff866e4
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
3341
diff
changeset
|
1514 |
cls := aClass theNonMetaclass. |
5825 | 1515 |
cls isLoaded ifTrue:[ |
6288 | 1516 |
^ true. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1517 |
]. |
5825 | 1518 |
|
6216 | 1519 |
autoloadAsRequired value == true ifTrue:[ |
6288 | 1520 |
answer := true |
6216 | 1521 |
] ifFalse:[ |
6288 | 1522 |
answer := (self confirmWithCancel:(resources |
1523 |
string:'%1 is an autoloaded class.\I can only compare the methods source if its loaded first.\\Shall the class be loaded now ?' |
|
1524 |
with:cls name allBold) withCRs). |
|
6216 | 1525 |
]. |
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1526 |
|
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1527 |
answer == true ifTrue:[ |
6288 | 1528 |
Autoload autoloadFailedSignal handle:[:ex | |
1529 |
AbortOperationRequest raise. |
|
1530 |
^ false |
|
1531 |
] do:[ |
|
1532 |
^ cls autoload isLoaded |
|
1533 |
] |
|
5825 | 1534 |
]. |
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1535 |
|
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1536 |
answer isNil ifTrue:[ |
6288 | 1537 |
"cancel the operation" |
1538 |
AbortAllOperationRequest raiseRequest. |
|
1539 |
^ false. |
|
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1540 |
]. |
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1541 |
|
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1542 |
"cancel operation for this change, (but possibly continue with others)" |
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1543 |
AbortOperationRequest raiseRequest. |
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
1544 |
^ false. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1545 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1546 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1547 |
clearCodeView |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1548 |
"clear the (lower) code view." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1549 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1550 |
self unselect "changeListView deselect". |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1551 |
codeView contents:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1552 |
changeNrShown := nil |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1553 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1554 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1555 |
contractClass:className selector:selector to:maxLen |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1556 |
"contract a class>>selector string (for display in the changeList)." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1557 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1558 |
|s l| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1559 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1560 |
s := className , ' ', selector. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1561 |
s size > maxLen ifTrue:[ |
6288 | 1562 |
l := maxLen - 1 - selector size max:20. |
1563 |
s := (className contractTo:l) , ' ' , selector. |
|
1564 |
||
1565 |
s size > maxLen ifTrue:[ |
|
1566 |
l := maxLen - 1 - className size max:20. |
|
1567 |
s := className , ' ', (selector contractTo:l). |
|
1568 |
||
1569 |
s size > maxLen ifTrue:[ |
|
1570 |
s := (className contractTo:(maxLen // 2 - 1)) , ' ' , (selector contractTo:maxLen // 2) |
|
1571 |
] |
|
1572 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1573 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1574 |
^ s |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1575 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1576 |
|
3472 | 1577 |
extractClassAndClassNameFromParseTree:rec |
1578 |
|isUnaryMessage className changeClass| |
|
1579 |
||
1580 |
isUnaryMessage := rec isUnaryMessage. |
|
1581 |
||
1582 |
isUnaryMessage ifTrue:[ |
|
6288 | 1583 |
className := rec receiver name. |
3472 | 1584 |
] ifFalse:[ |
6288 | 1585 |
className := rec name. |
3472 | 1586 |
]. |
1587 |
||
1588 |
enforcedNameSpace notNil ifTrue:[ |
|
6288 | 1589 |
changeClass := enforcedNameSpace classNamed:className. |
3472 | 1590 |
]. |
1591 |
changeClass isNil ifTrue:[ |
|
6288 | 1592 |
changeClass := Smalltalk classNamed:className. |
3472 | 1593 |
]. |
1594 |
isUnaryMessage ifTrue:[ |
|
6288 | 1595 |
changeClass notNil ifTrue:[ |
1596 |
changeClass := changeClass class. |
|
1597 |
]. |
|
1598 |
className := className , ' class'. |
|
3472 | 1599 |
]. |
1600 |
||
1601 |
^ className -> changeClass |
|
1602 |
! |
|
1603 |
||
3203 | 1604 |
isChangeSetBrowser |
1605 |
^ false |
|
1606 |
! |
|
1607 |
||
4487 | 1608 |
makeDiffViewInvisible |
1609 |
diffViewBox lower |
|
1610 |
! |
|
1611 |
||
1612 |
makeDiffViewVisible |
|
1613 |
diffViewBox raise |
|
1614 |
! |
|
1615 |
||
3472 | 1616 |
nameSpaceForApply |
1617 |
applyInOriginalNameSpace value ifFalse:[ |
|
6288 | 1618 |
^ enforcedNameSpace ? Class nameSpaceQuerySignal query. |
3472 | 1619 |
]. |
1620 |
^ Smalltalk. |
|
1621 |
! |
|
1622 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1623 |
newLabel:how |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1624 |
|l| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1625 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1626 |
(changeFileName ~= 'changes') ifTrue:[ |
6288 | 1627 |
l := self class defaultLabel , ': ', changeFileName |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1628 |
] ifFalse:[ |
6288 | 1629 |
l := self class defaultLabel |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1630 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1631 |
l := l , ' ' , how. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1632 |
self label:l |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1633 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1634 |
"Created: / 8.9.1995 / 19:32:04 / claus" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1635 |
"Modified: / 8.9.1995 / 19:39:29 / claus" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1636 |
"Modified: / 6.2.1998 / 13:27:01 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1637 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1638 |
|
4857 | 1639 |
oldSourceForParseTree:parseTree |
1640 |
|selector thisClass method superClass thisClassSym ownerClass receiver classGlobalNode| |
|
1641 |
||
6288 | 1642 |
(parseTree isNil |
1643 |
or:[parseTree == #Error |
|
4857 | 1644 |
or:[ parseTree isMessage not ]]) ifTrue:[ |
6288 | 1645 |
^ nil |
4857 | 1646 |
]. |
1647 |
||
1648 |
selector := parseTree selector. |
|
1649 |
receiver := parseTree receiver. |
|
1650 |
||
1651 |
selector == #'removeSelector:' ifTrue:[ |
|
6288 | 1652 |
thisClass := receiver evaluate. |
1653 |
thisClass isBehavior ifTrue:[ |
|
1654 |
thisClass isLoaded ifTrue:[ |
|
1655 |
selector := (parseTree arg1 evaluate). |
|
1656 |
(thisClass includesSelector:selector) ifTrue:[ |
|
1657 |
^ (thisClass compiledMethodAt:selector) source. |
|
1658 |
] |
|
1659 |
] ifFalse:[ |
|
1660 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
1661 |
] |
|
1662 |
] ifFalse:[ |
|
1663 |
^ 'Cannot compare this change (class not present)'. |
|
1664 |
]. |
|
4857 | 1665 |
]. |
1666 |
selector == #'comment:' ifTrue:[ |
|
6288 | 1667 |
thisClass := receiver evaluate. |
1668 |
thisClass isBehavior ifTrue:[ |
|
1669 |
thisClass isLoaded ifTrue:[ |
|
1670 |
^ thisClass name , ' comment: ' , thisClass comment storeString. |
|
1671 |
] ifFalse:[ |
|
1672 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
1673 |
] |
|
1674 |
] ifFalse:[ |
|
1675 |
^ 'Cannot compare this change (class not present)'. |
|
1676 |
]. |
|
4857 | 1677 |
]. |
1678 |
||
1679 |
selector == #'category:' ifTrue:[ |
|
6288 | 1680 |
receiver isMessage ifTrue:[ |
1681 |
receiver selector == #compiledMethodAt: ifTrue:[ |
|
1682 |
classGlobalNode := receiver receiver. |
|
1683 |
(classGlobalNode isMessage and:[classGlobalNode selector == #class]) ifTrue:[ |
|
1684 |
classGlobalNode := classGlobalNode receiver |
|
1685 |
]. |
|
1686 |
classGlobalNode isUndeclared ifTrue:[ |
|
1687 |
^ 'Class does not exist.'. |
|
1688 |
]. |
|
1689 |
Error handle:[method := nil] do:[method := receiver evaluate]. |
|
1690 |
method isMethod ifTrue:[ |
|
1691 |
method category = parseTree arg1 evaluate ifFalse:[ |
|
1692 |
^ '(' , method class name , ' compiledMethodAt: ' , method selector storeString , ') category: ' , method category storeString. |
|
1693 |
] |
|
1694 |
] ifFalse:[ |
|
1695 |
^ 'There is no such method'. |
|
1696 |
] |
|
1697 |
] |
|
1698 |
] |
|
4857 | 1699 |
]. |
1700 |
||
1701 |
selector == #'instanceVariableNames:' ifTrue:[ |
|
6288 | 1702 |
receiver isMessage ifTrue:[ |
1703 |
receiver selector == #class ifTrue:[ |
|
1704 |
thisClass := receiver evaluate. |
|
1705 |
thisClass isBehavior ifTrue:[ |
|
1706 |
thisClass isLoaded ifTrue:[ |
|
4857 | 1707 |
"/ varsHere := thisClass instanceVariableString asCollectionOfWords. |
1708 |
"/ varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords. |
|
6288 | 1709 |
^ thisClass definition. |
1710 |
] ifFalse:[ |
|
1711 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
1712 |
]. |
|
1713 |
] ifFalse:[ |
|
1714 |
^ 'Cannot compare this change (class not present)'. |
|
1715 |
] |
|
1716 |
]. |
|
1717 |
] |
|
4857 | 1718 |
]. |
1719 |
||
1720 |
(Class definitionSelectors includes:selector) |
|
6288 | 1721 |
"/ selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' |
4857 | 1722 |
ifTrue:[ |
6288 | 1723 |
superClass := receiver evaluate. |
1724 |
superClass isBehavior ifFalse:[ |
|
1725 |
^ 'Cannot compare this change\\(no such superclass).' withCRs. |
|
1726 |
] ifTrue:[ |
|
1727 |
superClass isLoaded ifFalse:[ |
|
1728 |
^ 'Cannot compare this change\\(superclass not loaded).' withCRs. |
|
1729 |
] ifTrue:[ |
|
1730 |
thisClassSym := (parseTree arguments at:1) evaluate. |
|
1731 |
||
1732 |
(selector endsWith:':privateIn:') ifTrue:[ |
|
1733 |
ownerClass := (parseTree arguments at:5). |
|
1734 |
ownerClass isUndeclared ifFalse:[ |
|
1735 |
ownerClass := ownerClass evaluate. |
|
1736 |
] ifTrue:[ |
|
1737 |
ownerClass := nil. |
|
1738 |
]. |
|
1739 |
ownerClass isNil ifTrue:[ |
|
1740 |
^ 'Cannot compare this change\\(owning class is not loaded).' withCRs. |
|
1741 |
]. |
|
1742 |
thisClass := ownerClass privateClassesAt:thisClassSym. |
|
1743 |
] ifFalse:[ |
|
1744 |
thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil. |
|
1745 |
]. |
|
1746 |
thisClass notNil ifTrue:[ |
|
1747 |
thisClass isLoaded ifFalse:[ |
|
1748 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
1749 |
] ifTrue:[ |
|
1750 |
^ thisClass definition. |
|
1751 |
] |
|
1752 |
] |
|
1753 |
] |
|
1754 |
] |
|
4857 | 1755 |
]. |
1756 |
||
1757 |
^ nil. |
|
1758 |
! |
|
1759 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1760 |
queryCloseText |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1761 |
"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
|
1762 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1763 |
^ 'Quit without updating changeFile ?' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1764 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1765 |
|
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1766 |
selectedClassNames |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1767 |
|classes| |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1768 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1769 |
classes := Set new. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1770 |
self withSelectedChangesDo:[:changeNr | |
6288 | 1771 |
| classNameToCompress | |
1772 |
||
1773 |
classNameToCompress := self classNameOfChange:changeNr. |
|
1774 |
classNameToCompress notNil ifTrue:[ |
|
1775 |
classes add:classNameToCompress. |
|
1776 |
] |
|
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1777 |
]. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1778 |
^ classes |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1779 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1780 |
"Created: / 19.11.2001 / 21:54:59 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1781 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
1782 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1783 |
setChangeList |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1784 |
"extract type-information from changes and stuff into top selection |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1785 |
view" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1786 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1787 |
changeListView setList:changeHeaderLines expandTabs:false redraw:false. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1788 |
changeListView invalidate. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1789 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1790 |
"/ changeListView deselect. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1791 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1792 |
"Modified: / 18.5.1998 / 14:29:10 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1793 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1794 |
|
3211 | 1795 |
setSingleSelection:changeNr |
1796 |
changeListView multipleSelectOk ifFalse:[ |
|
6288 | 1797 |
changeListView setSelection:changeNr. |
3211 | 1798 |
] ifTrue:[ |
6288 | 1799 |
changeListView setSelection:(Array with:changeNr). |
3211 | 1800 |
]. |
1801 |
! |
|
1802 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1803 |
showNotFound |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1804 |
|savedCursor| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1805 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1806 |
savedCursor := cursor. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1807 |
[ |
6288 | 1808 |
self cursor:(Cursor cross). |
1809 |
self beep. |
|
1810 |
Delay waitForMilliseconds:300. |
|
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
1811 |
] ensure:[ |
6288 | 1812 |
self cursor:savedCursor |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1813 |
] |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1814 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1815 |
"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
|
1816 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1817 |
|
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1818 |
sourceOfChange:changeNr |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1819 |
|aStream sawExcla chunk| |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1820 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1821 |
aStream := self streamForChange:changeNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1822 |
aStream isNil ifTrue:[ |
6288 | 1823 |
^ nil |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1824 |
]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1825 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1826 |
chunk := aStream nextChunk. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1827 |
sawExcla ifTrue:[ |
6288 | 1828 |
chunk := aStream nextChunk |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1829 |
]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1830 |
aStream close. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1831 |
^ chunk |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1832 |
! |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
1833 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1834 |
unselect |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1835 |
"common unselect" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1836 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1837 |
changeListView setSelection:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1838 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1839 |
"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
|
1840 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1841 |
|
3211 | 1842 |
withSelectedChangesDo:aBlock |
1843 |
"just a helper, check for a selected change and evaluate aBlock |
|
1844 |
with busy cursor" |
|
1845 |
||
1846 |
self withSelectedChangesInOrder:nil do:aBlock |
|
1847 |
! |
|
1848 |
||
1849 |
withSelectedChangesInOrder:order do:aBlock |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1850 |
"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
|
1851 |
with busy cursor" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1852 |
|
3211 | 1853 |
|changeNrSelection| |
1854 |
||
1855 |
changeNrSelection := changeListView selection. |
|
1856 |
changeListView multipleSelectOk ifFalse:[ |
|
6288 | 1857 |
changeNrSelection notNil ifTrue:[ |
1858 |
self withExecuteCursorDo:[ |
|
1859 |
aBlock value:changeNrSelection |
|
1860 |
] |
|
1861 |
] |
|
3211 | 1862 |
] ifTrue:[ |
6288 | 1863 |
changeNrSelection size > 0 ifTrue:[ |
1864 |
self withExecuteCursorDo:[ |
|
1865 |
|changeNumbers| |
|
1866 |
||
1867 |
changeNumbers := changeNrSelection copy sort. |
|
1868 |
order == #reverse ifTrue:[ |
|
1869 |
changeNumbers reverse |
|
1870 |
]. |
|
1871 |
changeNumbers do:aBlock |
|
1872 |
] |
|
1873 |
] |
|
3211 | 1874 |
]. |
1875 |
! |
|
1876 |
||
1877 |
withSelectedChangesReverseDo:aBlock |
|
1878 |
"just a helper, check for a selected change and evaluate aBlock |
|
1879 |
with busy cursor" |
|
1880 |
||
1881 |
self withSelectedChangesInOrder:#reverse do:aBlock |
|
3668 | 1882 |
! |
1883 |
||
1884 |
withSingleSelectedChangeDo:aBlock |
|
1885 |
"just a helper, check for a single selection, and evaluate aBlock |
|
1886 |
with busy cursor" |
|
1887 |
||
1888 |
self theSingleSelection isNil ifTrue:[ |
|
6288 | 1889 |
^ self information:'Only possible if a single change is selected.'. |
3668 | 1890 |
]. |
1891 |
||
1892 |
self withSelectedChangesInOrder:nil do:aBlock |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1893 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1894 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1895 |
!ChangesBrowser methodsFor:'private-change access'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1896 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1897 |
changeIsFollowupMethodChange:changeNr |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1898 |
"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
|
1899 |
in a bunch of methodsFor-changes)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1900 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1901 |
^ changeIsFollowupMethodChange at:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1902 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1903 |
"Created: / 6.2.1998 / 13:03:39 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1904 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1905 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1906 |
changeIsSnapShotInfo:changeNr |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1907 |
"return true, if a change is a snapShot info chunk" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1908 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1909 |
|words chunk| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1910 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1911 |
(self classNameOfChange:changeNr) isNil ifTrue:[ |
6288 | 1912 |
" |
1913 |
get the chunk |
|
1914 |
" |
|
1915 |
chunk := changeChunks at:changeNr. |
|
1916 |
"mhmh - empty ??" |
|
1917 |
chunk notNil ifTrue:[ |
|
1918 |
(chunk startsWith:'''---') ifTrue:[ |
|
1919 |
words := chunk asCollectionOfWords. |
|
1920 |
words size > 2 ifTrue:[ |
|
1921 |
(words at:2) = 'snapshot' ifTrue:[ |
|
1922 |
^ true |
|
1923 |
]. |
|
1924 |
]. |
|
1925 |
]. |
|
1926 |
]. |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1927 |
]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1928 |
^ false |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1929 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1930 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1931 |
classNameOfChange:changeNr |
6288 | 1932 |
"return the classname of a change |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1933 |
(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
|
1934 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1935 |
|name| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1936 |
|
3364 | 1937 |
name := self realClassNameOfChange:changeNr. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1938 |
name isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1939 |
(name endsWith:' class') ifTrue:[ |
6288 | 1940 |
name := name copyWithoutLast:6 |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1941 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1942 |
^ name |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1943 |
|
3364 | 1944 |
"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
|
1945 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1946 |
|
3202 | 1947 |
extractSelectorOfMethodChange:changeNr |
1948 |
"return a method-changes selector, or nil if its not a methodChange" |
|
1949 |
||
1950 |
|source parser sel chunk aParseTree | |
|
1951 |
||
1952 |
source := self sourceOfMethodChange:changeNr. |
|
1953 |
source isNil ifTrue:[ |
|
6288 | 1954 |
(self classNameOfChange:changeNr) notNil ifTrue:[ |
1955 |
chunk := changeChunks at:changeNr. |
|
1956 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
|
1957 |
||
1958 |
aParseTree := Parser parseExpression:chunk. |
|
1959 |
(aParseTree isNil |
|
1960 |
or:[aParseTree == #Error |
|
1961 |
or:[aParseTree isMessage not]]) ifTrue:[ |
|
1962 |
^ nil "seems strange ... (could be a comment)" |
|
1963 |
]. |
|
1964 |
sel := aParseTree selector. |
|
1965 |
(#( |
|
1966 |
#'removeSelector:' |
|
1967 |
) includes:sel) ifTrue:[ |
|
1968 |
sel := aParseTree arguments at:1. |
|
1969 |
sel isConstant ifTrue:[ |
|
1970 |
sel := sel evaluate. |
|
1971 |
sel isSymbol ifTrue:[ |
|
1972 |
^ sel |
|
1973 |
] |
|
1974 |
] |
|
1975 |
] |
|
1976 |
]. |
|
1977 |
^ nil |
|
3202 | 1978 |
]. |
1979 |
||
1980 |
||
6288 | 1981 |
parser := Parser |
1982 |
parseMethodArgAndVarSpecification:source |
|
1983 |
in:nil |
|
1984 |
ignoreErrors:true |
|
1985 |
ignoreWarnings:true |
|
1986 |
parseBody:false. |
|
3202 | 1987 |
|
1988 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
6288 | 1989 |
sel := parser selector. |
3202 | 1990 |
]. |
1991 |
^ sel |
|
1992 |
||
1993 |
"Created: 24.11.1995 / 14:30:46 / cg" |
|
1994 |
"Modified: 5.9.1996 / 17:12:50 / cg" |
|
1995 |
! |
|
1996 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
1997 |
fullClassNameOfChange:changeNr |
6288 | 1998 |
"return the full classname of a change |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
1999 |
(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
|
2000 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2001 |
|chunk aParseTree recTree sel name arg1Tree isMeta prevMethodDefNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2002 |
words changeStream fullParseTree ownerTree ownerName oldDollarSetting| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2003 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2004 |
changeNr isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2005 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2006 |
first look, if not already known |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2007 |
" |
5145 | 2008 |
name := changeClassNames at:changeNr. |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
2009 |
name notNil ifTrue:[ |
6288 | 2010 |
name == #nil ifTrue:[^ nil]. |
2011 |
^ name |
|
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
2012 |
]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2013 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2014 |
prevMethodDefNr := changeNr. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2015 |
[changeIsFollowupMethodChange at:prevMethodDefNr] whileTrue:[ |
6288 | 2016 |
prevMethodDefNr := prevMethodDefNr - 1. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2017 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2018 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2019 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2020 |
get the chunk |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2021 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2022 |
chunk := changeChunks at:prevMethodDefNr. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2023 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2024 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2025 |
(chunk startsWith:'''---') ifTrue:[ |
6288 | 2026 |
words := chunk asCollectionOfWords. |
2027 |
words size > 2 ifTrue:[ |
|
2028 |
(words at:2) = 'checkin' ifTrue:[ |
|
2029 |
name := words at:3. |
|
2030 |
^ name |
|
2031 |
] |
|
2032 |
]. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2033 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2034 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2035 |
"/ fix it - otherwise, it cannot be parsed |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2036 |
(chunk endsWith:'primitiveDefinitions:') ifTrue:[ |
6288 | 2037 |
chunk := chunk , '''''' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2038 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2039 |
(chunk endsWith:'primitiveFunctions:') ifTrue:[ |
6288 | 2040 |
chunk := chunk , '''''' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2041 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2042 |
(chunk endsWith:'primitiveVariables:') ifTrue:[ |
6288 | 2043 |
chunk := chunk , '''''' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2044 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2045 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2046 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2047 |
use parser to construct a parseTree |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2048 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2049 |
oldDollarSetting := Parser allowDollarInIdentifier. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2050 |
[ |
6288 | 2051 |
Parser allowDollarInIdentifier:true. |
5014 | 2052 |
"/ Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
2053 |
"/ do:[ |
|
6288 | 2054 |
aParseTree := Parser parseExpression:chunk. |
5014 | 2055 |
"/ ]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2056 |
|
6288 | 2057 |
aParseTree == #Error ifTrue:[ |
2058 |
(chunk includesString:'comment') ifTrue:[ |
|
2059 |
"/ could be a comment ... |
|
2060 |
aParseTree := Parser parseExpression:chunk , ''''. |
|
2061 |
] |
|
2062 |
]. |
|
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
2063 |
] ensure:[ |
6288 | 2064 |
Parser allowDollarInIdentifier:oldDollarSetting |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2065 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2066 |
(aParseTree isNil or:[aParseTree == #Error]) ifTrue:[ |
6288 | 2067 |
^ 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
|
2068 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2069 |
aParseTree isMessage ifFalse:[ |
6288 | 2070 |
^ nil "very strange ... (whats that ?)" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2071 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2072 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2073 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2074 |
ask parser for selector |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2075 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2076 |
sel := aParseTree selector. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2077 |
recTree := aParseTree receiver. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2078 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2079 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2080 |
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
|
2081 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2082 |
|
6288 | 2083 |
(#(#'methodsFor:' |
2084 |
#'privateMethodsFor:' |
|
2085 |
#'protectedMethodsFor:' |
|
2086 |
#'ignoredMethodsFor:' |
|
2087 |
#'publicMethodsFor:' |
|
2088 |
#'removeSelector:' |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2089 |
#'comment:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2090 |
#'primitiveDefinitions:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2091 |
#'primitiveFunctions:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2092 |
#'primitiveVariables:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2093 |
#'renameCategory:to:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2094 |
#'instanceVariableNames:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2095 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2096 |
#'methodsFor:stamp:' "/ Squeak support |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2097 |
#'commentStamp:prior:' "/ Squeak support |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2098 |
#'addClassVarName:' "/ Squeak support |
2527
afa639104477
some support for dolphin source files
Claus Gittinger <cg@exept.de>
parents:
2511
diff
changeset
|
2099 |
#methodsFor "/ Dolphin support |
3472 | 2100 |
#categoriesForClass "/ Dolphin support |
2101 |
#categoriesFor: "/ Dolphin support |
|
2606 | 2102 |
#methods "/ STV support |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2103 |
) includes:sel) ifTrue:[ |
6288 | 2104 |
" |
2105 |
yes, the className is the receiver |
|
2106 |
" |
|
2107 |
(recTree notNil and:[recTree ~~ #Error]) ifTrue:[ |
|
2108 |
isMeta := false. |
|
2109 |
recTree isUnaryMessage ifTrue:[ |
|
2110 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
2111 |
"id class methodsFor:..." |
|
2112 |
recTree := recTree receiver. |
|
2113 |
isMeta := true. |
|
2114 |
]. |
|
2115 |
recTree isPrimary ifTrue:[ |
|
2116 |
name := recTree name. |
|
2117 |
isMeta ifTrue:[ |
|
2118 |
name := name , ' class'. |
|
2119 |
]. |
|
2120 |
^ name |
|
2121 |
] |
|
2122 |
]. |
|
2123 |
"more strange things" |
|
2124 |
^ nil |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2125 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2126 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2127 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2128 |
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
|
2129 |
" |
2322 | 2130 |
|
6288 | 2131 |
(('subclass:*' match:sel) |
2322 | 2132 |
or:[('variable*ubclass:*' match:sel)]) ifTrue:[ |
6288 | 2133 |
"/ must parse the full changes text, to get |
2134 |
"/ privacy information. |
|
2135 |
||
2136 |
changeStream := self streamForChange:changeNr. |
|
2137 |
changeStream notNil ifTrue:[ |
|
2138 |
chunk := changeStream nextChunk. |
|
2139 |
changeStream close. |
|
2140 |
fullParseTree := Parser parseExpression:chunk. |
|
2141 |
(fullParseTree isNil or:[fullParseTree == #Error]) ifTrue:[ |
|
2142 |
fullParseTree := nil |
|
2143 |
] ifFalse:[ |
|
2144 |
fullParseTree isMessage ifFalse:[ |
|
2145 |
fullParseTree := nil |
|
2146 |
] |
|
2147 |
]. |
|
2148 |
"/ actually, the nil case cannot happen |
|
2149 |
fullParseTree notNil ifTrue:[ |
|
2150 |
aParseTree := fullParseTree. |
|
2151 |
sel := aParseTree selector. |
|
2152 |
]. |
|
2153 |
]. |
|
2154 |
||
2155 |
arg1Tree := aParseTree arg1. |
|
2156 |
(arg1Tree notNil and:[arg1Tree isConstant]) ifTrue:[ |
|
2157 |
name := arg1Tree value asString. |
|
2158 |
||
2159 |
"/ is it a private-class ? |
|
2160 |
('*privateIn:' match:sel) ifTrue:[ |
|
2161 |
ownerTree := aParseTree args last. |
|
2162 |
ownerName := ownerTree name asString. |
|
2163 |
name := ownerName , '::' , name |
|
2164 |
]. |
|
2165 |
^ name |
|
2166 |
]. |
|
2167 |
"very strange" |
|
2168 |
^ nil |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2169 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2170 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2171 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2172 |
is it a class remove ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2173 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2174 |
(sel == #removeClass:) ifTrue:[ |
6288 | 2175 |
(recTree notNil |
2176 |
and:[recTree ~~ #Error |
|
2177 |
and:[recTree isPrimary |
|
2178 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
|
2179 |
arg1Tree := aParseTree arg1. |
|
2180 |
(arg1Tree notNil and:[arg1Tree isPrimary]) ifTrue:[ |
|
2181 |
name := arg1Tree name. |
|
2182 |
^ name |
|
2183 |
]. |
|
2184 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2185 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2186 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2187 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2188 |
is it a method category change ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2189 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2190 |
((sel == #category:) |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2191 |
or:[sel == #privacy:]) ifTrue:[ |
6288 | 2192 |
(recTree notNil |
2193 |
and:[recTree ~~ #Error |
|
2194 |
and:[recTree isMessage |
|
2195 |
and:[recTree selector == #compiledMethodAt:]]]) ifTrue:[ |
|
2196 |
isMeta := false. |
|
2197 |
recTree := recTree receiver. |
|
2198 |
recTree isUnaryMessage ifTrue:[ |
|
2199 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
2200 |
"id class " |
|
2201 |
recTree := recTree receiver |
|
2202 |
]. |
|
2203 |
recTree isPrimary ifTrue:[ |
|
2204 |
isMeta ifTrue:[ |
|
2205 |
name := name , ' class'. |
|
2206 |
]. |
|
2207 |
name := recTree name. |
|
2208 |
^ name |
|
2209 |
] |
|
2210 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2211 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2212 |
^ nil |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2213 |
|
2606 | 2214 |
"Modified: / 13.2.2000 / 15:05:28 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2215 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2216 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2217 |
numberOfChanges |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2218 |
^ changePositions size |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2219 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2220 |
"Created: 3.12.1995 / 18:15:39 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2221 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2222 |
|
2511 | 2223 |
ownerClassNameOfChange:changeNr |
6288 | 2224 |
"return the owner classname of a change |
2511 | 2225 |
For a normal class, this is the className; |
2226 |
for a private class, this is the name of the owning class" |
|
2227 |
||
4706 | 2228 |
|name "ns idx" cls| |
2511 | 2229 |
|
2230 |
name := self classNameOfChange:changeNr. |
|
2231 |
name isNil ifTrue:[^ nil]. |
|
2232 |
cls := Smalltalk at:name asSymbol. |
|
2233 |
(cls notNil and:[cls isBehavior]) ifTrue:[ |
|
6288 | 2234 |
cls owningClass notNil ifTrue:[ |
2235 |
^ cls owningClass name |
|
2236 |
]. |
|
2237 |
^ cls name |
|
2511 | 2238 |
]. |
2239 |
||
2240 |
"/ (name includes:$:) ifTrue:[ |
|
2241 |
"/ idx := name indexOf:$:. |
|
2242 |
"/ ns := name copyTo:idx-1. |
|
2243 |
"/ ns := Smalltalk at:ns asSymbol. |
|
2244 |
"/ ns notNil ifTrue:[ |
|
6288 | 2245 |
"/ |
2511 | 2246 |
"/ ]. |
2247 |
"/ |
|
2248 |
"/ name := name copyFrom:idx+2. |
|
2249 |
"/ (Smalltalk at:ns asSymbol) notNil ifTrue:[ |
|
2250 |
"/ cls |
|
2251 |
"/ ]. |
|
2252 |
"/ ^ name copyWithoutLast:6 |
|
2253 |
"/ ]. |
|
2254 |
^ name |
|
2255 |
||
2256 |
"Modified: 6.12.1995 / 17:06:31 / cg" |
|
2257 |
! |
|
2258 |
||
3364 | 2259 |
realClassNameOfChange:changeNr |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
2260 |
"return the classname of a change. |
6288 | 2261 |
- 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
|
2262 |
changeClassNames for the next query" |
3364 | 2263 |
|
2264 |
|name| |
|
2265 |
||
2266 |
name := changeClassNames at:changeNr. |
|
2267 |
name isNil ifTrue:[ |
|
6288 | 2268 |
name := self fullClassNameOfChange:changeNr. |
2269 |
name isNil ifTrue:[ |
|
2270 |
changeClassNames at:changeNr put:#nil. |
|
2271 |
]. |
|
3364 | 2272 |
]. |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
2273 |
name == #nil ifTrue:[^ nil]. |
3364 | 2274 |
^ name |
2275 |
||
2276 |
"Modified: / 6.12.1995 / 17:06:31 / cg" |
|
2277 |
"Created: / 5.11.2001 / 18:09:46 / cg" |
|
2278 |
! |
|
2279 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2280 |
selectorOfMethodChange:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2281 |
"return a method-changes selector, or nil if its not a methodChange" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2282 |
|
3202 | 2283 |
|sel | |
2284 |
||
2285 |
changeSelectors size >= changeNr ifTrue:[ |
|
6288 | 2286 |
sel := changeSelectors at:changeNr. |
2287 |
sel notNil ifTrue:[ ^ sel ]. |
|
3202 | 2288 |
]. |
2289 |
||
2290 |
sel := self extractSelectorOfMethodChange:changeNr. |
|
2291 |
sel notNil ifTrue:[ |
|
6288 | 2292 |
changeSelectors isNil ifTrue:[ |
2293 |
changeSelectors := OrderedCollection new |
|
2294 |
]. |
|
2295 |
changeSelectors grow:changeNr. |
|
2296 |
changeSelectors at:changeNr put:sel. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2297 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2298 |
^ sel |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2299 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2300 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2301 |
sourceOfMethodChange:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2302 |
"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
|
2303 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2304 |
|aStream chunk sawExcla parseTree sourceChunk sel| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2305 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2306 |
aStream := self streamForChange:changeNr. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2307 |
aStream isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2308 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2309 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
6288 | 2310 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
2311 |
chunk := aStream nextChunk. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2312 |
] ifTrue:[ |
6288 | 2313 |
chunk := (changeChunks at:changeNr). |
2314 |
sawExcla := true. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2315 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2316 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2317 |
sawExcla ifTrue:[ |
6288 | 2318 |
parseTree := Parser parseExpression:chunk. |
2319 |
(parseTree notNil |
|
2320 |
and:[parseTree ~~ #Error |
|
2321 |
and:[parseTree isMessage]]) ifTrue:[ |
|
2322 |
sel := parseTree selector. |
|
2323 |
(#( |
|
2324 |
#methodsFor: |
|
2325 |
#privateMethodsFor: |
|
2326 |
#publicMethodsFor: |
|
2327 |
#ignoredMethodsFor: |
|
2328 |
#protectedMethodsFor: |
|
2329 |
||
2330 |
#methodsFor:stamp: "/ Squeak support |
|
2331 |
#commentStamp:prior: "/ Squeak support |
|
2332 |
#methodsFor "/ Dolphin support |
|
2333 |
#methods "/ STV support |
|
2334 |
) |
|
2335 |
includes:sel) ifTrue:[ |
|
2336 |
sourceChunk := aStream nextChunk. |
|
2337 |
] |
|
2338 |
]. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2339 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2340 |
aStream close. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2341 |
^ sourceChunk |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2342 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2343 |
"Created: / 5.9.1996 / 17:11:32 / cg" |
2606 | 2344 |
"Modified: / 13.2.2000 / 15:05:45 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2345 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2346 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2347 |
streamForChange:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2348 |
"answer a stream for change" |
6288 | 2349 |
|
5702 | 2350 |
|aStream encoding decoder| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2351 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2352 |
(changeNr between:1 and:changePositions size) ifFalse:[^ nil]. |
5702 | 2353 |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
2354 |
aStream := changeFileName asFilename readStreamOrNil. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2355 |
aStream isNil ifTrue:[^ nil]. |
5702 | 2356 |
|
6173
4ba4589e4952
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
6162
diff
changeset
|
2357 |
encoding := CharacterEncoder guessEncodingOfStream:aStream. |
5702 | 2358 |
encoding notNil ifTrue:[ |
6288 | 2359 |
decoder := CharacterEncoder encoderFor:encoding. |
2360 |
aStream := EncodedStream stream:aStream encoder:decoder. |
|
5702 | 2361 |
]. |
2362 |
||
4599
9a95e5ae08ad
code rewritten to be independent of stream zero-base
Claus Gittinger <cg@exept.de>
parents:
4497
diff
changeset
|
2363 |
aStream position1Based:(changePositions at:changeNr). |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2364 |
^ aStream |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2365 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2366 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2367 |
!ChangesBrowser methodsFor:'private-changeFile access'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2368 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2369 |
changeFileName:aFileName |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
2370 |
"set the name of the changeFile" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
2371 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2372 |
changeFileName := aFileName |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2373 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2374 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2375 |
checkIfFileHasChanged |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
2376 |
"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
|
2377 |
install a timeout for rechecking after some time." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
2378 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2379 |
|f info | |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2380 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2381 |
Processor removeTimedBlock:checkBlock. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2382 |
f := changeFileName asFilename. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2383 |
(info := f info) isNil ifTrue:[ |
6288 | 2384 |
self newLabel:'(unaccessable)' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2385 |
] ifFalse:[ |
6288 | 2386 |
(info modificationTime) > changeFileTimestamp ifTrue:[ |
2387 |
self newLabel:'(outdated)'. |
|
2388 |
autoUpdate value ifTrue:[ |
|
2389 |
self doUpdate |
|
2390 |
] |
|
2391 |
] ifFalse:[ |
|
2392 |
self newLabel:'' |
|
2393 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2394 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2395 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2396 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2397 |
"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
|
2398 |
"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
|
2399 |
"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
|
2400 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2401 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2402 |
readChangesFile |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2403 |
"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
|
2404 |
and a list of chunk-positions (changePositions)" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2405 |
|
5178 | 2406 |
self readChangesFileInBackground:false. |
2407 |
self newLabel:''. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2408 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2409 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2410 |
readChangesFileInBackground:inBackground |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2411 |
"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
|
2412 |
and a list of chunk-positions (changePositions). |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2413 |
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
|
2414 |
the cols are: |
6288 | 2415 |
1 delta (only if comparing) |
2416 |
'+' -> new method (w.r.t. current state) |
|
2417 |
'-' -> removed method (w.r.t. current state) |
|
2418 |
'?' -> class does not exist currently |
|
2419 |
'=' -> change is same as current methods source |
|
2420 |
2 class/selector |
|
2421 |
3 type of change |
|
2422 |
doit |
|
2423 |
method |
|
2424 |
category change |
|
2425 |
4 timestamp |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2426 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2427 |
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
|
2428 |
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
|
2429 |
|
5715 | 2430 |
|inStream maxLen i f chunkText fullChunkText askedForEditingClassSource |
6288 | 2431 |
excla timeStampInfo entry changeDelta changeString changeType |
2432 |
s changeClass sawExcla category |
|
3067
96387c6aa216
allItalic now understood by CharacterArray
Claus Gittinger <cg@exept.de>
parents:
3065
diff
changeset
|
2433 |
chunkPos sel headerLine cls p rec clsName |
2683 | 2434 |
myProcess myPriority myPrioRange |
6288 | 2435 |
done first text methodPos |
3472 | 2436 |
singleJunkOnly methodChunks classCategoryChunks methodCategoryChunks singleInfo |
2683 | 2437 |
ownerTree ownerName |
5696 | 2438 |
m currentText t1 t2 methodSelector nameAndClass encoding decoder| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2439 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2440 |
editingClassSource := false. |
2641 | 2441 |
askedForEditingClassSource := false. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2442 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2443 |
maxLen := 60. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2444 |
|
3674 | 2445 |
self newLabel:'updating ...'. |
2446 |
||
2447 |
(self class isXMLFile:changeFileName) ifTrue:[ |
|
6288 | 2448 |
^ self class readXMLChangesFromFile:changeFileName inBackground:inBackground |
3674 | 2449 |
]. |
2450 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2451 |
f := changeFileName asFilename. |
5715 | 2452 |
inStream := f readStreamOrNil. |
2453 |
inStream isNil ifTrue:[^ nil]. |
|
2454 |
||
6173
4ba4589e4952
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
6162
diff
changeset
|
2455 |
encoding := CharacterEncoder guessEncodingOfStream:inStream. |
5696 | 2456 |
encoding notNil ifTrue:[ |
6288 | 2457 |
decoder := CharacterEncoder encoderFor:encoding. |
2458 |
inStream := EncodedStream stream:inStream encoder:decoder. |
|
2459 |
inStream skipEncodingChunk. |
|
5696 | 2460 |
]. |
2461 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2462 |
i := f info. |
3965
e499c0dae8fc
use #fileSize instead of #size
Claus Gittinger <cg@exept.de>
parents:
3962
diff
changeset
|
2463 |
changeFileSize := i fileSize. |
3962
3906b10c42fd
modified -> modificationTime
Claus Gittinger <cg@exept.de>
parents:
3930
diff
changeset
|
2464 |
changeFileTimestamp := i modificationTime. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2465 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2466 |
self withReadCursorDo:[ |
6288 | 2467 |
" |
2468 |
this is a time consuming operation (especially, if reading an |
|
2469 |
NFS-mounted directory; therefore lower my priority ... |
|
2470 |
" |
|
2471 |
inBackground ifTrue:[ |
|
2472 |
myProcess := Processor activeProcess. |
|
2473 |
myPriority := myProcess priority. |
|
2474 |
myPrioRange := myProcess priorityRange. |
|
2475 |
myProcess priorityRange:(Processor userBackgroundPriority to:Processor activePriority). |
|
2295
4e05198e7dd8
execute BG tasks at a prio range, to ensure progress.
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
2476 |
"/ myProcess priority:(Processor userBackgroundPriority). |
6288 | 2477 |
]. |
2478 |
||
2479 |
[ |
|
2480 |
changeChunks := OrderedCollection new. |
|
2481 |
changeClassNames := OrderedCollection new. |
|
2482 |
changeHeaderLines := OrderedCollection new. |
|
2483 |
changePositions := OrderedCollection new. |
|
2484 |
changeTimeStamps := OrderedCollection new. |
|
2485 |
changeIsFollowupMethodChange := OrderedCollection new. |
|
2486 |
||
2487 |
excla := inStream class chunkSeparator. |
|
2488 |
||
2489 |
[inStream atEnd] whileFalse:[ |
|
2490 |
" |
|
2491 |
get a chunk (separated by excla) |
|
2492 |
" |
|
2493 |
inStream skipSeparators. |
|
2494 |
chunkPos := inStream position1Based. |
|
2495 |
||
2496 |
||
2497 |
sawExcla := inStream peekFor:excla. |
|
2498 |
chunkText := fullChunkText := inStream nextChunk. |
|
2499 |
chunkText notNil ifTrue:[ |
|
2500 |
||
2501 |
(chunkText startsWith:'''---- timestamp ') ifTrue:[ |
|
2502 |
timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces. |
|
2503 |
] ifFalse:[ |
|
2504 |
" |
|
2505 |
only first line is saved in changeChunks ... |
|
2506 |
" |
|
2664
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2507 |
"/ index := chunkText indexOf:(Character cr). |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2508 |
"/ (index ~~ 0) ifTrue:[ |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2509 |
"/ chunkText := chunkText copyTo:(index - 1). |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2510 |
"/ |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2511 |
"/ "take care for comment changes - must still be a |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2512 |
"/ valid expression for classNameOfChange: to work" |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2513 |
"/ |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2514 |
"/ (chunkText endsWith:'comment:''') ifTrue:[ |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2515 |
"/ chunkText := chunkText , '...''' |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2516 |
"/ ]. |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2517 |
"/ (chunkText endsWith:'primitiveDefinitions:''') ifTrue:[ |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2518 |
"/ sel := 'primitiveDefinitions:'. |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2519 |
"/ chunkText := chunkText copyWithoutLast:1 |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2520 |
"/ ]. |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2521 |
"/ (chunkText endsWith:'primitiveVariables:''') ifTrue:[ |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2522 |
"/ sel := 'primitiveVariables:'. |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2523 |
"/ chunkText := chunkText copyWithoutLast:1 |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2524 |
"/ ]. |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2525 |
"/ (chunkText endsWith:'primitiveFunctions:''') ifTrue:[ |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2526 |
"/ sel := 'primitiveFunctions:'. |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2527 |
"/ chunkText := chunkText copyWithoutLast:1 |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2528 |
"/ ]. |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
2529 |
"/ ]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2530 |
|
6288 | 2531 |
changeChunks add:chunkText. |
2532 |
changeClassNames add:nil. |
|
2533 |
changePositions add:chunkPos. |
|
2534 |
changeTimeStamps add:timeStampInfo. |
|
2535 |
changeIsFollowupMethodChange add:false. |
|
2536 |
||
2537 |
headerLine := nil. |
|
2538 |
changeDelta := ' '. |
|
2539 |
||
2540 |
sawExcla ifFalse:[ |
|
2541 |
(chunkText startsWith:'''---- snap') ifTrue:[ |
|
2542 |
changeType := ''. |
|
2543 |
headerLine := chunkText. |
|
2544 |
changeString := (chunkText contractTo:maxLen) withoutSeparators. |
|
2545 |
timeStampInfo := nil. |
|
2546 |
] ifFalse:[ |
|
2547 |
||
2548 |
headerLine := chunkText , ' (doIt)'. |
|
2549 |
||
2550 |
" |
|
2551 |
first, assume doIt - then lets have a more detailed look ... |
|
2552 |
" |
|
2553 |
((chunkText startsWith:'''---- file') |
|
2554 |
or:[(chunkText startsWith:'''---- check')]) ifTrue:[ |
|
2555 |
changeType := ''. |
|
2556 |
timeStampInfo := nil. |
|
2557 |
] ifFalse:[ |
|
2558 |
changeType := '(doIt)'. |
|
2559 |
]. |
|
2560 |
changeString := (chunkText contractTo:maxLen) withoutSeparators. |
|
2561 |
||
2562 |
p := Parser parseExpression:fullChunkText inNameSpace:Smalltalk. |
|
2563 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
|
2564 |
p isMessage ifTrue:[ |
|
2565 |
sel := p selector. |
|
2566 |
rec := p receiver. |
|
2567 |
] |
|
2568 |
] ifFalse:[ |
|
2569 |
sel := nil. |
|
2570 |
(Scanner new scanTokens:fullChunkText) size == 0 ifTrue:[ |
|
2571 |
"/ a comment only |
|
2572 |
changeType := '(comment)'. |
|
2573 |
NoColoring ~~ true ifTrue:[ |
|
2574 |
changeType := changeType allItalic. |
|
2575 |
"/ changeString := changeString allItalic. |
|
2576 |
changeType emphasisAllAdd:(#color -> UserPreferences current commentColor). |
|
2577 |
] |
|
2578 |
] ifFalse:[ |
|
2579 |
changeType := '(???)'. |
|
2580 |
] |
|
2581 |
]. |
|
2582 |
||
2583 |
(sel == #comment:) ifTrue:[ |
|
2584 |
changeType := '(comment)'. |
|
2585 |
clsName := rec name. |
|
2586 |
changeClass := (self nameSpaceForApply) classNamed:clsName. |
|
2587 |
changeClassNames at:changeClassNames size put:clsName. |
|
2588 |
NoColoring ~~ true ifTrue:[ |
|
2589 |
changeType := changeType allItalic. |
|
2590 |
changeType emphasisAllAdd:(#color -> UserPreferences current commentColor). |
|
2591 |
"/ changeString := clsName allItalic. |
|
2592 |
]. |
|
2593 |
autoCompare value ifTrue:[ |
|
2594 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
|
2595 |
changeDelta := '?' |
|
2596 |
] ifFalse:[ |
|
2597 |
(changeClass comment = (p args at:1) evaluate) ifTrue:[ |
|
2598 |
changeDelta := '='. |
|
2599 |
] |
|
2600 |
] |
|
2601 |
]. |
|
2602 |
sel := nil. |
|
2603 |
]. |
|
2604 |
||
2605 |
(sel == #removeSelector:) ifTrue:[ |
|
2606 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec. |
|
2607 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
|
2608 |
||
2609 |
sel := (p args at:1) evaluate. |
|
2610 |
changeClassNames at:changeClassNames size put:clsName. |
|
2611 |
||
2612 |
autoCompare value ifTrue:[ |
|
2613 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
|
2614 |
changeDelta := '?' |
|
2615 |
] ifFalse:[ |
|
2616 |
(changeClass includesSelector:sel asSymbol) ifTrue:[ |
|
2617 |
changeDelta := '-'. |
|
2618 |
] ifFalse:[ |
|
2619 |
changeDelta := '='. |
|
2620 |
] |
|
2621 |
] |
|
2622 |
]. |
|
2623 |
changeType := '(remove)'. |
|
2624 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
|
2625 |
sel := nil. |
|
2626 |
]. |
|
2627 |
||
2628 |
(p notNil |
|
2629 |
and:[p ~~ #Error |
|
2630 |
and:[p isMessage |
|
2631 |
and:[rec isMessage |
|
2632 |
and:[rec selector == #compiledMethodAt:]]]]) ifTrue:[ |
|
2633 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec receiver. |
|
2634 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
|
2635 |
||
2636 |
(sel == #category:) ifTrue:[ |
|
2637 |
sel := (rec args at:1) evaluate. |
|
2638 |
changeType := '(category change)'. |
|
2639 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
|
2640 |
changeClassNames at:changeClassNames size put:clsName. |
|
2641 |
changeClass notNil ifTrue:[ |
|
2642 |
m := changeClass compiledMethodAt:sel asSymbol. |
|
2643 |
m notNil ifTrue:[ |
|
2644 |
m category = (p args at:1) evaluate ifTrue:[ |
|
2645 |
changeDelta := '='. |
|
2646 |
] |
|
2647 |
] |
|
2648 |
]. |
|
2649 |
]. |
|
2650 |
(sel == #privacy:) ifTrue:[ |
|
2651 |
sel := (rec args at:1) evaluate. |
|
2652 |
changeType := '(privacy change)'. |
|
2653 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
|
2654 |
changeClassNames at:changeClassNames size put:clsName. |
|
2655 |
]. |
|
2656 |
sel := nil. |
|
2657 |
]. |
|
2658 |
||
2659 |
(Class definitionSelectors includes:sel) ifTrue:[ |
|
2660 |
changeType := '(class definition)'. |
|
2661 |
clsName := (p args at:1) evaluate. |
|
2662 |
changeClassNames at:changeClassNames size put:clsName. |
|
2663 |
||
2664 |
"/ is it a private-class ? |
|
2665 |
('*privateIn:' match:sel) ifTrue:[ |
|
2666 |
ownerTree := p args last. |
|
2667 |
ownerName := ownerTree name asString. |
|
2668 |
clsName := ownerName , '::' , clsName |
|
2669 |
]. |
|
2670 |
||
2671 |
changeString := clsName. |
|
2672 |
NoColoring ~~ true ifTrue:[ |
|
2673 |
changeType := changeType allBold. |
|
2674 |
changeString := changeString allBold. |
|
2675 |
]. |
|
2676 |
||
2677 |
autoCompare value ifTrue:[ |
|
2678 |
cls := (self nameSpaceForApply) at:clsName asSymbol ifAbsent:nil. |
|
2679 |
cls isNil ifTrue:[ |
|
2680 |
changeDelta := '+'. |
|
2681 |
] ifFalse:[ |
|
2682 |
(cls definitionSelector = sel |
|
2683 |
or:[ |
|
2684 |
"/ could be an ST/V, VAge or Dolphin definition |
|
2685 |
cls definitionSelector = (sel , 'category:') |
|
2686 |
]) |
|
2687 |
ifTrue:[ |
|
2688 |
((cls superclass isNil |
|
2689 |
and:[p receiver isConstant |
|
2690 |
and:[p receiver evaluate isNil]]) |
|
2691 |
or:[ |
|
2692 |
cls superclass notNil |
|
2693 |
and:[p receiver isConstant not |
|
2694 |
and:[cls superclass name = p receiver name]] |
|
2695 |
]) ifTrue:[ |
|
2696 |
cls instanceVariableString asCollectionOfWords = (p args at:2) evaluate asCollectionOfWords ifTrue:[ |
|
2697 |
cls classVariableString asCollectionOfWords = (p args at:3) evaluate asCollectionOfWords ifTrue:[ |
|
2698 |
(p args at:4) evaluate isEmpty ifTrue:[ |
|
2699 |
cls definitionSelector = (sel , 'category:') |
|
2700 |
ifTrue:[ |
|
2701 |
"/ ST/V, VAge or Dolphin definition |
|
2702 |
changeDelta := '='. |
|
2703 |
] ifFalse:[ |
|
2704 |
cls category = (p args at:5) evaluate ifTrue:[ |
|
2705 |
changeDelta := '='. |
|
2706 |
] ifFalse:[ |
|
2707 |
changeType := '(class category change)'. |
|
2708 |
] |
|
2709 |
] |
|
2710 |
] |
|
2711 |
] |
|
2712 |
] |
|
2713 |
] |
|
2714 |
] |
|
2715 |
] |
|
2716 |
]. |
|
2717 |
sel := nil. |
|
2718 |
] ifFalse:[ |
|
2719 |
(#( |
|
2720 |
#'primitiveDefinitions:' |
|
2721 |
#'primitiveFunctions:' |
|
2722 |
#'primitiveVariables:' |
|
2723 |
) includes:sel) ifTrue:[ |
|
2724 |
changeType := '(class definition)'. |
|
2725 |
clsName := rec evaluate. |
|
2726 |
] ifFalse:[ |
|
2727 |
((sel == #instanceVariableNames:) |
|
2728 |
and:[rec isMessage |
|
2729 |
and:[rec selector == #class]]) ifTrue:[ |
|
2730 |
clsName := rec receiver name. |
|
2731 |
changeClass := (self nameSpaceForApply) classNamed:clsName. |
|
2732 |
changeType := '(class definition)'. |
|
2733 |
changeClassNames at:changeClassNames size put:clsName. |
|
2734 |
||
2735 |
autoCompare value ifTrue:[ |
|
2736 |
changeClass isNil ifTrue:[ |
|
2737 |
changeDelta := '?'. |
|
2738 |
] ifFalse:[ |
|
2739 |
s := (p args at:1) evaluate. |
|
2740 |
s = changeClass class instanceVariableString ifTrue:[ |
|
2741 |
changeDelta := '='. |
|
2742 |
] |
|
2743 |
] |
|
2744 |
]. |
|
2745 |
] |
|
2746 |
] |
|
2747 |
]. |
|
2748 |
] |
|
2749 |
] ifTrue:[ "sawExcla" |
|
2750 |
singleJunkOnly := false. |
|
2751 |
methodChunks := false. |
|
2752 |
classCategoryChunks := methodCategoryChunks := false. |
|
2753 |
singleInfo := false. |
|
2754 |
||
2755 |
" |
|
2756 |
method definitions actually consist of |
|
2757 |
two (or more) chunks; skip next chunk(s) |
|
2758 |
up to an empty one. |
|
2759 |
The system only writes one chunk, |
|
2760 |
and we cannot handle more in this ChangesBrowser .... |
|
2761 |
" |
|
2762 |
clsName := nil. |
|
2763 |
p := Parser parseExpression:chunkText inNameSpace:(self nameSpaceForApply). |
|
2764 |
||
2765 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
|
2766 |
rec := p receiver. |
|
2767 |
sel := p selector. |
|
2768 |
(#( |
|
2769 |
#methodsFor: |
|
2770 |
#privateMethodsFor: |
|
2771 |
#publicMethodsFor: |
|
2772 |
#ignoredMethodsFor: |
|
2773 |
#protectedMethodsFor: |
|
2774 |
#methodsFor:stamp: "/ Squeak support |
|
2775 |
#'commentStamp:prior:' "/ Squeak support |
|
2776 |
#methodsFor "/ Dolphin support |
|
2777 |
#categoriesForClass "/ Dolphin support |
|
2778 |
#categoriesFor: "/ Dolphin support |
|
2779 |
#methods "/ STV support |
|
2780 |
#publicMethods "/ STV support |
|
2781 |
#methodsForUndefined: |
|
2782 |
) |
|
2783 |
includes:sel) ifTrue:[ |
|
2784 |
methodChunks := true. |
|
2785 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec. |
|
2786 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
|
2787 |
||
2788 |
sel == #categoriesForClass ifTrue:[ |
|
2789 |
methodChunks := false. |
|
2790 |
classCategoryChunks := true. |
|
2791 |
changeType := '(class category change)'. |
|
2792 |
] ifFalse:[ |
|
2793 |
sel == #categoriesFor: ifTrue:[ |
|
2794 |
methodChunks := false. |
|
2795 |
methodCategoryChunks := true. |
|
2796 |
changeType := '(category change)'. |
|
2797 |
methodSelector := (p args at:1) evaluate. |
|
2798 |
] ifFalse:[ |
|
2799 |
(sel == #'methodsFor') ifTrue:[ |
|
2800 |
category := 'Dolphin methods'. |
|
2801 |
] ifFalse:[ |
|
2802 |
((sel == #methods) or:[sel == #publicMethods]) ifTrue:[ |
|
2803 |
category := 'STV methods'. |
|
2804 |
] ifFalse:[ |
|
2805 |
category := (p args at:1) evaluate. |
|
2806 |
] |
|
2807 |
]. |
|
2808 |
]. |
|
2809 |
]. |
|
2810 |
||
2811 |
sel == #'methodsFor:stamp:' ifTrue:[ |
|
2812 |
"/ Squeak timeStamp |
|
2813 |
timeStampInfo := (p args at:2) evaluate. |
|
2814 |
singleInfo := true |
|
2815 |
] ifFalse:[ |
|
2816 |
sel == #'commentStamp:prior:' ifTrue:[ |
|
2817 |
singleJunkOnly := true. |
|
2818 |
methodChunks := false. |
|
2819 |
] |
|
2820 |
] |
|
2821 |
] ifFalse:[ |
|
2822 |
sel == #reorganize ifTrue:[ |
|
2823 |
singleJunkOnly := true. |
|
2824 |
methodChunks := false. |
|
2825 |
] |
|
2826 |
]. |
|
2827 |
]. |
|
2828 |
||
2829 |
done := false. |
|
2830 |
first := true. |
|
2831 |
[done] whileFalse:[ |
|
2832 |
changeDelta := ' '. |
|
2833 |
methodPos := inStream position1Based. |
|
2834 |
||
2835 |
text := inStream nextChunk. |
|
2836 |
done := text isNil or:[text isEmpty]. |
|
2837 |
||
2838 |
done ifFalse:[ |
|
2839 |
first ifFalse:[ |
|
2840 |
changeChunks add:chunkText. |
|
2841 |
changeClassNames add:clsName. |
|
2842 |
changePositions add:methodPos. |
|
2843 |
changeTimeStamps add:timeStampInfo. |
|
2844 |
changeIsFollowupMethodChange add:true. |
|
2845 |
askedForEditingClassSource ifFalse:[ |
|
2846 |
(changeFileName asFilename hasSuffix:'st') ifFalse:[ |
|
2847 |
editingClassSource := false. |
|
5702 | 2848 |
" |
2849 |
editingClassSource := (self confirm:'Multiple method chunks without individual ''methodsFor:'' encountered. |
|
2635
4ac62d4f2346
care for malformed changes file and ask
Claus Gittinger <cg@exept.de>
parents:
2606
diff
changeset
|
2850 |
Is this a class-file being browsed ?') |
5702 | 2851 |
" |
6288 | 2852 |
] ifTrue:[ |
2853 |
editingClassSource := true. |
|
2854 |
]. |
|
2855 |
askedForEditingClassSource := true. |
|
2856 |
] |
|
2857 |
] ifTrue:[ |
|
2858 |
changeClassNames at:changeClassNames size put:clsName. |
|
2859 |
]. |
|
2860 |
||
2861 |
first := false. |
|
2862 |
||
2863 |
(classCategoryChunks or:[methodCategoryChunks]) ifTrue:[ |
|
2864 |
text := text asCollectionOfLines first asString. |
|
2865 |
classCategoryChunks ifTrue:[ |
|
2866 |
changeClass isNil ifTrue:[ |
|
2867 |
changeDelta := '?'. |
|
2868 |
] ifFalse:[ |
|
2869 |
changeClass category = text ifTrue:[ |
|
2870 |
changeDelta := '='. |
|
2871 |
] |
|
2872 |
]. |
|
2873 |
changeString := clsName , ' category: ' , text storeString. |
|
2874 |
]ifFalse:[ |
|
2875 |
changeString := '(' , clsName , ' compiledMethodAt:' , methodSelector storeString , ') category: ' , text storeString. |
|
2876 |
]. |
|
2877 |
] ifFalse:[ |
|
2878 |
" |
|
2879 |
try to find the selector |
|
2880 |
" |
|
2881 |
methodSelector := nil. |
|
2882 |
clsName notNil ifTrue:[ |
|
2883 |
methodChunks ifTrue:[ |
|
2884 |
p := Parser |
|
2885 |
parseMethodSpecification:text |
|
2886 |
in:nil |
|
2887 |
ignoreErrors:true |
|
2888 |
ignoreWarnings:true. |
|
2889 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
|
2890 |
methodSelector := p selector. |
|
2891 |
] |
|
2892 |
] |
|
2893 |
]. |
|
2894 |
||
2895 |
methodSelector isNil ifTrue:[ |
|
2896 |
changeString := (chunkText contractTo:maxLen). |
|
2897 |
changeType := '(change)'. |
|
2898 |
headerLine := chunkText , ' (change)'. |
|
2899 |
] ifFalse:[ |
|
2900 |
changeString := self contractClass:clsName selector:methodSelector to:maxLen. |
|
2901 |
changeType := '{ ' , category , ' }'. |
|
2902 |
headerLine := clsName , ' ' , methodSelector , ' ' , '(change category: ''' , category , ''')'. |
|
2903 |
]. |
|
2904 |
||
2905 |
autoCompare value ifTrue:[ |
|
2906 |
changeClass isNil ifFalse:[ |
|
2907 |
cls := changeClass theNonMetaclass |
|
2908 |
]. |
|
2909 |
||
2910 |
(changeClass isNil or:[methodSelector isNil or:[cls isLoaded not]]) ifTrue:[ |
|
2911 |
changeClass isNil ifTrue:[ |
|
2912 |
changeDelta := '+' |
|
2913 |
] ifFalse:[ |
|
2914 |
changeDelta := '?' |
|
2915 |
] |
|
2916 |
] ifFalse:[ |
|
2917 |
(changeClass includesSelector:methodSelector asSymbol) ifFalse:[ |
|
2918 |
changeDelta := '+'. |
|
2919 |
] ifTrue:[ |
|
2920 |
m := changeClass compiledMethodAt:methodSelector asSymbol. |
|
2921 |
currentText := m source. |
|
2922 |
currentText notNil ifTrue:[ |
|
2923 |
text asString string withoutTrailingSeparators = currentText asString string withoutTrailingSeparators ifTrue:[ |
|
2924 |
changeDelta := '=' |
|
2925 |
] ifFalse:[ |
|
2926 |
t1 := currentText asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
2927 |
t2 := text asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
2928 |
t1 = t2 ifTrue:[ |
|
2929 |
changeDelta := '=' |
|
2930 |
] |
|
2931 |
] |
|
2932 |
] |
|
2933 |
] |
|
2934 |
] |
|
2935 |
]. |
|
2936 |
]. |
|
2937 |
||
2938 |
entry := MultiColListEntry new. |
|
2939 |
entry tabulatorSpecification:tabSpec. |
|
2940 |
entry colAt:1 put:changeDelta. |
|
2941 |
entry colAt:2 put:changeString. |
|
2942 |
entry colAt:3 put:changeType. |
|
2943 |
timeStampInfo notNil ifTrue:[ |
|
2944 |
entry colAt:4 put:timeStampInfo. |
|
2945 |
]. |
|
2946 |
changeHeaderLines add:entry |
|
2947 |
]. |
|
2948 |
changeString := nil. |
|
2949 |
headerLine := nil. |
|
2950 |
singleJunkOnly ifTrue:[done := true] |
|
2951 |
]. |
|
2952 |
singleInfo ifTrue:[ |
|
2953 |
timeStampInfo := nil |
|
2954 |
]. |
|
2955 |
]. |
|
2956 |
changeString notNil ifTrue:[ |
|
2957 |
entry := MultiColListEntry new. |
|
2958 |
entry tabulatorSpecification:tabSpec. |
|
2959 |
entry colAt:1 put:changeDelta. |
|
2960 |
entry colAt:2 put:changeString. |
|
2961 |
entry colAt:3 put:changeType. |
|
2962 |
timeStampInfo notNil ifTrue:[ |
|
2963 |
entry colAt:4 put:timeStampInfo. |
|
2964 |
]. |
|
2965 |
changeHeaderLines add:entry |
|
2966 |
] ifFalse:[ |
|
2967 |
headerLine notNil ifTrue:[ |
|
2968 |
changeHeaderLines add:headerLine |
|
2969 |
] |
|
2970 |
] |
|
2971 |
] |
|
2972 |
] |
|
2973 |
]. |
|
2974 |
anyChanges := false |
|
2975 |
] ensure:[ |
|
2976 |
inStream close. |
|
2977 |
inBackground ifTrue:[ |
|
2978 |
myProcess priority:myPriority. |
|
2979 |
myProcess priorityRange:myPrioRange. |
|
2980 |
]. |
|
2981 |
]. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2982 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2983 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2984 |
self checkIfFileHasChanged |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2985 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2986 |
"Modified: / 27.8.1995 / 23:06:55 / claus" |
3378
a13d1dfdf7e5
use symbols as key when accesing smalltalk
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
2987 |
"Modified: / 9.11.2001 / 02:24:46 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2988 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2989 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2990 |
writeBackChanges |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2991 |
"write back the changes file. To avoid problems when the disk is full |
6288 | 2992 |
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
|
2993 |
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
|
2994 |
rename the old change-file to a .bak file and finally rename the |
6288 | 2995 |
tempfile back to the change-file. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2996 |
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
|
2997 |
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
|
2998 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
2999 |
|inStream outStream tempfile stamp f| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3000 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3001 |
editingClassSource ifTrue:[ |
6288 | 3002 |
(self confirm:'You are editing a classes sourceFile (not a changeFile) !!\\Are you certain, you want to overwrite it ?' withCRs) |
3003 |
ifFalse:[ |
|
3004 |
^ false |
|
3005 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3006 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3007 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3008 |
tempfile := Filename newTemporaryIn:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3009 |
tempfile exists ifTrue:[tempfile remove]. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
3010 |
[ |
6288 | 3011 |
outStream := tempfile writeStream. |
3012 |
inStream := changeFileName asFilename readStreamOrNil. |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
3013 |
] on:FileStream openErrorSignal do:[:ex| |
6288 | 3014 |
self warn:'Cannot create temp file in current directory.'. |
3015 |
^ false |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3016 |
]. |
5715 | 3017 |
outStream nextPutLine:'"{ Encoding: utf8 }" !!'. |
5733 | 3018 |
outStream := EncodedStream stream:outStream encoder:(CharacterEncoder encoderForUTF8). |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3019 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3020 |
self withCursor:(Cursor write) do:[ |
6288 | 3021 |
|excla sawExcla done first chunk |
3022 |
nChanges "{Class:SmallInteger}" | |
|
3023 |
||
3024 |
Stream writeErrorSignal handle:[:ex | |
|
3025 |
self warn:('Could not update the changes file.\\' , ex description) withCRs. |
|
3026 |
tempfile exists ifTrue:[tempfile remove]. |
|
3027 |
^ false |
|
3028 |
] do:[ |
|
3029 |
excla := inStream class chunkSeparator. |
|
3030 |
nChanges := self numberOfChanges. |
|
3031 |
||
3032 |
1 to:nChanges do:[:index | |
|
3033 |
inStream position1Based:(changePositions at:index). |
|
3034 |
sawExcla := inStream peekFor:excla. |
|
3035 |
chunk := inStream nextChunk. |
|
3036 |
||
3037 |
(chunk notNil |
|
3038 |
and:[(chunk startsWith:'''---- snap') not]) ifTrue:[ |
|
3039 |
(stamp := changeTimeStamps at:index) notNil ifTrue:[ |
|
3040 |
outStream nextPutAll:'''---- timestamp ' , stamp , ' ----'''. |
|
3041 |
outStream nextPut:excla; cr. |
|
3042 |
]. |
|
3043 |
]. |
|
3044 |
||
3045 |
sawExcla ifTrue:[ |
|
3046 |
outStream nextPut:excla. |
|
3047 |
outStream nextChunkPut:chunk. |
|
3048 |
outStream cr; cr. |
|
3049 |
" |
|
3050 |
a method-definition chunk - output followups |
|
3051 |
" |
|
3052 |
done := false. |
|
3053 |
first := true. |
|
3054 |
[done] whileFalse:[ |
|
3055 |
chunk := inStream nextChunk. |
|
3056 |
chunk isNil ifTrue:[ |
|
3057 |
outStream cr; cr. |
|
3058 |
done := true |
|
3059 |
] ifFalse:[ |
|
3060 |
chunk isEmpty ifTrue:[ |
|
3061 |
outStream space; nextChunkPut:chunk; cr; cr. |
|
3062 |
done := true. |
|
3063 |
] ifFalse:[ |
|
3064 |
first ifFalse:[ |
|
3065 |
outStream cr; cr. |
|
3066 |
]. |
|
3067 |
outStream nextChunkPut:chunk. |
|
3068 |
]. |
|
3069 |
]. |
|
3070 |
first := false. |
|
3071 |
]. |
|
3072 |
] ifFalse:[ |
|
3073 |
outStream nextChunkPut:chunk. |
|
3074 |
outStream cr |
|
3075 |
] |
|
3076 |
]. |
|
3077 |
outStream close. |
|
3078 |
inStream close. |
|
3079 |
]. |
|
3080 |
||
3081 |
f := changeFileName asFilename. |
|
3082 |
f renameTo:(f withSuffix:'bak'). |
|
3083 |
tempfile renameOrCopyTo:changeFileName. |
|
3084 |
anyChanges := false |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3085 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3086 |
^ true |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3087 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3088 |
"Modified: / 2.12.1996 / 22:29:15 / stefan" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3089 |
"Modified: / 21.4.1998 / 17:50:11 / cg" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3090 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3091 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3092 |
!ChangesBrowser methodsFor:'private-user interaction ops'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3093 |
|
5735 | 3094 |
appendChange:changeNr toFile:aFileNameOrFileNameString |
202 | 3095 |
"append change to a file. return true if ok." |
3096 |
||
5735 | 3097 |
|fileName changeInStream outStream chunk chunk2 sawExcla separator encoding| |
3098 |
||
3099 |
changeInStream := self streamForChange:changeNr. |
|
3100 |
changeInStream isNil ifTrue:[ |
|
6288 | 3101 |
self warn:'Cannot read change'. |
3102 |
^ false |
|
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
3103 |
]. |
5735 | 3104 |
changeInStream skipSeparators. |
3105 |
||
3106 |
separator := changeInStream class chunkSeparator. |
|
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
3107 |
|
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
3108 |
(self changeIsFollowupMethodChange:changeNr) ifTrue:[ |
6288 | 3109 |
sawExcla := true. |
3110 |
chunk := changeChunks at:changeNr. |
|
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
3111 |
] ifFalse:[ |
6288 | 3112 |
sawExcla := changeInStream peekFor:separator. |
3113 |
chunk := changeInStream nextChunk. |
|
3991 | 3114 |
]. |
3115 |
chunk withoutSeparators isEmpty ifTrue:[ |
|
6288 | 3116 |
self error:'Empty chunk - should not happen'. |
5735 | 3117 |
]. |
3118 |
||
3119 |
fileName := aFileNameOrFileNameString asFilename. |
|
3120 |
fileName exists ifTrue:[ |
|
6288 | 3121 |
encoding := CharacterEncoder guessEncodingOfFile:fileName. |
5735 | 3122 |
] ifFalse:[ |
6288 | 3123 |
encoding := #utf8. |
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
3124 |
]. |
202 | 3125 |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
3126 |
[ |
6288 | 3127 |
outStream := fileName readWriteStream. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
3128 |
] on:FileStream openErrorSignal do:[:ex| |
6288 | 3129 |
self warn:'Cannot update file: ''%1''' with:fileName. |
3130 |
^ false |
|
73 | 3131 |
]. |
202 | 3132 |
|
5735 | 3133 |
encoding notNil ifTrue:[ |
6288 | 3134 |
outStream := EncodedStream stream:outStream encoder:(CharacterEncoder encoderFor:encoding). |
3135 |
outStream nextPutLine:'"{ Encoding: utf8 }" !!'. |
|
5735 | 3136 |
]. |
3137 |
||
202 | 3138 |
outStream setToEnd. |
3139 |
||
3140 |
sawExcla ifTrue:[ |
|
6288 | 3141 |
outStream nextPut:separator |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
3142 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
3143 |
outStream nextChunkPut:chunk; cr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
3144 |
sawExcla ifTrue:[ |
6288 | 3145 |
chunk2 := changeInStream nextChunk. |
3146 |
chunk2 withoutSeparators isEmpty ifTrue:[ |
|
3147 |
self error:'Empty chunk - should not happen'. |
|
3148 |
]. |
|
3149 |
outStream nextChunkPut:chunk2; space |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
3150 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
3151 |
sawExcla ifTrue:[ |
6288 | 3152 |
outStream nextPut:separator |
202 | 3153 |
]. |
3154 |
outStream cr. |
|
5735 | 3155 |
|
3156 |
changeInStream close. |
|
202 | 3157 |
outStream close. |
3158 |
^ true |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
3159 |
|
1472 | 3160 |
"Modified: / 6.2.1998 / 13:03:54 / cg" |
73 | 3161 |
! |
3162 |
||
51 | 3163 |
applyChange:changeNr |
3164 |
"fileIn a change" |
|
3165 |
||
3091 | 3166 |
|aStream applyAction nameSpace className changeClass ownerName ownerClass |
6288 | 3167 |
sig reader doItChunk methodsForChunk pkg |
4877 | 3168 |
alternativeClass shortName orgClassName nsClass aborted| |
45 | 3169 |
|
51 | 3170 |
aStream := self streamForChange:changeNr. |
3171 |
aStream isNil ifTrue:[^ self]. |
|
3172 |
||
2965 | 3173 |
className := self classNameOfChange:changeNr. |
3174 |
className notNil ifTrue:[ |
|
6288 | 3175 |
className := className asSymbol. |
3176 |
changeClass := Smalltalk at:className ifAbsent:[]. |
|
3177 |
changeClass notNil ifTrue:[ |
|
3178 |
changeClass autoload |
|
3179 |
] |
|
51 | 3180 |
]. |
45 | 3181 |
|
51 | 3182 |
changeNrProcessed := changeNr. |
4877 | 3183 |
aborted := false. |
45 | 3184 |
|
6288 | 3185 |
applyAction := |
3186 |
[ |
|
3187 |
(skipSignal notNil) ifTrue:[ |
|
3188 |
sig := skipSignal |
|
3189 |
] ifFalse:[ |
|
3190 |
sig := AbortOperationRequest |
|
3191 |
]. |
|
3192 |
sig handle:[:ex | |
|
3193 |
aborted := true. |
|
3194 |
ex return. |
|
3195 |
] do:[ |
|
3196 |
nameSpace := self nameSpaceForApply. |
|
3197 |
||
3198 |
pkg := enforcedPackage ? Class packageQuerySignal query. |
|
3199 |
Class packageQuerySignal answer:pkg |
|
3200 |
do:[ |
|
3201 |
Class nameSpaceQuerySignal answer:nameSpace |
|
3202 |
do:[ |
|
3203 |
"/ a followup methodsFor: chunk ... |
|
3204 |
(self changeIsFollowupMethodChange:changeNr) ifTrue:[ |
|
3205 |
methodsForChunk := (changeChunks at:changeNr). |
|
3206 |
] ifFalse:[ |
|
3207 |
doItChunk := aStream nextChunk. "/ an empty chunk sometimes ... |
|
3208 |
doItChunk notEmpty ifTrue:[ |
|
3209 |
Compiler evaluate:doItChunk notifying:self. |
|
3210 |
] ifFalse:[ |
|
3211 |
methodsForChunk := aStream nextChunk. "/ the real one |
|
3212 |
] |
|
3213 |
]. |
|
3214 |
methodsForChunk notNil ifTrue:[ |
|
3215 |
changeClass isNil ifTrue:[ |
|
3216 |
orgClassName := className. |
|
3217 |
||
3218 |
(className includes:$:) ifTrue:[ |
|
3219 |
ownerName := className copyTo:(className lastIndexOf:$:) - 1. |
|
3220 |
(ownerName endsWith:$:) ifTrue:[ |
|
3221 |
ownerName := ownerName copyWithoutLast:1. |
|
3222 |
]. |
|
3223 |
||
3224 |
ownerClass := Smalltalk at:(ownerName asSymbol) ifAbsent:[]. |
|
3225 |
ownerClass notNil ifTrue:[ |
|
3226 |
ownerClass autoload |
|
3227 |
]. |
|
3228 |
]. |
|
3229 |
(nameSpace notNil and:[nameSpace ~~ Smalltalk]) ifTrue:[ |
|
3230 |
changeClass := nameSpace at:className ifAbsent:[]. |
|
3231 |
]. |
|
3232 |
changeClass isNil ifTrue:[ |
|
3233 |
changeClass := Smalltalk at:className ifAbsent:[]. |
|
3234 |
]. |
|
3235 |
[changeClass isNil] whileTrue:[ |
|
3236 |
(NameSpace allNamespaces |
|
3237 |
detect:[:ns | (nsClass := (ns at:className)) notNil] ifNone:nil) |
|
3238 |
notNil ifTrue:[ |
|
3239 |
shortName := nsClass name. |
|
3240 |
] ifFalse:[ |
|
3241 |
shortName := className copyFrom:(className lastIndexOf:$:) + 1. |
|
3242 |
shortName = className ifTrue:[ |
|
3243 |
shortName := '' |
|
3244 |
]. |
|
3245 |
]. |
|
3246 |
className := Dialog |
|
3247 |
request:'No class ''' , className , ''' for change. Add to which class ?' |
|
3248 |
initialAnswer:shortName. |
|
3249 |
||
3250 |
className size == 0 ifTrue:[ |
|
3251 |
^ self |
|
3252 |
]. |
|
3253 |
alternativeClass := Smalltalk classNamed:className. |
|
3254 |
alternativeClass notNil ifTrue:[ |
|
3255 |
changeClass := alternativeClass |
|
3256 |
] |
|
3257 |
]. |
|
3258 |
methodsForChunk := methodsForChunk copyFrom:(methodsForChunk indexOfSeparator). |
|
3259 |
methodsForChunk := changeClass name , methodsForChunk. |
|
3260 |
]. |
|
3261 |
||
3262 |
reader := Compiler evaluate:methodsForChunk notifying:self. |
|
3263 |
reader fileInFrom:aStream notifying:self passChunk:false single:true. |
|
3264 |
] |
|
3265 |
] |
|
3266 |
] |
|
3267 |
]. |
|
3268 |
changeNrProcessed := nil. |
|
3269 |
]. |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
3270 |
|
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
3271 |
"/ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
3272 |
"/ 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
|
3273 |
"/ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
3274 |
changeFileName = ObjectMemory nameForChanges ifTrue:[ |
6288 | 3275 |
Class withoutUpdatingChangesDo:[ |
3276 |
Class updateChangeListQuerySignal answer:updateChangeSet value do:applyAction |
|
3277 |
] |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
3278 |
] ifFalse:[ |
6288 | 3279 |
applyAction value |
45 | 3280 |
]. |
4877 | 3281 |
aStream close. |
3282 |
||
3283 |
^ aborted not |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
3284 |
|
3436
c4fe19deba58
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3406
diff
changeset
|
3285 |
"Modified: / 16.11.2001 / 17:38:06 / cg" |
45 | 3286 |
! |
3287 |
||
255 | 3288 |
compareChange:changeNr |
2835 | 3289 |
"compare a change with the current (in-image) version; show the result of the compare (as dialog)" |
3290 |
||
3291 |
^ self compareChange:changeNr showResult:true |
|
3292 |
! |
|
3293 |
||
3294 |
compareChange:changeNr showResult:doShowResult |
|
3295 |
"compare a change with current version. |
|
3296 |
Return the result of the compare (same -> true, different -> false, uncomparable -> nil). |
|
3297 |
If doShowResult is true, the outcome is shown in a dialog/diffViewer." |
|
255 | 3298 |
|
3299 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource |
|
742
2ef5e22d8983
code cleanup (unused vars eliminated)
Claus Gittinger <cg@exept.de>
parents:
724
diff
changeset
|
3300 |
parser sel oldMethod outcome showDiff d t1 t2 selector isLoaded |
2835 | 3301 |
method beep superClass thisClassSym varsHere varsInChange addedVars removedVars |
4296
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
3302 |
isSame ownerClass superClassHere superClassInChange| |
255 | 3303 |
|
3304 |
aStream := self streamForChange:changeNr. |
|
2835 | 3305 |
aStream isNil ifTrue:[^ nil]. |
255 | 3306 |
|
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
3307 |
showDiff := false. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
3308 |
|
1472 | 3309 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
6288 | 3310 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
3311 |
chunk := aStream nextChunk. |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
3312 |
] ifTrue:[ |
6288 | 3313 |
chunk := (changeChunks at:changeNr). |
3314 |
sawExcla := true. |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
3315 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
3316 |
|
2835 | 3317 |
isSame := nil. |
3318 |
||
761 | 3319 |
beep := false. |
255 | 3320 |
sawExcla ifFalse:[ |
6288 | 3321 |
outcome := 'cannot compare this change\\(i.e. this is not a method change).'. |
3322 |
||
3323 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
3324 |
do:[ |
|
3325 |
parseTree := Parser parseExpression:chunk. |
|
3326 |
]. |
|
3327 |
(parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[ |
|
3328 |
selector := parseTree selector. |
|
3329 |
||
3330 |
selector == #'removeSelector:' ifTrue:[ |
|
3331 |
thisClass := (parseTree receiver evaluate). |
|
3332 |
thisClass isBehavior ifTrue:[ |
|
3333 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
3334 |
selector := (parseTree arg1 evaluate). |
|
3335 |
(thisClass includesSelector:selector) ifTrue:[ |
|
3336 |
outcome := 'Change removes the #' , selector , ' method from ' , thisClass name. |
|
3337 |
isSame := false. |
|
3338 |
] ifFalse:[ |
|
3339 |
outcome := 'Change has no effect\\(there is no method for #' , selector , ' in ' , thisClass name , ')'. |
|
3340 |
isSame := true. |
|
3341 |
] |
|
3342 |
] ifFalse:[ |
|
3343 |
beep := true. |
|
3344 |
outcome := 'Cannot compare this change (compare requires class to be loaded).'. |
|
3345 |
isSame := nil. |
|
3346 |
] |
|
3347 |
] ifFalse:[ |
|
3348 |
outcome := 'Cannot compare this change (class not present)'. |
|
3349 |
isSame := nil. |
|
3350 |
]. |
|
3351 |
]. |
|
3352 |
selector == #'category:' ifTrue:[ |
|
3353 |
parseTree receiver isMessage ifTrue:[ |
|
3354 |
parseTree receiver selector == #compiledMethodAt: ifTrue:[ |
|
3355 |
|receiver| |
|
3356 |
receiver := parseTree receiver. |
|
3357 |
(receiver receiver evaluate isBehavior |
|
3358 |
and:[(method := receiver evaluate) isMethod]) ifTrue:[ |
|
3359 |
method category = parseTree arg1 evaluate ifTrue:[ |
|
3360 |
outcome := 'Change has no effect\\(same category)'. |
|
3361 |
isSame := true. |
|
3362 |
] ifFalse:[ |
|
3363 |
outcome := 'Category is different (''' , method category , ''' vs. ''' , parseTree arg1 evaluate , ''')'. |
|
3364 |
isSame := false. |
|
3365 |
] |
|
3366 |
] ifFalse:[ |
|
3367 |
beep := true. |
|
3368 |
outcome := 'There is no such method'. |
|
3369 |
isSame := nil. |
|
3370 |
] |
|
3371 |
] |
|
3372 |
] |
|
3373 |
]. |
|
3374 |
selector == #'comment:' ifTrue:[ |
|
3375 |
thisClass := (parseTree receiver evaluate). |
|
3376 |
thisClass isBehavior ifTrue:[ |
|
3377 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
3378 |
(thisClass comment = parseTree arg1 evaluate) ifTrue:[ |
|
3379 |
outcome := 'Change has no effect\\(same comment)'. |
|
3380 |
isSame := true. |
|
3381 |
] ifFalse:[ |
|
3382 |
outcome := 'Comment is different'. |
|
3383 |
isSame := false. |
|
3384 |
] |
|
3385 |
] ifFalse:[ |
|
3386 |
beep := true. |
|
3387 |
outcome := 'Cannot compare this change (compare requires class to be loaded).'. |
|
3388 |
isSame := nil. |
|
3389 |
] |
|
3390 |
] ifFalse:[ |
|
3391 |
outcome := 'Cannot compare this change (class not present)'. |
|
3392 |
isSame := nil. |
|
3393 |
]. |
|
3394 |
]. |
|
3395 |
||
3396 |
selector == #'instanceVariableNames:' ifTrue:[ |
|
3397 |
parseTree receiver isMessage ifTrue:[ |
|
3398 |
parseTree receiver selector == #class ifTrue:[ |
|
3399 |
thisClass := (parseTree receiver evaluate). |
|
3400 |
varsHere := thisClass instanceVariableString asCollectionOfWords. |
|
3401 |
varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords. |
|
3402 |
varsHere = varsInChange ifTrue:[ |
|
3403 |
outcome := 'Change has no effect\\(same definition)'. |
|
3404 |
isSame := true. |
|
3405 |
] ifFalse:[ |
|
3406 |
outcome := 'Class-instanceVariable definition is different'. |
|
3407 |
isSame := false. |
|
3408 |
]. |
|
3409 |
]. |
|
3410 |
] |
|
3411 |
]. |
|
3412 |
||
3413 |
(Class definitionSelectors includes:selector) |
|
3414 |
"/ selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' |
|
3415 |
ifTrue:[ |
|
3416 |
superClass := (parseTree receiver evaluate). |
|
3417 |
superClass isBehavior ifFalse:[ |
|
3418 |
outcome := 'Cannot compare this change\\(superclass not loaded).'. |
|
3419 |
isSame := nil. |
|
3420 |
] ifTrue:[ |
|
3421 |
(self checkClassIsLoaded:superClass) ifTrue:[ |
|
3422 |
thisClassSym := (parseTree arguments at:1) evaluate. |
|
3423 |
||
3424 |
(selector endsWith:':privateIn:') ifTrue:[ |
|
3425 |
ownerClass := (parseTree arguments at:5) evaluate. |
|
3426 |
ownerClass isBehavior ifTrue:[ |
|
3427 |
thisClass := ownerClass privateClassesAt:thisClassSym. |
|
3428 |
]. |
|
3429 |
] ifFalse:[ |
|
3430 |
thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil. |
|
3431 |
]. |
|
3432 |
thisClass isNil ifTrue:[ |
|
3433 |
outcome := 'Change defines the class: ' , thisClassSym allBold. |
|
3434 |
isSame := false. |
|
3435 |
] ifFalse:[ |
|
3436 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
3437 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
3438 |
isSame := nil. |
|
3439 |
] ifTrue:[ |
|
3440 |
superClassHere := thisClass superclass name. |
|
3441 |
superClassInChange := parseTree receiver name. |
|
3442 |
superClassHere ~~ superClassInChange ifTrue:[ |
|
3443 |
outcome := 'Superclass is different.'. |
|
3444 |
isSame := false. |
|
3445 |
] ifFalse:[ |
|
3446 |
varsHere := thisClass instanceVariableString asCollectionOfWords. |
|
3447 |
varsInChange := (parseTree arguments at:2) evaluate asCollectionOfWords. |
|
3448 |
varsHere = varsInChange ifTrue:[ |
|
3449 |
thisClass classVariableString asCollectionOfWords = (parseTree arguments at:3) evaluate asCollectionOfWords ifTrue:[ |
|
3450 |
((thisClass sharedPools size == 0) and:[(parseTree arguments at:4) evaluate = '']) ifTrue:[ |
|
3451 |
((selector endsWith:':category:') |
|
3452 |
and:[thisClass category ~= (parseTree arguments at:5) evaluate]) ifTrue:[ |
|
3453 |
outcome := 'Category is different'. |
|
3454 |
isSame := false. |
|
3455 |
] ifFalse:[ |
|
3456 |
outcome := 'Change has no effect\\(same definition)'. |
|
3457 |
isSame := true. |
|
3458 |
] |
|
4296
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
3459 |
"/ thisClass category = (parseTree arguments at:5) evaluate ifTrue:[ |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
3460 |
"/ outcome := 'Change has no effect\\(same definition)'. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
3461 |
"/ isSame := true. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
3462 |
"/ ] ifFalse:[ |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
3463 |
"/ outcome := 'Category is different'. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
3464 |
"/ isSame := false. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
3465 |
"/ ] |
6288 | 3466 |
] ifFalse:[ |
3467 |
outcome := 'SharedPool definition is different'. |
|
3468 |
isSame := false. |
|
3469 |
]. |
|
3470 |
] ifFalse:[ |
|
3471 |
outcome := 'ClassVariable definition is different'. |
|
3472 |
isSame := false. |
|
3473 |
] |
|
3474 |
] ifFalse:[ |
|
3475 |
outcome := 'InstanceVariable definition is different'. |
|
3476 |
isSame := false. |
|
3477 |
addedVars := varsInChange select:[:eachVar | (varsHere includes:eachVar) not]. |
|
3478 |
removedVars := varsHere select:[:eachVar | (varsInChange includes:eachVar) not]. |
|
3479 |
addedVars isEmpty ifTrue:[ |
|
3480 |
removedVars isEmpty ifTrue:[ |
|
3481 |
outcome := 'Change reorders instanceVariable(s)'. |
|
3482 |
] ifFalse:[ |
|
3483 |
removedVars := removedVars collect:[:eachVar | '''' , eachVar , '''']. |
|
3484 |
outcome := 'Change removes instanceVariable(s): ' , (removedVars asStringWith:Character space) allBold. |
|
3485 |
] |
|
3486 |
] ifFalse:[ |
|
3487 |
removedVars isEmpty ifTrue:[ |
|
3488 |
addedVars := addedVars collect:[:eachVar | '''' , eachVar , '''']. |
|
3489 |
outcome := 'Change adds instanceVariable(s): ' , (addedVars asStringWith:Character space) allBold. |
|
3490 |
]. |
|
3491 |
]. |
|
3492 |
] |
|
3493 |
] |
|
3494 |
] |
|
3495 |
] |
|
3496 |
] |
|
3497 |
] |
|
3498 |
] |
|
3499 |
] |
|
255 | 3500 |
] ifTrue:[ |
6288 | 3501 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
3502 |
do:[ |
|
3503 |
parseTree := Parser parseExpression:chunk. |
|
3504 |
]. |
|
3505 |
(parseTree notNil |
|
3506 |
and:[parseTree ~~ #Error |
|
3507 |
and:[parseTree isMessage]]) ifTrue:[ |
|
3508 |
"/ Squeak support (#methodsFor:***) |
|
3509 |
(#( |
|
3510 |
#methodsFor: |
|
3511 |
#privateMethodsFor: |
|
3512 |
#publicMethodsFor: |
|
3513 |
#ignoredMethodsFor: |
|
3514 |
#protectedMethodsFor: |
|
3515 |
||
3516 |
#methodsFor:stamp: "/ Squeak support |
|
3517 |
#methodsFor "/ Dolphin support |
|
3518 |
#methods "/ STV support |
|
3519 |
) |
|
3520 |
includes:parseTree selector) ifTrue:[ |
|
3521 |
thisClass := (parseTree receiver evaluate). |
|
3522 |
(thisClass notNil and:[thisClass isKindOf:UndefinedVariable]) ifTrue:[ |
|
3523 |
|thisName path| |
|
3524 |
||
3525 |
thisName := thisClass name. |
|
3526 |
path := thisName asCollectionOfSubstringsSeparatedByAll:'::'. |
|
3527 |
1 to:path size do:[:length | |
|
3528 |
|ownerName owner| |
|
3529 |
||
3530 |
ownerName := (path copyTo:length) asStringCollection asStringWith:'::'. |
|
3531 |
owner := Smalltalk classNamed:ownerName. |
|
3532 |
(owner notNil and:[owner isBehavior and:[owner isLoaded not]]) ifTrue:[ |
|
3533 |
self checkClassIsLoaded:owner. |
|
3534 |
]. |
|
3535 |
]. |
|
3536 |
thisClass := (parseTree receiver evaluate). |
|
3537 |
]. |
|
3538 |
||
3539 |
thisClass isBehavior ifTrue:[ |
|
3540 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
3541 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
3542 |
isSame := nil. |
|
3543 |
]. |
|
3544 |
||
3545 |
parseTree selector == #methodsFor ifTrue:[ |
|
3546 |
cat := 'Dolphin methods'. |
|
3547 |
] ifFalse:[ |
|
3548 |
parseTree selector == #methods ifTrue:[ |
|
3549 |
cat := 'STV methods'. |
|
3550 |
] ifFalse:[ |
|
3551 |
cat := parseTree arg1 evaluate. |
|
3552 |
]. |
|
3553 |
]. |
|
3554 |
newSource := aStream nextChunk. |
|
3555 |
||
3556 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
3557 |
do:[ |
|
3558 |
parser := Parser parseMethod:newSource in:thisClass. |
|
3559 |
]. |
|
3560 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
3561 |
sel := parser selector. |
|
3562 |
oldMethod := thisClass compiledMethodAt:sel. |
|
3563 |
oldMethod notNil ifTrue:[ |
|
3564 |
(oldMethod category = cat) ifFalse:[ |
|
3565 |
Transcript showCR:'category changed.'. |
|
3566 |
]. |
|
3567 |
oldSource := oldMethod source. |
|
3568 |
(oldSource = newSource) ifTrue:[ |
|
3569 |
outcome := 'Same source'. |
|
3570 |
isSame := true. |
|
3571 |
] ifFalse:[ |
|
3572 |
oldSource isNil ifTrue:[ |
|
3573 |
beep := true. |
|
3574 |
outcome := 'No source for compare.'. |
|
3575 |
isSame := true. |
|
3576 |
] ifFalse:[ |
|
3577 |
"/ |
|
3578 |
"/ compare for tabulator <-> space changes |
|
3579 |
"/ before showing diff ... |
|
3580 |
"/ |
|
3581 |
t1 := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
3582 |
t2 := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
3583 |
t1 = t2 ifTrue:[ |
|
3584 |
outcome := 'Same source'. |
|
3585 |
isSame := true. |
|
3586 |
] ifFalse:[ |
|
3587 |
outcome := 'Source changed.'. |
|
3588 |
showDiff := true. |
|
3589 |
isSame := false. |
|
3590 |
||
3591 |
"/ |
|
3592 |
"/ check if only historyLine diffs |
|
3593 |
"/ |
|
3594 |
(HistoryManager notNil |
|
3595 |
and:[HistoryManager isActive]) ifTrue:[ |
|
3596 |
(HistoryManager withoutHistoryLines:newSource) |
|
3597 |
= |
|
3598 |
(HistoryManager withoutHistoryLines:oldSource) |
|
3599 |
ifTrue:[ |
|
3600 |
outcome := 'Same source (history only)'. |
|
3601 |
isSame := true. |
|
3602 |
showDiff := false. |
|
3603 |
] |
|
3604 |
]. |
|
3605 |
] |
|
3606 |
] |
|
3607 |
] |
|
3608 |
] ifFalse:[ |
|
3609 |
isLoaded ifTrue:[ |
|
3610 |
beep := true. |
|
3611 |
outcome := 'Method does not exist.'. |
|
3612 |
isSame := nil. |
|
3613 |
] |
|
3614 |
] |
|
3615 |
] ifFalse:[ |
|
3616 |
outcome := 'Change is unparsable (parse error).'. |
|
3617 |
isSame := nil. |
|
3618 |
]. |
|
3619 |
doShowResult ifTrue:[ |
|
3620 |
(showDiff and:[oldSource notNil and:[newSource notNil]]) ifTrue:[ |
|
3621 |
d := DiffTextView |
|
3622 |
openOn:oldSource label:(resources string:'current version (in image)') |
|
3623 |
and:newSource label:(resources string:'change version'). |
|
3624 |
d label:'method differences'. |
|
3625 |
] |
|
3626 |
] |
|
3627 |
] ifFalse:[ |
|
3628 |
beep := true. |
|
3629 |
outcome := 'Class does not exist.'. |
|
3630 |
isSame := nil. |
|
3631 |
] |
|
3632 |
] ifFalse:[ |
|
3633 |
beep := true. |
|
3634 |
outcome := 'Not comparable.'. |
|
3635 |
isSame := nil. |
|
3636 |
] |
|
3637 |
] ifFalse:[ |
|
3638 |
beep := true. |
|
3639 |
outcome := 'Not comparable.'. |
|
3640 |
isSame := nil. |
|
3641 |
] |
|
255 | 3642 |
]. |
3643 |
aStream close. |
|
2835 | 3644 |
|
3645 |
doShowResult ifTrue:[ |
|
6288 | 3646 |
showDiff ifFalse:[ |
3647 |
outcome := (resources string:outcome) withCRs. |
|
3648 |
beep ifTrue:[ |
|
3649 |
self warn:outcome. |
|
3650 |
] ifFalse:[ |
|
3651 |
self information:outcome. |
|
3652 |
] |
|
553 | 3653 |
"/ Transcript showCR:outcome. |
6288 | 3654 |
]. |
255 | 3655 |
]. |
2835 | 3656 |
^ isSame. |
255 | 3657 |
|
1472 | 3658 |
"Created: / 24.11.1995 / 14:30:46 / cg" |
2606 | 3659 |
"Modified: / 13.2.2000 / 15:04:39 / cg" |
255 | 3660 |
! |
3661 |
||
1359 | 3662 |
compressForClass:aClassNameOrNil |
6288 | 3663 |
"compress the change-set; |
1359 | 3664 |
this replaces multiple method-changes by the last (i.e. the most recent) change. |
3665 |
If the class argument is nil, compress for all classes. |
|
3666 |
otherwise, only changes for that class are compressed." |
|
3667 |
||
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3668 |
self |
6288 | 3669 |
compressForClass:aClassNameOrNil selector:nil |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3670 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3671 |
"Modified: / 19.11.2001 / 22:04:12 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3672 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3673 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3674 |
compressForClass:aClassNameOrNil selector:selectorToCompressOrNil |
6288 | 3675 |
"compress the change-set; |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3676 |
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
|
3677 |
If the class argument is nil, compress for all classes. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3678 |
otherwise, only changes for that class are compressed." |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3679 |
|
6288 | 3680 |
|lbl aStream searchIndex anyMore deleteSet index |
1359 | 3681 |
str snapshotProto snapshotPrefix snapshotNameIndex fileName| |
3682 |
||
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
3683 |
aStream := changeFileName asFilename readStreamOrNil. |
1359 | 3684 |
aStream isNil ifTrue:[^ self]. |
3685 |
||
4762 | 3686 |
lbl := 'compressing'. |
1359 | 3687 |
aClassNameOrNil isNil ifTrue:[ |
6288 | 3688 |
selectorToCompressOrNil notNil ifTrue:[ |
3689 |
lbl := lbl , ' for ' , selectorToCompressOrNil. |
|
3690 |
] |
|
1359 | 3691 |
] ifFalse:[ |
6288 | 3692 |
selectorToCompressOrNil isNil ifTrue:[ |
3693 |
lbl := lbl , ' for ' , aClassNameOrNil. |
|
3694 |
] ifFalse:[ |
|
3695 |
lbl := lbl , ' for ' , aClassNameOrNil , '>>' , selectorToCompressOrNil. |
|
3696 |
] |
|
1359 | 3697 |
]. |
6288 | 3698 |
lbl := lbl , '...'. |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3699 |
self newLabel:lbl. |
1359 | 3700 |
|
3701 |
CompressSnapshotInfo == true ifTrue:[ |
|
6288 | 3702 |
" |
3703 |
get a prototype snapshot record (to be independent of |
|
3704 |
the actual format .. |
|
3705 |
" |
|
3706 |
str := WriteStream on:String new. |
|
3707 |
Class addChangeRecordForSnapshot:'foo' to:str. |
|
3708 |
snapshotProto := str contents. |
|
3709 |
snapshotPrefix := snapshotProto copyTo:10. |
|
3710 |
snapshotNameIndex := snapshotProto findString:'foo'. |
|
1359 | 3711 |
]. |
3712 |
||
3713 |
self withExecuteCursorDo:[ |
|
6288 | 3714 |
|numChanges classes selectors types excla sawExcla |
3715 |
changeNr chunk aParseTree parseTreeChunk |
|
3716 |
thisClass thisSelector codeChunk codeParser |
|
3717 |
compressThis| |
|
3718 |
||
3719 |
numChanges := self numberOfChanges. |
|
3720 |
classes := Array new:numChanges. |
|
3721 |
selectors := Array new:numChanges. |
|
3722 |
types := Array new:numChanges. |
|
3723 |
||
3724 |
"starting at the end, get the change class and change selector; |
|
3725 |
collect all in classes / selectors" |
|
3726 |
||
3727 |
changeNr := numChanges. |
|
3728 |
excla := aStream class chunkSeparator. |
|
3729 |
||
3730 |
[changeNr >= 1] whileTrue:[ |
|
3731 |
aStream position1Based:(changePositions at:changeNr). |
|
3732 |
sawExcla := aStream peekFor:excla. |
|
3733 |
chunk := aStream nextChunk. |
|
3734 |
sawExcla ifTrue:[ |
|
3735 |
"optimize a bit if multiple methods for same category arrive" |
|
3736 |
(chunk = parseTreeChunk) ifFalse:[ |
|
3737 |
aParseTree := Parser parseExpression:chunk. |
|
3738 |
parseTreeChunk := chunk |
|
3739 |
]. |
|
3740 |
(aParseTree notNil |
|
3741 |
and:[(aParseTree ~~ #Error) |
|
3742 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
3743 |
(#( |
|
3744 |
#methodsFor: |
|
3745 |
#privateMethodsFor: |
|
3746 |
#publicMethodsFor: |
|
3747 |
#ignoredMethodsFor: |
|
3748 |
#protectedMethodsFor: |
|
3749 |
#methodsFor:stamp: "/ Squeak support |
|
3750 |
#methodsFor "/ Dolphin support |
|
3751 |
#methods "/ STV support |
|
3752 |
) |
|
3753 |
includes:aParseTree selector) ifTrue:[ |
|
3754 |
thisClass := (aParseTree receiver evaluate). |
|
3755 |
codeChunk := aStream nextChunk. |
|
3756 |
codeParser := Parser |
|
3757 |
parseMethodSpecification:codeChunk |
|
3758 |
in:thisClass |
|
3759 |
ignoreErrors:true |
|
3760 |
ignoreWarnings:true. |
|
3761 |
(codeParser notNil and:[codeParser ~~ #Error]) ifTrue:[ |
|
3762 |
selectors at:changeNr put:(codeParser selector). |
|
3763 |
classes at:changeNr put:thisClass. |
|
3764 |
types at:changeNr put:#methodsFor |
|
3765 |
] |
|
3766 |
] |
|
3767 |
] |
|
3768 |
] ifFalse:[ |
|
3769 |
aParseTree := Parser parseExpression:chunk. |
|
3770 |
parseTreeChunk := chunk. |
|
3771 |
(aParseTree notNil |
|
3772 |
and:[(aParseTree ~~ #Error) |
|
3773 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
3774 |
(aParseTree selector == #removeSelector:) ifTrue:[ |
|
3775 |
selectors at:changeNr put:(aParseTree arg1 value ). |
|
3776 |
classes at:changeNr put:(aParseTree receiver evaluate). |
|
3777 |
types at:changeNr put:#removeSelector |
|
3778 |
] |
|
3779 |
] ifFalse:[ |
|
3780 |
CompressSnapshotInfo == true ifTrue:[ |
|
3781 |
(chunk startsWith:snapshotPrefix) ifTrue:[ |
|
3782 |
str := chunk readStream position1Based:snapshotNameIndex. |
|
3783 |
fileName := str upTo:(Character space). |
|
3784 |
" |
|
3785 |
kludge to allow use of match-check below |
|
3786 |
" |
|
3787 |
selectors at:changeNr put:snapshotPrefix. |
|
3788 |
classes at:changeNr put:fileName. |
|
3789 |
] |
|
3790 |
] |
|
3791 |
] |
|
3792 |
]. |
|
3793 |
changeNr := changeNr - 1 |
|
3794 |
]. |
|
3795 |
aStream close. |
|
3796 |
||
3797 |
"for all changes, look for another class/selector occurrence later |
|
3798 |
in the list and, if there is one, add change number to the delete set" |
|
3799 |
||
3800 |
deleteSet := OrderedCollection new. |
|
3801 |
changeNr := 1. |
|
3802 |
[changeNr < self numberOfChanges] whileTrue:[ |
|
3803 |
thisClass := classes at:changeNr. |
|
3804 |
||
3805 |
compressThis := false. |
|
3806 |
aClassNameOrNil isNil ifTrue:[ |
|
3807 |
compressThis := true |
|
3808 |
] ifFalse:[ |
|
3809 |
"/ skipping unloaded/unknown classes |
|
3810 |
thisClass isBehavior ifTrue:[ |
|
3811 |
compressThis := aClassNameOrNil = thisClass theNonMetaclass name. |
|
3812 |
] |
|
3813 |
]. |
|
3814 |
compressThis ifTrue:[ |
|
3815 |
thisSelector := selectors at:changeNr. |
|
3816 |
compressThis := (selectorToCompressOrNil isNil or:[thisSelector == selectorToCompressOrNil]). |
|
3817 |
compressThis ifTrue:[ |
|
3818 |
searchIndex := changeNr. |
|
3819 |
anyMore := true. |
|
3820 |
[anyMore] whileTrue:[ |
|
3821 |
searchIndex := classes indexOf:thisClass startingAt:(searchIndex + 1). |
|
3822 |
(searchIndex ~~ 0) ifTrue:[ |
|
3823 |
((selectors at:searchIndex) == thisSelector) ifTrue:[ |
|
3824 |
thisClass notNil ifTrue:[ |
|
3825 |
deleteSet add:changeNr. |
|
3826 |
anyMore := false |
|
3827 |
] |
|
3828 |
] |
|
3829 |
] ifFalse:[ |
|
3830 |
anyMore := false |
|
3831 |
] |
|
3832 |
]. |
|
3833 |
]. |
|
3834 |
]. |
|
3835 |
||
3836 |
changeNr := changeNr + 1 |
|
3837 |
]. |
|
3838 |
||
3839 |
"finally delete what has been found" |
|
3840 |
||
3841 |
(deleteSet size > 0) ifTrue:[ |
|
3842 |
changeListView setSelection:nil. |
|
3843 |
index := deleteSet size. |
|
3844 |
[index > 0] whileTrue:[ |
|
3845 |
self silentDeleteChange:(deleteSet at:index). |
|
3846 |
index := index - 1 |
|
3847 |
]. |
|
3848 |
self setChangeList. |
|
3849 |
" |
|
3850 |
scroll back a bit, if we are left way behind the list |
|
3851 |
" |
|
3852 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
|
3853 |
changeListView makeLineVisible:self numberOfChanges |
|
3854 |
]. |
|
3855 |
self clearCodeView |
|
3856 |
] |
|
1359 | 3857 |
]. |
3858 |
self newLabel:''. |
|
3859 |
||
3359
2cc7eff866e4
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
3341
diff
changeset
|
3860 |
"Modified: / 5.11.2001 / 16:34:53 / cg" |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3861 |
"Created: / 19.11.2001 / 22:03:42 / cg" |
1359 | 3862 |
! |
3863 |
||
255 | 3864 |
deleteChange:changeNr |
3865 |
"delete a change" |
|
3866 |
||
3867 |
self deleteChangesFrom:changeNr to:changeNr |
|
3868 |
! |
|
3869 |
||
3870 |
deleteChangesFrom:start to:stop |
|
3871 |
"delete a range of changes" |
|
3872 |
||
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
3873 |
changeListView setSelection:nil. |
255 | 3874 |
stop to:start by:-1 do:[:changeNr | |
6288 | 3875 |
self silentDeleteInternalChange:changeNr. |
255 | 3876 |
]. |
6255 | 3877 |
changeListView removeFromIndex:start toIndex:stop. |
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3878 |
|
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
3879 |
"/ changeListView contentsChanged. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
3880 |
"/ changeListView redrawFromLine:start. |
255 | 3881 |
|
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3882 |
"/ self setChangeList |
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3883 |
|
1648 | 3884 |
"Modified: / 18.5.1998 / 14:22:27 / cg" |
255 | 3885 |
! |
3886 |
||
202 | 3887 |
makeChangeAPatch:changeNr |
3888 |
"append change to patchfile" |
|
3889 |
||
3890 |
self appendChange:changeNr toFile:'patches' |
|
3891 |
! |
|
3892 |
||
3893 |
makeChangePermanent:changeNr |
|
3894 |
"rewrite the source file where change changeNr lies" |
|
3895 |
||
3896 |
self notify:'this is not yet implemented' |
|
3897 |
! |
|
3898 |
||
73 | 3899 |
silentDeleteChange:changeNr |
3900 |
"delete a change do not update changeListView" |
|
57 | 3901 |
|
73 | 3902 |
anyChanges := true. |
3903 |
changeChunks removeIndex:changeNr. |
|
3203 | 3904 |
changePositions size >= changeNr ifTrue:[ changePositions removeIndex:changeNr ]. |
3905 |
changeClassNames size >= changeNr ifTrue:[ changeClassNames removeIndex:changeNr ]. |
|
3906 |
changeSelectors size >= changeNr ifTrue:[ changeSelectors removeIndex:changeNr ]. |
|
3907 |
changeHeaderLines size >= changeNr ifTrue:[ changeHeaderLines removeIndex:changeNr ]. |
|
3908 |
changeTimeStamps size >= changeNr ifTrue:[ changeTimeStamps removeIndex:changeNr ]. |
|
3909 |
changeIsFollowupMethodChange size >= changeNr ifTrue:[ changeIsFollowupMethodChange removeIndex:changeNr ]. |
|
182
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
3910 |
|
0c2f9214d531
handle & display timestamp records
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
3911 |
"Modified: 18.11.1995 / 17:08:44 / cg" |
45 | 3912 |
! |
3913 |
||
202 | 3914 |
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
|
3915 |
"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
|
3916 |
Return the number of deleted changes." |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
3917 |
|
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
3918 |
|thisClassName index numDeleted| |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
3919 |
|
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
3920 |
numDeleted := 0. |
202 | 3921 |
index := stop. |
3922 |
[index >= start] whileTrue:[ |
|
6288 | 3923 |
thisClassName := self classNameOfChange:index. |
3924 |
thisClassName = aClassName ifTrue:[ |
|
3925 |
self silentDeleteChange:index. |
|
3926 |
numDeleted := numDeleted + 1. |
|
3927 |
]. |
|
3928 |
index := index - 1 |
|
1428
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
3929 |
]. |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
3930 |
^ numDeleted |
51 | 3931 |
|
45 | 3932 |
! |
3933 |
||
3607 | 3934 |
silentDeleteChangesFor:aClassName selector:selector from:start to:stop |
3935 |
"delete changes for given class/selector in a range. |
|
3936 |
Return the number of deleted changes." |
|
3937 |
||
3938 |
|thisClassName index numDeleted| |
|
3939 |
||
3940 |
numDeleted := 0. |
|
3941 |
index := stop. |
|
3942 |
[index >= start] whileTrue:[ |
|
6288 | 3943 |
thisClassName := self classNameOfChange:index. |
3944 |
thisClassName = aClassName ifTrue:[ |
|
3945 |
(self selectorOfMethodChange:index) == selector ifTrue:[ |
|
3946 |
self silentDeleteChange:index. |
|
3947 |
numDeleted := numDeleted + 1. |
|
3948 |
] |
|
3949 |
]. |
|
3950 |
index := index - 1 |
|
3607 | 3951 |
]. |
3952 |
^ numDeleted |
|
3953 |
! |
|
3954 |
||
2511 | 3955 |
silentDeleteChangesForClassAndPrivateClasses:aClassName from:start to:stop |
3956 |
"delete changes for a given class and its private classes in a range. |
|
3957 |
Return the number of deleted changes." |
|
3958 |
||
3959 |
|thisClassName index numDeleted| |
|
3960 |
||
3961 |
numDeleted := 0. |
|
3962 |
index := stop. |
|
3963 |
[index >= start] whileTrue:[ |
|
6288 | 3964 |
thisClassName := self ownerClassNameOfChange:index. |
3965 |
thisClassName = aClassName ifTrue:[ |
|
3966 |
self silentDeleteChange:index. |
|
3967 |
numDeleted := numDeleted + 1. |
|
3968 |
]. |
|
3969 |
index := index - 1 |
|
2511 | 3970 |
]. |
3971 |
^ numDeleted |
|
3972 |
||
3973 |
! |
|
3974 |
||
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
3975 |
silentDeleteInternalChange:changeNr |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
3976 |
"delete a change do not update changeListView" |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
3977 |
|
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
3978 |
anyChanges := true. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
3979 |
changeChunks removeIndex:changeNr. |
1473 | 3980 |
changePositions size >= changeNr ifTrue:[changePositions removeIndex:changeNr]. |
3981 |
changeClassNames size >= changeNr ifTrue:[changeClassNames removeIndex:changeNr]. |
|
3203 | 3982 |
changeSelectors size >= changeNr ifTrue:[ changeSelectors removeIndex:changeNr ]. |
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
3983 |
changeTimeStamps size >= changeNr ifTrue:[changeTimeStamps removeIndex:changeNr]. |
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
3984 |
changeIsFollowupMethodChange size >= changeNr ifTrue:[changeIsFollowupMethodChange removeIndex:changeNr]. |
1473 | 3985 |
|
3986 |
"Created: / 7.3.1997 / 16:28:32 / cg" |
|
3987 |
"Modified: / 7.2.1998 / 19:59:11 / cg" |
|
1496
978b3c3565c9
#silentDeleteInternalChange: copy-paste error
Stefan Vogel <sv@exept.de>
parents:
1473
diff
changeset
|
3988 |
"Modified: / 26.2.1998 / 18:20:48 / stefan" |
4487 | 3989 |
! |
3990 |
||
3991 |
updateDiffView |
|
3992 |
self withSelectedChangesDo:[:changeNr | |
|
6288 | 3993 |
self updateDiffViewFor:changeNr. |
3994 |
^ self. |
|
4487 | 3995 |
]. |
3996 |
||
3997 |
diffView text1:'' text2:'' |
|
3998 |
! |
|
3999 |
||
4000 |
updateDiffViewFor:changeNr |
|
4001 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource |
|
4857 | 4002 |
parser sel showDiff selector oldMethod| |
4487 | 4003 |
|
4004 |
aStream := self streamForChange:changeNr. |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
4005 |
aStream isNil ifTrue:[ |
6317 | 4006 |
^ self |
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
4007 |
]. |
4487 | 4008 |
|
4009 |
showDiff := false. |
|
4010 |
||
4011 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
|
6317 | 4012 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
4013 |
chunk := aStream nextChunk. |
|
4487 | 4014 |
] ifTrue:[ |
6317 | 4015 |
chunk := (changeChunks at:changeNr). |
4016 |
sawExcla := true. |
|
4487 | 4017 |
]. |
4018 |
||
4857 | 4019 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
4020 |
do:[ |
|
6317 | 4021 |
parseTree := Parser parseExpression:chunk. |
4022 |
(parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[ |
|
4023 |
selector := parseTree selector. |
|
4024 |
] |
|
4857 | 4025 |
]. |
4026 |
||
4027 |
selector isNil ifTrue:[ |
|
6317 | 4028 |
newSource := chunk. |
4029 |
oldSource := 'Not comparable.'. |
|
4857 | 4030 |
] ifFalse:[ |
6317 | 4031 |
sawExcla ifFalse:[ |
4032 |
"/ not a method-change |
|
4033 |
newSource := chunk. |
|
4034 |
oldSource := self oldSourceForParseTree:parseTree. |
|
4035 |
] ifTrue:[ |
|
4036 |
"/ a method-change |
|
4037 |
||
4038 |
(#( |
|
4039 |
#methodsFor: |
|
4040 |
#privateMethodsFor: |
|
4041 |
#publicMethodsFor: |
|
4042 |
#ignoredMethodsFor: |
|
4043 |
#protectedMethodsFor: |
|
4044 |
||
4045 |
#methodsFor:stamp: "/ Squeak support |
|
4046 |
#methodsFor "/ Dolphin support |
|
4047 |
#methods "/ STV support |
|
4048 |
) |
|
4049 |
includes:selector) ifTrue:[ |
|
4050 |
newSource := aStream nextChunk. |
|
4051 |
||
4052 |
thisClass := (parseTree receiver evaluate). |
|
4053 |
thisClass isBehavior ifTrue:[ |
|
4054 |
(thisClass isLoaded |
|
4055 |
or:[ autoloadAsRequired value |
|
4056 |
and:[self checkClassIsLoaded:thisClass]]) ifFalse:[ |
|
4057 |
oldSource := 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
4058 |
] ifTrue:[ |
|
4059 |
selector == #methodsFor ifTrue:[ |
|
4060 |
cat := 'Dolphin methods'. |
|
4061 |
] ifFalse:[ |
|
4062 |
selector == #methods ifTrue:[ |
|
4063 |
cat := 'STV methods'. |
|
4064 |
] ifFalse:[ |
|
4065 |
cat := parseTree arg1 evaluate. |
|
4066 |
]. |
|
4067 |
]. |
|
4068 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
4069 |
do:[ |
|
4070 |
Error handle:[:ex | |
|
4071 |
] do:[ |
|
4072 |
parser := Parser parseMethod:newSource in:thisClass. |
|
4073 |
] |
|
4074 |
]. |
|
4075 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
4076 |
sel := parser selector. |
|
4077 |
oldMethod := thisClass compiledMethodAt:sel. |
|
4078 |
oldMethod notNil ifTrue:[ |
|
4079 |
(oldMethod category = cat) ifFalse:[ |
|
4080 |
Transcript showCR:'category changed.'. |
|
4081 |
]. |
|
4082 |
oldSource := oldMethod source. |
|
4083 |
(oldSource = newSource) ifFalse:[ |
|
4084 |
oldSource isNil ifTrue:[ |
|
4085 |
oldSource := 'No source for compare.'. |
|
4086 |
] ifFalse:[ |
|
4087 |
"/ |
|
4088 |
"/ compare for tabulator <-> space changes |
|
4089 |
"/ before showing diff ... |
|
4090 |
"/ |
|
4091 |
oldSource := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
4092 |
newSource := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
4093 |
oldSource = newSource ifFalse:[ |
|
4094 |
"/ |
|
4095 |
"/ check if only historyLine diffs |
|
4096 |
"/ |
|
4097 |
(HistoryManager notNil |
|
4098 |
and:[HistoryManager isActive]) ifTrue:[ |
|
4099 |
oldSource := oldSource asStringCollection asString. |
|
4100 |
newSource := newSource asStringCollection asString. |
|
4101 |
(HistoryManager withoutHistoryLines:oldSource) |
|
4102 |
= |
|
4103 |
(HistoryManager withoutHistoryLines:newSource) |
|
4104 |
ifTrue:[ |
|
4105 |
oldSource := (HistoryManager withoutHistoryLines:oldSource). |
|
4106 |
newSource := (HistoryManager withoutHistoryLines:newSource). |
|
4107 |
] |
|
4108 |
]. |
|
4109 |
] |
|
4110 |
] |
|
4111 |
] |
|
4112 |
] ifFalse:[ |
|
4113 |
oldSource := 'Method does not exist.'. |
|
4114 |
] |
|
4115 |
] ifFalse:[ |
|
4116 |
oldSource := 'Change is unparsable (parse error).'. |
|
4117 |
]. |
|
4118 |
]. |
|
4119 |
] ifFalse:[ |
|
4120 |
oldSource := 'Class does not exist.'. |
|
4121 |
] |
|
4122 |
] ifFalse:[ |
|
4123 |
newSource := chunk. "/ aStream contents. |
|
4124 |
oldSource := 'Not comparable.'. |
|
4125 |
] |
|
4126 |
] |
|
4487 | 4127 |
]. |
4128 |
aStream close. |
|
4129 |
||
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
4130 |
oldSource := oldSource ? ''. |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
4131 |
newSource := newSource ? ''. |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
4132 |
(oldSource = newSource |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
4133 |
or:[ oldSource asStringCollection withTabsExpanded = newSource asStringCollection withTabsExpanded]) ifTrue:[ |
6317 | 4134 |
self makeDiffViewInvisible |
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
4135 |
] ifFalse:[ |
6317 | 4136 |
self makeDiffViewVisible. |
4137 |
diffView text1:oldSource text2:newSource. |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
4138 |
]. |
4487 | 4139 |
|
4140 |
"Created: / 24.11.1995 / 14:30:46 / cg" |
|
4699
393443e15c9b
compare fix if historyManager is enabled.
Claus Gittinger <cg@exept.de>
parents:
4632
diff
changeset
|
4141 |
"Modified: / 21.3.2003 / 14:26:58 / cg" |
202 | 4142 |
! ! |
0 | 4143 |
|
202 | 4144 |
!ChangesBrowser methodsFor:'termination'! |
51 | 4145 |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
4146 |
askIfChangesAreToBeWrittenBack |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
4147 |
|action again| |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
4148 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
4149 |
anyChanges ifFalse:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
4150 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
4151 |
again := true. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
4152 |
[again] whileTrue:[ |
6288 | 4153 |
action := OptionBox |
4154 |
request:(resources at:'The modified changelist has not been written back to the change file.\\Write change file before closing ?') withCRs |
|
4155 |
label:'ChangesBrowser' |
|
4156 |
image:(WarningBox iconBitmap) |
|
4157 |
buttonLabels:(resources array:#('Cancel' 'Don''t Write' 'Write')) |
|
4158 |
values:#(#abort #ignore #save) |
|
4159 |
default:#save |
|
4160 |
onCancel:#abort. |
|
4161 |
||
4162 |
again := false. |
|
4163 |
action == #abort ifTrue:[AbortSignal raise. ^ self]. |
|
4164 |
action == #save ifTrue:[ |
|
4165 |
again := self writeBackChanges not |
|
4166 |
]. |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
4167 |
]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
4168 |
! |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
4169 |
|
1787 | 4170 |
closeRequest |
4171 |
"window manager wants us to go away" |
|
4172 |
||
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
4173 |
self askIfChangesAreToBeWrittenBack. |
1787 | 4174 |
super closeRequest |
4175 |
! |
|
4176 |
||
202 | 4177 |
saveAndTerminate |
4178 |
"update the changes file and quit. |
|
4179 |
Dont depend on this being sent, not all window managers |
|
4180 |
send it; instead, they simply destroy the view." |
|
28 | 4181 |
|
202 | 4182 |
anyChanges ifTrue:[ |
6288 | 4183 |
self writeBackChanges. |
0 | 4184 |
]. |
1787 | 4185 |
super saveAndTerminate |
4186 |
||
4187 |
"Modified: / 3.8.1998 / 19:54:00 / cg" |
|
0 | 4188 |
! ! |
4189 |
||
73 | 4190 |
!ChangesBrowser methodsFor:'user interaction'! |
51 | 4191 |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4192 |
askForSearch:msg initialAnswer:initial thenSearchUsing:searchBlock2 onCancel:cancelBlock |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4193 |
|searchString directionHolder searchBlock| |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4194 |
|
6288 | 4195 |
searchString := self |
4196 |
askForSearchString:msg |
|
4197 |
initialAnswer:initial |
|
4198 |
directionInto:(directionHolder := ValueHolder new). |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4199 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4200 |
searchString isNil ifTrue:[ |
6288 | 4201 |
^ cancelBlock value |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4202 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4203 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4204 |
searchBlock := [:changeNr | searchBlock2 value:searchString value:changeNr]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4205 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4206 |
directionHolder value == #backward ifTrue:[ |
6288 | 4207 |
changeNrShown isNil ifTrue:[ |
4208 |
changeNrShown := self numberOfChanges. |
|
4209 |
]. |
|
4210 |
self findPreviousForWhich:searchBlock |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4211 |
] ifFalse:[ |
6288 | 4212 |
changeNrShown isNil ifTrue:[ |
4213 |
changeNrShown := 0. |
|
4214 |
]. |
|
4215 |
self findNextForWhich:searchBlock |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4216 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4217 |
! |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4218 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4219 |
askForSearchString:msg initialAnswer:initial directionInto:aValueHolder |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4220 |
"common code to open a search box" |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4221 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4222 |
|searchString direction| |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4223 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4224 |
direction := #forward. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4225 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4226 |
Dialog aboutToOpenBoxNotificationSignal handle:[:ex | |
6288 | 4227 |
|box nextButton prevButton| |
4228 |
||
4229 |
box := ex parameter. |
|
4230 |
nextButton := box okButton. |
|
4231 |
prevButton := Button label:(resources string:'Previous'). |
|
4232 |
prevButton action:[direction := #backward. box okPressed.]. |
|
4233 |
box addButton:prevButton after:nextButton. |
|
4234 |
nextButton label:(resources string:'Next'). |
|
4235 |
ex proceed. |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4236 |
] do:[ |
6288 | 4237 |
searchString := Dialog |
4238 |
request:msg |
|
4239 |
initialAnswer:initial |
|
4240 |
onCancel:nil. |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4241 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4242 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4243 |
searchString isNil ifTrue:[ |
6288 | 4244 |
^ nil |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4245 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4246 |
aValueHolder value:direction. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4247 |
^ searchString |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4248 |
! |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
4249 |
|
221 | 4250 |
autoUpdate:aBoolean |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4251 |
"enabled/disable automatic update from the change-file (for monitoring)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4252 |
|
6216 | 4253 |
autoUpdate value:aBoolean |
221 | 4254 |
|
4255 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
4256 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
4257 |
! |
|
4258 |
||
6216 | 4259 |
autoloadAsRequired:aBoolean |
4260 |
"enabled/disable automatic load of unloaded classes" |
|
4261 |
||
4262 |
autoloadAsRequired value:aBoolean |
|
4263 |
! |
|
4264 |
||
3211 | 4265 |
changeSelection:lineNrCollection |
0 | 4266 |
"show a change in the codeView" |
4267 |
||
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
4268 |
|chunk lineNr| |
3211 | 4269 |
|
4270 |
lineNrCollection isInteger ifTrue:[ |
|
6288 | 4271 |
lineNr := lineNrCollection |
3211 | 4272 |
] ifFalse:[ |
6288 | 4273 |
changeListView multipleSelectOk ifTrue:[ |
4274 |
lineNrCollection size == 1 ifTrue:[ |
|
4275 |
lineNr := lineNrCollection first. |
|
4276 |
] |
|
4277 |
] ifFalse:[ |
|
4278 |
lineNr := lineNrCollection |
|
4279 |
]. |
|
3211 | 4280 |
]. |
0 | 4281 |
|
2293 | 4282 |
lineNr isNil ifTrue:[ |
6288 | 4283 |
codeView contents:nil. |
4284 |
codeView initializeDoITAction. |
|
4285 |
changeNrShown := nil. |
|
4286 |
^ self |
|
2293 | 4287 |
]. |
4288 |
||
3211 | 4289 |
"/ display the changes code |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
4290 |
chunk := self sourceOfChange:lineNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
4291 |
chunk isNil ifTrue:[ |
6288 | 4292 |
codeView initializeDoITAction. |
4293 |
^ self |
|
2044 | 4294 |
]. |
0 | 4295 |
codeView contents:chunk. |
13 | 4296 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
2043
66b5276b2760
set self in changesBrowsers doIt.
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
4297 |
codeView doItAction:[:theCode | |
6288 | 4298 |
|clsName cls| |
4299 |
||
4300 |
clsName := self classNameOfChange:lineNr. |
|
4301 |
clsName notNil ifTrue:[ |
|
4302 |
clsName := clsName asSymbolIfInterned. |
|
4303 |
clsName notNil ifTrue:[ |
|
4304 |
cls := Smalltalk at:clsName ifAbsent:nil. |
|
4305 |
] |
|
4306 |
]. |
|
4307 |
Compiler |
|
4308 |
evaluate:theCode |
|
4309 |
in:nil |
|
4310 |
receiver:cls |
|
4311 |
notifying:self |
|
4312 |
logged:true |
|
4313 |
ifFail:nil |
|
2043
66b5276b2760
set self in changesBrowsers doIt.
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
4314 |
]. |
15 | 4315 |
changeNrShown := lineNr. |
0 | 4316 |
|
4487 | 4317 |
self showingDiffs value ifTrue:[ |
6288 | 4318 |
AbortOperationRequest catch:[ |
4319 |
self updateDiffViewFor:changeNrShown. |
|
4320 |
] |
|
4487 | 4321 |
]. |
4322 |
||
2044 | 4323 |
"Modified: / 28.2.1999 / 15:26:46 / cg" |
51 | 4324 |
! |
4325 |
||
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4326 |
classOfChange:changeNr |
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4327 |
^ self |
6288 | 4328 |
classOfChange:changeNr |
4329 |
ifAbsent:[:className | |
|
4330 |
|msg| |
|
4331 |
||
4332 |
className isNil ifTrue:[ |
|
4333 |
msg := 'Could not extract classname from change'. |
|
4334 |
] ifFalse:[ |
|
4335 |
msg := 'Class not found: ''' , className , ''''. |
|
4336 |
]. |
|
4337 |
self warn:msg. |
|
4338 |
nil |
|
4339 |
] |
|
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4340 |
! |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4341 |
|
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4342 |
classOfChange:changeNr ifAbsent:exceptionBlock |
4271 | 4343 |
|className cls isMeta ownerClassName ownerClass| |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4344 |
|
5014 | 4345 |
className := self realClassNameOfChange:changeNr. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4346 |
className isNil ifTrue:[ |
6288 | 4347 |
^ exceptionBlock value:nil |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4348 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4349 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4350 |
isMeta := false. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4351 |
(className endsWith:' class') ifTrue:[ |
6288 | 4352 |
className := className copyWithoutLast:6. |
4353 |
isMeta := true. |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4354 |
]. |
3472 | 4355 |
|
4356 |
(cls := (self nameSpaceForApply) classNamed:className) isNil ifTrue:[ |
|
6288 | 4357 |
cls := Smalltalk classNamed:className |
3472 | 4358 |
]. |
4359 |
||
4360 |
cls isNil ifTrue:[ |
|
6288 | 4361 |
(className includes:$:) ifTrue:[ |
4362 |
ownerClassName := className copyTo:(className lastIndexOf:$:)-1. |
|
4363 |
(ownerClassName endsWith:$:) ifTrue:[ ownerClassName := ownerClassName copyWithoutLast:1 ]. |
|
4364 |
ownerClass := Smalltalk classNamed:ownerClassName. |
|
4365 |
ownerClass isBehavior ifTrue:[ |
|
4366 |
ownerClass isLoaded ifFalse:[ |
|
4271 | 4367 |
"/ self halt. |
6288 | 4368 |
]. |
4369 |
]. |
|
4370 |
]. |
|
4371 |
^ exceptionBlock value:className |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4372 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4373 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4374 |
isMeta ifTrue:[ |
6288 | 4375 |
cls := cls class |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4376 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4377 |
^ cls |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4378 |
! |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4379 |
|
202 | 4380 |
doApply |
4381 |
"user wants a change to be applied" |
|
45 | 4382 |
|
3211 | 4383 |
self withSelectedChangesDo:[:changeNr | |
6288 | 4384 |
skipSignal := nil. |
4385 |
(self applyChange:changeNr) ifFalse:[ |
|
4386 |
^ self "/ cancel |
|
4387 |
]. |
|
4388 |
self autoSelect:(changeNr + 1) |
|
202 | 4389 |
] |
45 | 4390 |
! |
4391 |
||
202 | 4392 |
doApplyAll |
4393 |
"user wants all changes to be applied" |
|
37 | 4394 |
|
294 | 4395 |
self withExecuteCursorDo:[ |
6288 | 4396 |
|lastNr "{ Class: SmallInteger }" | |
4397 |
||
4398 |
self clearCodeView. |
|
4399 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
4400 |
lastNr := self numberOfChanges. |
|
4401 |
1 to:lastNr do:[:changeNr | |
|
4402 |
changeListView setSelection:changeNr. |
|
4403 |
self applyChange:changeNr |
|
4404 |
]. |
|
4405 |
self autoSelectLast |
|
202 | 4406 |
] |
294 | 4407 |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
4408 |
"Modified: 21.1.1997 / 22:26:30 / cg" |
37 | 4409 |
! |
4410 |
||
3668 | 4411 |
doApplyClassFromBeginning |
4412 |
"user wants all changes for this class from 1 to changeNr to be applied" |
|
4413 |
||
4414 |
self withSingleSelectedChangeDo:[:changeNr | |
|
6288 | 4415 |
|thisClassName classNameToApply lastChange |
4416 |
lastNr "{ Class: SmallInteger }" | |
|
4417 |
||
4418 |
classNameToApply := self classNameOfChange:changeNr. |
|
4419 |
classNameToApply notNil ifTrue:[ |
|
4420 |
self clearCodeView. |
|
4421 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
4422 |
||
4423 |
lastNr := self numberOfChanges. |
|
4424 |
1 to:changeNr do:[:changeNr | |
|
4425 |
thisClassName := self classNameOfChange:changeNr. |
|
4426 |
thisClassName = classNameToApply ifTrue:[ |
|
4427 |
changeListView setSelection:changeNr. |
|
4428 |
self applyChange:changeNr. |
|
4429 |
lastChange := changeNr |
|
4430 |
]. |
|
4431 |
]. |
|
4432 |
self autoSelect:changeNr+1. |
|
4433 |
] |
|
3668 | 4434 |
] |
4435 |
||
4436 |
"Modified: 21.1.1997 / 22:26:04 / cg" |
|
4437 |
! |
|
4438 |
||
202 | 4439 |
doApplyClassRest |
4440 |
"user wants all changes for this class from changeNr to be applied" |
|
4441 |
||
3668 | 4442 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4443 |
|thisClassName classNameToApply lastChange |
4444 |
lastNr "{ Class: SmallInteger }" | |
|
4445 |
||
4446 |
classNameToApply := self classNameOfChange:changeNr. |
|
4447 |
classNameToApply notNil ifTrue:[ |
|
4448 |
self clearCodeView. |
|
4449 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
4450 |
||
4451 |
lastNr := self numberOfChanges. |
|
4452 |
changeNr to:lastNr do:[:changeNr | |
|
4453 |
thisClassName := self classNameOfChange:changeNr. |
|
4454 |
thisClassName = classNameToApply ifTrue:[ |
|
4455 |
changeListView setSelection:changeNr. |
|
4456 |
self applyChange:changeNr. |
|
4457 |
lastChange := changeNr |
|
4458 |
]. |
|
4459 |
]. |
|
4460 |
self autoSelect:lastChange. |
|
4461 |
] |
|
202 | 4462 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
4463 |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
4464 |
"Modified: 21.1.1997 / 22:26:04 / cg" |
37 | 4465 |
! |
4466 |
||
3668 | 4467 |
doApplyFromBeginning |
4468 |
"user wants all changes from 1 to changeNr to be applied" |
|
4469 |
||
4470 |
self withSingleSelectedChangeDo:[:changeNr | |
|
6288 | 4471 |
|lastNr "{ Class: SmallInteger }" | |
4472 |
||
4473 |
self clearCodeView. |
|
4474 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
4475 |
||
4476 |
1 to:changeNr do:[:changeNr | |
|
4477 |
changeListView setSelection:changeNr. |
|
4478 |
self applyChange:changeNr |
|
4479 |
]. |
|
4480 |
self autoSelect:changeNr+1. |
|
3668 | 4481 |
] |
4482 |
! |
|
4483 |
||
202 | 4484 |
doApplyRest |
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4485 |
"apply all changes from changeNr to the end" |
28 | 4486 |
|
3668 | 4487 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4488 |
|lastNr "{ Class: SmallInteger }" | |
4489 |
||
4490 |
self clearCodeView. |
|
4491 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
4492 |
||
4493 |
lastNr := self numberOfChanges. |
|
4494 |
changeNr to:lastNr do:[:changeNr | |
|
4495 |
changeListView setSelection:changeNr. |
|
4496 |
self applyChange:changeNr |
|
4497 |
]. |
|
4498 |
self autoSelect:self numberOfChanges. |
|
37 | 4499 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
4500 |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
4501 |
"Modified: 21.1.1997 / 22:25:29 / cg" |
37 | 4502 |
! |
4503 |
||
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4504 |
doApplyToConflictOrEnd |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4505 |
"apply all changes from changeNr to either a conflict (i.e. method exists) |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4506 |
or the end." |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4507 |
|
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4508 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4509 |
|lastNr "{ Class: SmallInteger }"| |
4510 |
||
4511 |
self clearCodeView. |
|
4512 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
4513 |
||
4514 |
lastNr := self numberOfChanges. |
|
4515 |
changeNr to:lastNr do:[:changeNr | |
|
4516 |
| cls sel | |
|
4517 |
changeListView setSelection:changeNr. |
|
4518 |
||
4519 |
((cls := self classOfChange:changeNr ifAbsent:[:className| nil]) notNil |
|
4520 |
and:[(sel := self selectorOfMethodChange:changeNr) notNil]) |
|
4521 |
ifTrue:[ |
|
4522 |
(cls implements:sel) ifTrue:[ |
|
4523 |
self autoSelect:changeNr. |
|
4524 |
^ self |
|
4525 |
]. |
|
4526 |
]. |
|
4527 |
self applyChange:changeNr |
|
4528 |
]. |
|
4529 |
self autoSelect:self numberOfChanges. |
|
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4530 |
] |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4531 |
! |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
4532 |
|
45 | 4533 |
doBrowse |
4534 |
"user wants a browser on the class of a change" |
|
4535 |
||
3668 | 4536 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4537 |
|cls| |
4538 |
||
4539 |
cls := self classOfChange:changeNr. |
|
4540 |
cls notNil ifTrue:[ |
|
4541 |
UserPreferences systemBrowserClass |
|
4542 |
openInClass:cls |
|
4543 |
selector:(self selectorOfMethodChange:changeNr) |
|
4544 |
] |
|
37 | 4545 |
] |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4546 |
! |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4547 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4548 |
doBrowseImplementors |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4549 |
"open an implementors-browser" |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4550 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4551 |
|changeNr initial selector| |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4552 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4553 |
(changeNr := self theSingleSelection) notNil ifTrue:[ |
6288 | 4554 |
initial := self selectorOfMethodChange:changeNr. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4555 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4556 |
|
6288 | 4557 |
selector := Dialog |
4558 |
request:'Selector to browse implementors of:' |
|
4559 |
initialAnswer:(initial ? ''). |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4560 |
selector size ~~ 0 ifTrue:[ |
6288 | 4561 |
UserPreferences systemBrowserClass |
4562 |
browseImplementorsMatching:selector. |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4563 |
] |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4564 |
! |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4565 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4566 |
doBrowseSenders |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4567 |
"user wants a browser on the class of a change" |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4568 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4569 |
|changeNr initial selector| |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4570 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4571 |
(changeNr := self theSingleSelection) notNil ifTrue:[ |
6288 | 4572 |
initial := self selectorOfMethodChange:changeNr. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4573 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4574 |
|
6288 | 4575 |
selector := Dialog |
4576 |
request:'Selector to browse senders of:' |
|
4577 |
initialAnswer:(initial ? ''). |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4578 |
selector size ~~ 0 ifTrue:[ |
6288 | 4579 |
UserPreferences systemBrowserClass |
4580 |
browseAllCallsOn:selector asSymbol. |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
4581 |
] |
37 | 4582 |
! |
4583 |
||
2541
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4584 |
doCheckinAndDeleteClassAll |
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4585 |
"first checkin the selected changes class then delete all changes |
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4586 |
for it." |
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4587 |
|
4917
9f2476c53513
single logMessage query when checking in multiple classes
Claus Gittinger <cg@exept.de>
parents:
4897
diff
changeset
|
4588 |
|classes answer logTitle logMessage| |
3442 | 4589 |
|
4590 |
"/ self theSingleSelection isNil ifTrue:[ |
|
4591 |
"/ ^ self information:'Only possible if a single change is selected.'. |
|
4592 |
"/ ]. |
|
4593 |
||
4594 |
self withExecuteCursorDo:[ |
|
6288 | 4595 |
classes := IdentitySet new. |
4596 |
||
4597 |
self withSelectedChangesDo:[:changeNr | |
|
4598 |
| className class | |
|
4599 |
||
4600 |
className := self classNameOfChange:changeNr. |
|
4601 |
className notNil ifTrue:[ |
|
4602 |
class := Smalltalk classNamed:className. |
|
4603 |
class isNil ifTrue:[ |
|
4604 |
self error:'oops - no class: ', className mayProceed:true. |
|
4605 |
]. |
|
4606 |
class notNil ifTrue:[ |
|
4607 |
class := class theNonMetaclass. |
|
4608 |
(classes includes:class) ifFalse:[ |
|
4609 |
class isPrivate ifTrue:[ |
|
4610 |
(classes includes:class owningClass) ifFalse:[ |
|
4611 |
answer := self confirmWithCancel:('This is a private class.\\CheckIn the owner ''%1'' and all of its private classes ?' |
|
4612 |
bindWith:class owningClass name allBold) withCRs. |
|
4613 |
answer isNil ifTrue:[^ self]. |
|
4614 |
answer ifTrue:[ |
|
4615 |
classes add:class owningClass |
|
4616 |
] |
|
4617 |
] |
|
4618 |
] ifFalse:[ |
|
4619 |
classes add:class |
|
4620 |
]. |
|
4621 |
] |
|
4622 |
] |
|
4623 |
] |
|
4624 |
]. |
|
4625 |
||
4626 |
classes size == 1 ifTrue:[ |
|
4627 |
logTitle := classes first name. |
|
4628 |
] ifFalse:[ |
|
4629 |
logTitle := '%1 classes' bindWith:classes size. |
|
4630 |
]. |
|
4631 |
logMessage := SourceCodeManagerUtilities |
|
4632 |
getLogMessageFor:logTitle |
|
4633 |
initialAnswer:nil. |
|
4634 |
||
4635 |
changeListView setSelection:nil. |
|
4636 |
classes do:[:eachClass | |
|
4637 |
(SourceCodeManagerUtilities checkinClass:eachClass withLog:logMessage) |
|
4638 |
ifTrue:[ |
|
4639 |
self silentDeleteChangesForClassAndPrivateClasses:eachClass name |
|
4640 |
from:1 to:(self numberOfChanges). |
|
4641 |
] |
|
4642 |
]. |
|
4643 |
self setChangeList. |
|
2541
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4644 |
] |
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4645 |
|
3442 | 4646 |
"Modified: / 6.9.1995 / 17:11:16 / claus" |
4647 |
"Modified: / 17.11.2001 / 14:21:13 / cg" |
|
2541
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4648 |
! |
f8b6ae881564
experimental: checkIn & deleteForClass added.
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
4649 |
|
73 | 4650 |
doCompare |
4651 |
"compare change with current system version |
|
4652 |
- give a note in transcript" |
|
4653 |
||
3668 | 4654 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4655 |
self withExecuteCursorDo:[ |
4656 |
self compareChange:changeNr |
|
4657 |
]. |
|
4658 |
self newLabel:'' |
|
3211 | 4659 |
]. |
4660 |
||
394 | 4661 |
"Modified: 24.2.1996 / 19:37:19 / cg" |
73 | 4662 |
! |
4663 |
||
2835 | 4664 |
doCompareAndCompress |
4665 |
"remove all changes, which are equivalent to the current image version" |
|
4666 |
||
4667 |
|toDelete| |
|
4668 |
||
4669 |
toDelete := OrderedCollection new. |
|
4670 |
self withExecuteCursorDo:[ |
|
6288 | 4671 |
1 to:self numberOfChanges do:[:changeNr | |
4672 |
[ |
|
4673 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
|
4674 |
toDelete add:changeNr |
|
4675 |
] |
|
4676 |
] on:AbortOperationRequest do:[:ex| "ignore unloaded clases" ] |
|
4677 |
]. |
|
2835 | 4678 |
]. |
4679 |
||
4680 |
toDelete reverseDo:[:changeNr | |
|
6288 | 4681 |
self silentDeleteChange:changeNr. |
2835 | 4682 |
]. |
4683 |
self setChangeList. |
|
4684 |
" |
|
4685 |
scroll back a bit, if we are left way behind the list |
|
4686 |
" |
|
4687 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
|
6288 | 4688 |
changeListView makeLineVisible:self numberOfChanges |
2835 | 4689 |
]. |
4690 |
self clearCodeView. |
|
4691 |
||
4692 |
self newLabel:'' |
|
4693 |
! |
|
4694 |
||
45 | 4695 |
doCompress |
6288 | 4696 |
"compress the change-set; this replaces multiple method-changes by the last |
45 | 4697 |
(i.e. the most recent) change" |
4698 |
||
1359 | 4699 |
self compressForClass:nil |
4700 |
||
4701 |
"Modified: / 29.10.1997 / 01:03:26 / cg" |
|
4702 |
! |
|
4703 |
||
4704 |
doCompressClass |
|
4705 |
"compress changes for the selected class. |
|
4706 |
this replaces multiple method-changes by the last (i.e. the most recent) change." |
|
4707 |
||
3211 | 4708 |
self theSingleSelection isNil ifTrue:[ |
6288 | 4709 |
^ self information:'Only possible if a single change is selected.'. |
3211 | 4710 |
]. |
4711 |
||
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4712 |
self selectedClassNames do:[:classNameToCompress | |
6288 | 4713 |
self compressForClass:classNameToCompress. |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4714 |
] |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4715 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4716 |
"Created: / 29.10.1997 / 01:05:16 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4717 |
"Modified: / 19.11.2001 / 21:55:17 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4718 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4719 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4720 |
doCompressSelector |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4721 |
"compress changes for the selected class & selector. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4722 |
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
|
4723 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4724 |
|classSelectorPairs| |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4725 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4726 |
self theSingleSelection isNil ifTrue:[ |
6288 | 4727 |
^ self information:'Only possible if a single change is selected.'. |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4728 |
]. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4729 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4730 |
classSelectorPairs := Set new. |
3211 | 4731 |
self withSelectedChangesDo:[:changeNr | |
6288 | 4732 |
| classNameToCompress selector | |
4733 |
||
4734 |
classNameToCompress := self classNameOfChange:changeNr. |
|
4735 |
classNameToCompress notNil ifTrue:[ |
|
4736 |
selector := self selectorOfMethodChange:changeNr. |
|
4737 |
selector notNil ifTrue:[ |
|
4738 |
classSelectorPairs add:(classNameToCompress -> selector). |
|
4739 |
] |
|
4740 |
] |
|
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4741 |
]. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4742 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4743 |
classSelectorPairs do:[:pair | |
6288 | 4744 |
self compressForClass:pair key selector:pair value. |
1359 | 4745 |
] |
4746 |
||
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4747 |
"Created: / 19.11.2001 / 21:50:59 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
4748 |
"Modified: / 19.11.2001 / 22:10:08 / cg" |
45 | 4749 |
! |
4750 |
||
202 | 4751 |
doDelete |
3211 | 4752 |
"delete currently selected change(s)" |
4753 |
||
6255 | 4754 |
|rangeEnd rangeStart firstDeleted| |
4755 |
||
4756 |
changeListView selection size <= 5 ifTrue:[ |
|
6288 | 4757 |
self withSelectedChangesReverseDo:[:changeNr | |
4758 |
self deleteChange:changeNr. |
|
4759 |
self autoSelectOrEnd:changeNr |
|
4760 |
]. |
|
4761 |
^ self |
|
6255 | 4762 |
]. |
4763 |
||
3211 | 4764 |
self withSelectedChangesReverseDo:[:changeNr | |
6288 | 4765 |
rangeEnd isNil ifTrue:[ |
4766 |
rangeEnd := rangeStart := changeNr |
|
4767 |
] ifFalse:[ |
|
4768 |
(changeNr = (rangeEnd + 1)) ifTrue:[ |
|
4769 |
rangeEnd := changeNr |
|
4770 |
] ifFalse:[ |
|
4771 |
(changeNr = (rangeStart - 1)) ifTrue:[ |
|
4772 |
rangeStart := changeNr |
|
4773 |
] ifFalse:[ |
|
4774 |
self deleteChangesFrom:rangeStart to:rangeEnd. |
|
4775 |
firstDeleted := (firstDeleted ? rangeStart) min:rangeStart. |
|
4776 |
rangeStart := rangeEnd := nil. |
|
4777 |
]. |
|
4778 |
]. |
|
4779 |
]. |
|
6255 | 4780 |
]. |
4781 |
rangeStart notNil ifTrue:[ |
|
6288 | 4782 |
self deleteChangesFrom:rangeStart to:rangeEnd. |
4783 |
firstDeleted := (firstDeleted ? rangeStart) min:rangeStart. |
|
6255 | 4784 |
]. |
4785 |
self autoSelectOrEnd:firstDeleted |
|
73 | 4786 |
! |
4787 |
||
3249 | 4788 |
doDeleteAndSelectPrevious |
4789 |
"delete currently selected change(s)" |
|
4790 |
||
4791 |
self withSelectedChangesReverseDo:[:changeNr | |
|
6288 | 4792 |
self deleteChange:changeNr. |
4793 |
self autoSelectOrEnd:changeNr-1 |
|
3249 | 4794 |
] |
4795 |
! |
|
4796 |
||
202 | 4797 |
doDeleteClassAll |
4798 |
"delete all changes with same class as currently selected change" |
|
4799 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4800 |
|classNamesToDelete lastChangeNr overAllNumDeletedBefore| |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4801 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4802 |
lastChangeNr := -1. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4803 |
classNamesToDelete := Set new. |
3211 | 4804 |
self withSelectedChangesDo:[:changeNr | |
6288 | 4805 |
|classNameToDelete| |
4806 |
||
4807 |
classNameToDelete := self classNameOfChange:changeNr. |
|
4808 |
classNameToDelete notNil ifTrue:[ |
|
4809 |
classNamesToDelete add:classNameToDelete. |
|
4810 |
]. |
|
4811 |
lastChangeNr := lastChangeNr max:changeNr. |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4812 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4813 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4814 |
overAllNumDeletedBefore := 0. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4815 |
changeListView setSelection:nil. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4816 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4817 |
self withExecuteCursorDo:[ |
6288 | 4818 |
classNamesToDelete do:[:classNameToDelete | |
4819 |
|numDeletedBefore| |
|
4820 |
||
4821 |
self silentDeleteChangesFor:classNameToDelete |
|
4822 |
from:lastChangeNr |
|
4823 |
to:(self numberOfChanges). |
|
4824 |
numDeletedBefore := self |
|
4825 |
silentDeleteChangesFor:classNameToDelete |
|
4826 |
from:1 |
|
4827 |
to:(lastChangeNr-1). |
|
4828 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
4829 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
4830 |
]. |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4831 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4832 |
|
6288 | 4833 |
self setChangeList. |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
4834 |
self autoSelectOrEnd:lastChangeNr |
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4835 |
|
1431 | 4836 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
4837 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
|
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4838 |
! |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4839 |
|
2511 | 4840 |
doDeleteClassAndPrivateClassesAll |
4841 |
"delete all changes with same class and private classes |
|
4842 |
as currently selected change" |
|
4843 |
||
6200 | 4844 |
|lastChangeNr classNamesToDelete overAllNumDeletedBefore| |
4845 |
||
4846 |
lastChangeNr := -1. |
|
4847 |
classNamesToDelete := Set new. |
|
3211 | 4848 |
self withSelectedChangesDo:[:changeNr | |
6288 | 4849 |
|classNameToDelete| |
4850 |
||
4851 |
classNameToDelete := self ownerClassNameOfChange:changeNr. |
|
4852 |
classNameToDelete notNil ifTrue:[ |
|
4853 |
classNamesToDelete add:classNameToDelete. |
|
4854 |
]. |
|
4855 |
lastChangeNr := lastChangeNr max:changeNr. |
|
6200 | 4856 |
]. |
4857 |
||
4858 |
overAllNumDeletedBefore := 0. |
|
4859 |
changeListView setSelection:nil. |
|
4860 |
||
4861 |
self withExecuteCursorDo:[ |
|
6288 | 4862 |
classNamesToDelete do:[:classNameToDelete | |
4863 |
| changeNr numDeletedBefore| |
|
4864 |
||
4865 |
classNameToDelete notNil ifTrue:[ |
|
4866 |
changeListView setSelection:nil. |
|
4867 |
self silentDeleteChangesForClassAndPrivateClasses:classNameToDelete |
|
4868 |
from:lastChangeNr |
|
4869 |
to:(self numberOfChanges). |
|
4870 |
numDeletedBefore := self |
|
4871 |
silentDeleteChangesForClassAndPrivateClasses:classNameToDelete |
|
4872 |
from:1 |
|
4873 |
to:(lastChangeNr-1). |
|
4874 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
4875 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
4876 |
] |
|
4877 |
] |
|
6200 | 4878 |
]. |
6288 | 4879 |
self setChangeList. |
6200 | 4880 |
self autoSelectOrEnd:lastChangeNr |
2511 | 4881 |
|
4882 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
|
4883 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
|
4884 |
! |
|
4885 |
||
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4886 |
doDeleteClassFromBeginning |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4887 |
"delete changes with same class as currently selected change from the beginning |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4888 |
up to the selected change. |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4889 |
Useful to get rid of obsolete changes before a fileout or checkin entry." |
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4890 |
|
3668 | 4891 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4892 |
|classNameToDelete prevSelection numDeleted| |
4893 |
||
4894 |
classNameToDelete := self classNameOfChange:changeNr. |
|
4895 |
classNameToDelete notNil ifTrue:[ |
|
4896 |
prevSelection := changeNr. |
|
4897 |
changeListView setSelection:nil. |
|
4898 |
numDeleted := self |
|
4899 |
silentDeleteChangesFor:classNameToDelete |
|
4900 |
from:1 |
|
4901 |
to:changeNr. |
|
4902 |
self setChangeList. |
|
4903 |
self autoSelectOrEnd:(changeNr + 1 - numDeleted) |
|
4904 |
] |
|
1428
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
4905 |
]. |
286
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4906 |
|
96d31200b0c1
added delete-for-class-from-beginning; ignore timestamps for fileOut/checkin/snapshot entries
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
4907 |
"Created: 13.12.1995 / 15:41:58 / cg" |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
4908 |
"Modified: 25.5.1996 / 12:26:34 / cg" |
51 | 4909 |
! |
4910 |
||
73 | 4911 |
doDeleteClassRest |
4912 |
"delete rest of changes with same class as currently selected change" |
|
4913 |
||
3668 | 4914 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4915 |
| classNameToDelete | |
4916 |
||
4917 |
classNameToDelete := self classNameOfChange:changeNr. |
|
4918 |
classNameToDelete notNil ifTrue:[ |
|
4919 |
changeListView setSelection:nil. |
|
4920 |
self silentDeleteChangesFor:classNameToDelete |
|
4921 |
from:changeNr |
|
4922 |
to:(self numberOfChanges). |
|
4923 |
self setChangeList. |
|
4924 |
self autoSelectOrEnd:changeNr |
|
4925 |
] |
|
73 | 4926 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
4927 |
|
1648 | 4928 |
"Modified: / 18.5.1998 / 14:25:07 / cg" |
73 | 4929 |
! |
4930 |
||
3607 | 4931 |
doDeleteClassSelectorAll |
4932 |
"delete all changes with same class and selector as currently selected change" |
|
4933 |
||
4934 |
|classNameSelectorPairsToDelete lastChangeNr overAllNumDeletedBefore| |
|
4935 |
||
4936 |
lastChangeNr := -1. |
|
4937 |
classNameSelectorPairsToDelete := Set new. |
|
4938 |
self withSelectedChangesDo:[:changeNr | |
|
6288 | 4939 |
|className selector| |
4940 |
||
4941 |
className := self classNameOfChange:changeNr. |
|
4942 |
selector := self selectorOfMethodChange:changeNr. |
|
4943 |
selector notNil ifTrue:[ |
|
4944 |
(className notNil and:[selector notNil]) ifTrue:[ |
|
4945 |
classNameSelectorPairsToDelete add:(className -> selector). |
|
4946 |
] |
|
4947 |
]. |
|
4948 |
lastChangeNr := lastChangeNr max:changeNr. |
|
3607 | 4949 |
]. |
4950 |
||
4951 |
overAllNumDeletedBefore := 0. |
|
4952 |
changeListView setSelection:nil. |
|
4953 |
||
4954 |
self withExecuteCursorDo:[ |
|
6288 | 4955 |
classNameSelectorPairsToDelete do:[:pair | |
4956 |
|numDeletedBefore className selector| |
|
4957 |
||
4958 |
className := pair key. |
|
4959 |
selector := pair value. |
|
4960 |
self silentDeleteChangesFor:className selector:selector |
|
4961 |
from:lastChangeNr |
|
4962 |
to:(self numberOfChanges). |
|
4963 |
numDeletedBefore := self |
|
4964 |
silentDeleteChangesFor:className selector:selector |
|
4965 |
from:1 |
|
4966 |
to:(lastChangeNr-1). |
|
4967 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
4968 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
4969 |
]. |
|
3607 | 4970 |
]. |
4971 |
||
6288 | 4972 |
self setChangeList. |
3607 | 4973 |
self autoSelectOrEnd:lastChangeNr |
4974 |
||
4975 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
|
4976 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
|
4977 |
! |
|
4978 |
||
4896 | 4979 |
doDeleteFromBeginning |
4980 |
"delete all changes from 1 to the current" |
|
4981 |
||
4982 |
self withSingleSelectedChangeDo:[:changeNr | |
|
6288 | 4983 |
self deleteChangesFrom:1 to:changeNr. |
4984 |
self clearCodeView. |
|
4985 |
self autoSelectOrEnd:changeNr |
|
4896 | 4986 |
] |
4987 |
! |
|
4988 |
||
202 | 4989 |
doDeleteRest |
4990 |
"delete all changes from current to the end" |
|
51 | 4991 |
|
3668 | 4992 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 4993 |
self deleteChangesFrom:changeNr to:(self numberOfChanges). |
4994 |
self clearCodeView. |
|
4995 |
self autoSelectOrEnd:changeNr-1 |
|
3668 | 4996 |
] |
132 | 4997 |
! |
4998 |
||
4999 |
doFileoutAndDeleteClassAll |
|
5000 |
"first fileOut the selected changes class then delete all changes |
|
5001 |
for it." |
|
5002 |
||
3668 | 5003 |
self withSingleSelectedChangeDo:[:changeNr | |
6288 | 5004 |
| className class | |
5005 |
||
5006 |
className := self classNameOfChange:changeNr. |
|
5007 |
className notNil ifTrue:[ |
|
5008 |
class := Smalltalk classNamed:className. |
|
5009 |
class notNil ifTrue:[ |
|
5010 |
Class fileOutErrorSignal handle:[:ex | |
|
5011 |
self warn:('fileout failed: ' , ex description). |
|
5012 |
] do:[ |
|
5013 |
class fileOut. |
|
5014 |
self doDeleteClassAll |
|
5015 |
]. |
|
5016 |
]. |
|
5017 |
||
5018 |
]. |
|
132 | 5019 |
] |
5020 |
||
5021 |
"Modified: 6.9.1995 / 17:11:16 / claus" |
|
202 | 5022 |
! |
73 | 5023 |
|
202 | 5024 |
doMakePatch |
5025 |
"user wants a change to be made a patch |
|
5026 |
- copy it over to the patches file" |
|
89 | 5027 |
|
3211 | 5028 |
self withSelectedChangesDo:[:changeNr | |
6288 | 5029 |
self makeChangeAPatch:changeNr. |
5030 |
self autoSelect:(changeNr + 1) |
|
202 | 5031 |
] |
73 | 5032 |
! |
5033 |
||
202 | 5034 |
doMakePermanent |
5035 |
"user wants a change to be made permanent |
|
5036 |
- rewrite the source file where this change has to go" |
|
5037 |
||
5038 |
|yesNoBox| |
|
73 | 5039 |
|
3211 | 5040 |
(self theSingleSelection) isNil ifTrue:[ |
6288 | 5041 |
^ self information:'Only possible if a single change is selected.'. |
3211 | 5042 |
]. |
5043 |
||
202 | 5044 |
yesNoBox := YesNoBox new. |
5045 |
yesNoBox title:(resources at:'Warning: this operation cannot be undone'). |
|
1378 | 5046 |
yesNoBox okText:(resources at:'continue') noText:(resources at:'abort'). |
202 | 5047 |
yesNoBox okAction:[ |changeNr| |
5048 |
||
6288 | 5049 |
changeNr := self theSingleSelection. |
5050 |
changeNr notNil ifTrue:[ |
|
5051 |
self makeChangePermanent:changeNr. |
|
5052 |
self autoSelect:(changeNr + 1) |
|
5053 |
] |
|
5054 |
]. |
|
917 | 5055 |
yesNoBox showAtPointer. |
5056 |
yesNoBox destroy |
|
5057 |
||
5058 |
"Modified: 7.1.1997 / 23:03:33 / cg" |
|
73 | 5059 |
! |
5060 |
||
202 | 5061 |
doSave |
5062 |
"user wants a change to be appended to a file" |
|
73 | 5063 |
|
3211 | 5064 |
|fileName| |
5065 |
||
5066 |
self withSelectedChangesDo:[:changeNr | |
|
6288 | 5067 |
fileName := Dialog |
5068 |
requestFileName:'Append change to:' |
|
5069 |
default:(lastSaveFileName ? '') |
|
5070 |
ok:'Append' |
|
5071 |
abort:'Abort' |
|
5072 |
pattern:'*.chg'. |
|
5073 |
||
5074 |
fileName notNil ifTrue:[ |
|
5075 |
lastSaveFileName := fileName. |
|
5076 |
self withCursor:(Cursor write) do:[ |
|
5077 |
self appendChange:changeNr toFile:fileName. |
|
5078 |
]. |
|
5079 |
self autoSelect:(changeNr + 1) |
|
5080 |
]. |
|
202 | 5081 |
] |
73 | 5082 |
! |
5083 |
||
202 | 5084 |
doSaveClass |
5085 |
"user wants changes for some class from current to end to be appended to a file" |
|
89 | 5086 |
|
3211 | 5087 |
(self theSingleSelection) isNil ifTrue:[ |
6288 | 5088 |
^ self information:'Only possible if a single change is selected.'. |
3211 | 5089 |
]. |
202 | 5090 |
self doSaveClassFrom:1 |
89 | 5091 |
! |
5092 |
||
202 | 5093 |
doSaveClassAll |
5094 |
"user wants changes for some class from current to end to be appended to a file" |
|
73 | 5095 |
|
3211 | 5096 |
(self theSingleSelection) isNil ifTrue:[ |
6288 | 5097 |
^ self information:'Only possible if a single change is selected.'. |
3211 | 5098 |
]. |
202 | 5099 |
self doSaveClassFrom:1 |
5100 |
! |
|
5101 |
||
5102 |
doSaveClassFrom:startNr |
|
5103 |
"user wants changes from current to end to be appended to a file" |
|
5104 |
||
5105 |
|changeNr classNameToSave| |
|
73 | 5106 |
|
3211 | 5107 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
6288 | 5108 |
^ self information:'Only possible if a single change is selected.'. |
3211 | 5109 |
]. |
5110 |
classNameToSave := self classNameOfChange:changeNr. |
|
5111 |
classNameToSave notNil ifTrue:[ |
|
6288 | 5112 |
self saveClass:classNameToSave from:startNr |
202 | 5113 |
] |
5114 |
! |
|
73 | 5115 |
|
202 | 5116 |
doSaveClassRest |
5117 |
"user wants changes for some class from current to end to be appended to a file" |
|
73 | 5118 |
|
202 | 5119 |
|changeNr| |
132 | 5120 |
|
3211 | 5121 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
6317 | 5122 |
^ self information:'Only possible if a single change is selected.'. |
3211 | 5123 |
]. |
6317 | 5124 |
self doSaveClassFrom:changeNr. |
5125 |
||
5126 |
changeListView setSelection:changeNr. |
|
5127 |
"/ self changeSelection:changeNr. |
|
81 | 5128 |
! |
5129 |
||
202 | 5130 |
doSaveRest |
5131 |
"user wants changes from current to end to be appended to a file" |
|
73 | 5132 |
|
202 | 5133 |
|changeNr fileName| |
51 | 5134 |
|
3211 | 5135 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
6288 | 5136 |
^ self information:'Only possible if a single change is selected.'. |
3211 | 5137 |
]. |
5138 |
||
5139 |
fileName := Dialog |
|
6288 | 5140 |
requestFileName:'Append changes to:' |
5141 |
default:(lastSaveFileName ? '') |
|
5142 |
ok:'Append' |
|
5143 |
abort:'Abort' |
|
5144 |
pattern:'*.chg'. |
|
3211 | 5145 |
|
5146 |
fileName notNil ifTrue:[ |
|
6288 | 5147 |
lastSaveFileName := fileName. |
5148 |
self withCursor:(Cursor write) do:[ |
|
5149 |
changeNr to:(self numberOfChanges) do:[:changeNr | |
|
5150 |
changeListView setSelection:changeNr. |
|
5151 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
|
5152 |
^ self |
|
5153 |
] |
|
5154 |
] |
|
5155 |
] |
|
202 | 5156 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
5157 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
5158 |
"Modified: 25.5.1996 / 12:26:41 / cg" |
51 | 5159 |
! |
5160 |
||
202 | 5161 |
doUpdate |
5162 |
"reread the changes-file" |
|
51 | 5163 |
|
202 | 5164 |
self readChangesFileInBackground:true. |
5178 | 5165 |
self newLabel:''. |
202 | 5166 |
realized ifTrue:[ |
6288 | 5167 |
self setChangeList. |
202 | 5168 |
] |
51 | 5169 |
! |
5170 |
||
202 | 5171 |
doWriteBack |
5172 |
"write back the list onto the changes file" |
|
51 | 5173 |
|
5174 |
anyChanges ifTrue:[ |
|
6288 | 5175 |
(self writeBackChanges) ifTrue:[ |
5176 |
realized ifTrue:[ |
|
5177 |
self readChangesFileInBackground:false. |
|
5178 |
self newLabel:''. |
|
5179 |
realized ifTrue:[ |
|
5180 |
self setChangeList |
|
5181 |
] |
|
5182 |
] |
|
5183 |
] |
|
202 | 5184 |
] |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
5185 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
5186 |
"Modified: 5.9.1996 / 17:19:46 / cg" |
202 | 5187 |
! |
126 | 5188 |
|
1471 | 5189 |
doubleClickOnChange:lineNr |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5190 |
"action performed when a change-list entry is doubleClicked" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5191 |
|
1471 | 5192 |
self doBrowse |
5193 |
||
5194 |
"Created: / 6.2.1998 / 13:08:49 / cg" |
|
5195 |
! |
|
5196 |
||
1127 | 5197 |
findClass |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5198 |
"findClass menu action: let user enter a classes name, and select the next change for that class" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5199 |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5200 |
|current| |
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5201 |
|
1127 | 5202 |
changeNrShown notNil ifTrue:[ |
6288 | 5203 |
current := self classNameOfChange:changeNrShown. |
1127 | 5204 |
]. |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5205 |
|
6288 | 5206 |
self |
5207 |
askForSearch:'Class to search for:' |
|
5208 |
initialAnswer:current |
|
5209 |
thenSearchUsing:[:searchString :changeNr | |
|
5210 |
|thisClass| |
|
5211 |
||
5212 |
thisClass := self classNameOfChange:changeNr. |
|
5213 |
(thisClass = searchString |
|
5214 |
or:[searchString includesMatchCharacters and:[searchString match:thisClass]]) |
|
5215 |
] |
|
5216 |
onCancel:[^ self]. |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5217 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5218 |
lastSearchType := #class. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5219 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5220 |
! |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5221 |
|
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5222 |
findNext |
6288 | 5223 |
"findNext menu action: select the next change. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5224 |
Searches for what the last search was for; i.e. either same class or same selector" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5225 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5226 |
lastSearchType == #selector ifTrue:[ |
6288 | 5227 |
^ self findNextForSelector |
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5228 |
]. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5229 |
lastSearchType == #snapshot ifTrue:[ |
6288 | 5230 |
^ self findNextSnapshot |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5231 |
]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5232 |
lastSearchType == #string ifTrue:[ |
6288 | 5233 |
^ self findNextForString |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5234 |
]. |
3534 | 5235 |
lastSearchType == #difference ifTrue:[ |
6288 | 5236 |
^ self findNextDifference |
3534 | 5237 |
]. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5238 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5239 |
^ self findNextForClass |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5240 |
|
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5241 |
"Created: / 18.6.1998 / 22:15:00 / cg" |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5242 |
"Modified: / 18.6.1998 / 22:15:25 / cg" |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5243 |
! |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5244 |
|
3534 | 5245 |
findNextDifference |
5246 |
lastSearchType := #difference. |
|
5247 |
changeNrShown isNil ifTrue:[^ self]. |
|
5248 |
||
6288 | 5249 |
self findNextForWhich:[:changeNr | |
5250 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
|
5251 |
"/ same |
|
5252 |
false |
|
5253 |
] ifFalse:[ |
|
5254 |
"/ different |
|
5255 |
true |
|
5256 |
] |
|
5257 |
] |
|
3534 | 5258 |
! |
5259 |
||
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5260 |
findNextForClass |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5261 |
"findNextForClass menu action: select the next change for the selected changes class" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5262 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5263 |
|cls| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5264 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5265 |
lastSearchType := #class. |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5266 |
changeNrShown isNil ifTrue:[^ self]. |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5267 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5268 |
cls := self classNameOfChange:changeNrShown. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5269 |
cls isNil ifTrue:[^ self]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5270 |
|
6288 | 5271 |
self findNextForWhich:[:changeNr | |
5272 |
|thisClass| |
|
5273 |
||
5274 |
thisClass := self classNameOfChange:changeNr. |
|
5275 |
(thisClass = cls |
|
5276 |
or:[cls includesMatchCharacters and:[cls match:thisClass]]) |
|
5277 |
] |
|
3341
8f156ac559d5
fixed matching in find actions
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
5278 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5279 |
! |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5280 |
|
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5281 |
findNextForSelector |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5282 |
"findNextForSelector menu action: select the next change for the selected changes selector" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5283 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5284 |
|sel| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5285 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5286 |
lastSearchType := #selector. |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5287 |
changeNrShown isNil ifTrue:[^ self]. |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5288 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5289 |
sel := self selectorOfMethodChange:changeNrShown. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5290 |
sel isNil ifTrue:[^ self]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5291 |
|
6288 | 5292 |
self findNextForWhich: [:changeNr | |
5293 |
|thisSelector| |
|
5294 |
||
5295 |
thisSelector := self selectorOfMethodChange:changeNr. |
|
5296 |
(thisSelector = sel or:[sel includesMatchCharacters and:[sel match:thisSelector]]) |
|
5297 |
] |
|
3341
8f156ac559d5
fixed matching in find actions
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
5298 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5299 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5300 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5301 |
findNextForString |
4458 | 5302 |
lastSearchString isNil ifTrue:[ |
6288 | 5303 |
^ self findString |
4458 | 5304 |
]. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5305 |
self findNextWithString:lastSearchString |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5306 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5307 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5308 |
findNextForWhich:aBlock |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5309 |
"helper: select the next change for which aBlock evaluates to true" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5310 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5311 |
self withCursor:Cursor questionMark do:[ |
6288 | 5312 |
Object userInterruptSignal handle:[:ex | |
5313 |
self beep. |
|
5314 |
^ 0 |
|
5315 |
] do:[ |
|
5316 |
|lastNr nr| |
|
5317 |
||
5318 |
lastNr := self numberOfChanges. |
|
5319 |
nr := changeNrShown + 1. |
|
5320 |
[nr <= lastNr] whileTrue:[ |
|
5321 |
(aBlock value:nr) ifTrue:[ |
|
5322 |
changeListView setSelection:nr . |
|
5323 |
self changeSelection:nr. |
|
5324 |
^ nr |
|
5325 |
]. |
|
5326 |
nr := nr + 1. |
|
5327 |
]. |
|
5328 |
]. |
|
1127 | 5329 |
]. |
2132 | 5330 |
self showNotFound. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5331 |
self windowGroup sensor flushKeyboard. "/ avoid multiple beeps, in case of type ahead |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5332 |
^ 0 |
1127 | 5333 |
! |
5334 |
||
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5335 |
findNextSnapshot |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5336 |
"findNextSnapshot menu action: select the next change which is for a snapShot-image save action" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5337 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5338 |
lastSearchType := #snapshot. |
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5339 |
changeNrShown isNil ifTrue:[^ self]. |
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5340 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5341 |
self findNextForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5342 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5343 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5344 |
findNextWithString:searchString |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5345 |
lastSearchType := #string. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5346 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5347 |
lastSearchString := searchString. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5348 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5349 |
changeNrShown isNil ifTrue:[ |
6288 | 5350 |
changeNrShown := 0. |
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5351 |
]. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5352 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5353 |
self findNextForWhich: |
6288 | 5354 |
[:changeNr | |
5355 |
|s| |
|
5356 |
||
5357 |
s := self sourceOfMethodChange:changeNr. |
|
5358 |
s notNil and:[ |
|
5359 |
(searchString includesMatchCharacters not |
|
5360 |
and:[(s findString:searchString) ~~ 0]) |
|
5361 |
or:[ searchString includesMatchCharacters |
|
5362 |
and:[('*' , searchString , '*') match:s ]]] |
|
5363 |
]. |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5364 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5365 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5366 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5367 |
codeView setSearchPattern:searchString. |
6288 | 5368 |
codeView |
5369 |
searchFwd:searchString |
|
5370 |
ignoreCase:false |
|
5371 |
startingAtLine:1 col:0 |
|
5372 |
ifAbsent:nil. |
|
3341
8f156ac559d5
fixed matching in find actions
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
5373 |
|
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5374 |
! |
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5375 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5376 |
findPrevious |
6288 | 5377 |
"findPrevious menu action: select the previous change. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5378 |
Searches for what the last search was for; i.e. either same class or same selector" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5379 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5380 |
lastSearchType == #selector ifTrue:[ |
6288 | 5381 |
^ self findPreviousForSelector |
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5382 |
]. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5383 |
lastSearchType == #snapshot ifTrue:[ |
6288 | 5384 |
^ self findPreviousSnapshot |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5385 |
]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5386 |
lastSearchType == #string ifTrue:[ |
6288 | 5387 |
^ self findPreviousForString |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5388 |
]. |
3534 | 5389 |
lastSearchType == #difference ifTrue:[ |
6288 | 5390 |
^ self findPreviousDifference |
3534 | 5391 |
]. |
5392 |
||
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5393 |
^ self findPreviousForClass |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5394 |
|
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5395 |
"Created: / 18.6.1998 / 22:15:15 / cg" |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5396 |
! |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5397 |
|
3534 | 5398 |
findPreviousDifference |
5399 |
lastSearchType := #difference. |
|
5400 |
changeNrShown isNil ifTrue:[^ self]. |
|
5401 |
||
6288 | 5402 |
self findPreviousForWhich:[:changeNr | |
5403 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
|
5404 |
"/ same |
|
5405 |
false |
|
5406 |
] ifFalse:[ |
|
5407 |
"/ different |
|
5408 |
true |
|
5409 |
] |
|
5410 |
] |
|
3534 | 5411 |
! |
5412 |
||
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5413 |
findPreviousForClass |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5414 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5415 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5416 |
|cls| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5417 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5418 |
lastSearchType := #class. |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
5419 |
changeNrShown isNil ifTrue:[^ self]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
5420 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5421 |
cls := self classNameOfChange:changeNrShown. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5422 |
cls isNil ifTrue:[^ self]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5423 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5424 |
self findPreviousForWhich: |
6288 | 5425 |
[:changeNr | |
5426 |
|thisClass| |
|
5427 |
||
5428 |
thisClass := self classNameOfChange:changeNr. |
|
5429 |
(thisClass = cls |
|
5430 |
or:[cls includesMatchCharacters and:[cls match:thisClass]]) |
|
5431 |
] |
|
3341
8f156ac559d5
fixed matching in find actions
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
5432 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5433 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5434 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5435 |
findPreviousForSelector |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5436 |
"findPreviousForSelector menu action: select the previous change for the selected changes selector" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5437 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5438 |
|sel| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5439 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5440 |
lastSearchType := #selector. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5441 |
changeNrShown isNil ifTrue:[^ self]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5442 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5443 |
sel := self selectorOfMethodChange:changeNrShown. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5444 |
sel isNil ifTrue:[^ self]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5445 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5446 |
self findPreviousForWhich: |
6288 | 5447 |
[:changeNr | |
5448 |
|thisSelector| |
|
5449 |
||
5450 |
thisSelector := self selectorOfMethodChange:changeNr. |
|
5451 |
(thisSelector = sel |
|
5452 |
or:[sel includesMatchCharacters and:[sel match:thisSelector]]) |
|
5453 |
] |
|
3341
8f156ac559d5
fixed matching in find actions
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
5454 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5455 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5456 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5457 |
findPreviousForString |
4458 | 5458 |
lastSearchString isNil ifTrue:[ |
6288 | 5459 |
^ self findString |
4458 | 5460 |
]. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5461 |
self findPreviousWithString:lastSearchString |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5462 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5463 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5464 |
findPreviousForWhich:aBlock |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5465 |
"helper: select the previous change for which aBlock evaluates to true" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5466 |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
5467 |
self withCursor:Cursor questionMark do:[ |
6288 | 5468 |
Object userInterruptSignal handle:[:ex | |
5469 |
self beep. |
|
5470 |
^ 0 |
|
5471 |
] do:[ |
|
5472 |
|nr| |
|
5473 |
||
5474 |
nr := changeNrShown - 1. |
|
5475 |
[nr >= 1] whileTrue:[ |
|
5476 |
(aBlock value:nr) ifTrue:[ |
|
5477 |
changeListView setSelection:nr . |
|
5478 |
self changeSelection:nr. |
|
5479 |
^ nr |
|
5480 |
]. |
|
5481 |
nr := nr - 1. |
|
5482 |
]. |
|
5483 |
] |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
5484 |
]. |
2132 | 5485 |
self showNotFound. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5486 |
self windowGroup sensor flushKeyboard. "/ avoid multiple beeps, in case of type ahead |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5487 |
^ 0 |
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5488 |
! |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5489 |
|
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5490 |
findPreviousSnapshot |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5491 |
"findPreviousSnapshot menu action: select the previous change which is for a snapShot-image save action" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5492 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5493 |
lastSearchType := #snapshot. |
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5494 |
changeNrShown isNil ifTrue:[^ self]. |
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5495 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5496 |
self findPreviousForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5497 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5498 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5499 |
findPreviousWithString:searchString |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5500 |
lastSearchType := #string. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5501 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5502 |
lastSearchString := searchString. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5503 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5504 |
changeNrShown isNil ifTrue:[ |
6288 | 5505 |
changeNrShown := 0. |
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5506 |
]. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5507 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5508 |
self findPreviousForWhich: |
6288 | 5509 |
[:changeNr | |
5510 |
|s includesMatchCharacters| |
|
5511 |
||
5512 |
includesMatchCharacters := searchString includesMatchCharacters. |
|
5513 |
s := self sourceOfMethodChange:changeNr. |
|
5514 |
s notNil and:[ |
|
5515 |
(includesMatchCharacters not and:[(s findString:searchString) ~~ 0]) |
|
5516 |
or:[includesMatchCharacters and:[('*' , searchString , '*') match:s ]]] |
|
5517 |
]. |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5518 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5519 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5520 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5521 |
codeView setSearchPattern:searchString. |
6288 | 5522 |
codeView |
5523 |
searchFwd:searchString |
|
5524 |
ignoreCase:false |
|
5525 |
startingAtLine:1 col:0 |
|
5526 |
ifAbsent:nil. |
|
3341
8f156ac559d5
fixed matching in find actions
Claus Gittinger <cg@exept.de>
parents:
3339
diff
changeset
|
5527 |
|
1848
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5528 |
! |
61054ff3d470
added find prev/next snapshot to search menu
Claus Gittinger <cg@exept.de>
parents:
1833
diff
changeset
|
5529 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5530 |
findSelector |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5531 |
"findSelector menu action: let user enter a selector, and select the next change for that selector" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5532 |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5533 |
|current| |
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5534 |
|
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5535 |
changeNrShown notNil ifTrue:[ |
6288 | 5536 |
current := self selectorOfMethodChange:changeNrShown. |
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
5537 |
]. |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5538 |
|
6288 | 5539 |
self |
5540 |
askForSearch:'Selector to search for:' |
|
5541 |
initialAnswer:current |
|
5542 |
thenSearchUsing:[:searchString :changeNr | |
|
5543 |
|thisSelector| |
|
5544 |
||
5545 |
thisSelector := self selectorOfMethodChange:changeNr. |
|
5546 |
(thisSelector = searchString |
|
5547 |
or:[searchString includesMatchCharacters and:[searchString match:thisSelector]]) |
|
5548 |
] |
|
5549 |
onCancel:[^ self]. |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5550 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5551 |
lastSearchType := #selector. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5552 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
5553 |
! |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
5554 |
|
2576
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5555 |
findString |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5556 |
|searchString directionHolder| |
2576
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5557 |
|
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5558 |
lastSearchType := #string. |
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5559 |
|
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5560 |
searchString := codeView selection. |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
5561 |
searchString size == 0 ifTrue:[searchString := lastSearchString]. |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5562 |
|
6288 | 5563 |
searchString := self |
5564 |
askForSearchString:'String to search for:' |
|
5565 |
initialAnswer:(searchString ? '') |
|
5566 |
directionInto:(directionHolder := ValueHolder new). |
|
3554 | 5567 |
|
5568 |
searchString size == 0 ifTrue:[ |
|
6288 | 5569 |
^ self |
2576
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5570 |
]. |
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5571 |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5572 |
directionHolder value == #backward ifTrue:[ |
6288 | 5573 |
self findPreviousWithString:searchString. |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5574 |
] ifFalse:[ |
6288 | 5575 |
self findNextWithString:searchString. |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5576 |
] |
2576
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5577 |
! |
b5f0d32b09d3
added string search (in methods code)
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
5578 |
|
202 | 5579 |
noChangesAllowed |
5580 |
"show a warning that changes cannot be changed" |
|
93 | 5581 |
|
3211 | 5582 |
self warn:'Changes are not allowed to be changed.' |
0 | 5583 |
! |
5584 |
||
202 | 5585 |
saveClass:aClassName from:startNr |
5586 |
"user wants changes from current to end to be appended to a file" |
|
51 | 5587 |
|
202 | 5588 |
|changeNr fileName| |
51 | 5589 |
|
202 | 5590 |
changeNr := changeListView selection. |
5591 |
changeNr notNil ifTrue:[ |
|
6288 | 5592 |
fileName := Dialog |
5593 |
requestFileName:'Append changes for class to:' |
|
5594 |
default:(lastSaveFileName ? '') |
|
5595 |
ok:'Append' |
|
5596 |
abort:'Abort' |
|
5597 |
pattern:'*.chg'. |
|
5598 |
||
5599 |
fileName notNil ifTrue:[ |
|
5600 |
lastSaveFileName := fileName. |
|
5601 |
self withCursor:(Cursor write) do:[ |
|
5602 |
startNr to:(self numberOfChanges) do:[:changeNr | |
|
5603 |
|thisClassName| |
|
5604 |
||
5605 |
thisClassName := self classNameOfChange:changeNr. |
|
5606 |
thisClassName = aClassName ifTrue:[ |
|
5607 |
self setSingleSelection:changeNr. |
|
5608 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
|
5609 |
^ self |
|
5610 |
] |
|
5611 |
] |
|
5612 |
] |
|
5613 |
] |
|
5614 |
]. |
|
202 | 5615 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
5616 |
|
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
5617 |
"Modified: 25.5.1996 / 12:26:44 / cg" |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5618 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5619 |
|
3472 | 5620 |
setEnforcedNameSpace |
5621 |
|nsName listOfKnownNameSpaces| |
|
5622 |
||
5623 |
listOfKnownNameSpaces := Set new. |
|
6288 | 5624 |
NameSpace |
5625 |
allNamespaces |
|
5626 |
do:[:eachNameSpace | |
|
5627 |
listOfKnownNameSpaces add:eachNameSpace name |
|
5628 |
]. |
|
3472 | 5629 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
5630 |
||
6288 | 5631 |
nsName := Dialog |
5632 |
request:'When applying, new classes are created in nameSpace:' |
|
5633 |
initialAnswer:(enforcedNameSpace ? Class nameSpaceQuerySignal query name) |
|
5634 |
list:listOfKnownNameSpaces. |
|
3472 | 5635 |
nsName size ~~ 0 ifTrue:[ |
6288 | 5636 |
enforcedNameSpace := NameSpace name:nsName. |
5637 |
autoCompare value ifTrue:[ |
|
5638 |
self doUpdate |
|
5639 |
]. |
|
3472 | 5640 |
] |
5641 |
! |
|
5642 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5643 |
setEnforcedPackage |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5644 |
|pkg listOfKnownPackages| |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5645 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5646 |
listOfKnownPackages := Set new. |
6288 | 5647 |
Smalltalk allClassesDo:[:eachClass | |
5648 |
|package| |
|
5649 |
||
5650 |
package := eachClass package. |
|
5651 |
package size > 0 ifTrue:[ |
|
5652 |
listOfKnownPackages add:package |
|
5653 |
] |
|
5654 |
]. |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5655 |
listOfKnownPackages := listOfKnownPackages asOrderedCollection sort. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5656 |
|
6288 | 5657 |
pkg := Dialog |
5658 |
request:'When applying, changes go into package:' |
|
5659 |
initialAnswer:(enforcedPackage ? Class packageQuerySignal query) |
|
5660 |
list:listOfKnownPackages. |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5661 |
pkg size ~~ 0 ifTrue:[ |
6288 | 5662 |
enforcedPackage := pkg |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
5663 |
] |
202 | 5664 |
! ! |
0 | 5665 |
|
761 | 5666 |
!ChangesBrowser class methodsFor:'documentation'! |
202 | 5667 |
|
5668 |
version |
|
6317 | 5669 |
^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.332 2005-06-07 16:28:48 cg Exp $' |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
5670 |
! ! |