author | Claus Gittinger <cg@exept.de> |
Mon, 11 Sep 2017 09:08:06 +0200 | |
changeset 17686 | c6fc2da19287 |
parent 17666 | 7529a0d25290 |
child 17723 | 5d4dc1781105 |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1990 by Claus Gittinger |
6288 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2664
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
12 |
"{ Package: 'stx:libtool' }" |
541f43019451
fixed class-chunk remembering (remember the full chunk,
Claus Gittinger <cg@exept.de>
parents:
2641
diff
changeset
|
13 |
|
15082 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
0 | 16 |
StandardSystemView subclass:#ChangesBrowser |
16372 | 17 |
instanceVariableNames:'changesReader changeInfoList changeListView codeView diffView |
18 |
changeFileName anyChanges changeNrShown changeNrProcessed |
|
19 |
multipleApply autoCompare changeFileSize changeFileTimestamp |
|
20 |
checkBlock tabSpec autoUpdate editingClassSource lastSearchType |
|
4489 | 21 |
lastSearchString applyInOriginalNameSpace lastSaveFileName |
22 |
readOnly enforcedPackage enforcedNameSpace updateChangeSet |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
23 |
showingDiffs diffViewBox autoloadAsRequired |
10719 | 24 |
classesNotToBeAutoloaded encodingIfKnown |
11244 | 25 |
ignorePublicPrivateCategories changeListSelectionHolder |
16467 | 26 |
defaultApplicationForVAGEClasses infoHolder' |
7631
258e8ad34edf
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7625
diff
changeset
|
27 |
classVariableNames:'CompressSnapshotInfo NoColoring ShowWarningDialogs |
9168 | 28 |
DefaultAutoCompare DefaultShowingDiffs LastEnforcedNameSpace |
29 |
KeepEnforcedNameSpace' |
|
4489 | 30 |
poolDictionaries:'' |
31 |
category:'Interface-Browsers' |
|
0 | 32 |
! |
33 |
||
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
34 |
Object subclass:#ChangeFileReader |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
35 |
instanceVariableNames:'browser enforcedNameSpace changeFileName changeFileSize |
16372 | 36 |
changeFileTimestamp changeInfo changeChunks changeClassNames |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
37 |
changeHeaderLines changePositions changeTimeStamps |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
38 |
changeIsFollowupMethodChange autoCompare autoloadAsRequired |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
39 |
tabSpec anyChanges inStream thisIsAClassSource chunkText |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
40 |
chunkPosition sawExcla fullChunkText noColoring timeStampInfo |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
41 |
changeString changeType changeDelta headerLine maxLen' |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
42 |
classVariableNames:'NoColoring' |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
43 |
poolDictionaries:'' |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
44 |
privateIn:ChangesBrowser |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
45 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
46 |
|
16372 | 47 |
Object subclass:#ChangeInfo |
48 |
instanceVariableNames:'position chunk className selector headerLine timestamp |
|
49 |
isFollowupChange' |
|
50 |
classVariableNames:'' |
|
51 |
poolDictionaries:'' |
|
52 |
privateIn:ChangesBrowser |
|
53 |
! |
|
54 |
||
761 | 55 |
!ChangesBrowser class methodsFor:'documentation'! |
29 | 56 |
|
57 |
copyright |
|
58 |
" |
|
59 |
COPYRIGHT (c) 1990 by Claus Gittinger |
|
6288 | 60 |
All Rights Reserved |
0 | 61 |
|
29 | 62 |
This software is furnished under a license and may be used |
63 |
only in accordance with the terms of that license and with the |
|
64 |
inclusion of the above copyright notice. This software may not |
|
65 |
be provided or otherwise made available to, or used by, any |
|
66 |
other person. No title to or ownership of the software is |
|
67 |
hereby transferred. |
|
68 |
" |
|
69 |
! |
|
70 |
||
71 |
documentation |
|
72 |
" |
|
11397 | 73 |
this implements a browser for the changes-file |
74 |
(actually, it can display any sourceFile's contents). |
|
29 | 75 |
See the extra document 'doc/misc/cbrowser.doc' for how to use this browser. |
76 |
||
77 |
written jan 90 by claus |
|
51 | 78 |
|
11397 | 79 |
This is a very old leftover class (it was one of the very first apps in ST/X |
80 |
and the Merovingian has not yet detected this one ;-) |
|
5703 | 81 |
It will be completely replaced by the ChangeSetBrowser class in the near future. |
82 |
||
83 |
||
508 | 84 |
[Class variables:] |
11397 | 85 |
CompressSnapshotInfo if true (the default), snapshot entries |
86 |
are also compressed in the compress function. |
|
87 |
Some users prefer them to be not compressed. |
|
88 |
Set it to false for this. |
|
58 | 89 |
|
51 | 90 |
Notice: |
11397 | 91 |
this needs a total rewrite, to build up a changeSet from the file |
92 |
(which did not exist when the ChangesBrowser was originally written) |
|
93 |
and manipulate that changeSet. |
|
94 |
||
95 |
This way, we get a browser for any upcoming incore changeSets for |
|
96 |
free. Also, this will put the chunk analysation code into Change and |
|
97 |
subclasses (where it belongs) and give a better encapsulation and |
|
98 |
overall structure. Do not take this as an example for good style ;-) |
|
99 |
||
100 |
The Change hierarchy is currently been completed, and the changes browser |
|
17047 | 101 |
should be adapted soon. |
508 | 102 |
|
103 |
[author:] |
|
11397 | 104 |
Claus Gittinger |
508 | 105 |
|
106 |
[start with:] |
|
11397 | 107 |
ChangesBrowser open |
1359 | 108 |
|
109 |
[see also:] |
|
11397 | 110 |
( Using the ChangesBrowser :html: tools/cbrowser/TOP.html ) |
6288 | 111 |
|
29 | 112 |
" |
113 |
! ! |
|
0 | 114 |
|
761 | 115 |
!ChangesBrowser class methodsFor:'instance creation'! |
45 | 116 |
|
8379 | 117 |
openOn:aFilename |
9525 | 118 |
"create & open a changes browser on a change file" |
5696 | 119 |
|
8379 | 120 |
|fileName browser| |
121 |
||
122 |
fileName := aFilename asFilename pathName. |
|
123 |
||
124 |
(self isXMLFile:fileName) ifTrue:[ |
|
125 |
browser := ChangeSetBrowser new |
|
5696 | 126 |
] ifFalse:[ |
8379 | 127 |
browser := self new |
128 |
]. |
|
129 |
||
130 |
browser label:(self defaultLabel , ': ', fileName). |
|
131 |
browser changeFileName:fileName. |
|
5696 | 132 |
browser open. |
133 |
^ browser |
|
9525 | 134 |
|
135 |
"Modified: / 18-07-2010 / 10:32:18 / cg" |
|
45 | 136 |
! ! |
137 |
||
761 | 138 |
!ChangesBrowser class methodsFor:'behavior'! |
0 | 139 |
|
140 |
autoSelectNext |
|
141 |
"returning true here, makes a Delete operation automatically |
|
142 |
select the next change" |
|
143 |
||
144 |
^ true |
|
145 |
! ! |
|
146 |
||
761 | 147 |
!ChangesBrowser class methodsFor:'defaults'! |
0 | 148 |
|
489 | 149 |
defaultIcon |
1153 | 150 |
"return the browsers default window icon" |
151 |
||
7631
258e8ad34edf
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7625
diff
changeset
|
152 |
<resource: #programImage> |
258e8ad34edf
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7625
diff
changeset
|
153 |
|
258e8ad34edf
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7625
diff
changeset
|
154 |
^ ToolbarIconLibrary startChangesBrowserIcon |
489 | 155 |
! |
156 |
||
73 | 157 |
defaultLabel |
5527 | 158 |
^ self classResources string:'Changes Browser' |
2417 | 159 |
! |
160 |
||
161 |
isVisualStartable |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
162 |
"return true, if this application can be started via #open. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
163 |
(to allow start of a change browser via double-click in the browser)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
164 |
|
2417 | 165 |
^ true |
166 |
||
167 |
"Created: / 27.9.1999 / 12:28:27 / cg" |
|
28 | 168 |
! ! |
169 |
||
16022 | 170 |
!ChangesBrowser class methodsFor:'help specs'! |
3202 | 171 |
|
10681 | 172 |
flyByHelpSpec |
16022 | 173 |
<resource: #help> |
174 |
||
175 |
^ Dictionary new |
|
176 |
addPairsFrom:#( |
|
177 |
||
178 |
#applyChange |
|
179 |
'Apply (install) the selected change' |
|
180 |
||
181 |
deleteAllForClass |
|
182 |
'Delete all changes for the selected change''s class' |
|
183 |
||
184 |
deleteForClassFromBegin |
|
17597 | 185 |
'Delete this and all previous changes for the selected change''s class' |
16022 | 186 |
|
187 |
deleteForClassToEnd |
|
188 |
'Delete this and all following changes for the selected change''s class' |
|
17565 | 189 |
|
190 |
deleteClassSelectorAll |
|
191 |
'Delete all changes for the selected method' |
|
192 |
||
193 |
deleteClassSelectorOlder |
|
17597 | 194 |
'Delete this and all previous changes for the selected method' |
16022 | 195 |
) |
17565 | 196 |
|
17597 | 197 |
"Modified: / 25-07-2017 / 10:55:55 / cg" |
16022 | 198 |
! ! |
199 |
||
200 |
!ChangesBrowser class methodsFor:'menu specs'! |
|
10681 | 201 |
|
3202 | 202 |
menuSpec |
203 |
"This resource specification was automatically generated |
|
204 |
by the MenuEditor of ST/X." |
|
205 |
||
206 |
"Do not manually edit this!! If it is corrupted, |
|
207 |
the MenuEditor may not be able to read the specification." |
|
208 |
||
10719 | 209 |
|
3202 | 210 |
" |
211 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpec |
|
212 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpec)) startUp |
|
213 |
" |
|
214 |
||
215 |
<resource: #menu> |
|
216 |
||
7360 | 217 |
^ |
6216 | 218 |
#(Menu |
7096 | 219 |
( |
220 |
(MenuItem |
|
221 |
label: 'File' |
|
17093 | 222 |
submenuChannel: menuSpecFile |
7096 | 223 |
) |
224 |
(MenuItem |
|
17096 | 225 |
label: 'CHANGE' |
17093 | 226 |
submenuChannel: menuSpecChange |
7096 | 227 |
) |
228 |
(MenuItem |
|
229 |
label: 'Search' |
|
17093 | 230 |
submenuChannel: menuSpecSearch |
7096 | 231 |
) |
232 |
(MenuItem |
|
233 |
label: 'Browse' |
|
17093 | 234 |
submenuChannel: menuSpecBrowse |
7096 | 235 |
) |
236 |
(MenuItem |
|
237 |
label: 'Settings' |
|
17093 | 238 |
submenuChannel: menuSpecSettings |
7096 | 239 |
) |
240 |
(MenuItem |
|
7463
e8e74bdbfbda
support '?' as help (for now: controlled by resources)
Claus Gittinger <cg@exept.de>
parents:
7415
diff
changeset
|
241 |
label: 'MENU_Help' |
17093 | 242 |
submenuChannel: menuSpecHelp |
243 |
) |
|
244 |
) |
|
245 |
nil |
|
246 |
nil |
|
247 |
) |
|
17096 | 248 |
|
249 |
"Modified: / 21-11-2016 / 23:46:22 / cg" |
|
17093 | 250 |
! |
251 |
||
252 |
menuSpecBrowse |
|
253 |
"This resource specification was automatically generated |
|
254 |
by the MenuEditor of ST/X." |
|
255 |
||
256 |
"Do not manually edit this!! If it is corrupted, |
|
257 |
the MenuEditor may not be able to read the specification." |
|
258 |
||
259 |
||
260 |
" |
|
261 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecBrowse |
|
262 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecBrowse)) startUp |
|
263 |
" |
|
264 |
||
265 |
<resource: #menu> |
|
266 |
||
267 |
^ |
|
268 |
#(Menu |
|
269 |
( |
|
270 |
(MenuItem |
|
271 |
enabled: hasSingleSelection |
|
272 |
label: 'Class' |
|
273 |
itemValue: doBrowse |
|
274 |
) |
|
275 |
(MenuItem |
|
276 |
label: '-' |
|
277 |
) |
|
278 |
(MenuItem |
|
279 |
label: 'Senders...' |
|
280 |
itemValue: doBrowseSenders |
|
281 |
) |
|
282 |
(MenuItem |
|
283 |
label: 'Implementors...' |
|
284 |
itemValue: doBrowseImplementors |
|
285 |
) |
|
286 |
) |
|
287 |
nil |
|
288 |
nil |
|
289 |
) |
|
290 |
! |
|
291 |
||
292 |
menuSpecChange |
|
293 |
"This resource specification was automatically generated |
|
294 |
by the MenuEditor of ST/X." |
|
295 |
||
296 |
"Do not manually edit this!! If it is corrupted, |
|
297 |
the MenuEditor may not be able to read the specification." |
|
298 |
||
299 |
||
300 |
" |
|
301 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecChange |
|
302 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecChange)) startUp |
|
303 |
" |
|
304 |
||
305 |
<resource: #menu> |
|
306 |
||
307 |
^ |
|
308 |
#(Menu |
|
309 |
( |
|
310 |
(MenuItem |
|
311 |
enabled: hasSelection |
|
312 |
label: 'Apply' |
|
313 |
itemValue: doApply |
|
314 |
) |
|
315 |
(MenuItem |
|
316 |
enabled: hasSingleSelection |
|
317 |
label: 'Apply to End' |
|
318 |
itemValue: doApplyRest |
|
319 |
) |
|
320 |
(MenuItem |
|
321 |
enabled: hasSingleSelection |
|
322 |
label: 'Apply from Begin' |
|
323 |
itemValue: doApplyFromBeginning |
|
324 |
) |
|
325 |
(MenuItem |
|
326 |
enabled: hasSingleSelection |
|
327 |
label: 'Apply for Class to End' |
|
328 |
itemValue: doApplyClassRest |
|
329 |
) |
|
330 |
(MenuItem |
|
331 |
enabled: hasSingleSelection |
|
332 |
label: 'Apply for Class from Begin' |
|
333 |
itemValue: doApplyClassFromBeginning |
|
334 |
) |
|
335 |
(MenuItem |
|
336 |
enabled: hasNoSelection |
|
337 |
label: 'Apply All' |
|
338 |
itemValue: doApplyAll |
|
339 |
) |
|
340 |
(MenuItem |
|
341 |
enabled: hasSingleSelection |
|
342 |
label: 'Apply to Conflict or End' |
|
343 |
itemValue: doApplyToConflictOrEnd |
|
344 |
) |
|
345 |
(MenuItem |
|
346 |
label: '-' |
|
347 |
) |
|
348 |
(MenuItem |
|
349 |
enabled: hasSelection |
|
350 |
label: 'Delete' |
|
351 |
itemValue: doDelete |
|
352 |
) |
|
353 |
(MenuItem |
|
354 |
enabled: hasSingleSelection |
|
355 |
label: 'Delete to End' |
|
356 |
itemValue: doDeleteRest |
|
357 |
) |
|
358 |
(MenuItem |
|
359 |
enabled: hasSingleSelection |
|
360 |
label: 'Delete from Begin' |
|
361 |
itemValue: doDeleteFromBeginning |
|
362 |
) |
|
363 |
(MenuItem |
|
364 |
enabled: hasSingleSelection |
|
365 |
label: 'Delete for Class to End' |
|
366 |
itemValue: doDeleteClassRest |
|
367 |
) |
|
368 |
(MenuItem |
|
369 |
enabled: hasSingleSelection |
|
370 |
label: 'Delete for Class from Begin' |
|
371 |
itemValue: doDeleteClassFromBeginning |
|
372 |
) |
|
373 |
(MenuItem |
|
374 |
enabled: hasSelection |
|
375 |
label: 'Delete all for Class' |
|
376 |
itemValue: doDeleteClassAll |
|
377 |
isVisible: hasNoMultiSelection |
|
378 |
) |
|
379 |
(MenuItem |
|
380 |
enabled: hasSelection |
|
381 |
label: 'Delete all for Class && its Private Classes' |
|
382 |
itemValue: doDeleteClassAndPrivateClassesAll |
|
383 |
isVisible: hasNoMultiSelection |
|
384 |
) |
|
385 |
(MenuItem |
|
386 |
enabled: hasSelection |
|
387 |
label: 'Delete all for Namespace' |
|
388 |
itemValue: doDeleteAllForNamespace |
|
389 |
) |
|
390 |
(MenuItem |
|
391 |
enabled: hasSelection |
|
392 |
label: 'Delete all for Classes' |
|
393 |
itemValue: doDeleteClassAll |
|
394 |
isVisible: hasMultiSelection |
|
395 |
) |
|
396 |
(MenuItem |
|
397 |
enabled: hasSelection |
|
398 |
label: 'Delete all for Classes && their Private Classes' |
|
399 |
itemValue: doDeleteClassAndPrivateClassesAll |
|
400 |
isVisible: hasMultiSelection |
|
401 |
) |
|
402 |
(MenuItem |
|
403 |
label: '-' |
|
404 |
) |
|
405 |
(MenuItem |
|
406 |
enabled: hasSelection |
|
407 |
label: 'Delete older Versions of Selected Method' |
|
408 |
itemValue: doDeleteClassSelectorOlder |
|
409 |
isVisible: hasNoMultiSelectionHolder |
|
410 |
) |
|
411 |
(MenuItem |
|
412 |
enabled: hasSelection |
|
413 |
label: 'Delete older Versions of all Selected Methods' |
|
414 |
itemValue: doDeleteClassSelectorOlder |
|
415 |
isVisible: hasMultiSelectionHolder |
|
416 |
) |
|
417 |
(MenuItem |
|
418 |
enabled: hasSelection |
|
419 |
label: 'Delete all Versions of Selected Method' |
|
420 |
itemValue: doDeleteClassSelectorAll |
|
421 |
isVisible: hasNoMultiSelectionHolder |
|
422 |
) |
|
423 |
(MenuItem |
|
424 |
enabled: hasSelection |
|
425 |
label: 'Delete all Versions of all Selected Methods' |
|
426 |
itemValue: doDeleteClassSelectorAll |
|
427 |
isVisible: hasMultiSelectionHolder |
|
428 |
) |
|
429 |
(MenuItem |
|
430 |
label: '-' |
|
431 |
) |
|
432 |
(MenuItem |
|
433 |
enabled: hasSingleSelection |
|
434 |
label: 'Compare with Current' |
|
435 |
itemValue: doCompare |
|
436 |
) |
|
437 |
(MenuItem |
|
17096 | 438 |
enabled: hasSingleSelection |
439 |
label: 'Copy to Clipboard' |
|
440 |
itemValue: doCopyToClipboard |
|
441 |
) |
|
442 |
(MenuItem |
|
17093 | 443 |
label: '-' |
444 |
) |
|
445 |
(MenuItem |
|
446 |
enabled: hasSelection |
|
447 |
label: 'Make Change a Patch' |
|
448 |
itemValue: doMakePatch |
|
449 |
) |
|
450 |
) |
|
451 |
nil |
|
452 |
nil |
|
453 |
) |
|
17096 | 454 |
|
455 |
"Modified: / 21-11-2016 / 23:46:42 / cg" |
|
17093 | 456 |
! |
457 |
||
458 |
menuSpecFile |
|
459 |
"This resource specification was automatically generated |
|
460 |
by the MenuEditor of ST/X." |
|
461 |
||
462 |
"Do not manually edit this!! If it is corrupted, |
|
463 |
the MenuEditor may not be able to read the specification." |
|
464 |
||
465 |
||
466 |
" |
|
467 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecFile |
|
468 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecFile)) startUp |
|
469 |
" |
|
470 |
||
471 |
<resource: #menu> |
|
472 |
||
473 |
^ |
|
474 |
#(Menu |
|
475 |
( |
|
476 |
(MenuItem |
|
477 |
label: 'Compress' |
|
478 |
itemValue: doCompress |
|
479 |
isVisible: notEditingClassSource |
|
480 |
) |
|
481 |
(MenuItem |
|
482 |
enabled: hasSingleSelection |
|
483 |
label: 'Compress for Class' |
|
484 |
itemValue: doCompressClass |
|
485 |
isVisible: notEditingClassSource |
|
486 |
) |
|
487 |
(MenuItem |
|
488 |
enabled: hasSingleSelection |
|
489 |
label: 'Compress for Class && Selector' |
|
490 |
itemValue: doCompressSelector |
|
491 |
isVisible: notEditingClassSource |
|
492 |
) |
|
493 |
(MenuItem |
|
494 |
label: 'Compare and Compress' |
|
495 |
itemValue: doCompareAndCompress |
|
496 |
isVisible: notEditingClassSource |
|
497 |
) |
|
498 |
(MenuItem |
|
499 |
label: '-' |
|
500 |
isVisible: notEditingClassSource |
|
501 |
) |
|
502 |
(MenuItem |
|
503 |
enabled: hasSingleSelection |
|
504 |
label: 'Fileout && Delete all Changes for Class' |
|
505 |
itemValue: doFileoutAndDeleteClassAll |
|
506 |
isVisible: notEditingClassSource |
|
507 |
) |
|
508 |
(MenuItem |
|
509 |
enabled: hasSelection |
|
510 |
label: 'CheckIn && Delete all Changes for Class' |
|
511 |
itemValue: doCheckinAndDeleteClassAll |
|
512 |
isVisible: notEditingClassSource |
|
513 |
) |
|
514 |
(MenuItem |
|
515 |
label: '-' |
|
516 |
isVisible: notEditingClassSource |
|
517 |
) |
|
518 |
(MenuItem |
|
519 |
enabled: hasSelection |
|
520 |
label: 'Save In...' |
|
521 |
itemValue: doSave |
|
522 |
) |
|
523 |
(MenuItem |
|
524 |
enabled: hasSingleSelection |
|
525 |
label: 'Save to End In...' |
|
526 |
itemValue: doSaveRest |
|
527 |
) |
|
528 |
(MenuItem |
|
529 |
enabled: hasSingleSelection |
|
530 |
label: 'Save for Class to End In...' |
|
531 |
itemValue: doSaveClassRest |
|
532 |
) |
|
533 |
(MenuItem |
|
534 |
enabled: hasSingleSelection |
|
535 |
label: 'Save all for Class In...' |
|
536 |
itemValue: doSaveClassAll |
|
537 |
) |
|
538 |
(MenuItem |
|
539 |
label: '-' |
|
540 |
) |
|
541 |
(MenuItem |
|
542 |
label: 'Writeback ClassFile' |
|
543 |
itemValue: doWriteBack |
|
544 |
isVisible: editingClassSource |
|
545 |
) |
|
546 |
(MenuItem |
|
547 |
label: 'Writeback ChangeFile' |
|
548 |
itemValue: doWriteBack |
|
549 |
isVisible: notEditingClassSource |
|
550 |
) |
|
551 |
(MenuItem |
|
552 |
label: '-' |
|
553 |
) |
|
554 |
(MenuItem |
|
555 |
label: 'Update' |
|
556 |
itemValue: doUpdate |
|
557 |
) |
|
558 |
(MenuItem |
|
559 |
label: '-' |
|
560 |
) |
|
561 |
(MenuItem |
|
562 |
label: 'Exit' |
|
563 |
itemValue: menuExit |
|
564 |
) |
|
565 |
) |
|
566 |
nil |
|
567 |
nil |
|
568 |
) |
|
569 |
! |
|
570 |
||
571 |
menuSpecHelp |
|
572 |
"This resource specification was automatically generated |
|
573 |
by the MenuEditor of ST/X." |
|
574 |
||
575 |
"Do not manually edit this!! If it is corrupted, |
|
576 |
the MenuEditor may not be able to read the specification." |
|
577 |
||
578 |
||
579 |
" |
|
580 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecHelp |
|
581 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecHelp)) startUp |
|
582 |
" |
|
583 |
||
584 |
<resource: #menu> |
|
585 |
||
586 |
^ |
|
587 |
#(Menu |
|
588 |
( |
|
589 |
(MenuItem |
|
590 |
label: 'ChangesBrowser Documentation' |
|
591 |
itemValue: openHTMLDocument: |
|
592 |
argument: 'tools/cbrowser/TOP.html' |
|
593 |
) |
|
594 |
(MenuItem |
|
595 |
label: '-' |
|
596 |
) |
|
597 |
(MenuItem |
|
598 |
label: 'About ChangesBrowser...' |
|
599 |
itemValue: openAboutThisApplication |
|
600 |
) |
|
601 |
) |
|
602 |
nil |
|
603 |
nil |
|
604 |
) |
|
605 |
! |
|
606 |
||
607 |
menuSpecSearch |
|
608 |
"This resource specification was automatically generated |
|
609 |
by the MenuEditor of ST/X." |
|
610 |
||
611 |
"Do not manually edit this!! If it is corrupted, |
|
612 |
the MenuEditor may not be able to read the specification." |
|
613 |
||
614 |
||
615 |
" |
|
616 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecSearch |
|
617 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecSearch)) startUp |
|
618 |
" |
|
619 |
||
620 |
<resource: #menu> |
|
621 |
||
622 |
^ |
|
623 |
#(Menu |
|
624 |
( |
|
625 |
(MenuItem |
|
626 |
label: 'Class...' |
|
627 |
itemValue: findClass |
|
628 |
) |
|
629 |
(MenuItem |
|
630 |
enabled: hasSelection |
|
631 |
label: 'First for Class' |
|
632 |
itemValue: findFirstForClass |
|
633 |
) |
|
634 |
(MenuItem |
|
635 |
enabled: hasSelection |
|
636 |
label: 'Previous for Class' |
|
637 |
itemValue: findPreviousForClass |
|
638 |
) |
|
639 |
(MenuItem |
|
640 |
enabled: hasSelection |
|
641 |
label: 'Next for Class' |
|
642 |
itemValue: findNextForClass |
|
643 |
) |
|
644 |
(MenuItem |
|
645 |
enabled: hasSelection |
|
646 |
label: 'Last for Class' |
|
647 |
itemValue: findLastForClass |
|
648 |
) |
|
649 |
(MenuItem |
|
650 |
label: '-' |
|
651 |
) |
|
652 |
(MenuItem |
|
653 |
label: 'Selector...' |
|
654 |
itemValue: findSelector |
|
655 |
) |
|
656 |
(MenuItem |
|
657 |
enabled: hasSelection |
|
658 |
label: 'Previous for Selector' |
|
659 |
itemValue: findPreviousForSelector |
|
660 |
) |
|
661 |
(MenuItem |
|
662 |
enabled: hasSelection |
|
663 |
label: 'Next for Selector' |
|
664 |
itemValue: findNextForSelector |
|
665 |
) |
|
666 |
(MenuItem |
|
667 |
label: '-' |
|
668 |
) |
|
669 |
(MenuItem |
|
670 |
label: 'String...' |
|
671 |
itemValue: findString |
|
672 |
) |
|
673 |
(MenuItem |
|
674 |
enabled: hasSelection |
|
675 |
label: 'Previous with String' |
|
676 |
itemValue: findPreviousForString |
|
677 |
) |
|
678 |
(MenuItem |
|
679 |
enabled: hasSelection |
|
680 |
label: 'Next with String' |
|
681 |
itemValue: findNextForString |
|
682 |
) |
|
683 |
(MenuItem |
|
684 |
label: '-' |
|
685 |
) |
|
686 |
(MenuItem |
|
687 |
enabled: hasSelection |
|
688 |
label: 'Previous Difference' |
|
689 |
itemValue: findPreviousDifference |
|
690 |
) |
|
691 |
(MenuItem |
|
692 |
enabled: hasSelection |
|
693 |
label: 'Next Difference' |
|
694 |
itemValue: findNextDifference |
|
695 |
) |
|
696 |
(MenuItem |
|
697 |
label: '-' |
|
698 |
) |
|
699 |
(MenuItem |
|
700 |
enabled: hasSelection |
|
701 |
label: 'Previous Snapshot' |
|
702 |
itemValue: findPreviousSnapshot |
|
703 |
) |
|
704 |
(MenuItem |
|
705 |
enabled: hasSelection |
|
706 |
label: 'Next Snapshot' |
|
707 |
itemValue: findNextSnapshot |
|
708 |
) |
|
709 |
(MenuItem |
|
710 |
label: 'Last Snapshot' |
|
711 |
itemValue: findLastSnapshot |
|
712 |
) |
|
713 |
) |
|
714 |
nil |
|
715 |
nil |
|
716 |
) |
|
717 |
! |
|
718 |
||
719 |
menuSpecSettings |
|
720 |
"This resource specification was automatically generated |
|
721 |
by the MenuEditor of ST/X." |
|
722 |
||
723 |
"Do not manually edit this!! If it is corrupted, |
|
724 |
the MenuEditor may not be able to read the specification." |
|
725 |
||
726 |
||
727 |
" |
|
728 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#menuSpecSettings |
|
729 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser menuSpecSettings)) startUp |
|
730 |
" |
|
731 |
||
732 |
<resource: #menu> |
|
733 |
||
734 |
^ |
|
735 |
#(Menu |
|
736 |
( |
|
737 |
(MenuItem |
|
738 |
label: 'Auto Compare' |
|
739 |
indication: autoCompare |
|
740 |
) |
|
741 |
(MenuItem |
|
742 |
label: 'Autoload As Required' |
|
743 |
indication: autoloadAsRequired |
|
744 |
) |
|
745 |
(MenuItem |
|
746 |
label: 'Show Diffs' |
|
747 |
indication: showingDiffs |
|
748 |
) |
|
749 |
(MenuItem |
|
750 |
label: 'Auto Update' |
|
751 |
indication: autoUpdate |
|
752 |
) |
|
753 |
(MenuItem |
|
754 |
label: '-' |
|
755 |
) |
|
756 |
(MenuItem |
|
757 |
label: 'Add to ChangeSet when Applying' |
|
758 |
indication: updateChangeSet |
|
759 |
) |
|
760 |
(MenuItem |
|
761 |
label: 'Ignore Public/Private in Categories (Dolphin code)' |
|
762 |
itemValue: ignorePublicPrivateCategories: |
|
763 |
isVisible: false |
|
764 |
indication: ignorePublicPrivateCategories |
|
765 |
) |
|
766 |
(MenuItem |
|
767 |
label: '-' |
|
768 |
) |
|
769 |
(MenuItem |
|
770 |
label: 'Apply into Package...' |
|
771 |
itemValue: setEnforcedPackage |
|
772 |
) |
|
773 |
(MenuItem |
|
774 |
label: 'Apply into NameSpace...' |
|
775 |
itemValue: setEnforcedNameSpace |
|
776 |
) |
|
777 |
(MenuItem |
|
778 |
label: '-' |
|
779 |
) |
|
780 |
(MenuItem |
|
781 |
label: 'Settings...' |
|
782 |
itemValue: openSettingsDialog |
|
7096 | 783 |
) |
784 |
) |
|
785 |
nil |
|
786 |
nil |
|
3202 | 787 |
) |
10681 | 788 |
! |
789 |
||
790 |
toolbarMenuSpec |
|
791 |
"This resource specification was automatically generated |
|
792 |
by the MenuEditor of ST/X." |
|
793 |
||
794 |
"Do not manually edit this!! If it is corrupted, |
|
795 |
the MenuEditor may not be able to read the specification." |
|
796 |
||
797 |
||
798 |
" |
|
799 |
MenuEditor new openOnClass:ChangesBrowser andSelector:#toolbarMenuSpec |
|
800 |
(Menu new fromLiteralArrayEncoding:(ChangesBrowser toolbarMenuSpec)) startUp |
|
801 |
" |
|
802 |
||
803 |
<resource: #menu> |
|
804 |
||
805 |
^ |
|
806 |
#(Menu |
|
807 |
( |
|
808 |
(MenuItem |
|
809 |
activeHelpKey: applyChange |
|
810 |
enabled: hasSelectionHolder |
|
811 |
label: 'Apply' |
|
812 |
itemValue: doApply |
|
813 |
translateLabel: true |
|
814 |
isButton: true |
|
815 |
labelImage: (ResourceRetriever ToolbarIconLibrary executeMethod20x20Icon) |
|
816 |
) |
|
817 |
(MenuItem |
|
818 |
label: '-' |
|
819 |
) |
|
820 |
(MenuItem |
|
821 |
activeHelpKey: deleteAllForClass |
|
822 |
enabled: hasSelectionHolder |
|
15016 | 823 |
isVisible: canDeleteChanges |
10681 | 824 |
label: 'Delete all for Class' |
825 |
itemValue: doDeleteClassAll |
|
826 |
translateLabel: true |
|
827 |
isButton: true |
|
828 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteClass24x24Icon) |
|
829 |
) |
|
13991 | 830 |
(MenuItem |
16022 | 831 |
activeHelpKey: deleteForClassFromBegin |
832 |
enabled: hasSelectionHolder |
|
833 |
isVisible: canDeleteChanges |
|
834 |
label: 'Delete for Class from Beginning' |
|
835 |
itemValue: doDeleteClassFromBeginning |
|
836 |
translateLabel: true |
|
837 |
isButton: true |
|
838 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteClassFromStart24x24Icon) |
|
839 |
) |
|
840 |
(MenuItem |
|
13991 | 841 |
activeHelpKey: deleteForClassToEnd |
842 |
enabled: hasSelectionHolder |
|
15016 | 843 |
isVisible: canDeleteChanges |
13991 | 844 |
label: 'Delete for Class to End' |
845 |
itemValue: doDeleteClassRest |
|
846 |
translateLabel: true |
|
847 |
isButton: true |
|
848 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteClassToEnd24x24Icon) |
|
849 |
) |
|
17565 | 850 |
(MenuItem |
851 |
label: '-' |
|
852 |
) |
|
853 |
(MenuItem |
|
854 |
activeHelpKey: deleteClassSelectorAll |
|
855 |
enabled: hasSelectionHolder |
|
856 |
isVisible: canDeleteChanges |
|
857 |
label: 'Delete all Versions of this Method' |
|
858 |
itemValue: doDeleteClassSelectorAll |
|
859 |
translateLabel: true |
|
860 |
isButton: true |
|
861 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteMethod24x24Icon) |
|
862 |
) |
|
863 |
(MenuItem |
|
864 |
activeHelpKey: deleteClassSelectorOlder |
|
865 |
enabled: hasSelectionHolder |
|
866 |
isVisible: canDeleteChanges |
|
867 |
label: 'Delete older Versions of this Method' |
|
868 |
itemValue: doDeleteClassSelectorOlder |
|
869 |
translateLabel: true |
|
870 |
isButton: true |
|
871 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteMethodFromStart24x24Icon) |
|
872 |
) |
|
10681 | 873 |
) |
874 |
nil |
|
875 |
nil |
|
876 |
) |
|
17565 | 877 |
|
878 |
"Modified: / 07-07-2017 / 12:52:28 / cg" |
|
3202 | 879 |
! ! |
880 |
||
3674 | 881 |
!ChangesBrowser class methodsFor:'private-changeFile access'! |
882 |
||
883 |
readXMLChangesFrom:aStream inBackground:inBackground |
|
884 |
"read an XML source file (format as in campSmalltalk DTD)" |
|
885 |
||
886 |
|changeSet| |
|
887 |
||
888 |
(XML isNil or:[XML::SourceNodeBuilder isNil or:[XML::XMLParser isNil]]) ifTrue:[ |
|
6288 | 889 |
Smalltalk loadPackage:'stx:goodies/xml/vw'. |
890 |
(XML isNil or:[XML::SourceNodeBuilder isNil or:[XML::XMLParser isNil]]) ifTrue:[ |
|
891 |
self error:'Could not load XML package(s) from ''stx:goodies/xml/vw'''. |
|
892 |
] |
|
3674 | 893 |
]. |
894 |
||
895 |
changeSet := ChangeSet new. |
|
6288 | 896 |
XML::SourceScannerNodeBuilder new |
897 |
scanFile:aStream |
|
898 |
do:[:eachChange | |
|
899 |
changeSet addChange:eachChange. |
|
900 |
]. |
|
3674 | 901 |
^ changeSet |
902 |
||
903 |
"/ builder := XML::SourceScannerNodeBuilder new. |
|
904 |
"/ parser := XML::XMLParser on:aStream. |
|
905 |
"/ parser builder:builder. |
|
906 |
"/ parser validate:false. |
|
907 |
"/ parser scanDocument. |
|
908 |
! |
|
909 |
||
910 |
readXMLChangesFromFile:changeFileName inBackground:inBackground |
|
14011 | 911 |
|set| |
912 |
||
913 |
changeFileName asFilename readingFileDo:[:s| |
|
914 |
set := self readXMLChangesFrom:s inBackground:false. |
|
915 |
]. |
|
3674 | 916 |
^ set. |
917 |
! ! |
|
918 |
||
919 |
!ChangesBrowser class methodsFor:'utilities'! |
|
920 |
||
921 |
isXMLFile:aFilename |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
922 |
|stream first| |
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
923 |
|
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
924 |
stream := aFilename asFilename readStreamOrNil. |
3674 | 925 |
stream isNil ifTrue:[^ false]. |
926 |
||
927 |
stream skipSeparators. |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
928 |
first := stream peek. |
3674 | 929 |
stream close. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
930 |
^ first == $< |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
931 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
932 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
933 |
methodDefinitionSelectors |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
934 |
^ #( |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
935 |
#'methodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
936 |
#'privateMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
937 |
#'publicMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
938 |
#'ignoredMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
939 |
#'protectedMethodsFor:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
940 |
#'methodsFor:stamp:' "/ Squeak support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
941 |
#'commentStamp:prior:' "/ Squeak support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
942 |
#methodsFor "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
943 |
#categoriesForClass "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
944 |
#'categoriesFor:' "/ Dolphin support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
945 |
#methods "/ STV support |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
946 |
#publicMethods "/ STV / V'Age support |
6532 | 947 |
#privateMethods "/ STV / V'Age support |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
948 |
#'methodsForUndefined:' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
949 |
) |
3674 | 950 |
! ! |
951 |
||
3202 | 952 |
!ChangesBrowser methodsFor:'aspects'! |
953 |
||
954 |
applyInOriginalNameSpace |
|
955 |
^ applyInOriginalNameSpace |
|
956 |
! |
|
957 |
||
3472 | 958 |
applyNotInOriginalNameSpace |
6288 | 959 |
^ BlockValue forLogicalNot:self applyInOriginalNameSpace |
3472 | 960 |
! |
961 |
||
3202 | 962 |
autoCompare |
963 |
^ autoCompare |
|
964 |
! |
|
965 |
||
966 |
autoUpdate |
|
967 |
"enabled/disable automatic update from the change-file (for monitoring)" |
|
968 |
||
969 |
^ autoUpdate |
|
970 |
||
971 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
972 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
973 |
! |
|
974 |
||
6216 | 975 |
autoloadAsRequired |
976 |
^ autoloadAsRequired |
|
977 |
! |
|
978 |
||
15016 | 979 |
canDeleteChanges |
980 |
"makes the delete buttons in the toolbar visible" |
|
981 |
||
982 |
^ true. |
|
983 |
! |
|
984 |
||
11048 | 985 |
changeListSelectionHolder |
986 |
changeListSelectionHolder isNil ifTrue:[ |
|
987 |
changeListSelectionHolder := nil asValue. |
|
988 |
]. |
|
989 |
^ changeListSelectionHolder |
|
990 |
||
991 |
"Created: / 03-01-2012 / 15:19:25 / cg" |
|
992 |
! |
|
993 |
||
3202 | 994 |
editingClassSource |
3203 | 995 |
^ editingClassSource ? false |
3202 | 996 |
! |
997 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
998 |
hasMultiSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
999 |
^ self hasSelection and:[self hasSingleSelection not] |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1000 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1001 |
|
11028 | 1002 |
hasMultiSelectionHolder |
1003 |
^ [ self hasMultiSelection ] |
|
1004 |
||
1005 |
"Created: / 25-12-2011 / 11:21:52 / cg" |
|
1006 |
! |
|
1007 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1008 |
hasNoMultiSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1009 |
^ self hasMultiSelection not |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1010 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1011 |
|
11028 | 1012 |
hasNoMultiSelectionHolder |
1013 |
^ [ self hasNoMultiSelection ] |
|
1014 |
||
1015 |
"Created: / 25-12-2011 / 11:21:20 / cg" |
|
1016 |
! |
|
1017 |
||
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1018 |
hasNoSelection |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1019 |
^ self hasSelection not |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1020 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1021 |
|
3202 | 1022 |
hasSelection |
6288 | 1023 |
^ changeListView hasSelection |
3202 | 1024 |
! |
1025 |
||
11048 | 1026 |
hasSelectionHolder |
1027 |
^ BlockValue |
|
1028 |
with:[:v | v notEmptyOrNil ] |
|
1029 |
argument:(self changeListSelectionHolder) |
|
1030 |
||
1031 |
"Created: / 03-01-2012 / 15:15:47 / cg" |
|
1032 |
! |
|
1033 |
||
3211 | 1034 |
hasSingleSelection |
1035 |
changeListView multipleSelectOk ifTrue:[ |
|
6288 | 1036 |
^ changeListView selection size == 1 |
3211 | 1037 |
]. |
1038 |
^ changeListView hasSelection |
|
1039 |
! |
|
1040 |
||
10719 | 1041 |
ignorePublicPrivateCategories |
1042 |
^ ignorePublicPrivateCategories |
|
1043 |
||
1044 |
"Created: / 23-09-2011 / 19:42:46 / cg" |
|
1045 |
! |
|
1046 |
||
3202 | 1047 |
notEditingClassSource |
1048 |
^ self editingClassSource not |
|
3211 | 1049 |
! |
1050 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1051 |
notEditingClassSourceAndNotReadOnly |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1052 |
^ (self editingClassSource or:[readOnly == true]) not |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1053 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1054 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1055 |
notReadOnly |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1056 |
^ (readOnly ~~ true) |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1057 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1058 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1059 |
readOnly:aBoolean |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1060 |
readOnly := aBoolean |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1061 |
! |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1062 |
|
4487 | 1063 |
showingDiffs |
1064 |
showingDiffs isNil ifTrue:[ |
|
6288 | 1065 |
showingDiffs := self showingDiffsDefault asValue. |
1066 |
showingDiffs |
|
1067 |
onChangeEvaluate:[ |
|
1068 |
showingDiffs value ifTrue:[ |
|
1069 |
self updateDiffView. |
|
1070 |
self makeDiffViewVisible |
|
1071 |
] ifFalse:[ |
|
1072 |
self makeDiffViewInvisible |
|
1073 |
]. |
|
1074 |
DefaultShowingDiffs := showingDiffs value. |
|
1075 |
] |
|
4487 | 1076 |
]. |
1077 |
^ showingDiffs |
|
1078 |
! |
|
1079 |
||
4943 | 1080 |
showingDiffsDefault |
1081 |
^ (DefaultShowingDiffs ? true) |
|
1082 |
! |
|
1083 |
||
3211 | 1084 |
theSingleSelection |
1085 |
|sel| |
|
1086 |
||
1087 |
sel := changeListView selection. |
|
1088 |
changeListView multipleSelectOk ifTrue:[ |
|
6288 | 1089 |
sel size == 1 ifTrue:[ |
1090 |
^ sel first |
|
1091 |
]. |
|
1092 |
^ nil |
|
3211 | 1093 |
]. |
1094 |
^ sel. |
|
3319 | 1095 |
! |
1096 |
||
1097 |
updateChangeSet |
|
1098 |
^ updateChangeSet |
|
3202 | 1099 |
! ! |
1100 |
||
202 | 1101 |
!ChangesBrowser methodsFor:'compiler interface'! |
1102 |
||
1103 |
wantChangeLog |
|
1104 |
"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
|
1105 |
be written when compiling. Return false here." |
202 | 1106 |
|
1107 |
^ false |
|
1108 |
! ! |
|
1109 |
||
4869 | 1110 |
!ChangesBrowser methodsFor:'compiler interface-error handling'! |
202 | 1111 |
|
1112 |
correctableError:aString position:relPos to:relEndPos from:aCompiler |
|
12656 | 1113 |
"compiler notifies us of an error - this should really not happen since |
202 | 1114 |
changes ought to be correct (did someone edit the changes file ??). |
1115 |
Show the bad change in the codeView and let codeView hilight the error; |
|
1116 |
no corrections allowed here therefore return false" |
|
1117 |
||
2293 | 1118 |
ShowWarningDialogs == true ifTrue:[ |
12656 | 1119 |
self error:aString position:relPos to:relEndPos from:aCompiler. |
2293 | 1120 |
] ifFalse:[ |
12656 | 1121 |
Transcript showCR:aString. |
2293 | 1122 |
]. |
202 | 1123 |
^ false |
1124 |
! |
|
1125 |
||
2555 | 1126 |
correctableSelectorWarning:aString position:relPos to:relEndPos from:aCompiler |
12656 | 1127 |
"compiler notifies us of a warning" |
2555 | 1128 |
|
1129 |
^ false |
|
1130 |
||
1131 |
"Modified: / 19.1.2000 / 16:25:31 / cg" |
|
1132 |
"Created: / 19.1.2000 / 16:27:23 / cg" |
|
1133 |
! |
|
1134 |
||
9621
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1135 |
correctableWarning:aString position:relPos to:relEndPos from:aCompiler |
12656 | 1136 |
"compiler notifies us of an error - this should really not happen since |
9621
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1137 |
changes ought to be correct (did someone edit the changes file ??). |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1138 |
Show the bad change in the codeView and let codeView hilight the error; |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1139 |
no corrections allowed here therefore return false" |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1140 |
|
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1141 |
^ self correctableError:aString position:relPos to:relEndPos from:aCompiler |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1142 |
|
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1143 |
"Created: / 02-11-2010 / 13:29:52 / cg" |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1144 |
! |
2353a178d5c7
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
9604
diff
changeset
|
1145 |
|
202 | 1146 |
error:aString position:relPos to:relEndPos from:aCompiler |
12656 | 1147 |
"compiler notifies us of an error - this should really not happen since |
202 | 1148 |
changes ought to be correct (did someone edit the changes file ??). |
1149 |
Show the bad change in the codeView and let codeView hilight the error" |
|
1150 |
||
1151 |
|action| |
|
1152 |
||
1153 |
(changeNrProcessed ~~ changeNrShown) ifTrue:[ |
|
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1154 |
self changeSelection:changeNrProcessed |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1155 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1156 |
|
12973 | 1157 |
"if more than a single change is applied, |
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1158 |
ask the user if he wants to abort the whole sequence of operations..." |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1159 |
multipleApply == true ifTrue:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1160 |
codeView highlightingErrorPosition:relPos to:relEndPos do:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1161 |
|box| |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1162 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1163 |
" |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1164 |
start dialog - make certain cleanup is done |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1165 |
" |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1166 |
action := OptionBox |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1167 |
request:aString |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1168 |
label:'Error' |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1169 |
image:(WarningBox iconBitmap) |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1170 |
buttonLabels:#('Cancel All' 'Skip this Change' " 'Shut up' " 'Continue') |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1171 |
values:#(abortAll skip "shutUp" continue) |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1172 |
default:#continue |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1173 |
onCancel:#abort. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1174 |
]. |
2293 | 1175 |
|
1176 |
"/ action == #shutUp ifTrue:[ |
|
1177 |
"/ aCompiler ignoreWarnings. |
|
6288 | 1178 |
"/ ^ false |
2293 | 1179 |
"/ ]. |
1180 |
||
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1181 |
action == #abortAll ifTrue:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1182 |
AbortAllOperationRequest raise. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1183 |
^ false |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1184 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1185 |
action == #skip ifTrue:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1186 |
AbortOperationRequest raise. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1187 |
^ false |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1188 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
1189 |
^ false |
202 | 1190 |
]. |
1191 |
^ codeView error:aString position:relPos to:relEndPos from:aCompiler |
|
373 | 1192 |
|
3436
c4fe19deba58
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3406
diff
changeset
|
1193 |
"Modified: / 16.11.2001 / 17:38:10 / cg" |
202 | 1194 |
! |
1195 |
||
3064 | 1196 |
unusedVariableWarning:aString position:relPos to:relEndPos from:aCompiler |
1197 |
"compiler notifies us of a (or some) unused variables; |
|
1198 |
hilight the error (relPos to relEndPos) and show a Box asking for continue/correct/abort; |
|
1199 |
this method should return true to the compiler if user wants the error |
|
1200 |
to be corrected; false otherwise" |
|
1201 |
||
1202 |
^ false |
|
1203 |
! |
|
1204 |
||
202 | 1205 |
warning:aString position:relPos to:relEndPos from:aCompiler |
12656 | 1206 |
"compiler notifies us of a warning - ignore it" |
202 | 1207 |
|
1208 |
^ self |
|
1209 |
! ! |
|
1210 |
||
2604 | 1211 |
!ChangesBrowser methodsFor:'event handling'! |
202 | 1212 |
|
1213 |
handlesKeyPress:key inView:view |
|
1214 |
"this method is reached via delegation: are we prepared to handle |
|
1215 |
a keyPress in some other view ?" |
|
1216 |
||
1127 | 1217 |
<resource: #keyboard (#Delete #BackSpace #Accept #Find #FindPrev #FindNext)> |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1218 |
|
202 | 1219 |
view == changeListView ifTrue:[ |
6288 | 1220 |
(key == #Delete |
1221 |
or:[key == #BackSpace |
|
1222 |
or:[key == #Accept |
|
1223 |
or:[key == #Find |
|
1224 |
or:[key == #FindPrev |
|
1225 |
or:[key == #FindNext]]]]]) ifTrue:[^ true]. |
|
202 | 1226 |
]. |
1227 |
^ false |
|
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1228 |
|
1127 | 1229 |
"Modified: 8.4.1997 / 11:01:42 / cg" |
0 | 1230 |
! |
1231 |
||
202 | 1232 |
keyPress:key x:x y:y view:view |
1233 |
"this method is reached via delegation from the changeListView" |
|
1234 |
||
1127 | 1235 |
<resource: #keyboard (#Delete #BackSpace #Accept #Find #FindPrev #FindNext)> |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1236 |
|
3249 | 1237 |
(key == #Delete) ifTrue:[ |
13078 | 1238 |
self sensor shiftDown ifTrue:[ |
1239 |
self doDeleteAndSelectPrevious. |
|
1240 |
] ifFalse:[ |
|
1241 |
self doDelete. |
|
1242 |
]. |
|
1243 |
^ self |
|
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1244 |
]. |
3249 | 1245 |
(key == #BackSpace) ifTrue:[ |
13078 | 1246 |
self doDelete. "/ doDeleteAndSelectPrevious. |
1247 |
^ self |
|
3249 | 1248 |
]. |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1249 |
(key == #Accept) ifTrue:[ |
13078 | 1250 |
self doApply. |
1251 |
^ self |
|
202 | 1252 |
]. |
1127 | 1253 |
(key == #Find) ifTrue:[ |
13078 | 1254 |
self findClass. |
1255 |
^ self |
|
1127 | 1256 |
]. |
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1257 |
(key == #FindPrev) ifTrue:[ |
13078 | 1258 |
self findPrevious. |
1259 |
^ self |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1260 |
]. |
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1261 |
(key == #FindNext) ifTrue:[ |
13078 | 1262 |
self findNext. |
1263 |
^ self |
|
975
41a41f54874d
added findPrev (Alt-B) and findNext (Alt-F)
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
1264 |
]. |
202 | 1265 |
changeListView keyPress:key x:x y:y |
417
c80a8acf429c
show shortkeys in changeList view
Claus Gittinger <cg@exept.de>
parents:
394
diff
changeset
|
1266 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1267 |
"Modified: / 18.6.1998 / 22:15:36 / cg" |
202 | 1268 |
! ! |
1269 |
||
3327 | 1270 |
!ChangesBrowser methodsFor:'help'! |
202 | 1271 |
|
16022 | 1272 |
flyByHelpSpec |
1273 |
^ self class flyByHelpSpec |
|
1274 |
! |
|
1275 |
||
394 | 1276 |
showActivity:someMessage |
502 | 1277 |
"some activityNotification to be forwarded to the user; |
1278 |
show it in the windows title area here." |
|
1279 |
||
11346 | 1280 |
someMessage isNil ifTrue:[ |
1281 |
self newLabel:'' |
|
11347 | 1282 |
] ifFalse:[ |
1283 |
self label:someMessage |
|
1284 |
]. |
|
394 | 1285 |
|
1286 |
"Created: 24.2.1996 / 19:35:42 / cg" |
|
502 | 1287 |
"Modified: 23.4.1996 / 21:39:36 / cg" |
202 | 1288 |
! ! |
1289 |
||
4868 | 1290 |
!ChangesBrowser methodsFor:'initialization & release'! |
202 | 1291 |
|
3202 | 1292 |
autoCompareChanged |
1293 |
"sent from the compare-toggle" |
|
1294 |
||
3534 | 1295 |
|doCompare| |
1296 |
||
13373 | 1297 |
self askIfChangesAreToBeWrittenBack. |
1298 |
||
3534 | 1299 |
doCompare := autoCompare value. |
1300 |
DefaultAutoCompare := doCompare. |
|
1301 |
self setupTabSpec. |
|
1302 |
doCompare ifTrue:[ |
|
13373 | 1303 |
self doUpdate |
3202 | 1304 |
] ifFalse:[ |
13373 | 1305 |
changeListView invalidate. "/ clear; redraw. |
3202 | 1306 |
] |
1307 |
! |
|
1308 |
||
202 | 1309 |
changeListMenu |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1310 |
"return the menu for the change (upper) list" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
1311 |
|
586 | 1312 |
<resource: #keyboard ( #Accept #Delete ) > |
1359 | 1313 |
<resource: #programMenu > |
586 | 1314 |
|
3211 | 1315 |
|items m replNext replPrev sel| |
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1316 |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1317 |
self sensor ctrlDown ifTrue:[ |
7360 | 1318 |
"/ notice - findNext/prev shortKeys will search for the same thing again. |
1319 |
items := #( |
|
1320 |
('Search Class...' findClass #Find ) |
|
1321 |
('Previous for this Class' findPreviousForClass #FindPrevClass ) |
|
1322 |
('Next for this Class' findNextForClass #FindNextClass ) |
|
1323 |
('-' ) |
|
1324 |
('Search Selector...' findSelector ) |
|
1325 |
('Previous with this Selector' findPreviousForSelector #FindPrevSelector ) |
|
1326 |
('Next with this Selector' findNextForSelector #FindNextSelector ) |
|
1327 |
('-' ) |
|
1328 |
('Search String...' findString ) |
|
1329 |
('Previous with this String' findPreviousForString #FindPrevString ) |
|
1330 |
('Next with this String' findNextForString #FindNextString ) |
|
1331 |
('-' ) |
|
1332 |
('Previous Snapshot' findPreviousSnapshot #FindPrevSnapshot ) |
|
1333 |
('Next Snapshot' findNextSnapshot #FindNextSnapshot ) |
|
1334 |
). |
|
1335 |
||
1336 |
lastSearchType == #selector ifTrue:[ |
|
1337 |
replNext := #FindNextSelector. |
|
1338 |
replPrev := #FindPrevSelector. |
|
1339 |
] ifFalse:[ |
|
1340 |
lastSearchType == #snapshot ifTrue:[ |
|
1341 |
replNext := #FindNextSnapshot. |
|
1342 |
replPrev := #FindPrevSnapshot. |
|
1343 |
] ifFalse:[ |
|
1344 |
lastSearchType == #string ifTrue:[ |
|
1345 |
replNext := #FindNextString. |
|
1346 |
replPrev := #FindPrevString. |
|
1347 |
] ifFalse:[ |
|
1348 |
replNext := #FindNextClass. |
|
1349 |
replPrev := #FindPrevClass. |
|
1350 |
] |
|
1351 |
] |
|
1352 |
]. |
|
1353 |
items := items deepCopy. |
|
1354 |
items do:[:each | |
|
1355 |
each replaceAll:replNext with:#FindNext. |
|
1356 |
each replaceAll:replPrev with:#FindPrev. |
|
1357 |
each replaceAny:#(FindNextClass FindPrevClass |
|
1358 |
FindNextSelector FindPrevSelector |
|
1359 |
FindNextSnapshot FindPrevSnapshot |
|
1360 |
FindNextString FindPrevString) |
|
1361 |
with:nil. |
|
1362 |
]. |
|
1363 |
||
1364 |
^ PopUpMenu itemList:items resources:resources. |
|
1706
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1365 |
]. |
dd888c645873
added more search functions and a control-menu.
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1366 |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1367 |
items := #( |
7360 | 1368 |
('Apply' doApply Accept) |
1369 |
('Apply to End' doApplyRest ) |
|
1370 |
('Apply from Begin' doApplyFromBeginning ) |
|
1371 |
('Apply for Class to End' doApplyClassRest ) |
|
1372 |
('Apply for Class from Begin' doApplyClassFromBeginning ) |
|
1373 |
('Apply All' doApplyAll ) |
|
1374 |
('-' ) |
|
1375 |
('Delete' doDelete Delete) |
|
1376 |
('Delete to End' doDeleteRest ) |
|
1377 |
('Delete for Class to End' doDeleteClassRest ) |
|
1378 |
('Delete for Class from Begin' doDeleteClassFromBeginning ) |
|
1379 |
). |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1380 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1381 |
(self hasSelection and:[self hasSingleSelection not]) ifTrue:[ |
7360 | 1382 |
items := items , |
1383 |
#( |
|
15187 | 1384 |
('Delete all for Classes' doDeleteClassAll ) |
1385 |
('Delete all for Classes & their Private Classes' doDeleteClassAndPrivateClassesAll ) |
|
7360 | 1386 |
). |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1387 |
] ifFalse:[ |
7360 | 1388 |
items := items , |
1389 |
#( |
|
15187 | 1390 |
('Delete all for Class' doDeleteClassAll ) |
1391 |
('Delete all for Class & its Private Classes' doDeleteClassAndPrivateClassesAll ) |
|
7360 | 1392 |
). |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1393 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1394 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1395 |
items := items , |
7360 | 1396 |
#( |
1397 |
('-' ) |
|
1398 |
('Compress' doCompress ) |
|
1399 |
('Compress for Class' doCompressClass ) |
|
1400 |
('Compare and Compress' doCompareAndCompress ) |
|
1401 |
('-' ) |
|
1402 |
('Compare with current Version' doCompare ) |
|
1403 |
('Browse Class' doBrowse ) |
|
1404 |
('-' ) |
|
1405 |
('Make Change a Patch' doMakePatch ) |
|
1406 |
). |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1407 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1408 |
editingClassSource ifFalse:[ |
7360 | 1409 |
items := items , #( |
15187 | 1410 |
('Fileout & Delete all for Class' doFileoutAndDeleteClassAll ) |
1411 |
('CheckIn & Delete all for Class' doCheckinAndDeleteClassAll ) |
|
7360 | 1412 |
) |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1413 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1414 |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1415 |
items := items , #( |
7360 | 1416 |
('-' ) |
1417 |
('Save in...' doSave ) |
|
1418 |
('Save to End In...' doSaveRest ) |
|
1419 |
('Save for Class to End In...' doSaveClassRest ) |
|
1420 |
('Save all for Class In...' doSaveClassAll ) |
|
1421 |
('-' ) |
|
1422 |
). |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1423 |
|
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1424 |
editingClassSource ifTrue:[ |
7360 | 1425 |
items := items , #( |
1426 |
('Writeback ClassFile' doWriteBack ) |
|
1427 |
) |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1428 |
] ifFalse:[ |
7360 | 1429 |
items := items , #( |
1430 |
('Writeback ChangeFile' doWriteBack ) |
|
1431 |
) |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1432 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
1433 |
|
1833
c9b1a30b326d
moved update item to the end
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
1434 |
items := items , #( |
7360 | 1435 |
('-' ) |
1436 |
('Update' doUpdate ) |
|
1437 |
). |
|
1670
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1438 |
|
c3915af3f7f6
use new menu creation message
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
1439 |
m := PopUpMenu itemList:items resources:resources. |
202 | 1440 |
|
255 | 1441 |
"/ |
1442 |
"/ disable those that require a selected entry |
|
1443 |
"/ |
|
3202 | 1444 |
self hasSelection ifFalse:[ |
7360 | 1445 |
m disableAll:#(doApply doApplyClassRest doApplyRest doDelete doDeleteRest doDeleteClassRest |
1446 |
doDeleteClassFromBeginning doDeleteClassAll doDeleteClassAndPrivateClassesAll |
|
1447 |
doCompare doCompressClass doMakePatch doSaveChangeInFile doMakePermanent |
|
1448 |
doSave doSaveRest doSaveClassAll doSaveClassRest doBrowse |
|
1449 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll) |
|
1368 | 1450 |
] ifTrue:[ |
7360 | 1451 |
sel := self theSingleSelection. |
1452 |
sel isNil ifTrue:[ |
|
1453 |
"/ multiple selections |
|
1454 |
m disableAll:#(doApplyClassRest doApplyRest doDeleteClassRest doDeleteRest |
|
1455 |
doDeleteClassFromBeginning |
|
1456 |
doCompressClass doCompare |
|
1457 |
doSaveClassAll doSaveClassRest doSaveRest doBrowse |
|
1458 |
doFileoutAndDeleteClassAll) |
|
1459 |
] ifFalse:[ |
|
1460 |
(self classNameOfChange:sel) isNil ifTrue:[ |
|
1461 |
m disableAll:#(doApplyClassRest doDeleteClassRest |
|
1462 |
doDeleteClassFromBeginning doDeleteClassAll doDeleteClassAndPrivateClassesAll |
|
1463 |
doCompressClass doCompare doMakePatch |
|
1464 |
doSaveClassAll doSaveClassRest doBrowse |
|
1465 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll) |
|
1466 |
] |
|
1467 |
] |
|
255 | 1468 |
]. |
1469 |
||
1470 |
"/ |
|
1471 |
"/ disable those that do not make sense with autoUpdate |
|
1472 |
"/ ('cause this would be overwritten by next update operation) |
|
1473 |
"/ |
|
3202 | 1474 |
autoUpdate value ifTrue:[ |
7360 | 1475 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
1476 |
doDeleteClassAndPrivateClassesAll doCompress |
|
1477 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
|
1478 |
doWriteBack) |
|
202 | 1479 |
]. |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1480 |
readOnly == true ifTrue:[ |
7360 | 1481 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
1482 |
doDeleteClassAndPrivateClassesAll doCompress |
|
1483 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
|
1484 |
doWriteBack doSaveBack doUpdate |
|
1485 |
doApplyAll doApplyRest) |
|
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1486 |
]. |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1487 |
|
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1488 |
self hasSelection ifTrue:[ |
7360 | 1489 |
m disable:#doApplyAll |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
1490 |
]. |
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3211
diff
changeset
|
1491 |
|
202 | 1492 |
^ m |
1493 |
||
7360 | 1494 |
"Modified: / 06-09-1995 / 17:14:22 / claus" |
1495 |
"Modified: / 06-10-2006 / 11:17:06 / cg" |
|
202 | 1496 |
! |
1497 |
||
2114 | 1498 |
destroy |
1499 |
"destroy the receiver; make certain, that boxes are destroyed too" |
|
1500 |
||
1501 |
Processor removeTimedBlock:checkBlock. |
|
1502 |
ObjectMemory removeDependent:self. |
|
1503 |
super destroy |
|
1504 |
! |
|
1505 |
||
202 | 1506 |
initialize |
16467 | 1507 |
|panel infoLabel v upperFrame buttonPanel menuPanel mH toolbarMenu tmH |
9168 | 1508 |
checkBox oldStyle codeViewBox lbl applyInOriginal| |
3202 | 1509 |
|
3211 | 1510 |
"/ oldStyle := true. |
3202 | 1511 |
oldStyle := false. |
202 | 1512 |
|
1513 |
super initialize. |
|
1514 |
||
5702 | 1515 |
changeFileName := ObjectMemory nameForChanges. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
1516 |
encodingIfKnown := nil. |
3534 | 1517 |
autoCompare := (DefaultAutoCompare ? false) asValue. |
3202 | 1518 |
autoCompare onChangeSend:#autoCompareChanged to:self. |
1519 |
autoUpdate := false asValue. |
|
6216 | 1520 |
autoloadAsRequired := false asValue. |
10719 | 1521 |
ignorePublicPrivateCategories := false asValue. |
9168 | 1522 |
|
1523 |
applyInOriginal := true. |
|
1524 |
KeepEnforcedNameSpace == true ifTrue:[ |
|
1525 |
enforcedNameSpace := LastEnforcedNameSpace. |
|
1526 |
applyInOriginal := false. |
|
1527 |
]. |
|
1528 |
||
1529 |
applyInOriginalNameSpace := applyInOriginal asValue. |
|
6288 | 1530 |
applyInOriginalNameSpace |
6357 | 1531 |
onChangeEvaluate:[ |
1532 |
autoCompare value ifTrue:[ |
|
1533 |
self doUpdate |
|
1534 |
]. |
|
1535 |
]. |
|
9168 | 1536 |
|
4897 | 1537 |
updateChangeSet := true "false" asValue. |
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
1538 |
classesNotToBeAutoloaded := Set new. |
221 | 1539 |
|
1099
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1540 |
" |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1541 |
checkBlock is executed by the Processor. |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1542 |
We use #pushEvent: to perform the update |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1543 |
in our windowgroups process. |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1544 |
" |
b0a4e8ccc5cc
Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
1545 |
checkBlock := [self pushEvent:#checkIfFileHasChanged]. |
202 | 1546 |
|
3202 | 1547 |
oldStyle ifFalse:[ |
6357 | 1548 |
menuPanel := MenuPanel in:self. |
1549 |
"/ menuPanel level:1. |
|
1550 |
menuPanel verticalLayout:false. |
|
1551 |
menuPanel receiver:self. |
|
1552 |
menuPanel menu:(self pullDownMenu). |
|
1553 |
||
8164
ee17624160a6
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8102
diff
changeset
|
1554 |
mH := menuPanel preferredHeight. |
6357 | 1555 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
1556 |
mH := mH + 1. |
|
10681 | 1557 |
|
1558 |
toolbarMenu := MenuPanel in:self. |
|
1559 |
toolbarMenu verticalLayout:false. |
|
1560 |
toolbarMenu receiver:self. |
|
1561 |
toolbarMenu menu:(self toolbarMenu). |
|
16022 | 1562 |
toolbarMenu flyByHelpSpecProvider:self. "/ for helpTexts |
10681 | 1563 |
|
1564 |
tmH := toolbarMenu preferredHeight. |
|
1565 |
toolbarMenu origin:(0.0 @ mH) corner:(1.0 @ (mH+tmH)). |
|
1566 |
mH := mH + tmH + 1. |
|
3202 | 1567 |
] ifTrue:[ |
6357 | 1568 |
mH := 0.0 |
3202 | 1569 |
]. |
1570 |
||
16467 | 1571 |
panel := VariableVerticalPanel in:self. |
1572 |
"/ panel origin:(0.0 @ mH) corner:(1.0 @ 1.0) |
|
1573 |
panel layout:(LayoutFrame |
|
1574 |
leftFraction:0.0 offset:0 |
|
1575 |
rightFraction:1.0 offset:0 |
|
1576 |
topFraction:0.0 offset:mH |
|
1577 |
bottomFraction:1.0 offset:-30). |
|
1578 |
panel borderWidth:0. |
|
1579 |
||
1580 |
infoLabel := Label in:self. |
|
1581 |
infoLabel layout:(LayoutFrame |
|
1582 |
leftFraction:0.0 offset:0 |
|
1583 |
rightFraction:1.0 offset:0 |
|
1584 |
topFraction:1.0 offset:-28 |
|
1585 |
bottomFraction:1.0 offset:-2). |
|
1586 |
infoLabel borderWidth:0. |
|
1587 |
infoLabel sizeFixed:true. |
|
1588 |
infoLabel level:-1. |
|
1589 |
infoLabel adjust:#left. |
|
1590 |
infoLabel labelChannel:(infoHolder := '' asValue). |
|
1591 |
||
3202 | 1592 |
upperFrame := panel. |
1593 |
oldStyle ifTrue:[ |
|
6357 | 1594 |
upperFrame := VariableHorizontalPanel origin:(0.0 @ 0.0) corner:(1.0 @ 0.3) in:panel. |
3202 | 1595 |
]. |
202 | 1596 |
|
1597 |
v := HVScrollableView for:SelectionInListView miniScrollerH:true in:upperFrame. |
|
3202 | 1598 |
oldStyle ifTrue:[ |
6357 | 1599 |
v origin:(0.0 @ 0.0) corner:(0.75 @ 1.0). |
3202 | 1600 |
] ifFalse:[ |
6357 | 1601 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.3). |
3202 | 1602 |
]. |
3090 | 1603 |
|
202 | 1604 |
changeListView := v scrolledView. |
1605 |
changeListView delegate:self. |
|
1606 |
changeListView menuHolder:self; menuPerformer:self; menuMessage:#changeListMenu. |
|
1471 | 1607 |
changeListView doubleClickAction:[:line | self doubleClickOnChange:line]. |
3211 | 1608 |
oldStyle ifFalse:[ |
6357 | 1609 |
changeListView multipleSelectOk:true. |
3211 | 1610 |
]. |
202 | 1611 |
|
3202 | 1612 |
oldStyle ifTrue:[ |
6357 | 1613 |
buttonPanel := VerticalPanelView in:upperFrame. |
1614 |
buttonPanel origin:(0.75 @ 0.0) corner:(1.0 @ 1.0). |
|
1615 |
buttonPanel verticalLayout:#topSpace; horizontalLayout:#leftSpace. |
|
1616 |
||
1617 |
checkBox := CheckBox new model:autoCompare. |
|
1618 |
checkBox label:(resources string:'Auto Compare'). |
|
1619 |
checkBox action:[:val | autoCompare value:val]. |
|
1620 |
buttonPanel addSubView:checkBox. |
|
1621 |
||
1622 |
checkBox := CheckBox new model:autoUpdate. |
|
1623 |
checkBox label:(resources string:'Auto Update'). |
|
1624 |
checkBox action:[:val | autoUpdate value:val]. |
|
1625 |
buttonPanel addSubView:checkBox. |
|
1626 |
||
1627 |
checkBox := CheckBox new. |
|
1628 |
checkBox label:(resources stringWithCRs:'Apply in original NameSpace'). |
|
1629 |
checkBox model:applyInOriginalNameSpace. |
|
1630 |
buttonPanel addSubView:checkBox. |
|
3202 | 1631 |
]. |
2301 | 1632 |
|
3090 | 1633 |
"/ protectExistingMethods := CheckBox new. |
1634 |
"/ protectExistingMethods label:(resources string:'Protect existing code' withCRs). |
|
1635 |
"/ protectExistingMethods model:protectExistingMethods. |
|
1636 |
"/ buttonPanel addSubView:protectExistingMethods. |
|
1637 |
||
4487 | 1638 |
codeViewBox := View in:panel. |
1639 |
codeViewBox origin:(0.0 @ 0.3) corner:(1.0 @ 1.0). |
|
1640 |
||
1641 |
v := HVScrollableView for:CodeView miniScrollerH:true miniScrollerV:false in:codeViewBox. |
|
1642 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
202 | 1643 |
codeView := v scrolledView. |
1996 | 1644 |
codeView readOnly:true. |
202 | 1645 |
|
4487 | 1646 |
diffViewBox := View in:codeViewBox. |
1647 |
diffViewBox origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
1648 |
||
1649 |
lbl := Label label:'Current' in:diffViewBox. |
|
1650 |
lbl layout:(LayoutFrame |
|
6357 | 1651 |
leftFraction:0.0 offset:0 |
1652 |
rightFraction:0.5 offset:0 |
|
1653 |
topFraction:0.0 offset:0 |
|
1654 |
bottomFraction:0.0 offset:20). |
|
4487 | 1655 |
lbl := Label label:'Change' in:diffViewBox. |
1656 |
lbl layout:(LayoutFrame |
|
6357 | 1657 |
leftFraction:0.5 offset:0 |
1658 |
rightFraction:1.0 offset:0 |
|
1659 |
topFraction:0.0 offset:0 |
|
1660 |
bottomFraction:0.0 offset:20). |
|
4487 | 1661 |
|
1662 |
"/ diffView := DiffTextView in:diffViewBox. |
|
1663 |
"/ diffView layout:(LayoutFrame |
|
1664 |
"/ leftFraction:0.0 offset:0 |
|
1665 |
"/ rightFraction:1.0 offset:0 |
|
1666 |
"/ topFraction:0.0 offset:20 |
|
1667 |
"/ bottomFraction:1.0 offset:0). |
|
1668 |
||
8102 | 1669 |
v := HVScrollableView for:DiffCodeView miniScrollerH:true miniScrollerV:false in:diffViewBox. |
4487 | 1670 |
v layout:(LayoutFrame |
6357 | 1671 |
leftFraction:0.0 offset:0 |
1672 |
rightFraction:1.0 offset:0 |
|
1673 |
topFraction:0.0 offset:20 |
|
1674 |
bottomFraction:1.0 offset:0). |
|
4487 | 1675 |
diffView := v scrolledView. |
1676 |
||
1677 |
self showingDiffs value ifFalse:[ |
|
6357 | 1678 |
self makeDiffViewInvisible |
4487 | 1679 |
]. |
1680 |
||
202 | 1681 |
anyChanges := false. |
1682 |
ObjectMemory addDependent:self. "to get shutdown-update" |
|
1683 |
||
1684 |
tabSpec := TabulatorSpecification new. |
|
1685 |
tabSpec unit:#inch. |
|
1686 |
tabSpec positions:#(-1 0 5 8.5 ). |
|
1687 |
" +/- cls>>sel type info" |
|
1688 |
tabSpec align: #(#left #left #left #left). |
|
1689 |
||
10681 | 1690 |
"Modified: / 27-03-1997 / 11:07:07 / stefan" |
11048 | 1691 |
"Modified: / 03-01-2012 / 15:28:45 / cg" |
202 | 1692 |
! |
1693 |
||
1246
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1694 |
postRealize |
3534 | 1695 |
self setupTabSpec. |
202 | 1696 |
self readChangesFileInBackground:true. |
1697 |
self setChangeList. |
|
16467 | 1698 |
changeListView action:[:lineNrOrCollection | self changeSelection:lineNrOrCollection]. |
202 | 1699 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
1246
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1700 |
|
9ed3722bd2f2
setup in #postRealize instead of #realize
Claus Gittinger <cg@exept.de>
parents:
1200
diff
changeset
|
1701 |
"Created: 24.7.1997 / 18:06:12 / cg" |
202 | 1702 |
! |
1703 |
||
3202 | 1704 |
pullDownMenu |
1705 |
"return the top (pullDown) menu" |
|
1706 |
||
1707 |
<resource: #programMenu> |
|
1708 |
||
3330 | 1709 |
^ self menuFromSpec:self class menuSpec. |
1710 |
||
1711 |
"/ |m| |
|
1712 |
"/ |
|
1713 |
"/ m := self class menuSpec. |
|
1714 |
"/ m := m decodeAsLiteralArray. |
|
1715 |
"/ m receiver:self. |
|
1716 |
"/ m findGuiResourcesIn:self. |
|
1717 |
"/ ^ m. |
|
3202 | 1718 |
! |
1719 |
||
3534 | 1720 |
setupTabSpec |
1721 |
autoCompare value ifTrue:[ |
|
9515 | 1722 |
tabSpec positions:#(0 0.15 7 9.5 ). |
3534 | 1723 |
] ifFalse:[ |
9515 | 1724 |
"/ |
1725 |
"/ set tabs to hide compare-column |
|
1726 |
"/ |
|
1727 |
tabSpec positions:#(-1 0 7 9.5 ). |
|
3534 | 1728 |
] |
9515 | 1729 |
|
1730 |
"Modified: / 10-07-2010 / 10:59:49 / cg" |
|
3534 | 1731 |
! |
1732 |
||
10681 | 1733 |
toolbarMenu |
1734 |
"return the top (pullDown) menu" |
|
1735 |
||
1736 |
<resource: #programMenu> |
|
1737 |
||
1738 |
^ self menuFromSpec:self class toolbarMenuSpec. |
|
1739 |
||
1740 |
"Created: / 07-09-2011 / 16:03:41 / cg" |
|
1741 |
! |
|
1742 |
||
627 | 1743 |
update:what with:aParameter from:changedObject |
202 | 1744 |
|box| |
1745 |
||
8558
a85166102cb7
Wait for #aboutToQuit change message instead of obsolete #aboutToExit
Stefan Vogel <sv@exept.de>
parents:
8515
diff
changeset
|
1746 |
(what == #aboutToQuit) ifTrue:[ |
6639 | 1747 |
" |
1748 |
smalltalk is about to shut down - |
|
1749 |
- if change list was modified, ask user and save if requested. |
|
1750 |
" |
|
1751 |
anyChanges ifTrue:[ |
|
1752 |
self raiseDeiconified. |
|
1753 |
||
1754 |
box := YesNoBox new. |
|
1755 |
box title:('The modified changelist has not been written back to the change file.\\Write change file before exiting ?') withCRs. |
|
1756 |
box okText:(resources string:'Write') noText:(resources string:'Don''t write'). |
|
1757 |
box yesAction:[self writeBackChanges] |
|
1758 |
noAction:[]. |
|
1759 |
box showAtPointer. |
|
1760 |
box destroy |
|
1761 |
]. |
|
1762 |
^ self |
|
202 | 1763 |
]. |
11048 | 1764 |
|
8558
a85166102cb7
Wait for #aboutToQuit change message instead of obsolete #aboutToExit
Stefan Vogel <sv@exept.de>
parents:
8515
diff
changeset
|
1765 |
super update:what with:aParameter from:changedObject |
627 | 1766 |
|
11048 | 1767 |
"Created: / 15-06-1996 / 15:26:30 / cg" |
1768 |
"Modified: / 24-08-1999 / 09:45:06 / stefan" |
|
1769 |
"Modified: / 03-01-2012 / 15:23:13 / cg" |
|
202 | 1770 |
! ! |
1771 |
||
3202 | 1772 |
!ChangesBrowser methodsFor:'menu actions'! |
1773 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1774 |
doApply |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1775 |
"user wants a change to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1776 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1777 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1778 |
(self applyChange:changeNr) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1779 |
^ self "/ cancel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1780 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1781 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1782 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1783 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1784 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1785 |
doApplyAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1786 |
"user wants all changes to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1787 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1788 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1789 |
|lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1790 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1791 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1792 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1793 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1794 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1795 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1796 |
multipleApply := lastNr > 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1797 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1798 |
1 to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1799 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1800 |
self applyChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1801 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1802 |
self autoSelectLast |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1803 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1804 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1805 |
"Modified: 21.1.1997 / 22:26:30 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1806 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1807 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1808 |
doApplyClassFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1809 |
"user wants all changes for this class from 1 to changeNr to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1810 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1811 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1812 |
|thisClassName classNameToApply lastChange |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1813 |
lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1814 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1815 |
classNameToApply := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1816 |
classNameToApply notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1817 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1818 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1819 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1820 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1821 |
multipleApply := changeNr ~= 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1822 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1823 |
1 to:changeNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1824 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1825 |
thisClassName = classNameToApply ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1826 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1827 |
self applyChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1828 |
lastChange := changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1829 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1830 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1831 |
self autoSelect:changeNr+1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1832 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1833 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1834 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1835 |
"Modified: 21.1.1997 / 22:26:04 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1836 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1837 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1838 |
doApplyClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1839 |
"user wants all changes for this class from changeNr to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1840 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1841 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1842 |
|thisClassName classNameToApply lastChange |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1843 |
lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1844 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1845 |
classNameToApply := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1846 |
classNameToApply notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1847 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1848 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1849 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1850 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1851 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1852 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1853 |
multipleApply := (lastNr - changeNr) > 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1854 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1855 |
changeNr to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1856 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1857 |
thisClassName = classNameToApply ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1858 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1859 |
self applyChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1860 |
lastChange := changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1861 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1862 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1863 |
self autoSelect:lastChange. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1864 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1865 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1866 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1867 |
"Modified: 21.1.1997 / 22:26:04 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1868 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1869 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1870 |
doApplyFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1871 |
"user wants all changes from 1 to changeNr to be applied" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1872 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1873 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1874 |
|lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1875 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1876 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1877 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1878 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1879 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1880 |
multipleApply := changeNr ~= 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1881 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1882 |
1 to:changeNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1883 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1884 |
self applyChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1885 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1886 |
self autoSelect:changeNr+1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1887 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1888 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1889 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1890 |
doApplyRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1891 |
"apply all changes from changeNr to the end" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1892 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1893 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1894 |
|lastNr "{ Class: SmallInteger }" | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1895 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1896 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1897 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1898 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1899 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1900 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1901 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1902 |
multipleApply := (lastNr - changeNr) > 1. |
15087 | 1903 |
AbortAllOperationRequest handle:[:ex | |
1904 |
ex return |
|
1905 |
] do:[ |
|
1906 |
changeNr to:lastNr do:[:changeNr | |
|
1907 |
changeListView setSelection:changeNr. |
|
1908 |
self applyChange:changeNr |
|
1909 |
]. |
|
1910 |
self autoSelect:self numberOfChanges. |
|
1911 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1912 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1913 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1914 |
"Modified: 21.1.1997 / 22:25:29 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1915 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1916 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1917 |
doApplyToConflictOrEnd |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1918 |
"apply all changes from changeNr to either a conflict (i.e. method exists) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1919 |
or the end." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1920 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1921 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1922 |
|lastNr "{ Class: SmallInteger }"| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1923 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1924 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1925 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1926 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1927 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1928 |
"if we apply multiple changes, and an error occurs, |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1929 |
ask the user if all operations should be aborted..." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1930 |
multipleApply := (lastNr - changeNr) > 1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1931 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1932 |
changeNr to:lastNr do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1933 |
| cls sel | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1934 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1935 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1936 |
((cls := self classOfChange:changeNr ifAbsent:[:className| nil]) notNil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1937 |
and:[(sel := self selectorOfMethodChange:changeNr) notNil]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1938 |
ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1939 |
(cls includesSelector:sel) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1940 |
self autoSelect:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1941 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1942 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1943 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1944 |
self applyChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1945 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1946 |
self autoSelect:self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1947 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1948 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1949 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1950 |
doBrowse |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1951 |
"user wants a browser on the class of a change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1952 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1953 |
self withSingleSelectedChangeDo:[:changeNr | |
17666 | 1954 |
|cls| |
1955 |
||
1956 |
cls := self classOfChange:changeNr. |
|
1957 |
cls notNil ifTrue:[ |
|
1958 |
SystemBrowser default |
|
1959 |
openInClass:cls |
|
1960 |
selector:(self selectorOfMethodChange:changeNr) |
|
1961 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1962 |
] |
17666 | 1963 |
|
1964 |
"Modified: / 01-09-2017 / 14:20:00 / cg" |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1965 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1966 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1967 |
doBrowseImplementors |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1968 |
"open an implementors-browser" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1969 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1970 |
|changeNr initial selector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1971 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1972 |
(changeNr := self theSingleSelection) notNil ifTrue:[ |
17666 | 1973 |
initial := self selectorOfMethodChange:changeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1974 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1975 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1976 |
selector := Dialog |
17666 | 1977 |
request:'Selector to browse implementors of:' |
1978 |
initialAnswer:(initial ? ''). |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1979 |
selector size ~~ 0 ifTrue:[ |
17666 | 1980 |
SystemBrowser default browseImplementorsMatching:selector. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1981 |
] |
17666 | 1982 |
|
1983 |
"Modified (format): / 01-09-2017 / 14:20:06 / cg" |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1984 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1985 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1986 |
doBrowseSenders |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1987 |
"user wants a browser on the class of a change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1988 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1989 |
|changeNr initial selector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1990 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1991 |
(changeNr := self theSingleSelection) notNil ifTrue:[ |
17666 | 1992 |
initial := self selectorOfMethodChange:changeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1993 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1994 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1995 |
selector := Dialog |
17666 | 1996 |
request:'Selector to browse senders of:' |
1997 |
initialAnswer:(initial ? ''). |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
1998 |
selector size ~~ 0 ifTrue:[ |
17666 | 1999 |
SystemBrowser default browseAllCallsOn:selector asSymbol. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2000 |
] |
17666 | 2001 |
|
2002 |
"Modified: / 01-09-2017 / 14:20:13 / cg" |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2003 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2004 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2005 |
doCheckinAndDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2006 |
"first checkin the selected changes class then delete all changes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2007 |
for it." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2008 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2009 |
|classes answer logTitle checkinInfo| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2010 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2011 |
"/ self theSingleSelection isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2012 |
"/ ^ self information:'Only possible if a single change is selected.'. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2013 |
"/ ]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2014 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2015 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2016 |
classes := IdentitySet new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2017 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2018 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2019 |
| className class | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2020 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2021 |
className := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2022 |
className notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2023 |
class := Smalltalk classNamed:className. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2024 |
class isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2025 |
self error:'oops - no class: ', className mayProceed:true. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2026 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2027 |
class notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2028 |
class := class theNonMetaclass. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2029 |
(classes includes:class) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2030 |
class isPrivate ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2031 |
(classes includes:class owningClass) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2032 |
answer := self confirmWithCancel:('This is a private class.\\CheckIn the owner ''%1'' and all of its private classes ?' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2033 |
bindWith:class owningClass name allBold) withCRs. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2034 |
answer isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2035 |
answer ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2036 |
classes add:class owningClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2037 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2038 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2039 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2040 |
classes add:class |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2041 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2042 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2043 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2044 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2045 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2046 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2047 |
classes size == 1 ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2048 |
logTitle := classes first name. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2049 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2050 |
logTitle := '%1 classes' bindWith:classes size. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2051 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2052 |
checkinInfo := SourceCodeManagerUtilities default |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2053 |
getCheckinInfoFor:logTitle |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2054 |
initialAnswer:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2055 |
checkinInfo isNil ifTrue:[^ self ]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2056 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2057 |
changeListView setSelection:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2058 |
classes do:[:eachClass | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2059 |
(SourceCodeManagerUtilities default checkinClass:eachClass withInfo:checkinInfo) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2060 |
ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2061 |
self silentDeleteChangesForClassAndPrivateClasses:eachClass name |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2062 |
from:1 to:(self numberOfChanges). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2063 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2064 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2065 |
self setChangeList. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2066 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2067 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2068 |
"Modified: / 6.9.1995 / 17:11:16 / claus" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2069 |
"Modified: / 17.11.2001 / 14:21:13 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2070 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2071 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2072 |
doCompare |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2073 |
"compare change with current system version" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2074 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2075 |
classesNotToBeAutoloaded removeAll. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2076 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2077 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2078 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2079 |
self compareChange:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2080 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2081 |
self newLabel:'' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2082 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2083 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2084 |
"Modified: 24.2.1996 / 19:37:19 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2085 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2086 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2087 |
doCompareAndCompress |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2088 |
"remove all changes, which are equivalent to the current image version" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2089 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2090 |
|toDelete| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2091 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2092 |
classesNotToBeAutoloaded removeAll. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2093 |
toDelete := OrderedCollection new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2094 |
self withExecuteCursorDo:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2095 |
1 to:self numberOfChanges do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2096 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2097 |
toDelete add:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2098 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2099 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2100 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2101 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2102 |
toDelete reverseDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2103 |
self silentDeleteChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2104 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2105 |
self setChangeList. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2106 |
" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2107 |
scroll back a bit, if we are left way behind the list |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2108 |
" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2109 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2110 |
changeListView makeLineVisible:self numberOfChanges |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2111 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2112 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2113 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2114 |
self newLabel:''. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2115 |
classesNotToBeAutoloaded removeAll. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2116 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2117 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2118 |
doCompress |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2119 |
"compress the change-set; this replaces multiple method-changes by the last |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2120 |
(i.e. the most recent) change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2121 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2122 |
self compressForClass:nil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2123 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2124 |
"Modified: / 29.10.1997 / 01:03:26 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2125 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2126 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2127 |
doCompressClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2128 |
"compress changes for the selected class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2129 |
this replaces multiple method-changes by the last (i.e. the most recent) change." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2130 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2131 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2132 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2133 |
self selectedClassNames do:[:classNameToCompress | |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2134 |
self compressForClass:classNameToCompress. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2135 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2136 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2137 |
"Created: / 29.10.1997 / 01:05:16 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2138 |
"Modified: / 19.11.2001 / 21:55:17 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2139 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2140 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2141 |
doCompressSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2142 |
"compress changes for the selected class & selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2143 |
this replaces multiple method-changes by the last (i.e. the most recent) change." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2144 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2145 |
|classSelectorPairs| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2146 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2147 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2148 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2149 |
classSelectorPairs := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2150 |
self withSelectedChangesDo:[:changeNr | |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2151 |
| classNameToCompress selector | |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2152 |
|
17600 | 2153 |
classNameToCompress := self realClassNameOfChange:changeNr. |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2154 |
classNameToCompress notNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2155 |
selector := self selectorOfMethodChange:changeNr. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2156 |
selector notNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2157 |
classSelectorPairs add:(classNameToCompress -> selector). |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2158 |
] |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2159 |
] |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2160 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2161 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2162 |
classSelectorPairs do:[:pair | |
17600 | 2163 |
self compressForClass:(pair key) selector:(pair value). |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2164 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2165 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2166 |
"Created: / 19.11.2001 / 21:50:59 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2167 |
"Modified: / 19.11.2001 / 22:10:08 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2168 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2169 |
|
17096 | 2170 |
doCopyToClipboard |
2171 |
"user wants a change text to be copied to the clipboard" |
|
2172 |
||
2173 |
|text| |
|
2174 |
||
2175 |
self withSingleSelectedChangeDo:[:changeNr | |
|
2176 |
text := self sourceOfMethodChange:changeNr. |
|
2177 |
]. |
|
2178 |
text notEmptyOrNil ifTrue:[ |
|
2179 |
self window setClipboardText:text |
|
2180 |
] |
|
2181 |
||
2182 |
"Created: / 21-11-2016 / 23:38:11 / cg" |
|
2183 |
! |
|
2184 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2185 |
doDelete |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2186 |
"delete currently selected change(s)" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2187 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2188 |
|rangeEnd rangeStart firstDeleted| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2189 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2190 |
changeListView selection size <= 5 ifTrue:[ |
16467 | 2191 |
self withSelectedChangesReverseDo:[:changeNr | |
2192 |
self deleteChange:changeNr. |
|
2193 |
self autoSelectOrEnd:changeNr |
|
2194 |
]. |
|
2195 |
self showNumberOfChanges. |
|
2196 |
^ self |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2197 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2198 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2199 |
self withSelectedChangesReverseDo:[:changeNr | |
16467 | 2200 |
rangeEnd isNil ifTrue:[ |
2201 |
rangeEnd := rangeStart := changeNr |
|
2202 |
] ifFalse:[ |
|
2203 |
(changeNr = (rangeEnd + 1)) ifTrue:[ |
|
2204 |
rangeEnd := changeNr |
|
2205 |
] ifFalse:[ |
|
2206 |
(changeNr = (rangeStart - 1)) ifTrue:[ |
|
2207 |
rangeStart := changeNr |
|
2208 |
] ifFalse:[ |
|
2209 |
self deleteChangesFrom:rangeStart to:rangeEnd. |
|
2210 |
firstDeleted := (firstDeleted ? rangeStart) min:rangeStart. |
|
2211 |
rangeStart := rangeEnd := nil. |
|
2212 |
]. |
|
2213 |
]. |
|
2214 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2215 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2216 |
rangeStart notNil ifTrue:[ |
16467 | 2217 |
self deleteChangesFrom:rangeStart to:rangeEnd. |
2218 |
firstDeleted := (firstDeleted ? rangeStart) min:rangeStart. |
|
2219 |
]. |
|
2220 |
self autoSelectOrEnd:firstDeleted. |
|
2221 |
self showNumberOfChanges |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2222 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2223 |
|
12428 | 2224 |
doDeleteAllForNamespace |
2225 |
"delete all changes for classes with same namespace as currently selected change" |
|
2226 |
||
2227 |
|namespacesToDelete lastChangeNr overAllNumDeletedBefore| |
|
2228 |
||
2229 |
lastChangeNr := -1. |
|
2230 |
namespacesToDelete := Set new. |
|
2231 |
self withSelectedChangesDo:[:changeNr | |
|
2232 |
|namespaceToDelete| |
|
2233 |
||
2234 |
namespaceToDelete := self namespaceOfChange:changeNr. |
|
2235 |
namespaceToDelete notNil ifTrue:[ |
|
2236 |
namespacesToDelete add:namespaceToDelete |
|
2237 |
]. |
|
2238 |
lastChangeNr := lastChangeNr max:changeNr. |
|
2239 |
]. |
|
2240 |
namespacesToDelete isEmpty ifTrue:[^ self]. |
|
2241 |
||
2242 |
overAllNumDeletedBefore := 0. |
|
2243 |
changeListView setSelection:nil. |
|
2244 |
||
2245 |
self withExecuteCursorDo:[ |
|
2246 |
namespacesToDelete do:[:namespaceToDelete | |
|
2247 |
|numDeletedBefore| |
|
2248 |
||
2249 |
self |
|
2250 |
silentDeleteChangesForNamespace:namespaceToDelete |
|
2251 |
from:lastChangeNr |
|
2252 |
to:(self numberOfChanges). |
|
2253 |
numDeletedBefore := self |
|
2254 |
silentDeleteChangesForNamespace:namespaceToDelete |
|
2255 |
from:1 |
|
2256 |
to:(lastChangeNr-1). |
|
2257 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2258 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2259 |
]. |
|
2260 |
]. |
|
2261 |
||
2262 |
self setChangeList. |
|
16467 | 2263 |
self autoSelectOrEnd:lastChangeNr. |
12428 | 2264 |
! |
2265 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2266 |
doDeleteAndSelectPrevious |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2267 |
"delete currently selected change(s)" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2268 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2269 |
self withSelectedChangesReverseDo:[:changeNr | |
16467 | 2270 |
self deleteChange:changeNr. |
2271 |
self autoSelectOrEnd:changeNr-1 |
|
2272 |
]. |
|
2273 |
||
2274 |
"/mh - don't we need a |
|
2275 |
"/ self setChangeList |
|
2276 |
"/ here? |
|
2277 |
self showNumberOfChanges |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2278 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2279 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2280 |
doDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2281 |
"delete all changes with same class as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2282 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2283 |
|classNamesToDelete lastChangeNr overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2284 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2285 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2286 |
classNamesToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2287 |
self withSelectedChangesDo:[:changeNr | |
16467 | 2288 |
|classNameToDelete| |
2289 |
||
2290 |
classNameToDelete := self classNameOfChange:changeNr. |
|
2291 |
classNameToDelete notNil ifTrue:[ |
|
2292 |
classNamesToDelete add:classNameToDelete. |
|
2293 |
]. |
|
2294 |
lastChangeNr := lastChangeNr max:changeNr. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2295 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2296 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2297 |
overAllNumDeletedBefore := 0. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2298 |
changeListView setSelection:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2299 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2300 |
self withExecuteCursorDo:[ |
16467 | 2301 |
classNamesToDelete do:[:classNameToDelete | |
2302 |
|numDeletedBefore| |
|
2303 |
||
2304 |
self silentDeleteChangesFor:classNameToDelete |
|
2305 |
from:lastChangeNr |
|
2306 |
to:(self numberOfChanges). |
|
2307 |
numDeletedBefore := self |
|
2308 |
silentDeleteChangesFor:classNameToDelete |
|
2309 |
from:1 |
|
2310 |
to:(lastChangeNr-1). |
|
2311 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2312 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2313 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2314 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2315 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2316 |
self setChangeList. |
16467 | 2317 |
self autoSelectOrEnd:lastChangeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2318 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2319 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2320 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2321 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2322 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2323 |
doDeleteClassAndPrivateClassesAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2324 |
"delete all changes with same class and private classes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2325 |
as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2326 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2327 |
|lastChangeNr classNamesToDelete overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2328 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2329 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2330 |
classNamesToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2331 |
self withSelectedChangesDo:[:changeNr | |
16467 | 2332 |
|classNameToDelete| |
2333 |
||
2334 |
classNameToDelete := self ownerClassNameOfChange:changeNr. |
|
2335 |
classNameToDelete notNil ifTrue:[ |
|
2336 |
classNamesToDelete add:classNameToDelete. |
|
2337 |
]. |
|
2338 |
lastChangeNr := lastChangeNr max:changeNr. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2339 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2340 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2341 |
overAllNumDeletedBefore := 0. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2342 |
changeListView setSelection:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2343 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2344 |
self withExecuteCursorDo:[ |
16467 | 2345 |
classNamesToDelete do:[:classNameToDelete | |
2346 |
| changeNr numDeletedBefore| |
|
2347 |
||
2348 |
classNameToDelete notNil ifTrue:[ |
|
2349 |
changeListView setSelection:nil. |
|
2350 |
self silentDeleteChangesForClassAndPrivateClasses:classNameToDelete |
|
2351 |
from:lastChangeNr |
|
2352 |
to:(self numberOfChanges). |
|
2353 |
numDeletedBefore := self |
|
2354 |
silentDeleteChangesForClassAndPrivateClasses:classNameToDelete |
|
2355 |
from:1 |
|
2356 |
to:(lastChangeNr-1). |
|
2357 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2358 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2359 |
] |
|
2360 |
] |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2361 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2362 |
self setChangeList. |
16467 | 2363 |
self autoSelectOrEnd:lastChangeNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2364 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2365 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2366 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2367 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2368 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2369 |
doDeleteClassFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2370 |
"delete changes with same class as currently selected change from the beginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2371 |
up to the selected change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2372 |
Useful to get rid of obsolete changes before a fileout or checkin entry." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2373 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2374 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2375 |
|classNameToDelete prevSelection numDeleted| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2376 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2377 |
classNameToDelete := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2378 |
classNameToDelete notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2379 |
prevSelection := changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2380 |
changeListView setSelection:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2381 |
numDeleted := self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2382 |
silentDeleteChangesFor:classNameToDelete |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2383 |
from:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2384 |
to:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2385 |
self setChangeList. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2386 |
self autoSelectOrEnd:(changeNr + 1 - numDeleted) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2387 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2388 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2389 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2390 |
"Created: 13.12.1995 / 15:41:58 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2391 |
"Modified: 25.5.1996 / 12:26:34 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2392 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2393 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2394 |
doDeleteClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2395 |
"delete rest of changes with same class as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2396 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2397 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2398 |
| classNameToDelete | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2399 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2400 |
classNameToDelete := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2401 |
classNameToDelete notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2402 |
changeListView setSelection:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2403 |
self silentDeleteChangesFor:classNameToDelete |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2404 |
from:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2405 |
to:(self numberOfChanges). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2406 |
self setChangeList. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2407 |
self autoSelectOrEnd:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2408 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2409 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2410 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2411 |
"Modified: / 18.5.1998 / 14:25:07 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2412 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2413 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2414 |
doDeleteClassSelectorAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2415 |
"delete all changes with same class and selector as currently selected change" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2416 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2417 |
|classNameSelectorPairsToDelete lastChangeNr overAllNumDeletedBefore| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2418 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2419 |
lastChangeNr := -1. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2420 |
classNameSelectorPairsToDelete := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2421 |
self withSelectedChangesDo:[:changeNr | |
17600 | 2422 |
|className selector| |
2423 |
||
2424 |
className := self realClassNameOfChange:changeNr. |
|
2425 |
selector := self selectorOfMethodChange:changeNr. |
|
2426 |
selector notNil ifTrue:[ |
|
2427 |
(className notNil and:[selector notNil]) ifTrue:[ |
|
2428 |
classNameSelectorPairsToDelete add:(className -> selector). |
|
2429 |
] |
|
2430 |
]. |
|
2431 |
lastChangeNr := lastChangeNr max:changeNr. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2432 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2433 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2434 |
overAllNumDeletedBefore := 0. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2435 |
changeListView setSelection:nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2436 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2437 |
self withExecuteCursorDo:[ |
17600 | 2438 |
classNameSelectorPairsToDelete do:[:pair | |
2439 |
|numDeletedBefore className selector| |
|
2440 |
||
2441 |
className := pair key. |
|
2442 |
selector := pair value. |
|
2443 |
self silentDeleteChangesFor:className selector:selector |
|
2444 |
from:lastChangeNr |
|
2445 |
to:(self numberOfChanges). |
|
2446 |
numDeletedBefore := self |
|
2447 |
silentDeleteChangesFor:className selector:selector |
|
2448 |
from:1 |
|
2449 |
to:(lastChangeNr-1). |
|
2450 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2451 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2452 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2453 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2454 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2455 |
self setChangeList. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2456 |
self autoSelectOrEnd:lastChangeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2457 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2458 |
"Created: / 13.12.1995 / 16:07:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2459 |
"Modified: / 28.1.1998 / 20:42:14 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2460 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2461 |
|
16475 | 2462 |
doDeleteClassSelectorOlder |
2463 |
"delete older changes with same class and selector as currently selected change(s)" |
|
2464 |
||
2465 |
|classNameSelectorPairsToDelete upToPerClassAndSelector lastChangeNr overAllNumDeletedBefore| |
|
2466 |
||
2467 |
lastChangeNr := -1. |
|
2468 |
classNameSelectorPairsToDelete := Set new. |
|
2469 |
upToPerClassAndSelector := Dictionary new. |
|
2470 |
||
17597 | 2471 |
"/ collect info on what is to be deleted |
16475 | 2472 |
self withSelectedChangesDo:[:changeNr | |
2473 |
|className selector| |
|
2474 |
||
17600 | 2475 |
className := self realClassNameOfChange:changeNr. |
16475 | 2476 |
selector := self selectorOfMethodChange:changeNr. |
2477 |
selector notNil ifTrue:[ |
|
2478 |
(className notNil and:[selector notNil]) ifTrue:[ |
|
2479 |
classNameSelectorPairsToDelete add:(className -> selector). |
|
2480 |
upToPerClassAndSelector at:(className -> selector) put:changeNr. |
|
2481 |
] |
|
2482 |
]. |
|
2483 |
lastChangeNr := lastChangeNr max:changeNr. |
|
2484 |
]. |
|
2485 |
||
2486 |
overAllNumDeletedBefore := 0. |
|
2487 |
changeListView setSelection:nil. |
|
2488 |
||
2489 |
self withExecuteCursorDo:[ |
|
2490 |
classNameSelectorPairsToDelete do:[:pair | |
|
2491 |
|numDeletedBefore className selector lastToDelete| |
|
2492 |
||
2493 |
className := pair key. |
|
2494 |
selector := pair value. |
|
17597 | 2495 |
lastToDelete := (upToPerClassAndSelector at:pair). |
16475 | 2496 |
|
2497 |
numDeletedBefore := self |
|
2498 |
silentDeleteChangesFor:className selector:selector |
|
2499 |
from:1 |
|
2500 |
to:lastToDelete. |
|
2501 |
lastChangeNr := lastChangeNr - numDeletedBefore. |
|
2502 |
overAllNumDeletedBefore := overAllNumDeletedBefore + numDeletedBefore. |
|
2503 |
]. |
|
2504 |
]. |
|
2505 |
||
2506 |
self setChangeList. |
|
2507 |
self autoSelectOrEnd:lastChangeNr |
|
17597 | 2508 |
|
2509 |
"Modified: / 25-07-2017 / 10:57:31 / cg" |
|
16475 | 2510 |
! |
2511 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2512 |
doDeleteFromBeginning |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2513 |
"delete all changes from 1 to the current" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2514 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2515 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2516 |
self deleteChangesFrom:1 to:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2517 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2518 |
self autoSelectOrEnd:changeNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2519 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2520 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2521 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2522 |
doDeleteRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2523 |
"delete all changes from current to the end" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2524 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2525 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2526 |
self deleteChangesFrom:changeNr to:(self numberOfChanges). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2527 |
self clearCodeView. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2528 |
self autoSelectOrEnd:changeNr-1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2529 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2530 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2531 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2532 |
doFileoutAndDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2533 |
"first fileOut the selected changes class then delete all changes |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2534 |
for it." |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2535 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2536 |
self withSingleSelectedChangeDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2537 |
| className class | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2538 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2539 |
className := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2540 |
className notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2541 |
class := Smalltalk classNamed:className. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2542 |
class notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2543 |
Class fileOutErrorSignal handle:[:ex | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2544 |
self warn:('fileout failed: ' , ex description). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2545 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2546 |
class fileOut. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2547 |
self doDeleteClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2548 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2549 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2550 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2551 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2552 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2553 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2554 |
"Modified: 6.9.1995 / 17:11:16 / claus" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2555 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2556 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2557 |
doMakePatch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2558 |
"user wants a change to be made a patch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2559 |
- copy it over to the patches file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2560 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2561 |
self withSelectedChangesDo:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2562 |
self makeChangeAPatch:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2563 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2564 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2565 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2566 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2567 |
doMakePermanent |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2568 |
"user wants a change to be made permanent |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2569 |
- rewrite the source file where this change has to go" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2570 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2571 |
|yesNoBox| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2572 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2573 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2574 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2575 |
yesNoBox := YesNoBox new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2576 |
yesNoBox title:(resources string:'Warning: this operation cannot be undone'). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2577 |
yesNoBox okText:(resources string:'continue') noText:(resources string:'abort'). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2578 |
yesNoBox okAction:[ |changeNr| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2579 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2580 |
changeNr := self theSingleSelection. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2581 |
changeNr notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2582 |
self makeChangePermanent:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2583 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2584 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2585 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2586 |
yesNoBox showAtPointer. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2587 |
yesNoBox destroy |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2588 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2589 |
"Modified: 7.1.1997 / 23:03:33 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2590 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2591 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2592 |
doSave |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2593 |
"user wants a change to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2594 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2595 |
|fileName| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2596 |
|
13651 | 2597 |
fileName := Dialog |
2598 |
requestFileNameForSave:(resources string:'Append change to:') |
|
2599 |
default:(lastSaveFileName ? '') |
|
2600 |
ok:(resources string:'Append') |
|
2601 |
abort:(resources string:'Abort') |
|
2602 |
pattern:'*.chg'. |
|
2603 |
fileName isEmptyOrNil ifTrue:[ |
|
2604 |
^ self |
|
2605 |
]. |
|
2606 |
lastSaveFileName := fileName. |
|
2607 |
||
2608 |
self withWriteCursorDo:[ |
|
2609 |
self withSelectedChangesDo:[:changeNr | |
|
2610 |
self appendChange:changeNr toFile:fileName. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2611 |
self autoSelect:(changeNr + 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2612 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2613 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2614 |
|
11685 | 2615 |
"Modified: / 27-07-2012 / 09:46:14 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2616 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2617 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2618 |
doSaveClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2619 |
"user wants changes for some class from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2620 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2621 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2622 |
self doSaveClassFrom:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2623 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2624 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2625 |
doSaveClassAll |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2626 |
"user wants changes for some class from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2627 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2628 |
self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2629 |
self doSaveClassFrom:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2630 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2631 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2632 |
doSaveClassFrom:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2633 |
"user wants changes from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2634 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2635 |
|changeNr classNameToSave| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2636 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2637 |
changeNr := self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2638 |
classNameToSave := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2639 |
classNameToSave notNil ifTrue:[ |
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2640 |
self saveClass:classNameToSave from:startNr |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2641 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2642 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2643 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2644 |
doSaveClassRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2645 |
"user wants changes for some class from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2646 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2647 |
|changeNr| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2648 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
2649 |
changeNr := self checkSingleSelectedChange. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2650 |
self doSaveClassFrom:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2651 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2652 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2653 |
"/ self changeSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2654 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2655 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2656 |
doSaveRest |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2657 |
"user wants changes from current to end to be appended to a file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2658 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2659 |
|changeNr fileName| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2660 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2661 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2662 |
^ self information:(resources string:'Only possible if a single change is selected.'). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2663 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2664 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2665 |
fileName := Dialog |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2666 |
requestFileNameForSave:(resources string:'Append changes to:') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2667 |
default:(lastSaveFileName ? '') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2668 |
ok:(resources string:'Append') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2669 |
abort:(resources string:'Abort') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2670 |
pattern:'*.chg'. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2671 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2672 |
fileName notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2673 |
lastSaveFileName := fileName. |
11685 | 2674 |
self withWriteCursorDo:[ |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2675 |
changeNr to:(self numberOfChanges) do:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2676 |
changeListView setSelection:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2677 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2678 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2679 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2680 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2681 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2682 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2683 |
|
11685 | 2684 |
"Modified: / 27-07-2012 / 09:46:09 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2685 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2686 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2687 |
doUpdate |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2688 |
"reread the changes-file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2689 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2690 |
self readChangesFileInBackground:true. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2691 |
self newLabel:''. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2692 |
realized ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2693 |
self setChangeList. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2694 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2695 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2696 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2697 |
doWriteBack |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2698 |
"write back the list onto the changes file" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2699 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2700 |
anyChanges ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2701 |
(self writeBackChanges) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2702 |
realized ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2703 |
self readChangesFile. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2704 |
realized ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2705 |
self setChangeList |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2706 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2707 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2708 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2709 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2710 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2711 |
"Modified: 5.9.1996 / 17:19:46 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2712 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2713 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2714 |
findClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2715 |
"findClass menu action: let user enter a classes name, and select the next change for that class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2716 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2717 |
|current| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2718 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2719 |
changeNrShown notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2720 |
current := self classNameOfChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2721 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2722 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2723 |
self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2724 |
askForSearch:'Class to search for:' |
17394 | 2725 |
initialAnswer:(current ? lastSearchString) |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2726 |
thenSearchUsing:[:searchString :changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2727 |
|thisClassName| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2728 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2729 |
thisClassName := self classNameOfChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2730 |
thisClassName notNil |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2731 |
and:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2732 |
(thisClassName sameAs: searchString) |
13440 | 2733 |
or:[searchString includesMatchCharacters and:[searchString match:thisClassName caseSensitive:false]]] |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2734 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2735 |
onCancel:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2736 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2737 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2738 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
17382 | 2739 |
|
17394 | 2740 |
"Modified: / 12-02-2017 / 11:31:47 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2741 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2742 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2743 |
findFirstForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2744 |
"findNextForClass menu action: select the next change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2745 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2746 |
self findNextForClassStartingAt:1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2747 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2748 |
"Created: / 20-11-2006 / 16:37:56 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2749 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2750 |
|
15674 | 2751 |
findFirstForClass:className |
2752 |
"findNextForClass menu action: select the next change for the selected changes class" |
|
2753 |
||
2754 |
self findNextForClass:className startingAt:1 |
|
2755 |
! |
|
2756 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2757 |
findLastForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2758 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2759 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2760 |
self findPreviousForClassStartingAt:(self numberOfChanges) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2761 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2762 |
"Created: / 20-11-2006 / 16:39:15 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2763 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2764 |
|
15674 | 2765 |
findLastForClass:className |
2766 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
|
2767 |
||
2768 |
self findPreviousForClass:className startingAt:(self numberOfChanges) |
|
2769 |
||
2770 |
"Created: / 20-11-2006 / 16:39:15 / cg" |
|
2771 |
! |
|
2772 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2773 |
findLastSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2774 |
"findLastSnapshot menu action: select the last change which is for a snapShot-image save action" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2775 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2776 |
"/ lastSearchType := #snapshot. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2777 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2778 |
self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2779 |
findPreviousForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2780 |
startingAt:(self numberOfChanges) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2781 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2782 |
"Created: / 06-10-2006 / 11:03:39 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2783 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2784 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2785 |
findNext |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2786 |
"findNext menu action: select the next change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2787 |
Searches for what the last search was for; i.e. either same class or same selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2788 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2789 |
lastSearchType == #selector ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2790 |
^ self findNextForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2791 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2792 |
lastSearchType == #snapshot ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2793 |
^ self findNextSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2794 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2795 |
lastSearchType == #string ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2796 |
^ self findNextForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2797 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2798 |
lastSearchType == #difference ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2799 |
^ self findNextDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2800 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2801 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2802 |
^ self findNextForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2803 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2804 |
"Created: / 18.6.1998 / 22:15:00 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2805 |
"Modified: / 18.6.1998 / 22:15:25 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2806 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2807 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2808 |
findNextDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2809 |
lastSearchType := #difference. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2810 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2811 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2812 |
self findNextForWhich:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2813 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2814 |
"/ same |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2815 |
false |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2816 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2817 |
"/ different |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2818 |
true |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2819 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2820 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2821 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2822 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2823 |
findNextForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2824 |
"findNextForClass menu action: select the next change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2825 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2826 |
self findNextForClassStartingAt: changeNrShown + 1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2827 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2828 |
"Modified: / 20-11-2006 / 16:37:49 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2829 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2830 |
|
15674 | 2831 |
findNextForClass:className startingAt:startNr |
2832 |
"findNextForClass menu action: select the next change for the selected changes class" |
|
2833 |
||
2834 |
lastSearchType := #class. |
|
2835 |
||
2836 |
self |
|
2837 |
findNextForWhich:[:changeNr | |
|
2838 |
|thisClass| |
|
2839 |
||
2840 |
thisClass := self classNameOfChange:changeNr. |
|
2841 |
(thisClass = className |
|
2842 |
or:[className includesMatchCharacters |
|
2843 |
and:[className match:thisClass]])] |
|
2844 |
startingAt:startNr |
|
2845 |
! |
|
2846 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2847 |
findNextForClassStartingAt:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2848 |
"findNextForClass menu action: select the next change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2849 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2850 |
|cls| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2851 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2852 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2853 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2854 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2855 |
cls := self classNameOfChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2856 |
cls isNil ifTrue:[^ self]. |
15674 | 2857 |
self findNextForClass:cls startingAt:startNr. |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2858 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2859 |
"Created: / 20-11-2006 / 16:37:37 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2860 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2861 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2862 |
findNextForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2863 |
"findNextForSelector menu action: select the next change for the selected changes selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2864 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2865 |
|sel| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2866 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2867 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2868 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2869 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2870 |
sel := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2871 |
sel isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2872 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2873 |
self findNextForWhich: [:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2874 |
|thisSelector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2875 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2876 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2877 |
(thisSelector = sel or:[sel includesMatchCharacters and:[sel match:thisSelector]]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2878 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2879 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2880 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2881 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2882 |
findNextForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2883 |
lastSearchString isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2884 |
^ self findString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2885 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2886 |
self findNextWithString:lastSearchString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2887 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2888 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2889 |
findNextForWhich:aBlock |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2890 |
"helper: select the next change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2891 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2892 |
^ self findNextForWhich:aBlock startingAt:changeNrShown + 1 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2893 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2894 |
"Modified: / 20-11-2006 / 16:34:23 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2895 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2896 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2897 |
findNextForWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2898 |
"helper: select the next change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2899 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2900 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2901 |
findNextOrPrevious:#next |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2902 |
forWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2903 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2904 |
"Created: / 20-11-2006 / 16:34:06 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2905 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2906 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2907 |
findNextOrPrevious:direction forWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2908 |
"helper: find and select the next or previous change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2909 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2910 |
self withCursor:Cursor questionMark do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2911 |
Object userInterruptSignal handle:[:ex | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2912 |
self beep. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2913 |
^ 0 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2914 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2915 |
|increment nr lastNr| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2916 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2917 |
increment := (direction == #previous) ifTrue:[-1] ifFalse:[1]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2918 |
lastNr := self numberOfChanges. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2919 |
nr := changeNrToStartSearch. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2920 |
[ (direction == #previous and:[nr >= 1]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2921 |
or:[ direction == #next and:[ nr <= lastNr]] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2922 |
] whileTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2923 |
(aBlock value:nr) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2924 |
changeListView setSelection:nr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2925 |
self changeSelection:nr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2926 |
^ nr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2927 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2928 |
nr := nr + increment. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2929 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2930 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2931 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2932 |
self showNotFound. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2933 |
self windowGroup sensor flushKeyboard. "/ avoid multiple beeps, in case of type ahead |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2934 |
^ 0 |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2935 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2936 |
"Created: / 08-03-2012 / 11:57:26 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2937 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2938 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2939 |
findNextSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2940 |
"findNextSnapshot menu action: select the next change which is for a snapShot-image save action" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2941 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2942 |
lastSearchType := #snapshot. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2943 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2944 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2945 |
self findNextForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2946 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2947 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2948 |
findNextWithString:searchString |
14939 | 2949 |
|includesMatchCharacters| |
2950 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2951 |
lastSearchType := #string. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2952 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2953 |
lastSearchString := searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2954 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2955 |
changeNrShown isNil ifTrue:[ |
14939 | 2956 |
changeNrShown := 0. |
2957 |
]. |
|
2958 |
||
2959 |
includesMatchCharacters := searchString includesMatchCharacters. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2960 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2961 |
self findNextForWhich: |
14939 | 2962 |
[:changeNr | |
2963 |
|s| |
|
2964 |
||
2965 |
s := self sourceOfMethodChange:changeNr. |
|
2966 |
s notNil and:[ |
|
2967 |
(includesMatchCharacters not and:[(s findString:searchString) ~~ 0]) |
|
2968 |
or:[ includesMatchCharacters and:[('*' , searchString , '*') match:s ]]] |
|
2969 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2970 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2971 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2972 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2973 |
codeView setSearchPattern:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2974 |
codeView |
14939 | 2975 |
searchFwd:searchString |
2976 |
ignoreCase:false |
|
2977 |
startingAtLine:1 col:0 |
|
2978 |
ifAbsent:nil. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2979 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2980 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2981 |
findPrevious |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2982 |
"findPrevious menu action: select the previous change. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2983 |
Searches for what the last search was for; i.e. either same class or same selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2984 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2985 |
lastSearchType == #selector ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2986 |
^ self findPreviousForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2987 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2988 |
lastSearchType == #snapshot ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2989 |
^ self findPreviousSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2990 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2991 |
lastSearchType == #string ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2992 |
^ self findPreviousForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2993 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2994 |
lastSearchType == #difference ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2995 |
^ self findPreviousDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2996 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2997 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2998 |
^ self findPreviousForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
2999 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3000 |
"Created: / 18.6.1998 / 22:15:15 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3001 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3002 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3003 |
findPreviousDifference |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3004 |
lastSearchType := #difference. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3005 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3006 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3007 |
self findPreviousForWhich:[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3008 |
(self compareChange:changeNr showResult:false) == true ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3009 |
"/ same |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3010 |
false |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3011 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3012 |
"/ different |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3013 |
true |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3014 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3015 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3016 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3017 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3018 |
findPreviousForClass |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3019 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3020 |
|
12738 | 3021 |
self findPreviousForClassStartingAt:((changeNrShown ? 1) - 1) |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3022 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3023 |
"Modified: / 20-11-2006 / 16:39:04 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3024 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3025 |
|
15674 | 3026 |
findPreviousForClass:className startingAt:startNr |
3027 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
|
3028 |
||
3029 |
lastSearchType := #class. |
|
3030 |
||
3031 |
self |
|
3032 |
findPreviousForWhich: |
|
3033 |
[:changeNr | |
|
3034 |
|thisClass| |
|
3035 |
||
3036 |
thisClass := self classNameOfChange:changeNr. |
|
3037 |
(thisClass = className |
|
3038 |
or:[className includesMatchCharacters |
|
3039 |
and:[className match:thisClass]])] |
|
3040 |
startingAt:startNr |
|
3041 |
! |
|
3042 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3043 |
findPreviousForClassStartingAt:startNr |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3044 |
"findPreviousForClass menu action: select the previous change for the selected changes class" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3045 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3046 |
|cls| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3047 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3048 |
lastSearchType := #class. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3049 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3050 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3051 |
cls := self classNameOfChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3052 |
cls isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3053 |
|
15674 | 3054 |
self findPreviousForClass:cls startingAt:startNr |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3055 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3056 |
"Created: / 20-11-2006 / 16:38:37 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3057 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3058 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3059 |
findPreviousForSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3060 |
"findPreviousForSelector menu action: select the previous change for the selected changes selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3061 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3062 |
|sel| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3063 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3064 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3065 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3066 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3067 |
sel := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3068 |
sel isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3069 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3070 |
self findPreviousForWhich: |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3071 |
[:changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3072 |
|thisSelector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3073 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3074 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3075 |
(thisSelector = sel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3076 |
or:[sel includesMatchCharacters and:[sel match:thisSelector]]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3077 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3078 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3079 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3080 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3081 |
findPreviousForString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3082 |
lastSearchString isNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3083 |
^ self findString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3084 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3085 |
self findPreviousWithString:lastSearchString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3086 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3087 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3088 |
findPreviousForWhich:aBlock |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3089 |
"helper: select the previous change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3090 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3091 |
^ self findPreviousForWhich:aBlock startingAt:(changeNrShown - 1) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3092 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3093 |
"Modified: / 06-10-2006 / 11:01:38 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3094 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3095 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3096 |
findPreviousForWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3097 |
"helper: select the previous change for which aBlock evaluates to true" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3098 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3099 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3100 |
findNextOrPrevious:#previous |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3101 |
forWhich:aBlock startingAt:changeNrToStartSearch |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3102 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3103 |
"Created: / 06-10-2006 / 11:01:09 / cg" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3104 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3105 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3106 |
findPreviousSnapshot |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3107 |
"findPreviousSnapshot menu action: select the previous change which is for a snapShot-image save action" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3108 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3109 |
lastSearchType := #snapshot. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3110 |
changeNrShown isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3111 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3112 |
self findPreviousForWhich: [:changeNr | self changeIsSnapShotInfo:changeNr ] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3113 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3114 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3115 |
findPreviousWithString:searchString |
14939 | 3116 |
|includesMatchCharacters| |
3117 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3118 |
lastSearchType := #string. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3119 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3120 |
lastSearchString := searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3121 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3122 |
changeNrShown isNil ifTrue:[ |
14939 | 3123 |
changeNrShown := 0. |
3124 |
]. |
|
3125 |
||
3126 |
includesMatchCharacters := searchString includesMatchCharacters. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3127 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3128 |
self findPreviousForWhich: |
14939 | 3129 |
[:changeNr | |
3130 |
|s | |
|
3131 |
||
3132 |
s := self sourceOfMethodChange:changeNr. |
|
3133 |
s notNil and:[ |
|
3134 |
(includesMatchCharacters not and:[(s findString:searchString) ~~ 0]) |
|
3135 |
or:[includesMatchCharacters and:[('*' , searchString , '*') match:s ]]] |
|
3136 |
]. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3137 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3138 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3139 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3140 |
codeView setSearchPattern:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3141 |
codeView |
14939 | 3142 |
searchFwd:searchString |
3143 |
ignoreCase:false |
|
3144 |
startingAtLine:1 col:0 |
|
3145 |
ifAbsent:nil. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3146 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3147 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3148 |
findSelector |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3149 |
"findSelector menu action: let user enter a selector, and select the next change for that selector" |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3150 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3151 |
|current| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3152 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3153 |
changeNrShown notNil ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3154 |
current := self selectorOfMethodChange:changeNrShown. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3155 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3156 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3157 |
self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3158 |
askForSearch:'Selector to search for:' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3159 |
initialAnswer:current |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3160 |
thenSearchUsing:[:searchString :changeNr | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3161 |
|thisSelector| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3162 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3163 |
thisSelector := self selectorOfMethodChange:changeNr. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3164 |
(thisSelector = searchString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3165 |
or:[searchString includesMatchCharacters and:[searchString match:thisSelector]]) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3166 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3167 |
onCancel:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3168 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3169 |
lastSearchType := #selector. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3170 |
changeNrShown == 0 ifTrue:[changeNrShown := nil]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3171 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3172 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3173 |
findString |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3174 |
|searchString directionHolder| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3175 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3176 |
lastSearchType := #string. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3177 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3178 |
searchString := codeView selection. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3179 |
searchString size == 0 ifTrue:[searchString := lastSearchString]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3180 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3181 |
searchString := self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3182 |
askForSearchString:'String to search for:' |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3183 |
initialAnswer:(searchString ? '') |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3184 |
directionInto:(directionHolder := ValueHolder new). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3185 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3186 |
searchString size == 0 ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3187 |
^ self |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3188 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3189 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3190 |
directionHolder value == #backward ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3191 |
self findPreviousWithString:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3192 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3193 |
self findNextWithString:searchString. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3194 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3195 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3196 |
|
10719 | 3197 |
ignorePublicPrivateCategories:aBoolean |
3198 |
UserPreferences current ignorePublicPrivateCategories:aBoolean |
|
3199 |
||
3200 |
"Created: / 23-09-2011 / 19:52:21 / cg" |
|
3201 |
! |
|
3202 |
||
3202 | 3203 |
menuExit |
3204 | 3204 |
self closeRequest |
3202 | 3205 |
! |
3206 |
||
3207 |
openAboutThisApplication |
|
3208 |
"opens an about box for this application." |
|
3209 |
||
7115 | 3210 |
Dialog aboutClass:self class. |
3211 |
||
3212 |
"Modified: / 12-09-2006 / 17:20:22 / cg" |
|
3202 | 3213 |
! |
3214 |
||
3215 |
openHTMLDocument:relativeDocPath |
|
3216 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
3217 |
! |
|
3218 |
||
9055 | 3219 |
openSettingsDialog |
14558 | 3220 |
|settingsList| |
9055 | 3221 |
|
3222 |
settingsList := |
|
3223 |
#( |
|
3224 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
|
3225 |
"/ #('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
3226 |
"/ #('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
3227 |
"/ #('System Browser' #'AbstractSettingsApplication::SystemBrowserSettingsAppl' ) |
|
3228 |
#('Compiler' #'AbstractSettingsApplication::GeneralCompilerSettingsAppl' ) |
|
3229 |
#('Compiler/ByteCode' #'AbstractSettingsApplication::ByteCodeCompilerSettingsAppl' ) |
|
3230 |
"/ #('Source Code Management' #'AbstractSettingsApplication::SourceCodeManagementSettingsAppl') |
|
3231 |
). |
|
3232 |
||
14558 | 3233 |
SettingsDialog |
3234 |
openWithList:settingsList |
|
3235 |
label:(resources string:'Change Browser Settings'). |
|
9055 | 3236 |
! |
3237 |
||
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3238 |
setEnforcedNameSpace |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3239 |
|nsName listOfKnownNameSpaces keepAsDefaultHolder| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3240 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3241 |
listOfKnownNameSpaces := Set new. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3242 |
NameSpace |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3243 |
allNameSpaces |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3244 |
do:[:eachNameSpace | |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3245 |
listOfKnownNameSpaces add:eachNameSpace name |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3246 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3247 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3248 |
|
15450 | 3249 |
Dialog modifyingBoxWith:[:box | |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3250 |
keepAsDefaultHolder := true asValue. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3251 |
box verticalPanel |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3252 |
add:((CheckBox |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3253 |
label:(resources string:'Use this as default in the future')) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3254 |
model:keepAsDefaultHolder). |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3255 |
] do:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3256 |
nsName := Dialog |
15450 | 3257 |
request:(resources string:'When applying, new classes are created in nameSpace:') |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3258 |
initialAnswer:(enforcedNameSpace ? LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3259 |
list:listOfKnownNameSpaces. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3260 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3261 |
nsName isNil ifTrue:[^ self]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3262 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3263 |
(nsName isEmpty or:[nsName = 'Smalltalk']) ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3264 |
applyInOriginalNameSpace value:true. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3265 |
LastEnforcedNameSpace := enforcedNameSpace := nil. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3266 |
] ifFalse:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3267 |
applyInOriginalNameSpace value:false. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3268 |
LastEnforcedNameSpace := enforcedNameSpace := NameSpace name:nsName. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3269 |
autoCompare value ifTrue:[ |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3270 |
self doUpdate |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3271 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3272 |
]. |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3273 |
KeepEnforcedNameSpace := keepAsDefaultHolder value. |
11680
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3274 |
codeView nameSpaceForDoits:enforcedNameSpace. |
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3275 |
diffView textViews do:[:each | each nameSpaceForDoits:enforcedNameSpace]. |
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3276 |
|
5b1a15736f97
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11499
diff
changeset
|
3277 |
"Modified: / 26-07-2012 / 23:06:23 / cg" |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3278 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3279 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3280 |
setEnforcedPackage |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3281 |
|pkg listOfKnownPackages| |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3282 |
|
16207 | 3283 |
listOfKnownPackages := Smalltalk allPackageIDs. |
12645 | 3284 |
"/ Smalltalk allClassesDo:[:eachClass | |
3285 |
"/ |package| |
|
3286 |
"/ |
|
3287 |
"/ package := eachClass package. |
|
3288 |
"/ package size > 0 ifTrue:[ |
|
3289 |
"/ listOfKnownPackages add:package |
|
3290 |
"/ ] |
|
3291 |
"/ ]. |
|
3292 |
listOfKnownPackages := listOfKnownPackages asNewOrderedCollection sort. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3293 |
|
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3294 |
pkg := Dialog |
12645 | 3295 |
request:'When applying, changes go into package:' |
3296 |
initialAnswer:(enforcedPackage ? Class packageQuerySignal query) |
|
3297 |
list:listOfKnownPackages. |
|
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3298 |
pkg size ~~ 0 ifTrue:[ |
12645 | 3299 |
enforcedPackage := pkg |
11499
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3300 |
] |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3301 |
! |
dcd14a0cdbc5
changed: #setEnforcedNameSpace
Claus Gittinger <cg@exept.de>
parents:
11477
diff
changeset
|
3302 |
|
3202 | 3303 |
showAboutSTX |
3304 |
ToolApplicationModel openAboutSTX |
|
3305 |
! ! |
|
3306 |
||
202 | 3307 |
!ChangesBrowser methodsFor:'private'! |
3308 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3309 |
autoSelect:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3310 |
"select a change" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3311 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3312 |
self class autoSelectNext ifTrue:[ |
6288 | 3313 |
(changeNr <= self numberOfChanges) ifTrue:[ |
3314 |
changeListView setSelection:changeNr. |
|
3315 |
self changeSelection:changeNr. |
|
3316 |
^ self |
|
3317 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3318 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3319 |
self clearCodeView. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3320 |
changeListView setSelection:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3321 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3322 |
"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
|
3323 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3324 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3325 |
autoSelectLast |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3326 |
"select the last change" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3327 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3328 |
self autoSelect:(self numberOfChanges) |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3329 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3330 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3331 |
autoSelectOrEnd:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3332 |
"select the next change or the last" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3333 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3334 |
|last| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3335 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3336 |
last := self numberOfChanges. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3337 |
changeNr < last ifTrue:[ |
6288 | 3338 |
self autoSelect:changeNr |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3339 |
] ifFalse:[ |
6288 | 3340 |
last == 0 ifTrue:[ |
3341 |
last := nil |
|
3342 |
]. |
|
3343 |
changeListView setSelection:last . |
|
3344 |
self changeSelection:last. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3345 |
] |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3346 |
|
3406
8fe22b36fbc2
fixed autoselectNext if list is empty
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
3347 |
"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
|
3348 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3349 |
|
8619 | 3350 |
beep |
15136 | 3351 |
"output an audible beep or bell on my screen device" |
3352 |
||
8619 | 3353 |
UserPreferences current beepInEditor ifTrue:[ |
3354 |
super beep |
|
3355 |
] |
|
3356 |
! |
|
3357 |
||
16372 | 3358 |
changeChunkAt:index |
3359 |
^ (changeInfoList at:index) chunk |
|
3360 |
"/ ^ changeChunks at:index |
|
3361 |
||
3362 |
"Created: / 01-05-2016 / 18:24:28 / cg" |
|
3363 |
! |
|
3364 |
||
3365 |
changeClassNameAt:index |
|
3366 |
^ (changeInfoList at:index) className |
|
3367 |
||
3368 |
"Created: / 01-05-2016 / 18:28:13 / cg" |
|
3369 |
"Modified: / 01-05-2016 / 19:32:42 / cg" |
|
3370 |
! |
|
3371 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3372 |
checkClassIsLoaded:aClass |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3373 |
"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
|
3374 |
|
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3375 |
|cls answer| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3376 |
|
3359
2cc7eff866e4
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
3341
diff
changeset
|
3377 |
cls := aClass theNonMetaclass. |
5825 | 3378 |
cls isLoaded ifTrue:[ |
6357 | 3379 |
^ true. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3380 |
]. |
11805 | 3381 |
(classesNotToBeAutoloaded includes:#all) ifTrue:[ |
3382 |
^ false. |
|
3383 |
]. |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3384 |
(classesNotToBeAutoloaded includes:cls) ifTrue:[ |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3385 |
^ false. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3386 |
]. |
5825 | 3387 |
|
6216 | 3388 |
autoloadAsRequired value == true ifTrue:[ |
6357 | 3389 |
answer := true |
6216 | 3390 |
] ifFalse:[ |
11805 | 3391 |
answer := Dialog |
3392 |
confirmWithCancel:(resources |
|
17400 | 3393 |
stringWithCRs:'%1 is an autoloaded class.\I can only compare the method''s source if it''s loaded first.\\Shall the class be loaded now ?' |
11805 | 3394 |
with:cls name allBold) |
3395 |
labels:(resources array:#('Cancel' 'No for All' 'No' 'Yes')) |
|
3396 |
values:#(nil #never false true) |
|
3397 |
default:4. |
|
3398 |
answer isNil ifTrue:[ |
|
3399 |
"cancel the operation" |
|
3400 |
AbortAllOperationRequest raise. |
|
3401 |
"not reached" |
|
3402 |
]. |
|
3403 |
answer == #never ifTrue:[ |
|
3404 |
classesNotToBeAutoloaded add:#all. |
|
3405 |
^ false. |
|
3406 |
]. |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3407 |
]. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3408 |
|
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3409 |
answer ifTrue:[ |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3410 |
Autoload autoloadFailedSignal catch:[ |
6357 | 3411 |
^ cls autoload isLoaded |
3412 |
] |
|
5825 | 3413 |
]. |
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3414 |
|
8026
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3415 |
classesNotToBeAutoloaded add:cls. |
48f053eed5b8
on #compareAndCompress - ask only once for each unloaded class
Stefan Vogel <sv@exept.de>
parents:
8000
diff
changeset
|
3416 |
|
6162
5ab2371c63a1
Compare and Compress: continue comparing even if the user doesn't
Stefan Vogel <sv@exept.de>
parents:
6048
diff
changeset
|
3417 |
^ false. |
17400 | 3418 |
|
3419 |
"Modified: / 13-02-2017 / 19:57:15 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3420 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3421 |
|
11896
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3422 |
checkSingleSelectedChange |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3423 |
"just a helper, check for a single selection" |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3424 |
|
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3425 |
|changeNr| |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3426 |
|
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3427 |
(changeNr := self theSingleSelection) isNil ifTrue:[ |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3428 |
self information:'Only possible if a single change is selected.'. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3429 |
AbortSignal raise. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3430 |
^ nil. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3431 |
]. |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3432 |
^ changeNr |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3433 |
! |
627b63f51074
added: #checkSingleSelectedChange
Claus Gittinger <cg@exept.de>
parents:
11805
diff
changeset
|
3434 |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3435 |
classFromEvaluatingTree:aParseTree |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3436 |
|thisClass| |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3437 |
|
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3438 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3439 |
do:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3440 |
thisClass := Parser undefinedVariableError handle:[:ex | ] do:[ aParseTree evaluate ]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3441 |
]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3442 |
^ thisClass |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3443 |
|
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3444 |
"Created: / 05-03-2012 / 14:28:01 / cg" |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3445 |
! |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3446 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3447 |
clearCodeView |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3448 |
"clear the (lower) code view." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3449 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3450 |
self unselect "changeListView deselect". |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3451 |
codeView contents:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3452 |
changeNrShown := nil |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3453 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3454 |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3455 |
currentSourceForParseTree:parseTree |
12845 | 3456 |
|selector thisClass method mClass thisClassSym ownerClass receiver classGlobalNode| |
4857 | 3457 |
|
6288 | 3458 |
(parseTree isNil |
3459 |
or:[parseTree == #Error |
|
4857 | 3460 |
or:[ parseTree isMessage not ]]) ifTrue:[ |
6614 | 3461 |
^ nil |
4857 | 3462 |
]. |
3463 |
||
3464 |
selector := parseTree selector. |
|
3465 |
receiver := parseTree receiver. |
|
3466 |
||
3467 |
selector == #'removeSelector:' ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3468 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3469 |
thisClass isBehavior ifTrue:[ |
3470 |
thisClass isLoaded ifTrue:[ |
|
3471 |
selector := (parseTree arg1 evaluate). |
|
3472 |
(thisClass includesSelector:selector) ifTrue:[ |
|
3473 |
^ (thisClass compiledMethodAt:selector) source. |
|
3474 |
] |
|
3475 |
] ifFalse:[ |
|
3476 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3477 |
] |
|
3478 |
] ifFalse:[ |
|
3479 |
^ 'Cannot compare this change (class not present)'. |
|
3480 |
]. |
|
4857 | 3481 |
]. |
3482 |
selector == #'comment:' ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3483 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3484 |
thisClass isBehavior ifTrue:[ |
3485 |
thisClass isLoaded ifTrue:[ |
|
3486 |
^ thisClass name , ' comment: ' , thisClass comment storeString. |
|
3487 |
] ifFalse:[ |
|
3488 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3489 |
] |
|
3490 |
] ifFalse:[ |
|
3491 |
^ 'Cannot compare this change (class not present)'. |
|
3492 |
]. |
|
4857 | 3493 |
]. |
3494 |
||
7953 | 3495 |
(#(#'category:' #'package:') includes:selector) ifTrue:[ |
6614 | 3496 |
receiver isMessage ifTrue:[ |
3497 |
receiver selector == #compiledMethodAt: ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3498 |
"/ thisClass := self classFromEvaluatingTree:receiver receiver. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3499 |
"/ thisClass isNil ifTrue:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3500 |
"/ ^ 'Class does not exist.'. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3501 |
"/ ]. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3502 |
|
6614 | 3503 |
classGlobalNode := receiver receiver. |
3504 |
(classGlobalNode isMessage and:[classGlobalNode selector == #class]) ifTrue:[ |
|
3505 |
classGlobalNode := classGlobalNode receiver |
|
3506 |
]. |
|
3507 |
classGlobalNode isUndeclared ifTrue:[ |
|
3508 |
^ 'Class does not exist.'. |
|
3509 |
]. |
|
3510 |
Error handle:[method := nil] do:[method := receiver evaluate]. |
|
7953 | 3511 |
method isMethod ifFalse:[ |
3512 |
^ 'There is no such method'. |
|
3513 |
]. |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3514 |
mClass := method mclass. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3515 |
|
7953 | 3516 |
selector == #category: ifTrue:[ |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3517 |
"/ method category = parseTree arg1 evaluate ifFalse:[ |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3518 |
^ '(' , mClass name , ' compiledMethodAt: ' , method selector storeString , ') category: ' , method category storeString. |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3519 |
"/ ]. |
6614 | 3520 |
] ifFalse:[ |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3521 |
"/ method package = parseTree arg1 evaluate ifFalse:[ |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3522 |
^ '(' , mClass name , ' compiledMethodAt: ' , method selector storeString , ') package: ' , method package storeString. |
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3523 |
"/ ]. |
7953 | 3524 |
]. |
3525 |
^ nil |
|
6614 | 3526 |
] |
3527 |
] |
|
4857 | 3528 |
]. |
3529 |
||
3530 |
selector == #'instanceVariableNames:' ifTrue:[ |
|
6614 | 3531 |
receiver isMessage ifTrue:[ |
3532 |
receiver selector == #class ifTrue:[ |
|
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
3533 |
thisClass := self classFromEvaluatingTree:receiver. |
6614 | 3534 |
thisClass isBehavior ifTrue:[ |
3535 |
thisClass isLoaded ifTrue:[ |
|
4857 | 3536 |
"/ varsHere := thisClass instanceVariableString asCollectionOfWords. |
3537 |
"/ varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords. |
|
6614 | 3538 |
^ thisClass definition. |
3539 |
] ifFalse:[ |
|
3540 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3541 |
]. |
|
3542 |
] ifFalse:[ |
|
3543 |
^ 'Cannot compare this change (class not present)'. |
|
3544 |
] |
|
3545 |
]. |
|
3546 |
] |
|
4857 | 3547 |
]. |
3548 |
||
3549 |
(Class definitionSelectors includes:selector) |
|
6288 | 3550 |
"/ selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' |
4857 | 3551 |
ifTrue:[ |
6614 | 3552 |
"/ Class nameSpaceQuerySignal |
3553 |
"/ answer:(self nameSpaceForApply) |
|
3554 |
"/ do:[ |
|
3555 |
"/ superClass := receiver evaluate. |
|
3556 |
"/ ]. |
|
3557 |
"/ superClass isBehavior ifFalse:[ |
|
3558 |
"/ self nameSpaceForApply classNamed:receiver name |
|
3559 |
"/ ]. |
|
3560 |
"/ superClass isBehavior ifFalse:[ |
|
3561 |
"/ |rest matchingKeys superClassName| |
|
3562 |
"/ |
|
3563 |
"/ rest := '::' , receiver name. |
|
3564 |
"/ matchingKeys := Smalltalk keys select:[:nm | nm endsWith:rest]. |
|
3565 |
"/ superClassName := Dialog choose:'Which Class ?' fromList:matchingKeys lines:10. |
|
3566 |
"/ superClassName notEmptyOrNil ifTrue:[ |
|
3567 |
"/ superClass := Smalltalk at:superClassName asSymbol. |
|
3568 |
"/ ]. |
|
3569 |
"/ ]. |
|
3570 |
"/ superClass isBehavior ifFalse:[ |
|
3571 |
"/ ^ 'Cannot compare this change\\(no such superclass).' withCRs. |
|
3572 |
"/ ]. |
|
3573 |
"/ superClass isLoaded ifFalse:[ |
|
3574 |
"/ ^ 'Cannot compare this change\\(superclass not loaded).' withCRs. |
|
3575 |
"/ ]. |
|
3576 |
||
3577 |
thisClassSym := (parseTree arguments at:1) evaluate. |
|
3578 |
||
3579 |
(selector endsWith:':privateIn:') ifTrue:[ |
|
3580 |
ownerClass := (parseTree arguments at:5). |
|
3581 |
ownerClass isUndeclared ifFalse:[ |
|
3582 |
ownerClass := ownerClass evaluate. |
|
3583 |
] ifTrue:[ |
|
3584 |
ownerClass := nil. |
|
3585 |
]. |
|
3586 |
ownerClass isNil ifTrue:[ |
|
3587 |
^ 'Cannot compare this change\\(owning class is not loaded).' withCRs. |
|
3588 |
]. |
|
3589 |
thisClass := ownerClass privateClassesAt:thisClassSym. |
|
3590 |
] ifFalse:[ |
|
3591 |
thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil. |
|
3592 |
]. |
|
3593 |
thisClass notNil ifTrue:[ |
|
3594 |
thisClass isLoaded ifFalse:[ |
|
3595 |
^ 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
3596 |
] ifTrue:[ |
|
3597 |
^ thisClass definition. |
|
3598 |
] |
|
3599 |
] |
|
4857 | 3600 |
]. |
3601 |
||
3602 |
^ nil. |
|
9570
f81993219003
changed: #oldSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
9548
diff
changeset
|
3603 |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3604 |
"Created: / 15-02-2012 / 15:11:15 / cg" |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3605 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3606 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3607 |
isChangeSetBrowser |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3608 |
^ false |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3609 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3610 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3611 |
makeDiffViewInvisible |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3612 |
diffViewBox lower |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3613 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3614 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3615 |
makeDiffViewVisible |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3616 |
diffViewBox raise |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3617 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3618 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3619 |
nameSpaceForApply |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3620 |
applyInOriginalNameSpace value ifFalse:[ |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3621 |
^ enforcedNameSpace ? Class nameSpaceQuerySignal query. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3622 |
]. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3623 |
^ Smalltalk. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3624 |
! |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3625 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3626 |
newLabel:how |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3627 |
|l| |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3628 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3629 |
l := self class defaultLabel. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3630 |
(changeFileName notNil and:[changeFileName ~= 'changes']) ifTrue:[ |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3631 |
l := l , ': ', changeFileName |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3632 |
]. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3633 |
l := l , ' ' , how. |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3634 |
self label:l |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3635 |
|
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3636 |
"Created: / 08-09-1995 / 19:32:04 / claus" |
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
3637 |
"Modified: / 12-11-2006 / 16:23:53 / cg" |
4857 | 3638 |
! |
3639 |
||
8665 | 3640 |
parseExpression:chunk |
3641 |
^ self parseExpression:chunk inNameSpace:(self nameSpaceForApply). |
|
3642 |
! |
|
3643 |
||
3644 |
parseExpression:text inNameSpace:nameSpace |
|
3645 |
|parser p| |
|
3646 |
||
3647 |
"/ old: |
|
3648 |
"/ does not care for VW qualified names |
|
3649 |
"/ ^ Parser parseExpression:text inNameSpace:nameSpace. |
|
3650 |
||
17666 | 3651 |
(text includesString:'§') ifTrue:[self halt]. |
17094 | 3652 |
|
8665 | 3653 |
"/ new: |
3654 |
parser := Parser for:(ReadStream on:text). |
|
3655 |
parser parserFlags allowQualifiedNames:true. |
|
17094 | 3656 |
parser parserFlags allowDollarInIdentifier:true. |
3657 |
parser parserFlags allowParagraphInIdentifier:true. |
|
9228
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3658 |
Error handle:[:ex | |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3659 |
^ nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3660 |
] do:[ |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3661 |
p := parser |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3662 |
parseExpressionWithSelf:nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3663 |
notifying:nil |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3664 |
ignoreErrors:true |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3665 |
ignoreWarnings:true |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3666 |
inNameSpace:nameSpace. |
c99c25eb54db
changed: #parseExpression:inNameSpace:
Claus Gittinger <cg@exept.de>
parents:
9168
diff
changeset
|
3667 |
]. |
8665 | 3668 |
^ p |
17094 | 3669 |
|
3670 |
"Modified: / 21-11-2016 / 23:25:48 / cg" |
|
8665 | 3671 |
! |
3672 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3673 |
queryCloseText |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3674 |
"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
|
3675 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3676 |
^ 'Quit without updating changeFile ?' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3677 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3678 |
|
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3679 |
selectedClassNames |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3680 |
|classes| |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3681 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3682 |
classes := Set new. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3683 |
self withSelectedChangesDo:[:changeNr | |
6288 | 3684 |
| classNameToCompress | |
3685 |
||
3686 |
classNameToCompress := self classNameOfChange:changeNr. |
|
3687 |
classNameToCompress notNil ifTrue:[ |
|
3688 |
classes add:classNameToCompress. |
|
3689 |
] |
|
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3690 |
]. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3691 |
^ classes |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3692 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3693 |
"Created: / 19.11.2001 / 21:54:59 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3694 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
3695 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3696 |
setChangeList |
16467 | 3697 |
"update the selection-list; |
3698 |
called after the changeList has been modified" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3699 |
|
16372 | 3700 |
|headerList| |
3701 |
||
3702 |
headerList := changeInfoList collect:[:info | info headerLine]. |
|
3703 |
changeListView setList:headerList expandTabs:false redraw:false. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3704 |
changeListView invalidate. |
16467 | 3705 |
self showNumberOfChanges. |
3706 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3707 |
"/ changeListView deselect. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3708 |
|
16372 | 3709 |
"Modified: / 01-05-2016 / 19:27:35 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3710 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3711 |
|
3211 | 3712 |
setSingleSelection:changeNr |
3713 |
changeListView multipleSelectOk ifFalse:[ |
|
6288 | 3714 |
changeListView setSelection:changeNr. |
3211 | 3715 |
] ifTrue:[ |
6288 | 3716 |
changeListView setSelection:(Array with:changeNr). |
3211 | 3717 |
]. |
3718 |
! |
|
3719 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3720 |
showNotFound |
14483 | 3721 |
self withCursor:(Cursor cross) do:[ |
3722 |
self beep. |
|
3723 |
Delay waitForMilliseconds:300. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3724 |
] |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3725 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3726 |
"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
|
3727 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3728 |
|
16467 | 3729 |
showNumberOfChanges |
3730 |
infoHolder value:(resources string:'%1 changes.' with:changeInfoList size). |
|
3731 |
! |
|
3732 |
||
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3733 |
sourceOfChange:changeNr |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3734 |
|aStream sawExcla chunk| |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3735 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3736 |
aStream := self streamForChange:changeNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3737 |
aStream isNil ifTrue:[ |
6288 | 3738 |
^ nil |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3739 |
]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3740 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3741 |
chunk := aStream nextChunk. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3742 |
sawExcla ifTrue:[ |
6288 | 3743 |
chunk := aStream nextChunk |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3744 |
]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3745 |
aStream close. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3746 |
^ chunk |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3747 |
! |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
3748 |
|
12599
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3749 |
timeStampPrintStringOf:ts |
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3750 |
^ ts printString |
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3751 |
! |
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
3752 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3753 |
unselect |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3754 |
"common unselect" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3755 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3756 |
changeListView setSelection:nil. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3757 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3758 |
"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
|
3759 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3760 |
|
3211 | 3761 |
withSelectedChangesDo:aBlock |
3762 |
"just a helper, check for a selected change and evaluate aBlock |
|
3763 |
with busy cursor" |
|
3764 |
||
3765 |
self withSelectedChangesInOrder:nil do:aBlock |
|
3766 |
! |
|
3767 |
||
3768 |
withSelectedChangesInOrder:order do:aBlock |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3769 |
"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
|
3770 |
with busy cursor" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3771 |
|
3211 | 3772 |
|changeNrSelection| |
3773 |
||
3774 |
changeNrSelection := changeListView selection. |
|
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3775 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3776 |
"if we apply multiple changes, and an error occurs, |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3777 |
ask the user if all operations should be aborted..." |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3778 |
multipleApply := changeNrSelection size > 1. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3779 |
|
3211 | 3780 |
changeListView multipleSelectOk ifFalse:[ |
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3781 |
changeNrSelection notNil ifTrue:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3782 |
self withExecuteCursorDo:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3783 |
aBlock value:changeNrSelection |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3784 |
] |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3785 |
] |
3211 | 3786 |
] ifTrue:[ |
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3787 |
changeNrSelection size > 0 ifTrue:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3788 |
self withExecuteCursorDo:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3789 |
|changeNumbers| |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3790 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3791 |
changeNumbers := changeNrSelection copy sort. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3792 |
order == #reverse ifTrue:[ |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3793 |
changeNumbers reverse |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3794 |
]. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3795 |
changeNumbers do:aBlock |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3796 |
] |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
3797 |
] |
3211 | 3798 |
]. |
3799 |
! |
|
3800 |
||
3801 |
withSelectedChangesReverseDo:aBlock |
|
3802 |
"just a helper, check for a selected change and evaluate aBlock |
|
3803 |
with busy cursor" |
|
3804 |
||
3805 |
self withSelectedChangesInOrder:#reverse do:aBlock |
|
3668 | 3806 |
! |
3807 |
||
3808 |
withSingleSelectedChangeDo:aBlock |
|
3809 |
"just a helper, check for a single selection, and evaluate aBlock |
|
3810 |
with busy cursor" |
|
3811 |
||
3812 |
self theSingleSelection isNil ifTrue:[ |
|
6288 | 3813 |
^ self information:'Only possible if a single change is selected.'. |
3668 | 3814 |
]. |
3815 |
||
3816 |
self withSelectedChangesInOrder:nil do:aBlock |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3817 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3818 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3819 |
!ChangesBrowser methodsFor:'private-change access'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3820 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3821 |
changeIsFollowupMethodChange:changeNr |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3822 |
"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
|
3823 |
in a bunch of methodsFor-changes)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3824 |
|
16372 | 3825 |
^ (changeInfoList at:changeNr) isFollowupChange |
3826 |
||
3827 |
"Created: / 06-02-1998 / 13:03:39 / cg" |
|
3828 |
"Modified: / 01-05-2016 / 19:32:06 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3829 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
3830 |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3831 |
changeIsSnapShotInfo:changeNr |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3832 |
"return true, if a change is a snapShot info chunk" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3833 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3834 |
|words chunk| |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3835 |
|
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3836 |
(self classNameOfChange:changeNr) isNil ifTrue:[ |
16372 | 3837 |
" |
3838 |
get the chunk |
|
3839 |
" |
|
3840 |
chunk := self changeChunkAt:changeNr. |
|
3841 |
"mhmh - empty ??" |
|
3842 |
chunk notNil ifTrue:[ |
|
3843 |
(chunk startsWith:'''---') ifTrue:[ |
|
3844 |
words := chunk asCollectionOfWords. |
|
3845 |
words size > 2 ifTrue:[ |
|
3846 |
(words at:2) = 'snapshot' ifTrue:[ |
|
3847 |
^ true |
|
3848 |
]. |
|
3849 |
]. |
|
3850 |
]. |
|
3851 |
]. |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3852 |
]. |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3853 |
^ false |
16372 | 3854 |
|
3855 |
"Modified: / 01-05-2016 / 18:25:25 / cg" |
|
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3856 |
! |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3857 |
|
11396 | 3858 |
classNameFromAttributeChangeParseTree:aParseTree |
3859 |
"mhmh - seems to always return the name of the nonMeta class - is this OK?" |
|
3860 |
||
11397 | 3861 |
|recTree isMeta name| |
11396 | 3862 |
|
3863 |
recTree := aParseTree receiver. |
|
3864 |
||
3865 |
(recTree notNil |
|
3866 |
and:[recTree ~~ #Error |
|
3867 |
and:[recTree isMessage |
|
3868 |
and:[recTree selector == #compiledMethodAt:]]]) ifTrue:[ |
|
3869 |
isMeta := false. |
|
3870 |
recTree := recTree receiver. |
|
3871 |
recTree isUnaryMessage ifTrue:[ |
|
3872 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
3873 |
"id class " |
|
3874 |
recTree := recTree receiver |
|
3875 |
]. |
|
3876 |
recTree isPrimary ifTrue:[ |
|
3877 |
name := recTree name. |
|
3878 |
isMeta ifTrue:[ |
|
3879 |
^ name , ' class'. |
|
3880 |
]. |
|
3881 |
^ name |
|
3882 |
] |
|
3883 |
]. |
|
3884 |
"very strange" |
|
3885 |
^ nil |
|
3886 |
||
3887 |
"Created: / 08-03-2012 / 09:42:36 / cg" |
|
3888 |
! |
|
3889 |
||
3890 |
classNameFromClassDefinitionChange:changeNr |
|
11397 | 3891 |
|changeStream chunk fullParseTree sel arg1Tree ownerTree ownerName name| |
11396 | 3892 |
|
3893 |
"/ must parse the full changes text, to get privacy information. |
|
3894 |
||
3895 |
changeStream := self streamForChange:changeNr. |
|
3896 |
changeStream isNil ifTrue:[ ^ nil]. |
|
3897 |
||
3898 |
chunk := changeStream nextChunk. |
|
3899 |
changeStream close. |
|
3900 |
fullParseTree := self parseExpression:chunk. |
|
3901 |
(fullParseTree isNil or:[fullParseTree == #Error]) ifTrue:[ |
|
3902 |
^ nil |
|
3903 |
]. |
|
3904 |
fullParseTree isMessage ifFalse:[ |
|
3905 |
^ nil |
|
3906 |
]. |
|
3907 |
||
3908 |
sel := fullParseTree selector. |
|
3909 |
arg1Tree := fullParseTree arg1. |
|
16390 | 3910 |
(arg1Tree notNil and:[arg1Tree isLiteral]) ifTrue:[ |
11396 | 3911 |
name := arg1Tree value asString. |
3912 |
||
3913 |
"/ is it a private-class ? |
|
3914 |
('*privateIn:' match:sel) ifTrue:[ |
|
3915 |
ownerTree := fullParseTree args last. |
|
3916 |
ownerName := ownerTree name asString. |
|
3917 |
^ ownerName , '::' , name |
|
3918 |
]. |
|
3919 |
^ name |
|
3920 |
]. |
|
3921 |
"very strange" |
|
3922 |
^ nil |
|
3923 |
||
3924 |
"Created: / 08-03-2012 / 09:34:04 / cg" |
|
3925 |
! |
|
3926 |
||
3927 |
classNameFromReceiverInParseTree:aParseTree |
|
3928 |
"extrat the class name from a method-change, methodRemove or comment-change's |
|
3929 |
parse tree" |
|
3930 |
||
3931 |
|recTree isMeta cls name| |
|
3932 |
||
3933 |
recTree := aParseTree receiver. |
|
3934 |
(recTree isNil or:[recTree == #Error]) ifTrue:[ |
|
3935 |
"more strange things" |
|
3936 |
^ nil |
|
3937 |
]. |
|
3938 |
||
3939 |
isMeta := false. |
|
3940 |
recTree isUnaryMessage ifTrue:[ |
|
3941 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
3942 |
"id class methodsFor:..." |
|
3943 |
recTree := recTree receiver. |
|
3944 |
isMeta := true. |
|
3945 |
]. |
|
3946 |
recTree isPrimary ifTrue:[ |
|
3947 |
cls := self classFromEvaluatingTree:recTree. |
|
3948 |
cls notNil ifTrue:[^ cls name]. |
|
3949 |
||
3950 |
name := recTree name. |
|
3951 |
isMeta ifTrue:[ |
|
3952 |
^ name , ' class'. |
|
3953 |
]. |
|
3954 |
^ name |
|
3955 |
]. |
|
3956 |
||
3957 |
"more strange things" |
|
3958 |
^ nil |
|
3959 |
||
3960 |
"Created: / 08-03-2012 / 09:26:57 / cg" |
|
3961 |
! |
|
3962 |
||
3963 |
classNameFromRemoveClassParseTree:aParseTree |
|
11397 | 3964 |
"tree is: Smalltalk removeClass: class" |
3965 |
||
11396 | 3966 |
|recTree arg1Tree| |
3967 |
||
3968 |
recTree := aParseTree receiver. |
|
3969 |
||
3970 |
(recTree notNil |
|
3971 |
and:[recTree ~~ #Error |
|
3972 |
and:[recTree isPrimary |
|
3973 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
|
3974 |
arg1Tree := aParseTree arg1. |
|
13663 | 3975 |
(arg1Tree notNil and:[arg1Tree isVariable]) ifTrue:[ |
11397 | 3976 |
^ arg1Tree name. |
11396 | 3977 |
]. |
3978 |
]. |
|
3979 |
"very strange" |
|
3980 |
^ nil |
|
3981 |
||
3982 |
"Created: / 08-03-2012 / 09:36:59 / cg" |
|
3983 |
! |
|
3984 |
||
11397 | 3985 |
classNameFromRenameClassParseTree:aParseTree |
3986 |
"tree is: Smalltalk renameClass: oldClass to: 'newName'" |
|
3987 |
||
3988 |
|recTree arg1Tree arg2Tree oldName newName| |
|
3989 |
||
3990 |
recTree := aParseTree receiver. |
|
3991 |
||
3992 |
(recTree notNil |
|
3993 |
and:[recTree ~~ #Error |
|
3994 |
and:[recTree isPrimary |
|
3995 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
|
3996 |
arg1Tree := aParseTree arg1. |
|
3997 |
(arg1Tree notNil and:[arg1Tree isPrimary]) ifTrue:[ |
|
3998 |
oldName := arg1Tree name. |
|
3999 |
arg2Tree := aParseTree arg2. |
|
16390 | 4000 |
(arg2Tree notNil and:[arg2Tree isLiteral]) ifTrue:[ |
11397 | 4001 |
newName := arg2Tree evaluate. |
4002 |
(Smalltalk classNamed:oldName) notNil ifTrue:[^ oldName ]. |
|
4003 |
(Smalltalk classNamed:newName) notNil ifTrue:[^ newName ]. |
|
4004 |
]. |
|
4005 |
]. |
|
4006 |
]. |
|
4007 |
"very strange" |
|
4008 |
^ nil |
|
4009 |
||
4010 |
"Created: / 08-03-2012 / 11:42:25 / cg" |
|
4011 |
! |
|
4012 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4013 |
classNameOfChange:changeNr |
6288 | 4014 |
"return the classname of a change |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4015 |
(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
|
4016 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4017 |
|name| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4018 |
|
3364 | 4019 |
name := self realClassNameOfChange:changeNr. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4020 |
name isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4021 |
(name endsWith:' class') ifTrue:[ |
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
4022 |
name := name copyButLast:6 |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4023 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4024 |
^ name |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4025 |
|
3364 | 4026 |
"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
|
4027 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4028 |
|
3202 | 4029 |
extractSelectorOfMethodChange:changeNr |
17400 | 4030 |
"return a method-changes selector, or nil if it's not a methodChange" |
3202 | 4031 |
|
4032 |
|source parser sel chunk aParseTree | |
|
4033 |
||
4034 |
source := self sourceOfMethodChange:changeNr. |
|
4035 |
source isNil ifTrue:[ |
|
8665 | 4036 |
(self classNameOfChange:changeNr) notNil ifTrue:[ |
16372 | 4037 |
chunk := self changeChunkAt:changeNr. |
8665 | 4038 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
4039 |
||
4040 |
aParseTree := self parseExpression:chunk. |
|
4041 |
(aParseTree isNil |
|
4042 |
or:[aParseTree == #Error |
|
4043 |
or:[aParseTree isMessage not]]) ifTrue:[ |
|
4044 |
^ nil "seems strange ... (could be a comment)" |
|
4045 |
]. |
|
4046 |
sel := aParseTree selector. |
|
4047 |
(#( |
|
4048 |
#'removeSelector:' |
|
4049 |
) includes:sel) ifTrue:[ |
|
4050 |
sel := aParseTree arguments at:1. |
|
16390 | 4051 |
sel isLiteral ifTrue:[ |
8665 | 4052 |
sel := sel evaluate. |
4053 |
sel isSymbol ifTrue:[ |
|
4054 |
^ sel |
|
4055 |
] |
|
4056 |
] |
|
4057 |
] |
|
4058 |
]. |
|
4059 |
^ nil |
|
3202 | 4060 |
]. |
4061 |
||
4062 |
||
6288 | 4063 |
parser := Parser |
8665 | 4064 |
parseMethodArgAndVarSpecification:source |
4065 |
in:nil |
|
4066 |
ignoreErrors:true |
|
4067 |
ignoreWarnings:true |
|
4068 |
parseBody:false. |
|
3202 | 4069 |
|
4070 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
8665 | 4071 |
sel := parser selector. |
3202 | 4072 |
]. |
4073 |
^ sel |
|
4074 |
||
16372 | 4075 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
4076 |
"Modified: / 01-05-2016 / 18:25:39 / cg" |
|
17400 | 4077 |
"Modified (comment): / 13-02-2017 / 19:57:20 / cg" |
3202 | 4078 |
! |
4079 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4080 |
fullClassNameOfChange:changeNr |
6288 | 4081 |
"return the full classname of a change |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4082 |
(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
|
4083 |
|
11396 | 4084 |
|chunk aParseTree sel name prevMethodDefNr words oldDollarSetting| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4085 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4086 |
changeNr isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4087 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4088 |
first look, if not already known |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4089 |
" |
16372 | 4090 |
name := self changeClassNameAt:changeNr. |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4091 |
name notNil ifTrue:[ |
7953 | 4092 |
name == #nil ifTrue:[^ nil]. |
4093 |
^ name |
|
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4094 |
]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4095 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4096 |
prevMethodDefNr := changeNr. |
16372 | 4097 |
[ (changeInfoList at:prevMethodDefNr) isFollowupChange ] whileTrue:[ |
7953 | 4098 |
prevMethodDefNr := prevMethodDefNr - 1. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4099 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4100 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4101 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4102 |
get the chunk |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4103 |
" |
16372 | 4104 |
chunk := self changeChunkAt:prevMethodDefNr. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4105 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4106 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4107 |
(chunk startsWith:'''---') ifTrue:[ |
7953 | 4108 |
words := chunk asCollectionOfWords. |
4109 |
words size > 2 ifTrue:[ |
|
4110 |
(words at:2) = 'checkin' ifTrue:[ |
|
4111 |
name := words at:3. |
|
4112 |
^ name |
|
4113 |
] |
|
4114 |
]. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4115 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4116 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4117 |
"/ fix it - otherwise, it cannot be parsed |
11396 | 4118 |
((chunk endsWith:'primitiveDefinitions:') |
4119 |
or:[(chunk endsWith:'primitiveFunctions:') |
|
4120 |
or:[(chunk endsWith:'primitiveVariables:')]]) ifTrue:[ |
|
7953 | 4121 |
chunk := chunk , '''''' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4122 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4123 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4124 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4125 |
use parser to construct a parseTree |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4126 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4127 |
oldDollarSetting := Parser allowDollarInIdentifier. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4128 |
[ |
7953 | 4129 |
Parser allowDollarInIdentifier:true. |
5014 | 4130 |
"/ Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
4131 |
"/ do:[ |
|
8665 | 4132 |
aParseTree := self parseExpression:chunk. |
5014 | 4133 |
"/ ]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4134 |
|
7953 | 4135 |
aParseTree == #Error ifTrue:[ |
4136 |
(chunk includesString:'comment') ifTrue:[ |
|
4137 |
"/ could be a comment ... |
|
8665 | 4138 |
aParseTree := self parseExpression:chunk , ''''. |
7953 | 4139 |
] |
4140 |
]. |
|
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
4141 |
] ensure:[ |
7953 | 4142 |
Parser allowDollarInIdentifier:oldDollarSetting |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4143 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4144 |
(aParseTree isNil or:[aParseTree == #Error]) ifTrue:[ |
7953 | 4145 |
^ 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
|
4146 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4147 |
aParseTree isMessage ifFalse:[ |
7953 | 4148 |
^ nil "very strange ... (whats that ?)" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4149 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4150 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4151 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4152 |
ask parser for selector |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4153 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4154 |
sel := aParseTree selector. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4155 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4156 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4157 |
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
|
4158 |
" |
6288 | 4159 |
(#(#'methodsFor:' |
4160 |
#'privateMethodsFor:' |
|
4161 |
#'protectedMethodsFor:' |
|
4162 |
#'ignoredMethodsFor:' |
|
4163 |
#'publicMethodsFor:' |
|
4164 |
#'removeSelector:' |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4165 |
#'comment:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4166 |
#'primitiveDefinitions:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4167 |
#'primitiveFunctions:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4168 |
#'primitiveVariables:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4169 |
#'renameCategory:to:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4170 |
#'instanceVariableNames:' |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4171 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4172 |
#'methodsFor:stamp:' "/ Squeak support |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4173 |
#'commentStamp:prior:' "/ Squeak support |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4174 |
#'addClassVarName:' "/ Squeak support |
2527
afa639104477
some support for dolphin source files
Claus Gittinger <cg@exept.de>
parents:
2511
diff
changeset
|
4175 |
#methodsFor "/ Dolphin support |
3472 | 4176 |
#categoriesForClass "/ Dolphin support |
4177 |
#categoriesFor: "/ Dolphin support |
|
2606 | 4178 |
#methods "/ STV support |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4179 |
) includes:sel) ifTrue:[ |
7953 | 4180 |
" |
4181 |
yes, the className is the receiver |
|
4182 |
" |
|
11396 | 4183 |
^ self classNameFromReceiverInParseTree:aParseTree |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4184 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4185 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4186 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4187 |
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
|
4188 |
" |
6288 | 4189 |
(('subclass:*' match:sel) |
2322 | 4190 |
or:[('variable*ubclass:*' match:sel)]) ifTrue:[ |
7953 | 4191 |
"/ must parse the full changes text, to get |
4192 |
"/ privacy information. |
|
11396 | 4193 |
^ self classNameFromClassDefinitionChange:changeNr |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4194 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4195 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4196 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4197 |
is it a class remove ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4198 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4199 |
(sel == #removeClass:) ifTrue:[ |
11396 | 4200 |
^ self classNameFromRemoveClassParseTree:aParseTree |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4201 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4202 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4203 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4204 |
is it a method category change ? |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4205 |
" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4206 |
((sel == #category:) |
7953 | 4207 |
or:[sel == #package: |
4208 |
or:[sel == #privacy:]]) ifTrue:[ |
|
11396 | 4209 |
^ self classNameFromAttributeChangeParseTree:aParseTree |
4210 |
]. |
|
4211 |
||
4212 |
sel == #renameClass:to: ifTrue:[ |
|
11397 | 4213 |
^ self classNameFromRenameClassParseTree:aParseTree |
11396 | 4214 |
]. |
4215 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4216 |
^ nil |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4217 |
|
16372 | 4218 |
"Modified: / 01-05-2016 / 19:29:14 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4219 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4220 |
|
12428 | 4221 |
namespaceOfChange:changeNr |
4222 |
"return the namespace of a change or nil" |
|
4223 |
||
15116 | 4224 |
|className namespace idx| |
12428 | 4225 |
|
4226 |
className := self classNameOfChange:changeNr. |
|
4227 |
className isNil ifTrue:[ ^ nil ]. |
|
4228 |
||
15116 | 4229 |
idx := className indexOfSubCollection:'::'. |
4230 |
idx == 0 ifTrue:[ ^ nil ]. |
|
4231 |
namespace := className copyTo:idx-1. |
|
12428 | 4232 |
^ namespace |
4233 |
! |
|
4234 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4235 |
numberOfChanges |
16372 | 4236 |
^ changeInfoList size |
4237 |
||
4238 |
"Created: / 03-12-1995 / 18:15:39 / cg" |
|
4239 |
"Modified: / 01-05-2016 / 19:24:05 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4240 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4241 |
|
2511 | 4242 |
ownerClassNameOfChange:changeNr |
6288 | 4243 |
"return the owner classname of a change |
2511 | 4244 |
For a normal class, this is the className; |
4245 |
for a private class, this is the name of the owning class" |
|
4246 |
||
4706 | 4247 |
|name "ns idx" cls| |
2511 | 4248 |
|
4249 |
name := self classNameOfChange:changeNr. |
|
4250 |
name isNil ifTrue:[^ nil]. |
|
4251 |
cls := Smalltalk at:name asSymbol. |
|
4252 |
(cls notNil and:[cls isBehavior]) ifTrue:[ |
|
6288 | 4253 |
cls owningClass notNil ifTrue:[ |
4254 |
^ cls owningClass name |
|
4255 |
]. |
|
4256 |
^ cls name |
|
2511 | 4257 |
]. |
4258 |
||
4259 |
"/ (name includes:$:) ifTrue:[ |
|
4260 |
"/ idx := name indexOf:$:. |
|
4261 |
"/ ns := name copyTo:idx-1. |
|
4262 |
"/ ns := Smalltalk at:ns asSymbol. |
|
4263 |
"/ ns notNil ifTrue:[ |
|
6288 | 4264 |
"/ |
2511 | 4265 |
"/ ]. |
4266 |
"/ |
|
4267 |
"/ name := name copyFrom:idx+2. |
|
4268 |
"/ (Smalltalk at:ns asSymbol) notNil ifTrue:[ |
|
4269 |
"/ cls |
|
4270 |
"/ ]. |
|
13851 | 4271 |
"/ ^ name copyButLast:6 |
2511 | 4272 |
"/ ]. |
4273 |
^ name |
|
4274 |
||
4275 |
"Modified: 6.12.1995 / 17:06:31 / cg" |
|
4276 |
! |
|
4277 |
||
3364 | 4278 |
realClassNameOfChange:changeNr |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4279 |
"return the classname of a change. |
6288 | 4280 |
- 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
|
4281 |
changeClassNames for the next query" |
3364 | 4282 |
|
4283 |
|name| |
|
4284 |
||
16372 | 4285 |
name := self changeClassNameAt:changeNr. |
3364 | 4286 |
name isNil ifTrue:[ |
16372 | 4287 |
name := self fullClassNameOfChange:changeNr. |
4288 |
name isNil ifTrue:[ |
|
4289 |
(changeInfoList at:changeNr) className:#nil. |
|
4290 |
]. |
|
3364 | 4291 |
]. |
5806
eaaab48a7e8b
tuning (cache class name of change)
Claus Gittinger <cg@exept.de>
parents:
5735
diff
changeset
|
4292 |
name == #nil ifTrue:[^ nil]. |
3364 | 4293 |
^ name |
4294 |
||
16372 | 4295 |
"Created: / 05-11-2001 / 18:09:46 / cg" |
4296 |
"Modified: / 01-05-2016 / 19:24:53 / cg" |
|
3364 | 4297 |
! |
4298 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4299 |
selectorOfMethodChange:changeNr |
16467 | 4300 |
"return a method-changes selector, |
4301 |
or nil if it's not a methodChange" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4302 |
|
3202 | 4303 |
|sel | |
4304 |
||
16372 | 4305 |
changeInfoList size >= changeNr ifTrue:[ |
4306 |
sel := (changeInfoList at:changeNr) selector. |
|
15652 | 4307 |
sel notNil ifTrue:[ ^ sel ]. |
3202 | 4308 |
]. |
4309 |
||
4310 |
sel := self extractSelectorOfMethodChange:changeNr. |
|
4311 |
sel notNil ifTrue:[ |
|
16372 | 4312 |
(changeInfoList at:changeNr) selector:sel. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4313 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4314 |
^ sel |
16372 | 4315 |
|
4316 |
"Modified: / 01-05-2016 / 19:26:21 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4317 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4318 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4319 |
sourceOfMethodChange:changeNr |
17400 | 4320 |
"return a method-changes source code, or nil if it's not a methodChange." |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4321 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4322 |
|aStream chunk sawExcla parseTree sourceChunk sel| |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4323 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4324 |
aStream := self streamForChange:changeNr. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4325 |
aStream isNil ifTrue:[^ nil]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4326 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4327 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
8665 | 4328 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
4329 |
chunk := aStream nextChunk. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4330 |
] ifTrue:[ |
16372 | 4331 |
chunk := self changeChunkAt:changeNr. |
8665 | 4332 |
sawExcla := true. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4333 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4334 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4335 |
sawExcla ifTrue:[ |
8665 | 4336 |
parseTree := self parseExpression:chunk. |
4337 |
(parseTree notNil |
|
4338 |
and:[parseTree ~~ #Error |
|
4339 |
and:[parseTree isMessage]]) ifTrue:[ |
|
4340 |
sel := parseTree selector. |
|
4341 |
(#( |
|
4342 |
#methodsFor: |
|
4343 |
#privateMethodsFor: |
|
4344 |
#publicMethodsFor: |
|
4345 |
#ignoredMethodsFor: |
|
4346 |
#protectedMethodsFor: |
|
4347 |
||
4348 |
#methodsFor:stamp: "/ Squeak support |
|
4349 |
#commentStamp:prior: "/ Squeak support |
|
4350 |
#methodsFor "/ Dolphin support |
|
4351 |
#methods "/ STV support |
|
4352 |
) |
|
4353 |
includes:sel) ifTrue:[ |
|
4354 |
sourceChunk := aStream nextChunk. |
|
4355 |
] |
|
4356 |
]. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4357 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4358 |
aStream close. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4359 |
^ sourceChunk |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4360 |
|
16372 | 4361 |
"Created: / 05-09-1996 / 17:11:32 / cg" |
4362 |
"Modified: / 01-05-2016 / 18:25:53 / cg" |
|
17400 | 4363 |
"Modified (comment): / 13-02-2017 / 19:57:25 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4364 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4365 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4366 |
streamForChange:changeNr |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4367 |
"answer a stream for change" |
6288 | 4368 |
|
15858 | 4369 |
|aStream encoding| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4370 |
|
16372 | 4371 |
(changeNr between:1 and:changeInfoList size) ifFalse:[^ nil]. |
5702 | 4372 |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
4373 |
aStream := changeFileName asFilename readStreamOrNil. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4374 |
aStream isNil ifTrue:[^ nil]. |
5702 | 4375 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4376 |
encodingIfKnown isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4377 |
encoding := CharacterEncoder guessEncodingOfStream:aStream. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4378 |
encodingIfKnown := encoding ? #none |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4379 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4380 |
(encodingIfKnown notNil and:[encodingIfKnown ~~ #none]) ifTrue:[ |
15858 | 4381 |
aStream := EncodedStream stream:aStream encoding:encodingIfKnown. |
5702 | 4382 |
]. |
4383 |
||
16372 | 4384 |
aStream position:((changeInfoList at:changeNr) position)-1. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4385 |
^ aStream |
16372 | 4386 |
|
4387 |
"Modified: / 01-05-2016 / 19:24:17 / cg" |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4388 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4389 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4390 |
!ChangesBrowser methodsFor:'private-changeFile access'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4391 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4392 |
changeFileName:aFileName |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4393 |
"set the name of the changeFile" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4394 |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4395 |
changeFileName := aFileName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
4396 |
encodingIfKnown := nil. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4397 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4398 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4399 |
checkIfFileHasChanged |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4400 |
"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
|
4401 |
install a timeout for rechecking after some time." |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
4402 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4403 |
|f info | |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4404 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4405 |
Processor removeTimedBlock:checkBlock. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4406 |
f := changeFileName asFilename. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4407 |
(info := f info) isNil ifTrue:[ |
16092 | 4408 |
self newLabel:'(unaccessible)' |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4409 |
] ifFalse:[ |
16092 | 4410 |
(info modificationTime) > changeFileTimestamp ifTrue:[ |
4411 |
self newLabel:'(outdated)'. |
|
4412 |
autoUpdate value ifTrue:[ |
|
4413 |
self doUpdate |
|
4414 |
] |
|
4415 |
] ifFalse:[ |
|
4416 |
self newLabel:'' |
|
4417 |
] |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4418 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4419 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4420 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4421 |
"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
|
4422 |
"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
|
4423 |
"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
|
4424 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4425 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4426 |
readChangesFile |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4427 |
"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
|
4428 |
and a list of chunk-positions (changePositions)" |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4429 |
|
5178 | 4430 |
self readChangesFileInBackground:false. |
4431 |
self newLabel:''. |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4432 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4433 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4434 |
readChangesFileInBackground:inBackground |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4435 |
"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
|
4436 |
and a list of chunk-positions (changePositions). |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4437 |
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
|
4438 |
the cols are: |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4439 |
1 delta (only if comparing) |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4440 |
'+' -> new method (w.r.t. current state) |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4441 |
'-' -> removed method (w.r.t. current state) |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4442 |
'?' -> class does not exist currently |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4443 |
'=' -> change is the same as current methods source |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4444 |
'~' -> change is almost the same as current methods source |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4445 |
2 class/selector |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4446 |
3 type of change |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4447 |
doit |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4448 |
method |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4449 |
category change |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4450 |
4 timestamp |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4451 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4452 |
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
|
4453 |
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
|
4454 |
|
12635 | 4455 |
|inStream i f askedForEditingClassSource myProcess myPriority myPrioRange| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4456 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4457 |
editingClassSource := false. |
2641 | 4458 |
askedForEditingClassSource := false. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4459 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4460 |
"/ maxLen := 60. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4461 |
|
3674 | 4462 |
self newLabel:'updating ...'. |
4463 |
||
4464 |
(self class isXMLFile:changeFileName) ifTrue:[ |
|
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4465 |
^ self class readXMLChangesFromFile:changeFileName inBackground:inBackground |
3674 | 4466 |
]. |
4467 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4468 |
f := changeFileName asFilename. |
7346 | 4469 |
f exists ifFalse:[^ self]. |
12635 | 4470 |
inStream := EncodedStream decodedStreamFor:(f readStream). |
5696 | 4471 |
|
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4472 |
i := f info. |
3965
e499c0dae8fc
use #fileSize instead of #size
Claus Gittinger <cg@exept.de>
parents:
3962
diff
changeset
|
4473 |
changeFileSize := i fileSize. |
3962
3906b10c42fd
modified -> modificationTime
Claus Gittinger <cg@exept.de>
parents:
3930
diff
changeset
|
4474 |
changeFileTimestamp := i modificationTime. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4475 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4476 |
self withReadCursorDo:[ |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4477 |
" |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4478 |
this is a time consuming operation (especially, if reading an |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4479 |
NFS-mounted directory; therefore lower my priority ... |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4480 |
" |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4481 |
inBackground ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4482 |
myProcess := Processor activeProcess. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4483 |
myPriority := myProcess priority. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4484 |
myPrioRange := myProcess priorityRange. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4485 |
myProcess priorityRange:(Processor userBackgroundPriority to:Processor activePriority). |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4486 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4487 |
|
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4488 |
[ |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4489 |
|reader| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4490 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4491 |
reader := ChangeFileReader new. |
6516
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
4492 |
reader changeFileName:changeFileName. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4493 |
reader browser:self. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4494 |
reader enforcedNameSpace:enforcedNameSpace. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4495 |
reader autoCompare:autoCompare. |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
4496 |
reader autoloadAsRequired:autoloadAsRequired. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4497 |
reader tabSpec:tabSpec. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4498 |
reader inStream:inStream. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4499 |
reader noColoring:(NoColoring == true). |
16467 | 4500 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4501 |
reader readChangesFile. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4502 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
4503 |
editingClassSource := reader thisIsAClassSource. |
16372 | 4504 |
changeInfoList := reader changeInfo. |
16467 | 4505 |
|
4506 |
self showNumberOfChanges. |
|
7360 | 4507 |
anyChanges := false. |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4508 |
] ensure:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4509 |
inStream close. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4510 |
inBackground ifTrue:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4511 |
myProcess priority:myPriority. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4512 |
myProcess priorityRange:myPrioRange. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4513 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4514 |
]. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4515 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4516 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4517 |
self checkIfFileHasChanged |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4518 |
|
7360 | 4519 |
"Modified: / 27-08-1995 / 23:06:55 / claus" |
16372 | 4520 |
"Modified: / 01-05-2016 / 19:13:09 / cg" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4521 |
! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4522 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4523 |
writeBackChanges |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4524 |
"write back the changes file. To avoid problems when the disk is full |
6288 | 4525 |
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
|
4526 |
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
|
4527 |
rename the old change-file to a .bak file and finally rename the |
6288 | 4528 |
tempfile back to the change-file. |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4529 |
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
|
4530 |
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
|
4531 |
|
15858 | 4532 |
|inFilename inStream outStream stamp encoding tempFilename| |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4533 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4534 |
editingClassSource ifTrue:[ |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4535 |
(self confirm:'You are editing a classes sourceFile (not a changeFile) !!\\Are you certain, you want to overwrite it ?' withCRs) |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4536 |
ifFalse:[ |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4537 |
^ false |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4538 |
] |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4539 |
]. |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4540 |
|
13123 | 4541 |
inFilename := changeFileName asFilename. |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4542 |
[ |
13123 | 4543 |
inStream := inFilename readStream. |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4544 |
] on:FileStream openErrorSignal do:[:ex| |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4545 |
self warn:'Cannot open old changesFile.'. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4546 |
^ false |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4547 |
]. |
9020 | 4548 |
[ |
4549 |
[ |
|
13123 | 4550 |
outStream := FileStream newTemporaryIn:inFilename directory. |
4551 |
tempFilename := outStream fileName. |
|
9020 | 4552 |
] on:FileStream openErrorSignal do:[:ex| |
4553 |
self warn:'Cannot create temp file in current directory.'. |
|
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4554 |
^ false |
9020 | 4555 |
]. |
4556 |
||
11234 | 4557 |
outStream nextPutLine:'''---- encoding: utf8 ----''!!'. |
9020 | 4558 |
outStream := EncodedStream stream:outStream encoder:(CharacterEncoder encoderForUTF8). |
4559 |
||
4560 |
encoding := CharacterEncoder guessEncodingOfStream:inStream. |
|
4561 |
encoding notNil ifTrue:[ |
|
15858 | 4562 |
inStream := EncodedStream stream:inStream encoding:encoding. |
9020 | 4563 |
]. |
4564 |
||
11685 | 4565 |
self withWriteCursorDo:[ |
9020 | 4566 |
|excla sawExcla done first chunk |
4567 |
nChanges "{Class:SmallInteger}" | |
|
4568 |
||
4569 |
Stream writeErrorSignal handle:[:ex | |
|
4570 |
self warn:('Could not update the changes file.\\' , ex description) withCRs. |
|
13123 | 4571 |
outStream close. |
4572 |
tempFilename remove. |
|
9020 | 4573 |
^ false |
4574 |
] do:[ |
|
4575 |
excla := inStream class chunkSeparator. |
|
4576 |
nChanges := self numberOfChanges. |
|
4577 |
||
4578 |
1 to:nChanges do:[:index | |
|
16372 | 4579 |
inStream position:((changeInfoList at:index) position)-1. |
9020 | 4580 |
sawExcla := inStream peekFor:excla. |
4581 |
chunk := inStream nextChunk. |
|
4582 |
||
4583 |
(chunk notNil |
|
4584 |
and:[(chunk startsWith:'''---- snap') not]) ifTrue:[ |
|
16372 | 4585 |
(stamp := (changeInfoList at:index) timestamp) notNil ifTrue:[ |
9020 | 4586 |
outStream nextPutAll:'''---- timestamp ' , stamp , ' ----'''. |
4587 |
outStream nextPut:excla; cr. |
|
4588 |
]. |
|
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4589 |
]. |
9020 | 4590 |
|
4591 |
sawExcla ifTrue:[ |
|
4592 |
outStream nextPut:excla. |
|
4593 |
outStream nextChunkPut:chunk. |
|
4594 |
outStream cr; cr. |
|
4595 |
" |
|
4596 |
a method-definition chunk - output followups |
|
4597 |
" |
|
4598 |
done := false. |
|
4599 |
first := true. |
|
4600 |
[done] whileFalse:[ |
|
4601 |
chunk := inStream nextChunk. |
|
4602 |
chunk isNil ifTrue:[ |
|
4603 |
outStream cr; cr. |
|
4604 |
done := true |
|
4605 |
] ifFalse:[ |
|
4606 |
chunk isEmpty ifTrue:[ |
|
4607 |
outStream space; nextChunkPut:chunk; cr; cr. |
|
4608 |
done := true. |
|
4609 |
] ifFalse:[ |
|
4610 |
first ifFalse:[ |
|
4611 |
outStream cr; cr. |
|
4612 |
]. |
|
4613 |
outStream nextChunkPut:chunk. |
|
4614 |
]. |
|
4615 |
]. |
|
4616 |
first := false. |
|
4617 |
]. |
|
4618 |
] ifFalse:[ |
|
4619 |
outStream nextChunkPut:chunk. |
|
4620 |
outStream cr |
|
4621 |
] |
|
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4622 |
]. |
9020 | 4623 |
outStream syncData; close. |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4624 |
]. |
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4625 |
inStream close. |
9020 | 4626 |
|
17376 | 4627 |
inFilename renameTo:inFilename asBackupFilename. |
13123 | 4628 |
tempFilename renameTo:changeFileName. |
9020 | 4629 |
anyChanges := false |
6415
3b2616b53ab3
utf-8 characters have been destroyed if changes were written back to the change file
Stefan Vogel <sv@exept.de>
parents:
6386
diff
changeset
|
4630 |
]. |
9020 | 4631 |
] ensure:[ |
4632 |
inStream close. |
|
4633 |
]. |
|
4634 |
||
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4635 |
^ true |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4636 |
|
16372 | 4637 |
"Modified: / 01-05-2016 / 19:30:34 / cg" |
17376 | 4638 |
"Modified: / 09-02-2017 / 13:30:57 / stefan" |
2263
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4639 |
! ! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4640 |
|
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4641 |
!ChangesBrowser methodsFor:'private-user interaction ops'! |
46fc2bb1b9c1
changes to allow browsing Sqeak fileOut format.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
4642 |
|
5735 | 4643 |
appendChange:changeNr toFile:aFileNameOrFileNameString |
202 | 4644 |
"append change to a file. return true if ok." |
4645 |
||
5735 | 4646 |
|fileName changeInStream outStream chunk chunk2 sawExcla separator encoding| |
4647 |
||
4648 |
changeInStream := self streamForChange:changeNr. |
|
4649 |
changeInStream isNil ifTrue:[ |
|
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4650 |
self warn:'Cannot read change'. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4651 |
^ false |
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4652 |
]. |
5735 | 4653 |
changeInStream skipSeparators. |
4654 |
||
4655 |
separator := changeInStream class chunkSeparator. |
|
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4656 |
|
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4657 |
(self changeIsFollowupMethodChange:changeNr) ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4658 |
sawExcla := true. |
16372 | 4659 |
chunk := self changeChunkAt:changeNr. |
2394
0841cfed6ec5
fixed delete followed by save-change
Claus Gittinger <cg@exept.de>
parents:
2353
diff
changeset
|
4660 |
] ifFalse:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4661 |
sawExcla := changeInStream peekFor:separator. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4662 |
chunk := changeInStream nextChunk. |
3991 | 4663 |
]. |
4664 |
chunk withoutSeparators isEmpty ifTrue:[ |
|
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4665 |
self error:'Empty chunk - should not happen' mayProceed:true. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4666 |
^ false. |
5735 | 4667 |
]. |
4668 |
||
4669 |
fileName := aFileNameOrFileNameString asFilename. |
|
202 | 4670 |
|
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
4671 |
[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4672 |
outStream := fileName readWriteStream. |
4632
c16dc83e3972
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4599
diff
changeset
|
4673 |
] on:FileStream openErrorSignal do:[:ex| |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4674 |
self warn:'Cannot update file: ''%1''' with:fileName. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4675 |
^ false |
73 | 4676 |
]. |
202 | 4677 |
|
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4678 |
outStream fileSize = 0 ifTrue:[ |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4679 |
encoding := #utf8. |
15090 | 4680 |
outStream nextPutLine:'"{ Encoding: utf8 }" !!'. |
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4681 |
] ifFalse:[ |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4682 |
encoding := CharacterEncoder guessEncodingOfStream:outStream. |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4683 |
]. |
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4684 |
|
5735 | 4685 |
encoding notNil ifTrue:[ |
15858 | 4686 |
outStream := EncodedStream stream:outStream encoding:encoding. |
11476
a4678acc1e78
changed: #appendChange:toFile:
Stefan Vogel <sv@exept.de>
parents:
11475
diff
changeset
|
4687 |
]. |
202 | 4688 |
outStream setToEnd. |
4689 |
||
4690 |
sawExcla ifTrue:[ |
|
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4691 |
outStream nextPut:separator |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4692 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4693 |
outStream nextChunkPut:chunk; cr. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4694 |
sawExcla ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4695 |
chunk2 := changeInStream nextChunk. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4696 |
chunk2 withoutSeparators isEmpty ifTrue:[ |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4697 |
self error:'Empty chunk - should not happen'. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4698 |
]. |
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4699 |
outStream nextChunkPut:chunk2; space |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4700 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4701 |
sawExcla ifTrue:[ |
7618
92c7128604a4
changed #appendChange:toFile: Make error proceedable
Stefan Vogel <sv@exept.de>
parents:
7528
diff
changeset
|
4702 |
outStream nextPut:separator |
202 | 4703 |
]. |
4704 |
outStream cr. |
|
5735 | 4705 |
|
4706 |
changeInStream close. |
|
202 | 4707 |
outStream close. |
4708 |
^ true |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4709 |
|
16372 | 4710 |
"Modified: / 01-05-2016 / 18:25:00 / cg" |
73 | 4711 |
! |
4712 |
||
51 | 4713 |
applyChange:changeNr |
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4714 |
"fileIn a change. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4715 |
Answer true, if everything went ok." |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4716 |
|
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4717 |
|aStream applyAction nameSpace className changeClass ownerName ownerClass reader doItChunk methodsForChunk pkg |
4877 | 4718 |
alternativeClass shortName orgClassName nsClass aborted| |
45 | 4719 |
|
51 | 4720 |
aStream := self streamForChange:changeNr. |
12973 | 4721 |
aStream isNil ifTrue:[^ false]. |
51 | 4722 |
|
2965 | 4723 |
className := self classNameOfChange:changeNr. |
4724 |
className notNil ifTrue:[ |
|
6378 | 4725 |
className := className asSymbol. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4726 |
enforcedNameSpace notNil ifTrue:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4727 |
changeClass := enforcedNameSpace at:className ifAbsent:nil. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4728 |
] ifFalse:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4729 |
changeClass := Smalltalk at:className ifAbsent:nil. |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
4730 |
]. |
6378 | 4731 |
changeClass isNil ifTrue:[ |
4732 |
changeClass := self classOfChange:changeNr. |
|
4733 |
]. |
|
8351
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4734 |
changeClass notNil ifTrue:[ |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4735 |
"load unloaded class. Otherwise a class definition change |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4736 |
will create a class without methods" |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4737 |
changeClass autoload. |
e99a28a6288b
changed #applyChange: load class before applying a change
Stefan Vogel <sv@exept.de>
parents:
8320
diff
changeset
|
4738 |
]. |
51 | 4739 |
]. |
45 | 4740 |
|
51 | 4741 |
changeNrProcessed := changeNr. |
4877 | 4742 |
aborted := false. |
45 | 4743 |
|
6288 | 4744 |
applyAction := |
6378 | 4745 |
[ |
7783
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4746 |
AbortOperationRequest handle:[:ex | |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4747 |
"catch the abort of a single apply here. |
a0c1578e65fb
"Cancel all" did not work, when an error occured while applying multiple changes
Stefan Vogel <sv@exept.de>
parents:
7710
diff
changeset
|
4748 |
Send AbortAllOperationRequest to abort multiple operations" |
6378 | 4749 |
aborted := true. |
4750 |
ex return. |
|
4751 |
] do:[ |
|
4752 |
nameSpace := self nameSpaceForApply. |
|
4753 |
||
4754 |
pkg := enforcedPackage ? Class packageQuerySignal query. |
|
4755 |
Class packageQuerySignal answer:pkg |
|
4756 |
do:[ |
|
4757 |
Class nameSpaceQuerySignal answer:nameSpace |
|
4758 |
do:[ |
|
11244 | 4759 |
Class defaultApplicationQuerySignal handle:[:ex | |
4760 |
ex proceedWith:defaultApplicationForVAGEClasses |
|
4761 |
] do:[ |
|
4762 |
Class changeDefaultApplicationNotificationSignal handle:[:ex | |
|
4763 |
defaultApplicationForVAGEClasses := ex parameter. |
|
4764 |
] do:[ |
|
4765 |
||
4766 |
"/ a followup methodsFor: chunk ... |
|
4767 |
(self changeIsFollowupMethodChange:changeNr) ifTrue:[ |
|
16372 | 4768 |
methodsForChunk := self changeChunkAt:changeNr. |
11244 | 4769 |
] ifFalse:[ |
4770 |
doItChunk := aStream nextChunk. "/ an empty chunk sometimes ... |
|
4771 |
doItChunk notEmpty ifTrue:[ |
|
4772 |
doItChunk first = (Character value:16rFEFF) ifTrue:[ |
|
4773 |
doItChunk := doItChunk copyFrom:2. |
|
4774 |
]. |
|
4775 |
Compiler evaluate:doItChunk notifying:self. |
|
6378 | 4776 |
] ifFalse:[ |
11244 | 4777 |
methodsForChunk := aStream nextChunk. "/ the real one |
6378 | 4778 |
] |
4779 |
]. |
|
11244 | 4780 |
methodsForChunk notNil ifTrue:[ |
4781 |
changeClass isNil ifTrue:[ |
|
4782 |
orgClassName := className. |
|
4783 |
||
4784 |
(className includes:$:) ifTrue:[ |
|
4785 |
ownerName := className copyTo:(className lastIndexOf:$:) - 1. |
|
4786 |
(ownerName endsWith:$:) ifTrue:[ |
|
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
4787 |
ownerName := ownerName copyButLast:1. |
11244 | 4788 |
]. |
4789 |
||
4790 |
ownerClass := Smalltalk at:(ownerName asSymbol) ifAbsent:[]. |
|
4791 |
ownerClass notNil ifTrue:[ |
|
4792 |
ownerClass autoload |
|
4793 |
]. |
|
4794 |
]. |
|
4795 |
(nameSpace notNil and:[nameSpace ~~ Smalltalk]) ifTrue:[ |
|
4796 |
changeClass := nameSpace at:className ifAbsent:[]. |
|
4797 |
]. |
|
4798 |
changeClass isNil ifTrue:[ |
|
4799 |
changeClass := Smalltalk at:className ifAbsent:[]. |
|
4800 |
]. |
|
4801 |
[changeClass isNil] whileTrue:[ |
|
4802 |
(NameSpace allNameSpaces |
|
15683 | 4803 |
contains:[:ns | (nsClass := (ns at:className asSymbol)) notNil]) |
11244 | 4804 |
ifTrue:[ |
4805 |
shortName := nsClass name. |
|
4806 |
] ifFalse:[ |
|
4807 |
shortName := className copyFrom:(className lastIndexOf:$:) + 1. |
|
4808 |
shortName = className ifTrue:[ |
|
4809 |
shortName := '' |
|
4810 |
]. |
|
4811 |
]. |
|
4812 |
className := Dialog |
|
12973 | 4813 |
request:'No class ''' , className , ''' for change. Add to which class? (enter empty string to skip this change)' |
11244 | 4814 |
initialAnswer:shortName. |
4815 |
||
12973 | 4816 |
className isNil ifTrue:[ |
4817 |
AbortAllOperationRequest raise. |
|
4818 |
]. |
|
4819 |
className isEmpty ifTrue:[ |
|
4820 |
^ false |
|
11244 | 4821 |
]. |
4822 |
alternativeClass := Smalltalk classNamed:className. |
|
4823 |
alternativeClass notNil ifTrue:[ |
|
4824 |
changeClass := alternativeClass |
|
4825 |
] |
|
4826 |
]. |
|
4827 |
methodsForChunk := methodsForChunk copyFrom:(methodsForChunk indexOfSeparator). |
|
4828 |
methodsForChunk := changeClass name , methodsForChunk. |
|
4829 |
]. |
|
4830 |
reader := Compiler evaluate:methodsForChunk notifying:self. |
|
4831 |
reader fileInFrom:aStream notifying:self passChunk:false single:true. |
|
4832 |
] |
|
4833 |
] |
|
6378 | 4834 |
] |
4835 |
] |
|
4836 |
] |
|
4837 |
]. |
|
4838 |
changeNrProcessed := nil. |
|
4839 |
]. |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
4840 |
|
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
4841 |
"/ |
17026 | 4842 |
"/ if I am showing the changes file, don't update it |
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
4843 |
"/ |
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
4844 |
changeFileName = ObjectMemory nameForChanges ifTrue:[ |
6378 | 4845 |
Class withoutUpdatingChangesDo:[ |
4846 |
Class updateChangeListQuerySignal answer:updateChangeSet value do:applyAction |
|
4847 |
] |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
4848 |
] ifFalse:[ |
6378 | 4849 |
applyAction value |
45 | 4850 |
]. |
4877 | 4851 |
aStream close. |
4852 |
||
4853 |
^ aborted not |
|
358
a7546792f073
update changeFile if applying changes from another changeFile
Claus Gittinger <cg@exept.de>
parents:
326
diff
changeset
|
4854 |
|
16372 | 4855 |
"Modified: / 01-05-2016 / 18:25:18 / cg" |
45 | 4856 |
! |
4857 |
||
7953 | 4858 |
compareCategoryChange:parseTree |
9888 | 4859 |
|receiverExpression method thisClass| |
7953 | 4860 |
|
4861 |
receiverExpression := parseTree receiver. |
|
4862 |
receiverExpression isMessage ifTrue:[ |
|
4863 |
receiverExpression selector == #compiledMethodAt: ifTrue:[ |
|
9888 | 4864 |
[ |
4865 |
thisClass := receiverExpression receiver evaluate. |
|
4866 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
4867 |
||
4868 |
(thisClass isBehavior |
|
7953 | 4869 |
and:[(method := receiverExpression evaluate) isMethod]) ifTrue:[ |
4870 |
method category = parseTree arg1 evaluate ifTrue:[ |
|
4871 |
^ true -> 'Change has no effect\\(same category)'. |
|
4872 |
] ifFalse:[ |
|
8173 | 4873 |
^ false -> ('Category is different (''' , method category , ''' vs. ''' , parseTree arg1 evaluate , ''')'). |
7953 | 4874 |
] |
4875 |
] ifFalse:[ |
|
4876 |
^ nil -> 'There is no such method'. |
|
4877 |
] |
|
4878 |
] |
|
4879 |
]. |
|
4880 |
^ nil -> 'Unhandled receiver' |
|
4881 |
! |
|
4882 |
||
255 | 4883 |
compareChange:changeNr |
2835 | 4884 |
"compare a change with the current (in-image) version; show the result of the compare (as dialog)" |
4885 |
||
4886 |
^ self compareChange:changeNr showResult:true |
|
4887 |
! |
|
4888 |
||
4889 |
compareChange:changeNr showResult:doShowResult |
|
4890 |
"compare a change with current version. |
|
4891 |
Return the result of the compare (same -> true, different -> false, uncomparable -> nil). |
|
4892 |
If doShowResult is true, the outcome is shown in a dialog/diffViewer." |
|
255 | 4893 |
|
15016 | 4894 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource outcome showDiff d selector isLoaded beep superClass thisClassSym varsHere varsInChange addedVars removedVars |
9888 | 4895 |
isSame ownerClass superClassHere superClassInChange sameAndOutcome| |
255 | 4896 |
|
4897 |
aStream := self streamForChange:changeNr. |
|
2835 | 4898 |
aStream isNil ifTrue:[^ nil]. |
255 | 4899 |
|
275
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
4900 |
showDiff := false. |
604a906c0eb7
better handling of changes for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
255
diff
changeset
|
4901 |
|
1472 | 4902 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
6357 | 4903 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
4904 |
chunk := aStream nextChunk. |
|
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4905 |
] ifTrue:[ |
16372 | 4906 |
chunk := self changeChunkAt:changeNr. |
6357 | 4907 |
sawExcla := true. |
703
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4908 |
]. |
1b3b008d9f19
fixed to allow class-source files to be handled
Claus Gittinger <cg@exept.de>
parents:
627
diff
changeset
|
4909 |
|
2835 | 4910 |
isSame := nil. |
4911 |
||
761 | 4912 |
beep := false. |
255 | 4913 |
sawExcla ifFalse:[ |
6357 | 4914 |
outcome := 'cannot compare this change\\(i.e. this is not a method change).'. |
4915 |
||
4916 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
4917 |
do:[ |
|
8665 | 4918 |
parseTree := self parseExpression:chunk. |
6357 | 4919 |
]. |
4920 |
(parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[ |
|
4921 |
selector := parseTree selector. |
|
4922 |
||
4923 |
selector == #'removeSelector:' ifTrue:[ |
|
7953 | 4924 |
sameAndOutcome := self compareRemoveSelectorChange:parseTree. |
4925 |
isSame := sameAndOutcome key. |
|
4926 |
outcome := sameAndOutcome value. |
|
4927 |
]. |
|
4928 |
selector == #'package:' ifTrue:[ |
|
4929 |
sameAndOutcome := self comparePackageChange:parseTree. |
|
4930 |
isSame := sameAndOutcome key. |
|
4931 |
outcome := sameAndOutcome value. |
|
6357 | 4932 |
]. |
4933 |
selector == #'category:' ifTrue:[ |
|
7953 | 4934 |
sameAndOutcome := self compareCategoryChange:parseTree. |
4935 |
isSame := sameAndOutcome key. |
|
4936 |
outcome := sameAndOutcome value. |
|
6357 | 4937 |
]. |
4938 |
selector == #'comment:' ifTrue:[ |
|
7953 | 4939 |
sameAndOutcome := self compareCommentChange:parseTree. |
4940 |
isSame := sameAndOutcome key. |
|
4941 |
outcome := sameAndOutcome value. |
|
6357 | 4942 |
]. |
4943 |
||
4944 |
selector == #'instanceVariableNames:' ifTrue:[ |
|
7953 | 4945 |
sameAndOutcome := self compareInstanceVariableNamesChange:parseTree. |
4946 |
isSame := sameAndOutcome key. |
|
4947 |
outcome := sameAndOutcome value. |
|
6357 | 4948 |
]. |
4949 |
||
4950 |
(Class definitionSelectors includes:selector) |
|
4951 |
"/ selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:' |
|
4952 |
ifTrue:[ |
|
9888 | 4953 |
[ |
4954 |
superClass := parseTree receiver evaluate. |
|
4955 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
6357 | 4956 |
superClass isBehavior ifFalse:[ |
4957 |
outcome := 'Cannot compare this change\\(superclass not loaded).'. |
|
4958 |
isSame := nil. |
|
4959 |
] ifTrue:[ |
|
4960 |
(self checkClassIsLoaded:superClass) ifTrue:[ |
|
4961 |
thisClassSym := (parseTree arguments at:1) evaluate. |
|
4962 |
||
4963 |
(selector endsWith:':privateIn:') ifTrue:[ |
|
11475
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
4964 |
Parser undefinedVariableError catch:[ |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
4965 |
ownerClass := (parseTree arguments at:5) evaluate. |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
4966 |
ownerClass isBehavior ifTrue:[ |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
4967 |
thisClass := ownerClass privateClassesAt:thisClassSym. |
b6fdfe902263
changed: #compareChange:showResult:
Stefan Vogel <sv@exept.de>
parents:
11397
diff
changeset
|
4968 |
]. |
6357 | 4969 |
]. |
4970 |
] ifFalse:[ |
|
4971 |
thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil. |
|
4972 |
]. |
|
4973 |
thisClass isNil ifTrue:[ |
|
4974 |
outcome := 'Change defines the class: ' , thisClassSym allBold. |
|
4975 |
isSame := false. |
|
4976 |
] ifFalse:[ |
|
4977 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
4978 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
4979 |
isSame := nil. |
|
4980 |
] ifTrue:[ |
|
4981 |
superClassHere := thisClass superclass name. |
|
4982 |
superClassInChange := parseTree receiver name. |
|
4983 |
superClassHere ~~ superClassInChange ifTrue:[ |
|
4984 |
outcome := 'Superclass is different.'. |
|
4985 |
isSame := false. |
|
4986 |
] ifFalse:[ |
|
4987 |
varsHere := thisClass instanceVariableString asCollectionOfWords. |
|
4988 |
varsInChange := (parseTree arguments at:2) evaluate asCollectionOfWords. |
|
4989 |
varsHere = varsInChange ifTrue:[ |
|
4990 |
thisClass classVariableString asCollectionOfWords = (parseTree arguments at:3) evaluate asCollectionOfWords ifTrue:[ |
|
9689
72819fbf329a
changed: #compareChange:showResult:
Claus Gittinger <cg@exept.de>
parents:
9621
diff
changeset
|
4991 |
((thisClass sharedPoolNames size == 0) and:[(parseTree arguments at:4) evaluate = '']) ifTrue:[ |
6357 | 4992 |
((selector endsWith:':category:') |
4993 |
and:[thisClass category ~= (parseTree arguments at:5) evaluate]) ifTrue:[ |
|
4994 |
outcome := 'Category is different'. |
|
4995 |
isSame := false. |
|
4996 |
] ifFalse:[ |
|
4997 |
outcome := 'Change has no effect\\(same definition)'. |
|
4998 |
isSame := true. |
|
4999 |
] |
|
4296
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5000 |
"/ thisClass category = (parseTree arguments at:5) evaluate ifTrue:[ |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5001 |
"/ outcome := 'Change has no effect\\(same definition)'. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5002 |
"/ isSame := true. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5003 |
"/ ] ifFalse:[ |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5004 |
"/ outcome := 'Category is different'. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5005 |
"/ isSame := false. |
4ad7dde4a3db
care for unknown class in doIt;
Claus Gittinger <cg@exept.de>
parents:
4283
diff
changeset
|
5006 |
"/ ] |
6357 | 5007 |
] ifFalse:[ |
5008 |
outcome := 'SharedPool definition is different'. |
|
5009 |
isSame := false. |
|
5010 |
]. |
|
5011 |
] ifFalse:[ |
|
5012 |
outcome := 'ClassVariable definition is different'. |
|
5013 |
isSame := false. |
|
5014 |
] |
|
5015 |
] ifFalse:[ |
|
5016 |
outcome := 'InstanceVariable definition is different'. |
|
5017 |
isSame := false. |
|
12825 | 5018 |
addedVars := varsInChange reject:[:eachVar | (varsHere includes:eachVar)]. |
5019 |
removedVars := varsHere reject:[:eachVar | (varsInChange includes:eachVar)]. |
|
6357 | 5020 |
addedVars isEmpty ifTrue:[ |
5021 |
removedVars isEmpty ifTrue:[ |
|
5022 |
outcome := 'Change reorders instanceVariable(s)'. |
|
5023 |
] ifFalse:[ |
|
5024 |
removedVars := removedVars collect:[:eachVar | '''' , eachVar , '''']. |
|
5025 |
outcome := 'Change removes instanceVariable(s): ' , (removedVars asStringWith:Character space) allBold. |
|
5026 |
] |
|
5027 |
] ifFalse:[ |
|
5028 |
removedVars isEmpty ifTrue:[ |
|
5029 |
addedVars := addedVars collect:[:eachVar | '''' , eachVar , '''']. |
|
5030 |
outcome := 'Change adds instanceVariable(s): ' , (addedVars asStringWith:Character space) allBold. |
|
5031 |
]. |
|
5032 |
]. |
|
5033 |
] |
|
5034 |
] |
|
5035 |
] |
|
5036 |
] |
|
5037 |
] |
|
5038 |
] |
|
5039 |
] |
|
5040 |
] |
|
255 | 5041 |
] ifTrue:[ |
15016 | 5042 |
Class nameSpaceQuerySignal |
5043 |
answer:(self nameSpaceForApply) |
|
5044 |
do:[ |
|
5045 |
parseTree := self parseExpression:chunk. |
|
5046 |
]. |
|
5047 |
||
6357 | 5048 |
(parseTree notNil |
5049 |
and:[parseTree ~~ #Error |
|
5050 |
and:[parseTree isMessage]]) ifTrue:[ |
|
5051 |
"/ Squeak support (#methodsFor:***) |
|
5052 |
(#( |
|
5053 |
#methodsFor: |
|
5054 |
#privateMethodsFor: |
|
5055 |
#publicMethodsFor: |
|
5056 |
#ignoredMethodsFor: |
|
5057 |
#protectedMethodsFor: |
|
5058 |
||
5059 |
#methodsFor:stamp: "/ Squeak support |
|
5060 |
#methodsFor "/ Dolphin support |
|
5061 |
#methods "/ STV support |
|
5062 |
) |
|
5063 |
includes:parseTree selector) ifTrue:[ |
|
9888 | 5064 |
[ |
5065 |
thisClass := parseTree receiver evaluate. |
|
5066 |
] on:Parser undefinedVariableError do:[:ex| |
|
5067 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
5068 |
isSame := nil. |
|
5069 |
]. |
|
5070 |
thisClass notNil ifTrue:[ |
|
5071 |
(thisClass isKindOf:UndefinedVariable) ifTrue:[ |
|
6357 | 5072 |
|thisName path| |
5073 |
||
5074 |
thisName := thisClass name. |
|
5075 |
path := thisName asCollectionOfSubstringsSeparatedByAll:'::'. |
|
5076 |
1 to:path size do:[:length | |
|
5077 |
|ownerName owner| |
|
5078 |
||
5079 |
ownerName := (path copyTo:length) asStringCollection asStringWith:'::'. |
|
6820
4e8815b9e661
Do not autoload class when comparing changes.
Stefan Vogel <sv@exept.de>
parents:
6682
diff
changeset
|
5080 |
owner := Smalltalk loadedClassNamed:ownerName. |
6357 | 5081 |
(owner notNil and:[owner isBehavior and:[owner isLoaded not]]) ifTrue:[ |
5082 |
self checkClassIsLoaded:owner. |
|
5083 |
]. |
|
5084 |
]. |
|
9888 | 5085 |
thisClass := parseTree receiver evaluate. |
6357 | 5086 |
]. |
5087 |
||
5088 |
thisClass isBehavior ifTrue:[ |
|
5089 |
parseTree selector == #methodsFor ifTrue:[ |
|
5090 |
cat := 'Dolphin methods'. |
|
5091 |
] ifFalse:[ |
|
5092 |
parseTree selector == #methods ifTrue:[ |
|
5093 |
cat := 'STV methods'. |
|
5094 |
] ifFalse:[ |
|
5095 |
cat := parseTree arg1 evaluate. |
|
5096 |
]. |
|
5097 |
]. |
|
5098 |
newSource := aStream nextChunk. |
|
5099 |
||
15016 | 5100 |
isSame := self |
5101 |
compareMethodSource:newSource |
|
5102 |
withVersionInClass:thisClass |
|
5103 |
into:[:outcomeResult :beepResult :oldSourceResult| |
|
5104 |
outcome := outcomeResult. |
|
5105 |
beep := beepResult. |
|
5106 |
oldSource := oldSourceResult. |
|
5107 |
]. |
|
5108 |
||
5109 |
isSame isNil ifTrue:[ |
|
5110 |
showDiff := false. |
|
5111 |
] ifFalse:[ |
|
5112 |
showDiff := isSame not. |
|
6357 | 5113 |
]. |
15016 | 5114 |
|
6357 | 5115 |
doShowResult ifTrue:[ |
5116 |
(showDiff and:[oldSource notNil and:[newSource notNil]]) ifTrue:[ |
|
8102 | 5117 |
d := DiffCodeView |
6639 | 5118 |
openOn:oldSource label:(resources string:'Current version (in image)') |
5119 |
and:newSource label:(resources string:'Change version'). |
|
6357 | 5120 |
d label:'method differences'. |
5121 |
] |
|
5122 |
] |
|
5123 |
] ifFalse:[ |
|
5124 |
beep := true. |
|
5125 |
outcome := 'Class does not exist.'. |
|
5126 |
isSame := nil. |
|
5127 |
] |
|
9888 | 5128 |
]] ifFalse:[ |
6357 | 5129 |
beep := true. |
5130 |
outcome := 'Not comparable.'. |
|
5131 |
isSame := nil. |
|
5132 |
] |
|
5133 |
] ifFalse:[ |
|
5134 |
beep := true. |
|
5135 |
outcome := 'Not comparable.'. |
|
5136 |
isSame := nil. |
|
5137 |
] |
|
255 | 5138 |
]. |
5139 |
aStream close. |
|
2835 | 5140 |
|
5141 |
doShowResult ifTrue:[ |
|
6357 | 5142 |
showDiff ifFalse:[ |
5143 |
outcome := (resources stringWithCRs:outcome). |
|
5144 |
beep ifTrue:[ |
|
5145 |
self warn:outcome. |
|
5146 |
] ifFalse:[ |
|
5147 |
self information:outcome. |
|
5148 |
] |
|
5149 |
]. |
|
255 | 5150 |
]. |
2835 | 5151 |
^ isSame. |
255 | 5152 |
|
9689
72819fbf329a
changed: #compareChange:showResult:
Claus Gittinger <cg@exept.de>
parents:
9621
diff
changeset
|
5153 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
16372 | 5154 |
"Modified: / 01-05-2016 / 18:25:32 / cg" |
255 | 5155 |
! |
5156 |
||
7953 | 5157 |
compareCommentChange:parseTree |
5158 |
|thisClass| |
|
5159 |
||
9888 | 5160 |
[ |
5161 |
thisClass := parseTree receiver evaluate. |
|
5162 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5163 |
||
7953 | 5164 |
thisClass isBehavior ifTrue:[ |
5165 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
5166 |
(thisClass comment = parseTree arg1 evaluate) ifTrue:[ |
|
5167 |
^ true -> 'Change has no effect\\(same comment)'. |
|
5168 |
] ifFalse:[ |
|
5169 |
^ false -> 'Comment is different'. |
|
5170 |
] |
|
5171 |
] ifFalse:[ |
|
5172 |
^ nil -> 'Cannot compare this change (compare requires class to be loaded).'. |
|
5173 |
] |
|
5174 |
]. |
|
5175 |
^ nil -> 'Cannot compare this change (class not present)'. |
|
5176 |
! |
|
5177 |
||
5178 |
compareInstanceVariableNamesChange:parseTree |
|
5179 |
|receiverExpression thisClass varsHere varsInChange | |
|
5180 |
||
5181 |
receiverExpression := parseTree receiver. |
|
5182 |
receiverExpression isMessage ifTrue:[ |
|
5183 |
receiverExpression selector == #class ifTrue:[ |
|
9888 | 5184 |
[ |
5185 |
thisClass := receiverExpression evaluate. |
|
5186 |
] on:Parser undefinedVariableError do:[:ex| |
|
5187 |
^ nil -> 'Class is not loaded'. |
|
5188 |
]. |
|
5189 |
||
7953 | 5190 |
varsHere := thisClass instanceVariableString asCollectionOfWords. |
5191 |
varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords. |
|
5192 |
varsHere = varsInChange ifTrue:[ |
|
5193 |
^ true -> 'Change has no effect\\(same definition)'. |
|
5194 |
] ifFalse:[ |
|
5195 |
^ false -> 'Class-instanceVariable definition is different'. |
|
5196 |
]. |
|
5197 |
]. |
|
5198 |
]. |
|
5199 |
^ nil -> 'Unhandled receiver' |
|
5200 |
! |
|
5201 |
||
15016 | 5202 |
compareMethodSource:newSource withVersionInClass:thisClass into:aThreeArgBlock |
5203 |
"returns true/false/nil if same,different,undecided; |
|
5204 |
also provides a message and a beep-boolean via the passed in block" |
|
5205 |
||
17579 | 5206 |
<ignore: RBReturnsBooleanAndOtherRule rationale: 'done by purpose' author: 'cg'> |
5207 |
||
15016 | 5208 |
|parser sel oldMethod oldSource outcome t1 t2 isLoaded| |
5209 |
||
5210 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
5211 |
do:[ |
|
5212 |
parser := Parser parseMethod:newSource in:thisClass. |
|
5213 |
]. |
|
5214 |
(parser isNil or:[parser == #Error]) ifTrue:[ |
|
5215 |
outcome := 'Change is unparsable (parse error).'. |
|
5216 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5217 |
^ nil. |
|
5218 |
]. |
|
5219 |
||
5220 |
sel := parser selector. |
|
5221 |
oldMethod := thisClass compiledMethodAt:sel. |
|
5222 |
oldMethod isNil ifTrue:[ |
|
5223 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
5224 |
outcome := 'Cannot compare this change\\(compare requires class to be loaded).'. |
|
5225 |
] ifTrue:[ |
|
5226 |
outcome := 'Method does not exist.'. |
|
5227 |
]. |
|
5228 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5229 |
^ nil. |
|
5230 |
]. |
|
5231 |
||
5232 |
oldSource := oldMethod source. |
|
5233 |
oldSource isNil ifTrue:[ |
|
5234 |
outcome := 'No source for compare.'. |
|
5235 |
aThreeArgBlock value:outcome value:true "beep" value:nil. |
|
5236 |
^ nil. |
|
5237 |
]. |
|
5238 |
(oldSource = newSource) ifTrue:[ |
|
5239 |
outcome := 'Same source'. |
|
5240 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5241 |
^ true. |
|
5242 |
]. |
|
5243 |
||
5244 |
"/ |
|
5245 |
"/ compare for tabulator <-> space changes |
|
5246 |
"/ before showing diff ... |
|
5247 |
"/ |
|
5248 |
t1 := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5249 |
t2 := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5250 |
t1 = t2 ifTrue:[ |
|
5251 |
outcome := 'Same source'. |
|
5252 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5253 |
^ true. |
|
5254 |
]. |
|
5255 |
||
5256 |
"/ |
|
5257 |
"/ check if only historyLine diffs |
|
5258 |
"/ |
|
5259 |
(HistoryManager notNil |
|
5260 |
and:[HistoryManager isActive]) ifTrue:[ |
|
5261 |
(HistoryManager withoutHistoryLines:newSource) |
|
5262 |
= |
|
5263 |
(HistoryManager withoutHistoryLines:oldSource) |
|
5264 |
ifTrue:[ |
|
5265 |
outcome := 'Same source (history only)'. |
|
5266 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5267 |
^ true. |
|
5268 |
] |
|
5269 |
]. |
|
5270 |
||
5271 |
outcome := 'Source changed.'. |
|
5272 |
aThreeArgBlock value:outcome value:false "beep" value:oldSource. |
|
5273 |
^ false. |
|
17579 | 5274 |
|
5275 |
"Modified: / 16-07-2017 / 13:32:05 / cg" |
|
15016 | 5276 |
! |
5277 |
||
7953 | 5278 |
comparePackageChange:parseTree |
9888 | 5279 |
|receiverExpression method thisClass| |
7953 | 5280 |
|
5281 |
receiverExpression := parseTree receiver. |
|
5282 |
receiverExpression isMessage ifTrue:[ |
|
5283 |
receiverExpression selector == #compiledMethodAt: ifTrue:[ |
|
9888 | 5284 |
[ |
5285 |
thisClass := receiverExpression receiver evaluate. |
|
5286 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5287 |
(thisClass isBehavior |
|
7953 | 5288 |
and:[(method := receiverExpression evaluate) isMethod]) ifTrue:[ |
5289 |
method package = parseTree arg1 evaluate ifTrue:[ |
|
5290 |
^ true -> 'Change has no effect\\(same package)'. |
|
5291 |
] ifFalse:[ |
|
8000 | 5292 |
^ false -> ('Package is different (''<1p>'' vs. ''<2p>'')' expandMacrosWith:method package with:parseTree arg1 evaluate). |
7953 | 5293 |
] |
5294 |
] ifFalse:[ |
|
5295 |
^ nil -> 'There is no such method'. |
|
5296 |
] |
|
5297 |
] |
|
5298 |
]. |
|
5299 |
^ nil -> 'Unhandled receiver' |
|
5300 |
! |
|
5301 |
||
5302 |
compareRemoveSelectorChange:parseTree |
|
5303 |
|thisClass selector| |
|
5304 |
||
9888 | 5305 |
[ |
5306 |
thisClass := parseTree receiver evaluate. |
|
5307 |
] on:Parser undefinedVariableError do:[:ex| ]. |
|
5308 |
||
7953 | 5309 |
thisClass isBehavior ifTrue:[ |
5310 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
5311 |
selector := (parseTree arg1 evaluate). |
|
5312 |
(thisClass includesSelector:selector) ifTrue:[ |
|
8000 | 5313 |
^ false -> ('Change removes the #' , selector , ' method from ' , thisClass name). |
7953 | 5314 |
] ifFalse:[ |
8000 | 5315 |
^ true -> ('Change has no effect\\(there is no method for #' , selector , ' in ' , thisClass name , ')'). |
7953 | 5316 |
] |
5317 |
] ifFalse:[ |
|
5318 |
^ nil -> 'Cannot compare this change (compare requires class to be loaded).'. |
|
5319 |
] |
|
5320 |
]. |
|
5321 |
^ nil -> 'Cannot compare this change (class not present)'. |
|
5322 |
! |
|
5323 |
||
1359 | 5324 |
compressForClass:aClassNameOrNil |
6288 | 5325 |
"compress the change-set; |
1359 | 5326 |
this replaces multiple method-changes by the last (i.e. the most recent) change. |
5327 |
If the class argument is nil, compress for all classes. |
|
5328 |
otherwise, only changes for that class are compressed." |
|
5329 |
||
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5330 |
self |
6288 | 5331 |
compressForClass:aClassNameOrNil selector:nil |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5332 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5333 |
"Modified: / 19.11.2001 / 22:04:12 / cg" |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5334 |
! |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5335 |
|
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5336 |
compressForClass:aClassNameOrNil selector:selectorToCompressOrNil |
6288 | 5337 |
"compress the change-set; |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5338 |
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
|
5339 |
If the class argument is nil, compress for all classes. |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5340 |
otherwise, only changes for that class are compressed." |
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5341 |
|
6288 | 5342 |
|lbl aStream searchIndex anyMore deleteSet index |
7507 | 5343 |
str snapshotProto snapshotPrefix snapshotNameIndex| |
5344 |
||
5345 |
changeFileName notNil ifTrue:[ |
|
5346 |
aStream := changeFileName asFilename readStreamOrNil. |
|
5347 |
aStream isNil ifTrue:[^ self]. |
|
5348 |
]. |
|
1359 | 5349 |
|
4762 | 5350 |
lbl := 'compressing'. |
1359 | 5351 |
aClassNameOrNil isNil ifTrue:[ |
7507 | 5352 |
selectorToCompressOrNil notNil ifTrue:[ |
5353 |
lbl := lbl , ' for ' , selectorToCompressOrNil. |
|
5354 |
] |
|
1359 | 5355 |
] ifFalse:[ |
7507 | 5356 |
selectorToCompressOrNil isNil ifTrue:[ |
5357 |
lbl := lbl , ' for ' , aClassNameOrNil. |
|
5358 |
] ifFalse:[ |
|
5359 |
lbl := lbl , ' for ' , aClassNameOrNil , '>>' , selectorToCompressOrNil. |
|
5360 |
] |
|
1359 | 5361 |
]. |
6288 | 5362 |
lbl := lbl , '...'. |
3456
080399eeaab1
added compressForClass-selector function
Claus Gittinger <cg@exept.de>
parents:
3455
diff
changeset
|
5363 |
self newLabel:lbl. |
1359 | 5364 |
|
5365 |
CompressSnapshotInfo == true ifTrue:[ |
|
7507 | 5366 |
" |
5367 |
get a prototype snapshot record (to be independent of |
|
5368 |
the actual format .. |
|
5369 |
" |
|
16877 | 5370 |
str := WriteStream on:''. |
7507 | 5371 |
Class addChangeRecordForSnapshot:'foo' to:str. |
5372 |
snapshotProto := str contents. |
|
5373 |
snapshotPrefix := snapshotProto copyTo:10. |
|
5374 |
snapshotNameIndex := snapshotProto findString:'foo'. |
|
1359 | 5375 |
]. |
5376 |
||
5377 |
self withExecuteCursorDo:[ |
|
7507 | 5378 |
|numChanges classes selectors types excla sawExcla |
5379 |
chunk aParseTree parseTreeChunk |
|
5380 |
thisClass thisSelector codeChunk codeParser |
|
5381 |
compressThis fileName| |
|
5382 |
||
5383 |
numChanges := self numberOfChanges. |
|
5384 |
classes := Array new:numChanges. |
|
5385 |
selectors := Array new:numChanges. |
|
5386 |
types := Array new:numChanges. |
|
5387 |
||
5388 |
"starting at the end, get the change class and change selector; |
|
5389 |
collect all in classes / selectors" |
|
5390 |
||
5391 |
aStream notNil ifTrue:[ |
|
5392 |
excla := aStream class chunkSeparator. |
|
5393 |
numChanges to:1 by:-1 do:[:changeNr | |
|
16372 | 5394 |
aStream position:((changeInfoList at:changeNr) position)-1. |
7507 | 5395 |
sawExcla := aStream peekFor:excla. |
5396 |
chunk := aStream nextChunk. |
|
5397 |
sawExcla ifTrue:[ |
|
5398 |
"optimize a bit if multiple methods for same category arrive" |
|
5399 |
(chunk = parseTreeChunk) ifFalse:[ |
|
8665 | 5400 |
aParseTree := self parseExpression:chunk. |
7507 | 5401 |
parseTreeChunk := chunk |
5402 |
]. |
|
5403 |
(aParseTree notNil |
|
5404 |
and:[(aParseTree ~~ #Error) |
|
5405 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
5406 |
(#( |
|
5407 |
#methodsFor: |
|
5408 |
#privateMethodsFor: |
|
5409 |
#publicMethodsFor: |
|
5410 |
#ignoredMethodsFor: |
|
5411 |
#protectedMethodsFor: |
|
5412 |
#methodsFor:stamp: "/ Squeak support |
|
5413 |
#methodsFor "/ Dolphin support |
|
5414 |
#methods "/ STV support |
|
5415 |
) |
|
5416 |
includes:aParseTree selector) ifTrue:[ |
|
5417 |
codeChunk := aStream nextChunk. |
|
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5418 |
[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5419 |
thisClass := aParseTree receiver evaluate. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5420 |
codeParser := Parser |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5421 |
parseMethodSpecification:codeChunk |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5422 |
in:thisClass |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5423 |
ignoreErrors:true |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5424 |
ignoreWarnings:true. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5425 |
(codeParser notNil and:[codeParser ~~ #Error]) ifTrue:[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5426 |
selectors at:changeNr put:(codeParser selector). |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5427 |
classes at:changeNr put:thisClass. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5428 |
types at:changeNr put:#methodsFor |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5429 |
] |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5430 |
] on:Parser parseErrorSignal do:[:ex| |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5431 |
"ignore chunk" |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5432 |
ex return. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5433 |
]. |
7507 | 5434 |
] |
5435 |
] |
|
5436 |
] ifFalse:[ |
|
8665 | 5437 |
aParseTree := self parseExpression:chunk. |
7507 | 5438 |
parseTreeChunk := chunk. |
5439 |
(aParseTree notNil |
|
5440 |
and:[(aParseTree ~~ #Error) |
|
5441 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
5442 |
(aParseTree selector == #removeSelector:) ifTrue:[ |
|
9543
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5443 |
[ |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5444 |
thisClass := aParseTree receiver evaluate. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5445 |
selectors at:changeNr put:(aParseTree arg1 value). |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5446 |
classes at:changeNr put:thisClass. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5447 |
types at:changeNr put:#removeSelector |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5448 |
] on:Parser parseErrorSignal do:[:ex| |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5449 |
"ignore chunk" |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5450 |
ex return. |
5d4b92f6e483
changed: #compressForClass:selector:
Stefan Vogel <sv@exept.de>
parents:
9527
diff
changeset
|
5451 |
]. |
7507 | 5452 |
] |
5453 |
] ifFalse:[ |
|
5454 |
CompressSnapshotInfo == true ifTrue:[ |
|
5455 |
(chunk startsWith:snapshotPrefix) ifTrue:[ |
|
13314 | 5456 |
str := chunk readStream position:snapshotNameIndex-1. |
7507 | 5457 |
fileName := str upTo:(Character space). |
5458 |
" |
|
5459 |
kludge to allow use of match-check below |
|
5460 |
" |
|
5461 |
selectors at:changeNr put:snapshotPrefix. |
|
5462 |
classes at:changeNr put:fileName. |
|
5463 |
] |
|
5464 |
] |
|
5465 |
] |
|
5466 |
]. |
|
5467 |
]. |
|
5468 |
aStream close. |
|
5469 |
] ifFalse:[ |
|
5470 |
numChanges to:1 by:-1 do:[:changeNr | |
|
5471 |
|change| |
|
5472 |
||
5473 |
classes at:changeNr put:(self classOfChange:changeNr ifAbsent:[:className| nil]). |
|
5474 |
selectors at:changeNr put:(self selectorOfMethodChange:changeNr). |
|
5475 |
]. |
|
5476 |
]. |
|
5477 |
||
5478 |
"for all changes, look for another class/selector occurrence later |
|
5479 |
in the list and, if there is one, add change number to the delete set" |
|
5480 |
||
5481 |
deleteSet := OrderedCollection new. |
|
5482 |
1 to:self numberOfChanges-1 do:[:changeNr | |
|
5483 |
thisClass := classes at:changeNr. |
|
5484 |
||
5485 |
compressThis := false. |
|
5486 |
aClassNameOrNil isNil ifTrue:[ |
|
5487 |
compressThis := true |
|
5488 |
] ifFalse:[ |
|
5489 |
"/ skipping unloaded/unknown classes |
|
5490 |
thisClass isBehavior ifTrue:[ |
|
5491 |
compressThis := aClassNameOrNil = thisClass theNonMetaclass name. |
|
5492 |
] |
|
5493 |
]. |
|
5494 |
compressThis ifTrue:[ |
|
5495 |
thisSelector := selectors at:changeNr. |
|
5496 |
compressThis := (selectorToCompressOrNil isNil or:[thisSelector == selectorToCompressOrNil]). |
|
5497 |
compressThis ifTrue:[ |
|
5498 |
searchIndex := changeNr. |
|
5499 |
anyMore := true. |
|
5500 |
[anyMore] whileTrue:[ |
|
5501 |
searchIndex := classes indexOf:thisClass startingAt:(searchIndex + 1). |
|
5502 |
(searchIndex ~~ 0) ifTrue:[ |
|
5503 |
((selectors at:searchIndex) == thisSelector) ifTrue:[ |
|
5504 |
thisClass notNil ifTrue:[ |
|
5505 |
deleteSet add:changeNr. |
|
5506 |
anyMore := false |
|
5507 |
] |
|
5508 |
] |
|
5509 |
] ifFalse:[ |
|
5510 |
anyMore := false |
|
5511 |
] |
|
5512 |
]. |
|
5513 |
]. |
|
5514 |
]. |
|
5515 |
]. |
|
5516 |
||
5517 |
"finally delete what has been found" |
|
5518 |
||
5519 |
(deleteSet size > 0) ifTrue:[ |
|
5520 |
changeListView setSelection:nil. |
|
5521 |
index := deleteSet size. |
|
5522 |
[index > 0] whileTrue:[ |
|
5523 |
self silentDeleteChange:(deleteSet at:index). |
|
5524 |
index := index - 1 |
|
5525 |
]. |
|
5526 |
self setChangeList. |
|
5527 |
" |
|
5528 |
scroll back a bit, if we are left way behind the list |
|
5529 |
" |
|
5530 |
changeListView firstLineShown > self numberOfChanges ifTrue:[ |
|
5531 |
changeListView makeLineVisible:self numberOfChanges |
|
5532 |
]. |
|
5533 |
self clearCodeView |
|
5534 |
] |
|
1359 | 5535 |
]. |
5536 |
self newLabel:''. |
|
5537 |
||
7507 | 5538 |
"Created: / 19-11-2001 / 22:03:42 / cg" |
16372 | 5539 |
"Modified: / 01-05-2016 / 19:23:54 / cg" |
1359 | 5540 |
! |
5541 |
||
255 | 5542 |
deleteChange:changeNr |
5543 |
"delete a change" |
|
5544 |
||
5545 |
self deleteChangesFrom:changeNr to:changeNr |
|
5546 |
! |
|
5547 |
||
5548 |
deleteChangesFrom:start to:stop |
|
5549 |
"delete a range of changes" |
|
5550 |
||
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
5551 |
changeListView setSelection:nil. |
255 | 5552 |
stop to:start by:-1 do:[:changeNr | |
6288 | 5553 |
self silentDeleteInternalChange:changeNr. |
255 | 5554 |
]. |
6255 | 5555 |
changeListView removeFromIndex:start toIndex:stop. |
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5556 |
|
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5557 |
"/ changeListView contentsChanged. |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5558 |
"/ changeListView redrawFromLine:start. |
255 | 5559 |
|
744
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5560 |
"/ self setChangeList |
cb962cb21e8c
faster drawing when deleting items
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5561 |
|
1648 | 5562 |
"Modified: / 18.5.1998 / 14:22:27 / cg" |
255 | 5563 |
! |
5564 |
||
202 | 5565 |
makeChangeAPatch:changeNr |
5566 |
"append change to patchfile" |
|
5567 |
||
5568 |
self appendChange:changeNr toFile:'patches' |
|
5569 |
! |
|
5570 |
||
5571 |
makeChangePermanent:changeNr |
|
5572 |
"rewrite the source file where change changeNr lies" |
|
5573 |
||
5574 |
self notify:'this is not yet implemented' |
|
5575 |
! |
|
5576 |
||
73 | 5577 |
silentDeleteChange:changeNr |
5578 |
"delete a change do not update changeListView" |
|
57 | 5579 |
|
73 | 5580 |
anyChanges := true. |
16372 | 5581 |
changeInfoList removeIndex:changeNr. |
5582 |
"/ changeChunks removeIndex:changeNr. |
|
5583 |
"/ changePositions size >= changeNr ifTrue:[ changePositions removeIndex:changeNr ]. |
|
5584 |
"/ changeClassNames size >= changeNr ifTrue:[ changeClassNames removeIndex:changeNr ]. |
|
5585 |
"/ changeSelectors size >= changeNr ifTrue:[ changeSelectors removeIndex:changeNr ]. |
|
5586 |
"/ changeHeaderLines size >= changeNr ifTrue:[ changeHeaderLines removeIndex:changeNr ]. |
|
5587 |
"/ changeTimeStamps size >= changeNr ifTrue:[ changeTimeStamps removeIndex:changeNr ]. |
|
5588 |
"/ changeIsFollowupMethodChange size >= changeNr ifTrue:[ changeIsFollowupMethodChange removeIndex:changeNr ]. |
|
5589 |
||
5590 |
"Modified: / 01-05-2016 / 19:20:40 / cg" |
|
45 | 5591 |
! |
5592 |
||
202 | 5593 |
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
|
5594 |
"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
|
5595 |
Return the number of deleted changes." |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5596 |
|
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5597 |
|thisClassName index numDeleted| |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5598 |
|
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5599 |
numDeleted := 0. |
202 | 5600 |
index := stop. |
5601 |
[index >= start] whileTrue:[ |
|
6288 | 5602 |
thisClassName := self classNameOfChange:index. |
5603 |
thisClassName = aClassName ifTrue:[ |
|
5604 |
self silentDeleteChange:index. |
|
5605 |
numDeleted := numDeleted + 1. |
|
5606 |
]. |
|
5607 |
index := index - 1 |
|
1428
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5608 |
]. |
180d03d00db4
fixed selection after deleting a bunch of changes
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
5609 |
^ numDeleted |
51 | 5610 |
|
45 | 5611 |
! |
5612 |
||
3607 | 5613 |
silentDeleteChangesFor:aClassName selector:selector from:start to:stop |
5614 |
"delete changes for given class/selector in a range. |
|
5615 |
Return the number of deleted changes." |
|
5616 |
||
5617 |
|thisClassName index numDeleted| |
|
5618 |
||
5619 |
numDeleted := 0. |
|
5620 |
index := stop. |
|
5621 |
[index >= start] whileTrue:[ |
|
17600 | 5622 |
thisClassName := self realClassNameOfChange:index. |
5623 |
thisClassName = aClassName ifTrue:[ |
|
5624 |
(self selectorOfMethodChange:index) == selector ifTrue:[ |
|
5625 |
self silentDeleteChange:index. |
|
5626 |
numDeleted := numDeleted + 1. |
|
5627 |
] |
|
5628 |
]. |
|
5629 |
index := index - 1 |
|
3607 | 5630 |
]. |
5631 |
^ numDeleted |
|
5632 |
! |
|
5633 |
||
2511 | 5634 |
silentDeleteChangesForClassAndPrivateClasses:aClassName from:start to:stop |
5635 |
"delete changes for a given class and its private classes in a range. |
|
5636 |
Return the number of deleted changes." |
|
5637 |
||
5638 |
|thisClassName index numDeleted| |
|
5639 |
||
5640 |
numDeleted := 0. |
|
5641 |
index := stop. |
|
5642 |
[index >= start] whileTrue:[ |
|
6288 | 5643 |
thisClassName := self ownerClassNameOfChange:index. |
5644 |
thisClassName = aClassName ifTrue:[ |
|
5645 |
self silentDeleteChange:index. |
|
5646 |
numDeleted := numDeleted + 1. |
|
5647 |
]. |
|
5648 |
index := index - 1 |
|
2511 | 5649 |
]. |
5650 |
^ numDeleted |
|
5651 |
||
5652 |
! |
|
5653 |
||
12428 | 5654 |
silentDeleteChangesForNamespace:aNamespace from:start to:stop |
5655 |
"delete changes for a given namespace in a range. |
|
5656 |
Return the number of deleted changes." |
|
5657 |
||
5658 |
|thisNamespace index numDeleted| |
|
5659 |
||
5660 |
numDeleted := 0. |
|
5661 |
index := stop. |
|
5662 |
[index >= start] whileTrue:[ |
|
5663 |
thisNamespace := self namespaceOfChange:index. |
|
5664 |
thisNamespace = aNamespace ifTrue:[ |
|
5665 |
self silentDeleteChange:index. |
|
5666 |
numDeleted := numDeleted + 1. |
|
5667 |
]. |
|
5668 |
index := index - 1 |
|
5669 |
]. |
|
5670 |
^ numDeleted |
|
5671 |
! |
|
5672 |
||
1070
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5673 |
silentDeleteInternalChange:changeNr |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5674 |
"delete a change do not update changeListView" |
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5675 |
|
cdf5cf202f3b
faster redraw, when deleting items.
Claus Gittinger <cg@exept.de>
parents:
1027
diff
changeset
|
5676 |
anyChanges := true. |
16372 | 5677 |
changeInfoList removeIndex:changeNr. |
5678 |
"/ changeChunks removeIndex:changeNr. |
|
5679 |
"/ changePositions size >= changeNr ifTrue:[changePositions removeIndex:changeNr]. |
|
5680 |
"/ changeClassNames size >= changeNr ifTrue:[changeClassNames removeIndex:changeNr]. |
|
5681 |
"/ changeSelectors size >= changeNr ifTrue:[ changeSelectors removeIndex:changeNr ]. |
|
5682 |
"/ changeTimeStamps size >= changeNr ifTrue:[changeTimeStamps removeIndex:changeNr]. |
|
5683 |
"/ changeIsFollowupMethodChange size >= changeNr ifTrue:[changeIsFollowupMethodChange removeIndex:changeNr]. |
|
5684 |
||
5685 |
"Created: / 07-03-1997 / 16:28:32 / cg" |
|
5686 |
"Modified: / 26-02-1998 / 18:20:48 / stefan" |
|
5687 |
"Modified: / 01-05-2016 / 19:20:59 / cg" |
|
4487 | 5688 |
! |
5689 |
||
5690 |
updateDiffView |
|
5691 |
self withSelectedChangesDo:[:changeNr | |
|
6288 | 5692 |
self updateDiffViewFor:changeNr. |
5693 |
^ self. |
|
4487 | 5694 |
]. |
5695 |
||
5696 |
diffView text1:'' text2:'' |
|
5697 |
! |
|
5698 |
||
5699 |
updateDiffViewFor:changeNr |
|
5700 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource |
|
8675
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5701 |
parser sel showDiff selector oldMethod i| |
4487 | 5702 |
|
5703 |
aStream := self streamForChange:changeNr. |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5704 |
aStream isNil ifTrue:[ |
6317 | 5705 |
^ self |
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5706 |
]. |
4487 | 5707 |
|
5708 |
showDiff := false. |
|
5709 |
||
5710 |
(self changeIsFollowupMethodChange:changeNr) ifFalse:[ |
|
6317 | 5711 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
5712 |
chunk := aStream nextChunk. |
|
4487 | 5713 |
] ifTrue:[ |
16372 | 5714 |
chunk := self changeChunkAt:changeNr. |
6317 | 5715 |
sawExcla := true. |
4487 | 5716 |
]. |
5717 |
||
4857 | 5718 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
5719 |
do:[ |
|
8665 | 5720 |
parseTree := self parseExpression:chunk. |
6317 | 5721 |
(parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[ |
5722 |
selector := parseTree selector. |
|
5723 |
] |
|
4857 | 5724 |
]. |
5725 |
||
5726 |
selector isNil ifTrue:[ |
|
6317 | 5727 |
newSource := chunk. |
5728 |
oldSource := 'Not comparable.'. |
|
4857 | 5729 |
] ifFalse:[ |
6317 | 5730 |
sawExcla ifFalse:[ |
5731 |
"/ not a method-change |
|
5732 |
newSource := chunk. |
|
11275
abeda3e68385
added: #currentSourceForParseTree:
Claus Gittinger <cg@exept.de>
parents:
11244
diff
changeset
|
5733 |
oldSource := self currentSourceForParseTree:parseTree. |
6317 | 5734 |
] ifTrue:[ |
5735 |
"/ a method-change |
|
5736 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5737 |
(self class methodDefinitionSelectors includes:selector) ifTrue:[ |
6317 | 5738 |
newSource := aStream nextChunk. |
11362
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5739 |
thisClass := self classFromEvaluatingTree:parseTree receiver. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5740 |
"/ Error |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5741 |
"/ handle:[ ] |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5742 |
"/ do:[ |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5743 |
"/ thisClass := parseTree receiver evaluate. |
52ac4a5da69e
added: #classFromEvaluatingTree:
Claus Gittinger <cg@exept.de>
parents:
11347
diff
changeset
|
5744 |
"/ ]. |
6378 | 5745 |
thisClass isBehavior ifFalse:[ |
5746 |
thisClass := self classOfChange:changeNr. |
|
5747 |
]. |
|
6317 | 5748 |
thisClass isBehavior ifTrue:[ |
5749 |
(thisClass isLoaded |
|
5750 |
or:[ autoloadAsRequired value |
|
5751 |
and:[self checkClassIsLoaded:thisClass]]) ifFalse:[ |
|
5752 |
oldSource := 'Cannot compare this change\\(compare requires class to be loaded).' withCRs. |
|
5753 |
] ifTrue:[ |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5754 |
selector numArgs == 0 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5755 |
cat := '* as yet uncategorized *'. |
6532 | 5756 |
cat := selector. |
6317 | 5757 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
5758 |
cat := parseTree arg1 evaluate. |
6317 | 5759 |
]. |
5760 |
Class nameSpaceQuerySignal answer:(self nameSpaceForApply) |
|
5761 |
do:[ |
|
7709 | 5762 |
parser := Parser new. |
6639 | 5763 |
Error catch:[ |
7709 | 5764 |
parser |
5765 |
parseMethod:newSource in:thisClass |
|
5766 |
ignoreErrors:true ignoreWarnings:true. |
|
6317 | 5767 |
] |
5768 |
]. |
|
7709 | 5769 |
sel := parser selector. |
5770 |
(sel notNil) ifTrue:[ |
|
6317 | 5771 |
oldMethod := thisClass compiledMethodAt:sel. |
5772 |
oldMethod notNil ifTrue:[ |
|
5773 |
(oldMethod category = cat) ifFalse:[ |
|
6447 | 5774 |
"/ Transcript showCR:'category changed.'. |
6317 | 5775 |
]. |
5776 |
oldSource := oldMethod source. |
|
5777 |
(oldSource = newSource) ifFalse:[ |
|
5778 |
oldSource isNil ifTrue:[ |
|
5779 |
oldSource := 'No source for compare.'. |
|
5780 |
] ifFalse:[ |
|
5781 |
"/ |
|
5782 |
"/ compare for tabulator <-> space changes |
|
5783 |
"/ before showing diff ... |
|
5784 |
"/ |
|
5785 |
oldSource := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5786 |
newSource := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
5787 |
oldSource = newSource ifFalse:[ |
|
5788 |
"/ |
|
5789 |
"/ check if only historyLine diffs |
|
5790 |
"/ |
|
5791 |
(HistoryManager notNil |
|
5792 |
and:[HistoryManager isActive]) ifTrue:[ |
|
5793 |
oldSource := oldSource asStringCollection asString. |
|
5794 |
newSource := newSource asStringCollection asString. |
|
5795 |
(HistoryManager withoutHistoryLines:oldSource) |
|
5796 |
= |
|
5797 |
(HistoryManager withoutHistoryLines:newSource) |
|
5798 |
ifTrue:[ |
|
5799 |
oldSource := (HistoryManager withoutHistoryLines:oldSource). |
|
5800 |
newSource := (HistoryManager withoutHistoryLines:newSource). |
|
5801 |
] |
|
5802 |
]. |
|
5803 |
] |
|
5804 |
] |
|
5805 |
] |
|
5806 |
] ifFalse:[ |
|
5807 |
oldSource := 'Method does not exist.'. |
|
5808 |
] |
|
5809 |
] ifFalse:[ |
|
5810 |
oldSource := 'Change is unparsable (parse error).'. |
|
5811 |
]. |
|
5812 |
]. |
|
5813 |
] ifFalse:[ |
|
5814 |
oldSource := 'Class does not exist.'. |
|
5815 |
] |
|
5816 |
] ifFalse:[ |
|
5817 |
newSource := chunk. "/ aStream contents. |
|
5818 |
oldSource := 'Not comparable.'. |
|
5819 |
] |
|
5820 |
] |
|
4487 | 5821 |
]. |
5822 |
aStream close. |
|
5823 |
||
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5824 |
oldSource := oldSource ? ''. |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5825 |
newSource := newSource ? ''. |
8675
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5826 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5827 |
oldSource := oldSource asStringCollection asString. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5828 |
newSource := newSource asStringCollection asString. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5829 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5830 |
"/ unify cr, crlf and lf into lf |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5831 |
(oldSource includes:Character return) ifTrue: [ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5832 |
i := oldSource indexOf:Character return. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5833 |
(oldSource at:i+1) == Character nl ifTrue:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5834 |
"/ crnl endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5835 |
oldSource := oldSource copyReplaceString:(String crlf) withString:(String lf). |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5836 |
] ifFalse:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5837 |
"/ cr endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5838 |
oldSource := oldSource copyReplaceAll:Character return with:Character nl. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5839 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5840 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5841 |
|
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5842 |
"/ unify cr, crlf and lf into lf |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5843 |
(newSource includes:Character return) ifTrue: [ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5844 |
i := newSource indexOf:Character return. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5845 |
(newSource at:i+1) == Character nl ifTrue:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5846 |
"/ crnl endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5847 |
newSource := newSource copyReplaceString:(String crlf) withString:(String lf). |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5848 |
] ifFalse:[ |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5849 |
"/ cr endings |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5850 |
newSource := newSource copyReplaceAll:Character return with:Character nl. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5851 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5852 |
]. |
cb829711c85c
care for cr / crlf in string
Claus Gittinger <cg@exept.de>
parents:
8665
diff
changeset
|
5853 |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5854 |
(oldSource = newSource |
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5855 |
or:[ oldSource asStringCollection withTabsExpanded = newSource asStringCollection withTabsExpanded]) ifTrue:[ |
6317 | 5856 |
self makeDiffViewInvisible |
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5857 |
] ifFalse:[ |
6317 | 5858 |
self makeDiffViewVisible. |
5859 |
diffView text1:oldSource text2:newSource. |
|
5237
74f82f793e1b
make diffView invisible, if there are no diffs
Claus Gittinger <cg@exept.de>
parents:
5178
diff
changeset
|
5860 |
]. |
4487 | 5861 |
|
7709 | 5862 |
"Created: / 24-11-1995 / 14:30:46 / cg" |
16372 | 5863 |
"Modified: / 01-05-2016 / 18:26:01 / cg" |
202 | 5864 |
! ! |
0 | 5865 |
|
202 | 5866 |
!ChangesBrowser methodsFor:'termination'! |
51 | 5867 |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5868 |
askIfChangesAreToBeWrittenBack |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5869 |
|action again| |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5870 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5871 |
anyChanges ifFalse:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5872 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5873 |
again := true. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5874 |
[again] whileTrue:[ |
6357 | 5875 |
action := OptionBox |
5876 |
request:(resources stringWithCRs:'The modified changelist has not been written back to the change file.\\Write change file before closing ?') |
|
5877 |
label:'ChangesBrowser' |
|
5878 |
image:(WarningBox iconBitmap) |
|
5879 |
buttonLabels:(resources array:#('Cancel' 'Don''t Write' 'Write')) |
|
5880 |
values:#(#abort #ignore #save) |
|
5881 |
default:#save |
|
5882 |
onCancel:#abort. |
|
5883 |
||
5884 |
again := false. |
|
5885 |
action == #abort ifTrue:[AbortSignal raise. ^ self]. |
|
5886 |
action == #save ifTrue:[ |
|
5887 |
again := self writeBackChanges not |
|
5888 |
]. |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5889 |
]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5890 |
! |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5891 |
|
1787 | 5892 |
closeRequest |
5893 |
"window manager wants us to go away" |
|
5894 |
||
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3378
diff
changeset
|
5895 |
self askIfChangesAreToBeWrittenBack. |
1787 | 5896 |
super closeRequest |
5897 |
! |
|
5898 |
||
202 | 5899 |
saveAndTerminate |
5900 |
"update the changes file and quit. |
|
17026 | 5901 |
Don't depend on this being sent, not all window managers |
202 | 5902 |
send it; instead, they simply destroy the view." |
28 | 5903 |
|
202 | 5904 |
anyChanges ifTrue:[ |
17026 | 5905 |
self writeBackChanges. |
0 | 5906 |
]. |
1787 | 5907 |
super saveAndTerminate |
5908 |
||
5909 |
"Modified: / 3.8.1998 / 19:54:00 / cg" |
|
0 | 5910 |
! ! |
5911 |
||
73 | 5912 |
!ChangesBrowser methodsFor:'user interaction'! |
51 | 5913 |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5914 |
askForSearch:msg initialAnswer:initial thenSearchUsing:searchBlock2 onCancel:cancelBlock |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5915 |
|searchString directionHolder searchBlock| |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5916 |
|
6288 | 5917 |
searchString := self |
15674 | 5918 |
askForSearchString:msg |
5919 |
initialAnswer:initial |
|
5920 |
directionInto:(directionHolder := ValueHolder new). |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5921 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5922 |
searchString isNil ifTrue:[ |
15674 | 5923 |
^ cancelBlock value |
5924 |
]. |
|
17382 | 5925 |
lastSearchString := searchString. |
5926 |
||
15674 | 5927 |
directionHolder value == #first ifTrue:[ |
5928 |
self findFirstForClass:searchString. |
|
5929 |
^ self. |
|
5930 |
]. |
|
5931 |
directionHolder value == #last ifTrue:[ |
|
5932 |
self findLastForClass:searchString. |
|
5933 |
^ self. |
|
5934 |
]. |
|
5935 |
||
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5936 |
searchBlock := [:changeNr | searchBlock2 value:searchString value:changeNr]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5937 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5938 |
directionHolder value == #backward ifTrue:[ |
15674 | 5939 |
changeNrShown isNil ifTrue:[ |
5940 |
changeNrShown := self numberOfChanges. |
|
5941 |
]. |
|
5942 |
self findPreviousForWhich:searchBlock |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5943 |
] ifFalse:[ |
15674 | 5944 |
changeNrShown isNil ifTrue:[ |
5945 |
changeNrShown := 0. |
|
5946 |
]. |
|
5947 |
self findNextForWhich:searchBlock |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5948 |
]. |
17382 | 5949 |
|
5950 |
"Modified: / 10-02-2017 / 20:40:59 / cg" |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5951 |
! |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5952 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5953 |
askForSearchString:msg initialAnswer:initial directionInto:aValueHolder |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5954 |
"common code to open a search box" |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5955 |
|
17394 | 5956 |
|searchString direction choices current| |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5957 |
|
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5958 |
direction := #forward. |
17394 | 5959 |
choices := OrderedCollection new. |
5960 |
||
5961 |
changeNrShown notNil ifTrue:[ |
|
5962 |
current := self classNameOfChange:changeNrShown. |
|
5963 |
initial ~= current ifTrue:[ |
|
5964 |
(choices includes:current) ifFalse:[ |
|
5965 |
choices addFirst:current |
|
5966 |
]. |
|
5967 |
]. |
|
5968 |
]. |
|
5969 |
lastSearchString notNil ifTrue:[ |
|
5970 |
initial ~= lastSearchString ifTrue:[ |
|
5971 |
(choices includes:lastSearchString) ifFalse:[ |
|
5972 |
choices addFirst:lastSearchString |
|
5973 |
]. |
|
5974 |
]. |
|
5975 |
]. |
|
5976 |
||
15449 | 5977 |
"/ take a normal request box, but add an additional 'previous' button |
5978 |
Dialog modifyingBoxWith:[:box | |
|
15674 | 5979 |
|nextButton prevButton firstButton lastButton| |
15449 | 5980 |
|
13343 | 5981 |
nextButton := box okButton. |
15674 | 5982 |
|
5983 |
firstButton := Button label:(resources string:'First'). |
|
5984 |
firstButton action:[direction := #first. box okPressed.]. |
|
5985 |
box addButton:firstButton after:nextButton. |
|
5986 |
||
5987 |
lastButton := Button label:(resources string:'Last'). |
|
5988 |
lastButton action:[direction := #last. box okPressed.]. |
|
5989 |
box addButton:lastButton after:nextButton. |
|
5990 |
||
13343 | 5991 |
prevButton := Button label:(resources string:'Previous'). |
5992 |
prevButton action:[direction := #backward. box okPressed.]. |
|
5993 |
box addButton:prevButton after:nextButton. |
|
15674 | 5994 |
|
13343 | 5995 |
nextButton label:(resources string:'Next'). |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
5996 |
] do:[ |
13343 | 5997 |
searchString := Dialog |
5998 |
request:msg |
|
17394 | 5999 |
list:choices |
13343 | 6000 |
initialAnswer:initial |
17394 | 6001 |
]. |
6002 |
||
6003 |
searchString isEmptyOrNil ifTrue:[ |
|
13343 | 6004 |
^ nil |
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6005 |
]. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6006 |
aValueHolder value:direction. |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6007 |
^ searchString |
15449 | 6008 |
|
6009 |
" |
|
6010 |
self new askForSearchString:'foo' initialAnswer:'bla' directionInto:(false asValue) |
|
6011 |
" |
|
17394 | 6012 |
|
6013 |
"Modified: / 12-02-2017 / 11:18:11 / cg" |
|
3292
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6014 |
! |
7eca3bb7b8cb
added previous buttons to searches
Claus Gittinger <cg@exept.de>
parents:
3275
diff
changeset
|
6015 |
|
221 | 6016 |
autoUpdate:aBoolean |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6017 |
"enabled/disable automatic update from the change-file (for monitoring)" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6018 |
|
6216 | 6019 |
autoUpdate value:aBoolean |
221 | 6020 |
|
6021 |
"Created: 3.12.1995 / 14:14:24 / cg" |
|
6022 |
"Modified: 3.12.1995 / 14:20:45 / cg" |
|
6023 |
! |
|
6024 |
||
6216 | 6025 |
autoloadAsRequired:aBoolean |
6026 |
"enabled/disable automatic load of unloaded classes" |
|
6027 |
||
6028 |
autoloadAsRequired value:aBoolean |
|
6029 |
! |
|
6030 |
||
3211 | 6031 |
changeSelection:lineNrCollection |
0 | 6032 |
"show a change in the codeView" |
6033 |
||
11048 | 6034 |
|chunk lineNr lineNumbers| |
3211 | 6035 |
|
6036 |
lineNrCollection isInteger ifTrue:[ |
|
11048 | 6037 |
lineNr := lineNrCollection. |
6038 |
lineNumbers := Array with:lineNr. |
|
3211 | 6039 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6040 |
changeListView multipleSelectOk ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6041 |
lineNrCollection size == 1 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6042 |
lineNr := lineNrCollection first. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6043 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6044 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6045 |
lineNr := lineNrCollection |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6046 |
]. |
11048 | 6047 |
lineNumbers := lineNrCollection. |
6048 |
]. |
|
6049 |
||
6050 |
self changeListSelectionHolder value:lineNumbers. |
|
16467 | 6051 |
|
2293 | 6052 |
lineNr isNil ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6053 |
codeView contents:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6054 |
codeView initializeDoITAction. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6055 |
changeNrShown := nil. |
16467 | 6056 |
infoHolder value:nil. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6057 |
^ self |
2293 | 6058 |
]. |
6059 |
||
16467 | 6060 |
changeNrShown := lineNr. |
6061 |
self sensor |
|
6062 |
enqueueMessage:#updateSourceCodeAfterChangedSelection for:self arguments:nil; |
|
6063 |
enqueueMessage:#updateInfoAfterChangedSelection for:self arguments:nil. |
|
6064 |
^ self. |
|
6065 |
||
3211 | 6066 |
"/ display the changes code |
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
6067 |
chunk := self sourceOfChange:lineNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3771
diff
changeset
|
6068 |
chunk isNil ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6069 |
codeView initializeDoITAction. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6070 |
^ self |
2044 | 6071 |
]. |
8391 | 6072 |
|
0 | 6073 |
codeView contents:chunk. |
13 | 6074 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
2043
66b5276b2760
set self in changesBrowsers doIt.
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
6075 |
codeView doItAction:[:theCode | |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6076 |
|clsName cls| |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6077 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6078 |
clsName := self classNameOfChange:lineNr. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6079 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6080 |
clsName := clsName asSymbolIfInterned. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6081 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6082 |
cls := Smalltalk at:clsName ifAbsent:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6083 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6084 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6085 |
Compiler |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6086 |
evaluate:theCode |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6087 |
in:nil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6088 |
receiver:cls |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6089 |
notifying:self |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6090 |
logged:true |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6091 |
ifFail:nil |
2043
66b5276b2760
set self in changesBrowsers doIt.
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
6092 |
]. |
15 | 6093 |
changeNrShown := lineNr. |
0 | 6094 |
|
4487 | 6095 |
self showingDiffs value ifTrue:[ |
8391 | 6096 |
self withWaitCursorDo:[ |
6097 |
AbortOperationRequest catch:[ |
|
6098 |
self updateDiffViewFor:changeNrShown. |
|
6099 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6100 |
] |
4487 | 6101 |
]. |
6102 |
||
11048 | 6103 |
"Modified: / 03-01-2012 / 15:30:23 / cg" |
51 | 6104 |
! |
6105 |
||
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6106 |
classOfChange:changeNr |
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6107 |
^ self |
6386 | 6108 |
classOfChange:changeNr |
6109 |
ifAbsent:[:className | |
|
6110 |
|msg| |
|
6111 |
||
6112 |
className isNil ifTrue:[ |
|
6113 |
msg := 'Could not extract classname from change'. |
|
6114 |
] ifFalse:[ |
|
6115 |
msg := 'Class not found: ''' , className , ''''. |
|
6116 |
]. |
|
8320
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6117 |
Transcript showCR:msg. |
6386 | 6118 |
"/ self warn:msg. |
6119 |
nil |
|
6120 |
] |
|
3806
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6121 |
! |
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6122 |
|
46e459fdde4c
added "apply to next conflict"
Claus Gittinger <cg@exept.de>
parents:
3785
diff
changeset
|
6123 |
classOfChange:changeNr ifAbsent:exceptionBlock |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6124 |
"answer the class that is subject to the chamge at changeNr. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6125 |
The classes owning class may be autoloaded, if autoloadAsRequired is true." |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6126 |
|
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6127 |
|className cls isMeta nameSpaceForApply path ownerName owner| |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6128 |
|
5014 | 6129 |
className := self realClassNameOfChange:changeNr. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6130 |
className isNil ifTrue:[ |
6378 | 6131 |
^ exceptionBlock value:nil |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6132 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6133 |
|
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6134 |
isMeta := false. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6135 |
(className endsWith:' class') ifTrue:[ |
12704
6f20f7d39e75
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12656
diff
changeset
|
6136 |
className := className copyButLast:6. |
6378 | 6137 |
isMeta := true. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6138 |
]. |
3472 | 6139 |
|
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6140 |
autoloadAsRequired value ifTrue:[ |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6141 |
path := className asCollectionOfSubstringsSeparatedByAll:'::'. |
8320
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6142 |
path size >= 2 ifTrue:[ |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6143 |
1 to:path size-1 do:[:l | |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6144 |
"/ ensure that the owningClass is loaded - this will load the private classes as well |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6145 |
"/ Transcript showCR:'loading owner'. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6146 |
ownerName := (path copyTo:l) asStringCollection asStringWith:'::'. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6147 |
owner := Smalltalk classNamed:ownerName. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6148 |
owner notNil ifTrue:[ |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6149 |
owner autoload. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6150 |
]. |
c0d503e3dc91
also load private classes of an autoloaded as required
Claus Gittinger <cg@exept.de>
parents:
8272
diff
changeset
|
6151 |
]. |
8272
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6152 |
]. |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6153 |
]. |
cd6b675fc5fd
autoload class owner if required
Claus Gittinger <cg@exept.de>
parents:
8173
diff
changeset
|
6154 |
|
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6155 |
nameSpaceForApply := self nameSpaceForApply. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6156 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6157 |
cls := nameSpaceForApply classNamed:className. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6158 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6159 |
cls := nameSpaceForApply loadedClassNamed:className |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6160 |
]. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6161 |
(cls isNil and:[nameSpaceForApply ~~ Smalltalk]) ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6162 |
"if not found in special name space, fall back to the Smalltalk name space" |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6163 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6164 |
cls := Smalltalk classNamed:className. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6165 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6166 |
cls := Smalltalk loadedClassNamed:className |
6378 | 6167 |
]. |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6168 |
]. |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6169 |
|
6378 | 6170 |
cls isNil ifTrue:[ |
6171 |
^ exceptionBlock value:className |
|
6172 |
]. |
|
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6173 |
isMeta ifTrue:[ |
6378 | 6174 |
cls := cls class |
3275
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6175 |
]. |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6176 |
^ cls |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6177 |
! |
88c43d1cfc99
added browse-senders & browse implementors
Claus Gittinger <cg@exept.de>
parents:
3249
diff
changeset
|
6178 |
|
1471 | 6179 |
doubleClickOnChange:lineNr |
2843
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6180 |
"action performed when a change-list entry is doubleClicked" |
6e3fc30cd41f
commented; much better functionality
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
6181 |
|
1471 | 6182 |
self doBrowse |
6183 |
||
6184 |
"Created: / 6.2.1998 / 13:08:49 / cg" |
|
6185 |
! |
|
6186 |
||
202 | 6187 |
noChangesAllowed |
6188 |
"show a warning that changes cannot be changed" |
|
93 | 6189 |
|
3211 | 6190 |
self warn:'Changes are not allowed to be changed.' |
0 | 6191 |
! |
6192 |
||
202 | 6193 |
saveClass:aClassName from:startNr |
6194 |
"user wants changes from current to end to be appended to a file" |
|
51 | 6195 |
|
202 | 6196 |
|changeNr fileName| |
51 | 6197 |
|
202 | 6198 |
changeNr := changeListView selection. |
6199 |
changeNr notNil ifTrue:[ |
|
9604 | 6200 |
fileName := Dialog |
6201 |
requestFileNameForSave:(resources string:'Append changes for class to:') |
|
6202 |
default:(lastSaveFileName ? '') |
|
6203 |
ok:(resources string:'Append') |
|
6204 |
abort:(resources string:'Abort') |
|
6205 |
pattern:'*.chg'. |
|
6206 |
||
6207 |
fileName notNil ifTrue:[ |
|
6208 |
lastSaveFileName := fileName. |
|
11685 | 6209 |
self withWriteCursorDo:[ |
9604 | 6210 |
startNr to:(self numberOfChanges) do:[:changeNr | |
6211 |
|thisClassName| |
|
6212 |
||
6213 |
thisClassName := self classNameOfChange:changeNr. |
|
6214 |
thisClassName = aClassName ifTrue:[ |
|
6215 |
self setSingleSelection:changeNr. |
|
6216 |
(self appendChange:changeNr toFile:fileName) ifFalse:[ |
|
6217 |
^ self |
|
6218 |
] |
|
6219 |
] |
|
6220 |
] |
|
6221 |
] |
|
6222 |
]. |
|
202 | 6223 |
] |
562
8f772068fd1a
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
6224 |
|
11685 | 6225 |
"Modified: / 27-07-2012 / 09:46:04 / cg" |
3227
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
6226 |
! |
442696985817
deleteAllForClass - support multiple selection
Claus Gittinger <cg@exept.de>
parents:
3224
diff
changeset
|
6227 |
|
11477 | 6228 |
selectionChanged |
12946 | 6229 |
self halt:'should not be here' |
11048 | 6230 |
|
6231 |
"Created: / 03-01-2012 / 15:26:36 / cg" |
|
16467 | 6232 |
! |
6233 |
||
6234 |
updateInfoAfterChangedSelection |
|
6235 |
"update the info label" |
|
6236 |
||
17172 | 6237 |
|selection lineNr selectorOrNil className nonMetaClassName metaClassName |
16476 | 6238 |
nClassChanges nMethodChanges uniqueSelectors |
17172 | 6239 |
lastLineNr firstLineNr |
6240 |
countForClassBeforeCurrent countForClassAfterLast countForClassAndSelectorAfterLast |
|
17381 | 6241 |
moreInfo msg| |
16467 | 6242 |
|
6243 |
selection := lineNr := changeListView selection. |
|
6244 |
selection isNumber ifFalse:[ |
|
6245 |
lineNr := nil. |
|
6246 |
selection notEmptyOrNil ifTrue:[ |
|
6247 |
lineNr := selection first |
|
6248 |
]. |
|
6249 |
]. |
|
6250 |
||
6251 |
lineNr isNil ifTrue:[ |
|
6252 |
infoHolder value:nil. |
|
6253 |
^ self |
|
6254 |
]. |
|
6255 |
||
6256 |
"/ |
|
6257 |
"/ now, this info is computed so fast, |
|
6258 |
"/ we can do it each time the selection changes |
|
6259 |
"/ (can we?) |
|
6260 |
className := self realClassNameOfChange:lineNr. |
|
16478 | 6261 |
className isNil ifTrue:[ |
6262 |
infoHolder value:nil. |
|
6263 |
^ self |
|
6264 |
]. |
|
17172 | 6265 |
selectorOrNil := self selectorOfMethodChange:lineNr. |
16478 | 6266 |
|
16476 | 6267 |
nonMetaClassName := (className endsWith:' class') |
6268 |
ifTrue:[ className copyButLast:' class' size ] |
|
6269 |
ifFalse:[ className ]. |
|
6270 |
metaClassName := nonMetaClassName,' class'. |
|
6271 |
||
16467 | 6272 |
nClassChanges := nMethodChanges := 0. |
6273 |
uniqueSelectors := Set new. |
|
16476 | 6274 |
lastLineNr := firstLineNr := nil. |
17172 | 6275 |
countForClassAfterLast := 0. |
6276 |
countForClassBeforeCurrent := 0. |
|
6277 |
countForClassAndSelectorAfterLast := 0. |
|
16467 | 6278 |
|
6279 |
"/ count them all |
|
6280 |
1 to:changeInfoList size do:[:i | |
|
16476 | 6281 |
|sel nameOfChange| |
17420 | 6282 |
|
6283 |
changeInfoList at:i. |
|
16476 | 6284 |
nameOfChange := self realClassNameOfChange:i. |
6285 |
((nameOfChange = nonMetaClassName) or:[nameOfChange = metaClassName]) ifTrue:[ |
|
17172 | 6286 |
sel := self selectorOfMethodChange:i. |
6287 |
||
16467 | 6288 |
lastLineNr := i. |
16476 | 6289 |
firstLineNr := firstLineNr ? i. |
17172 | 6290 |
i > lineNr ifTrue:[ |
6291 |
countForClassAfterLast := countForClassAfterLast + 1. |
|
6292 |
(nameOfChange = className |
|
6293 |
and:[ selectorOrNil notNil |
|
6294 |
and:[sel == selectorOrNil]]) ifTrue:[ |
|
6295 |
countForClassAndSelectorAfterLast := countForClassAndSelectorAfterLast + 1. |
|
16476 | 6296 |
]. |
17172 | 6297 |
] ifFalse:[ |
6298 |
i < lineNr ifTrue:[ |
|
6299 |
countForClassBeforeCurrent := countForClassBeforeCurrent + 1 |
|
6300 |
] |
|
6301 |
]. |
|
16467 | 6302 |
nClassChanges := nClassChanges + 1. |
17172 | 6303 |
sel notNil ifTrue:[ |
16467 | 6304 |
uniqueSelectors add:sel. |
6305 |
nMethodChanges := nMethodChanges + 1. |
|
6306 |
]. |
|
6307 |
]. |
|
6308 |
]. |
|
6309 |
lastLineNr == lineNr ifTrue:[ |
|
16476 | 6310 |
firstLineNr == lineNr ifTrue:[ |
6311 |
moreInfo := resources string:'. This is the only one for this class '. |
|
6312 |
] ifFalse:[ |
|
6313 |
moreInfo := resources string:'. This is the last for this class '. |
|
6314 |
] |
|
16467 | 6315 |
] ifFalse:[ |
16476 | 6316 |
firstLineNr == lineNr ifTrue:[ |
6317 |
moreInfo := resources string:'. This is the first for this class'. |
|
6318 |
]. |
|
17172 | 6319 |
countForClassAfterLast > 0 ifTrue:[ |
6320 |
moreInfo := (moreInfo ? ''),(resources string:'. %1 more for this class' with:countForClassAfterLast). |
|
6321 |
countForClassAndSelectorAfterLast > 0 ifTrue:[ |
|
17419 | 6322 |
moreInfo := moreInfo,(resources string:', %1 for selector' with:countForClassAndSelectorAfterLast). |
17172 | 6323 |
]. |
16467 | 6324 |
]. |
6325 |
]. |
|
17381 | 6326 |
uniqueSelectors size == 1 ifTrue:[ |
6327 |
nMethodChanges == 1 ifTrue:[ |
|
6328 |
msg := '%1 changes. %2 for %3 (1 for #''%5'')%6' |
|
6329 |
] ifFalse:[ |
|
6330 |
msg := '%1 changes. %2 for %3 (%4 methods / for #''%5'')%6' |
|
6331 |
]. |
|
6332 |
infoHolder value:(resources |
|
6333 |
string:msg |
|
6334 |
with:(changeInfoList size) |
|
6335 |
with:nClassChanges |
|
6336 |
with:className |
|
6337 |
with:nMethodChanges |
|
6338 |
with:uniqueSelectors first |
|
6339 |
with:moreInfo). |
|
6340 |
] ifFalse:[ |
|
6341 |
infoHolder value:(resources |
|
6342 |
string:'%1 changes. %2 for %3 (%4 methods / %5 selectors)%6' |
|
6343 |
with:(changeInfoList size) |
|
6344 |
with:nClassChanges |
|
6345 |
with:className |
|
6346 |
with:nMethodChanges |
|
6347 |
with:uniqueSelectors size |
|
6348 |
with:moreInfo). |
|
6349 |
]. |
|
6350 |
||
17420 | 6351 |
"Modified: / 19-02-2017 / 13:37:19 / cg" |
16467 | 6352 |
! |
6353 |
||
6354 |
updateSourceCodeAfterChangedSelection |
|
6355 |
"show a change in the codeView" |
|
6356 |
||
6357 |
|selection lineNr chunk| |
|
6358 |
||
6359 |
selection := lineNr := changeListView selection. |
|
6360 |
selection isNumber ifFalse:[ |
|
6361 |
lineNr := nil. |
|
6362 |
selection notEmptyOrNil ifTrue:[ |
|
6363 |
lineNr := selection first |
|
6364 |
]. |
|
6365 |
]. |
|
6366 |
||
6367 |
lineNr isNil ifTrue:[ |
|
6368 |
^ self |
|
6369 |
]. |
|
6370 |
||
6371 |
"/ display the changes code |
|
6372 |
chunk := self sourceOfChange:lineNr. |
|
6373 |
chunk isNil ifTrue:[ |
|
6374 |
codeView initializeDoITAction. |
|
6375 |
^ self |
|
6376 |
]. |
|
6377 |
||
6378 |
codeView contents:chunk. |
|
6379 |
codeView acceptAction:[:theCode | self doApply "noChangesAllowed"]. |
|
6380 |
codeView doItAction:[:theCode | |
|
6381 |
|clsName cls| |
|
6382 |
||
6383 |
clsName := self classNameOfChange:lineNr. |
|
6384 |
clsName notNil ifTrue:[ |
|
6385 |
clsName := clsName asSymbolIfInterned. |
|
6386 |
clsName notNil ifTrue:[ |
|
6387 |
cls := Smalltalk at:clsName ifAbsent:nil. |
|
6388 |
] |
|
6389 |
]. |
|
6390 |
Compiler |
|
6391 |
evaluate:theCode |
|
6392 |
in:nil |
|
6393 |
receiver:cls |
|
6394 |
notifying:self |
|
6395 |
logged:true |
|
6396 |
ifFail:nil |
|
6397 |
]. |
|
6398 |
||
6399 |
||
6400 |
changeNrShown := lineNr. |
|
6401 |
||
6402 |
self showingDiffs value ifTrue:[ |
|
6403 |
self withWaitCursorDo:[ |
|
6404 |
AbortOperationRequest catch:[ |
|
6405 |
self updateDiffViewFor:changeNrShown. |
|
6406 |
] |
|
6407 |
] |
|
6408 |
]. |
|
202 | 6409 |
! ! |
0 | 6410 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6411 |
!ChangesBrowser::ChangeFileReader methodsFor:'accessing'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6412 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6413 |
autoCompare:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6414 |
autoCompare := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6415 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6416 |
|
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6417 |
autoloadAsRequired |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6418 |
^ autoloadAsRequired |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6419 |
! |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6420 |
|
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6421 |
autoloadAsRequired:something |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6422 |
autoloadAsRequired := something. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6423 |
! |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6424 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6425 |
browser:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6426 |
browser := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6427 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6428 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6429 |
changeChunks |
16372 | 6430 |
self halt. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6431 |
^ changeChunks |
16372 | 6432 |
|
6433 |
"Modified: / 01-05-2016 / 19:10:52 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6434 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6435 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6436 |
changeClassNames |
16372 | 6437 |
self halt. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6438 |
^ changeClassNames |
16372 | 6439 |
|
6440 |
"Modified: / 01-05-2016 / 19:10:47 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6441 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6442 |
|
6516
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6443 |
changeFileName |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6444 |
^ changeFileName |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6445 |
! |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6446 |
|
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6447 |
changeFileName:something |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6448 |
changeFileName := something. |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6449 |
! |
48d51ac63886
fix bug from prev version: could not read changes file
Stefan Vogel <sv@exept.de>
parents:
6512
diff
changeset
|
6450 |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6451 |
changeHeaderLines |
16372 | 6452 |
self halt. |
6453 |
^ changeHeaderLines |
|
6454 |
||
6455 |
"Modified: / 01-05-2016 / 19:10:41 / cg" |
|
6456 |
! |
|
6457 |
||
6458 |
changeInfo |
|
6459 |
^ changeInfo |
|
6460 |
||
6461 |
"Created: / 01-05-2016 / 19:10:05 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6462 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6463 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6464 |
changeIsFollowupMethodChange |
16372 | 6465 |
self halt. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6466 |
^ changeIsFollowupMethodChange |
16372 | 6467 |
|
6468 |
"Modified: / 01-05-2016 / 19:10:24 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6469 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6470 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6471 |
changePositions |
16372 | 6472 |
self halt. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6473 |
^ changePositions |
16372 | 6474 |
|
6475 |
"Modified: / 01-05-2016 / 19:10:29 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6476 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6477 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6478 |
changeTimeStamps |
16372 | 6479 |
self halt. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6480 |
^ changeTimeStamps |
16372 | 6481 |
|
6482 |
"Modified: / 01-05-2016 / 19:10:34 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6483 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6484 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6485 |
enforcedNameSpace:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6486 |
enforcedNameSpace := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6487 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6488 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6489 |
inStream:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6490 |
inStream := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6491 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6492 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6493 |
noColoring:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6494 |
noColoring := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6495 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6496 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6497 |
tabSpec:something |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6498 |
tabSpec := something. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6499 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6500 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6501 |
thisIsAClassSource |
7360 | 6502 |
^ thisIsAClassSource ? false |
6503 |
||
6504 |
"Modified: / 06-10-2006 / 11:18:49 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6505 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6506 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6507 |
!ChangesBrowser::ChangeFileReader methodsFor:'private'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6508 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6509 |
contractClass:className selector:selector to:maxLen |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6510 |
"contract a class>>selector string (for display in the changeList)." |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6511 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6512 |
|s l| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6513 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6514 |
s := className , ' ', selector. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6515 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6516 |
l := maxLen - 1 - selector size max:20. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6517 |
s := (className contractTo:l) , ' ' , selector. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6518 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6519 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6520 |
l := maxLen - 1 - className size max:20. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6521 |
s := className , ' ', (selector contractTo:l). |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6522 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6523 |
s size > maxLen ifTrue:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6524 |
s := (className contractTo:(maxLen // 2 - 1)) , ' ' , (selector contractTo:maxLen // 2) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6525 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6526 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6527 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6528 |
^ s |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6529 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6530 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6531 |
extractClassAndClassNameFromParseTree:rec |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6532 |
|isUnaryMessage className changeClass| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6533 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6534 |
isUnaryMessage := rec isUnaryMessage. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6535 |
|
9019 | 6536 |
Error |
6537 |
handle:[:ex | ^ '?' -> nil] |
|
6843 | 6538 |
do:[ |
9019 | 6539 |
isUnaryMessage ifTrue:[ |
6540 |
className := rec receiver name. |
|
6541 |
] ifFalse:[ |
|
6542 |
className := rec name. |
|
6543 |
]. |
|
6843 | 6544 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6545 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6546 |
enforcedNameSpace notNil ifTrue:[ |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6547 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6548 |
changeClass := enforcedNameSpace classNamed:className. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6549 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6550 |
changeClass := enforcedNameSpace loadedClassNamed:className. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6551 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6552 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6553 |
changeClass isNil ifTrue:[ |
7620
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6554 |
autoloadAsRequired value ifTrue:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6555 |
changeClass := Smalltalk classNamed:className. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6556 |
] ifFalse:[ |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6557 |
changeClass := Smalltalk loadedClassNamed:className. |
6812a1ebc510
Autoload owning classes of private classes in change set only if
Stefan Vogel <sv@exept.de>
parents:
7619
diff
changeset
|
6558 |
]. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6559 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6560 |
isUnaryMessage ifTrue:[ |
6843 | 6561 |
changeClass notNil ifTrue:[ |
6562 |
changeClass := changeClass class. |
|
6563 |
]. |
|
6564 |
className := className , ' class'. |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6565 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6566 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6567 |
^ className -> changeClass |
6843 | 6568 |
|
6569 |
"Modified: / 03-08-2006 / 14:02:31 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6570 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6571 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6572 |
nameSpaceForApply |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6573 |
^ browser nameSpaceForApply |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6574 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6575 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6576 |
!ChangesBrowser::ChangeFileReader methodsFor:'reading'! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6577 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6578 |
addHeaderLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo |
16372 | 6579 |
changeHeaderLines add:(self headerLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo) |
6580 |
||
6581 |
"Modified: / 01-05-2016 / 19:07:49 / cg" |
|
6582 |
! |
|
6583 |
||
6584 |
headerLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6585 |
|entry| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6586 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6587 |
entry := MultiColListEntry new. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6588 |
entry tabulatorSpecification:tabSpec. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6589 |
entry colAt:1 put:changeDelta. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6590 |
entry colAt:2 put:changeString. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6591 |
entry colAt:3 put:changeType. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6592 |
timeStampInfo notNil ifTrue:[ |
12599
827681c8f7d4
timestamp printing extracted
Claus Gittinger <cg@exept.de>
parents:
12428
diff
changeset
|
6593 |
entry colAt:4 put:(browser timeStampPrintStringOf:timeStampInfo). |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6594 |
]. |
16372 | 6595 |
^ entry |
6596 |
||
6597 |
"Created: / 01-05-2016 / 19:07:20 / cg" |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6598 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6599 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6600 |
processChunk |
16372 | 6601 |
|info| |
6602 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6603 |
(chunkText startsWith:'''---- timestamp ') ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6604 |
timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6605 |
^ self. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6606 |
]. |
11234 | 6607 |
(chunkText asLowercase startsWith:'''---- encoding: ') ifTrue:[ |
6608 |
^ self. |
|
6609 |
]. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6610 |
|
16372 | 6611 |
changeInfo add:(info := |
6612 |
ChangesBrowser::ChangeInfo new |
|
6613 |
position:chunkPosition chunk:chunkText className:nil selector:nil headerLine:nil |
|
6614 |
timestamp:timeStampInfo isFollowupChange:false). |
|
6615 |
"/ changeChunks add:chunkText. |
|
6616 |
"/ changeClassNames add:nil. |
|
6617 |
"/ changePositions add:chunkPosition. |
|
6618 |
"/ changeTimeStamps add:timeStampInfo. |
|
6619 |
"/ changeIsFollowupMethodChange add:false. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6620 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6621 |
headerLine := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6622 |
changeDelta := ' '. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6623 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6624 |
sawExcla ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6625 |
self processNonMethodChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6626 |
] ifTrue:[ |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6627 |
self processMethodChunkIfNone: |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6628 |
[ |
16372 | 6629 |
changeInfo removeLast. |
6630 |
"/ changeChunks removeLast. |
|
6631 |
"/ changeClassNames removeLast. |
|
6632 |
"/ changePositions removeLast. |
|
6633 |
"/ changeTimeStamps removeLast. |
|
6634 |
"/ changeIsFollowupMethodChange removeLast. |
|
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6635 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6636 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6637 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6638 |
changeString notNil ifTrue:[ |
16372 | 6639 |
"/ self addHeaderLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo. |
6640 |
info headerLine:(self headerLineForChangeType:changeType changeString:changeString changeDelta:changeDelta timeStampInfo:timeStampInfo) |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6641 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6642 |
headerLine notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6643 |
changeHeaderLines add:headerLine |
16372 | 6644 |
info headerLine:headerLine. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6645 |
] |
16372 | 6646 |
]. |
6647 |
||
6648 |
"Modified: / 01-05-2016 / 19:13:59 / cg" |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6649 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6650 |
|
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6651 |
processMethodChunkIfNone:emptyBlock |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6652 |
"sawExcla" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6653 |
|
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6654 |
|askedForEditingClassSource changeClass category anyMethod |
15012 | 6655 |
sel p rec clsName done first text methodPos |
16372 | 6656 |
singleJunkOnly methodChunks classCategoryChunks methodCategoryChunks singleInfo methodSelector nameAndClass |
6657 |
info| |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6658 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6659 |
singleJunkOnly := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6660 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6661 |
classCategoryChunks := methodCategoryChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6662 |
singleInfo := false. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6663 |
anyMethod := false. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6664 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6665 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6666 |
method definitions actually consist of |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6667 |
two (or more) chunks; skip next chunk(s) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6668 |
up to an empty one. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6669 |
The system only writes one chunk, |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6670 |
and we cannot handle more in this ChangesBrowser .... |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6671 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6672 |
clsName := nil. |
8665 | 6673 |
|
17666 | 6674 |
(chunkText includesString:'§') ifTrue:[self halt]. |
17094 | 6675 |
|
8665 | 6676 |
p := browser parseExpression:chunkText inNameSpace:(self nameSpaceForApply). |
6835
87e0844b7e12
Avoid debugger on timestamp information whenn doing autocompare
Stefan Vogel <sv@exept.de>
parents:
6820
diff
changeset
|
6677 |
(p notNil and:[p ~~ #Error and:[p isMessage]]) ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6678 |
rec := p receiver. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6679 |
sel := p selector. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6680 |
(ChangesBrowser methodDefinitionSelectors includes:sel) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6681 |
methodChunks := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6682 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6683 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6684 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6685 |
sel == #categoriesForClass ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6686 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6687 |
classCategoryChunks := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6688 |
changeType := '(class category change)'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6689 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6690 |
sel == #categoriesFor: ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6691 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6692 |
methodCategoryChunks := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6693 |
changeType := '(category change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6694 |
methodSelector := (p args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6695 |
] ifFalse:[ |
6532 | 6696 |
(sel numArgs == 0) ifTrue:[ |
6697 |
category := '* As yet uncategorized *'. |
|
6698 |
category := sel. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6699 |
] ifFalse:[ |
6532 | 6700 |
category := (p args at:1) evaluate. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6701 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6702 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6703 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6704 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6705 |
sel == #'methodsFor:stamp:' ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6706 |
"/ Squeak timeStamp |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6707 |
timeStampInfo := (p args at:2) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6708 |
singleInfo := true |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6709 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6710 |
sel == #'commentStamp:prior:' ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6711 |
singleJunkOnly := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6712 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6713 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6714 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6715 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6716 |
sel == #reorganize ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6717 |
singleJunkOnly := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6718 |
methodChunks := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6719 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6720 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6721 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6722 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6723 |
done := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6724 |
first := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6725 |
[done] whileFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6726 |
changeDelta := ' '. |
13314 | 6727 |
methodPos := inStream position + 1. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6728 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6729 |
text := inStream nextChunk. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6730 |
done := text isEmptyOrNil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6731 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6732 |
done ifFalse:[ |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6733 |
anyMethod := true. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6734 |
first ifFalse:[ |
16372 | 6735 |
info := ChangesBrowser::ChangeInfo new |
6736 |
position:methodPos chunk:chunkText className:clsName |
|
6737 |
selector:nil headerLine:nil timestamp:timeStampInfo isFollowupChange:true. |
|
6738 |
changeInfo add:info. |
|
6739 |
||
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6740 |
askedForEditingClassSource ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6741 |
thisIsAClassSource := (changeFileName asFilename hasSuffix:'st'). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6742 |
askedForEditingClassSource := true. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6743 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6744 |
] ifTrue:[ |
16372 | 6745 |
changeInfo last className:clsName |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6746 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6747 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6748 |
first := false. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6749 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6750 |
(classCategoryChunks or:[methodCategoryChunks]) ifTrue:[ |
6639 | 6751 |
text := text firstLine. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6752 |
classCategoryChunks ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6753 |
changeClass isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6754 |
changeDelta := '?'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
6755 |
] ifFalse:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6756 |
changeClass category = text ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6757 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6758 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6759 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6760 |
changeString := clsName , ' category: ' , text storeString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6761 |
]ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6762 |
changeString := '(' , clsName , ' compiledMethodAt:' , methodSelector storeString , ') category: ' , text storeString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6763 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6764 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6765 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6766 |
try to find the selector |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6767 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6768 |
methodSelector := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6769 |
clsName notNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6770 |
methodChunks ifTrue:[ |
17094 | 6771 |
p := Parser for:(ReadStream on:text) in:nil. |
6772 |
p ignoreErrors:true. |
|
6773 |
p ignoreWarnings:true. |
|
6774 |
p parserFlags allowDollarInIdentifier:true. |
|
6775 |
p parserFlags allowParagraphInIdentifier:true. |
|
6776 |
p parseMethodSpec. |
|
6777 |
methodSelector := p selector. |
|
6778 |
"/ p := Parser |
|
6779 |
"/ parseMethodSpecification:text |
|
6780 |
"/ in:nil |
|
6781 |
"/ ignoreErrors:true |
|
6782 |
"/ ignoreWarnings:true. |
|
6783 |
"/ (p notNil and:[p ~~ #Error]) ifTrue:[ |
|
6784 |
"/ methodSelector := p selector. |
|
6785 |
"/ ] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6786 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6787 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6788 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6789 |
methodSelector isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6790 |
changeString := (chunkText contractTo:maxLen). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6791 |
changeType := '(change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6792 |
headerLine := chunkText , ' (change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6793 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6794 |
changeString := self contractClass:clsName selector:methodSelector to:maxLen. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6795 |
changeType := '{ ' , category , ' }'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6796 |
headerLine := clsName , ' ' , methodSelector , ' ' , '(change category: ''' , category , ''')'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6797 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6798 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6799 |
autoCompare value ifTrue:[ |
17047 | 6800 |
changeDelta := ChangeDeltaInformation |
6801 |
changeDeltaFor:text changeClass:changeClass selector:methodSelector. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6802 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6803 |
]. |
17047 | 6804 |
changeInfo last |
6805 |
headerLine:(self headerLineForChangeType:changeType |
|
6806 |
changeString:changeString |
|
6807 |
changeDelta:changeDelta |
|
6808 |
timeStampInfo:timeStampInfo). |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6809 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6810 |
changeString := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6811 |
headerLine := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6812 |
singleJunkOnly ifTrue:[done := true] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6813 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6814 |
singleInfo ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6815 |
timeStampInfo := nil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6816 |
]. |
6658
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6817 |
anyMethod ifFalse:[ |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6818 |
emptyBlock value |
faf73551558b
handle empty methodsFor chunks
Claus Gittinger <cg@exept.de>
parents:
6639
diff
changeset
|
6819 |
]. |
16372 | 6820 |
|
17094 | 6821 |
"Modified: / 21-11-2016 / 23:32:29 / cg" |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6822 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6823 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6824 |
processNonMethodChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6825 |
|s changeClass sel cls p rec clsName ownerTree ownerName |
15087 | 6826 |
m nameAndClass args instVarsArg classVarsArg categoryArg| |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6827 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6828 |
(chunkText startsWith:'''---- snap') ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6829 |
self processSnapshotChunk. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6830 |
^ self |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6831 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6832 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6833 |
headerLine := chunkText , ' (doIt)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6834 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6835 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6836 |
first, assume doIt - then lets have a more detailed look ... |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6837 |
" |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6838 |
((chunkText startsWith:'''---- file') |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6839 |
or:[(chunkText startsWith:'''---- check')]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6840 |
changeType := ''. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6841 |
timeStampInfo := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6842 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6843 |
changeType := '(doIt)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6844 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6845 |
changeString := (chunkText contractTo:maxLen) withoutSeparators. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6846 |
|
8665 | 6847 |
p := browser parseExpression:fullChunkText inNameSpace:Smalltalk. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6848 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6849 |
p isMessage ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6850 |
sel := p selector. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6851 |
rec := p receiver. |
15087 | 6852 |
args := p args. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6853 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6854 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6855 |
sel := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6856 |
(Scanner new scanTokens:fullChunkText) size == 0 ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6857 |
"/ a comment only |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6858 |
changeType := '(comment)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6859 |
NoColoring ~~ true ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6860 |
changeType := changeType allItalic. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6861 |
"/ changeString := changeString allItalic. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6862 |
changeType emphasisAllAdd:(#color -> UserPreferences current commentColor). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6863 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6864 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6865 |
changeType := '(???)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6866 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6867 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6868 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6869 |
(sel == #comment:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6870 |
changeType := '(comment)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6871 |
clsName := rec name. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6872 |
changeClass := (self nameSpaceForApply) classNamed:clsName. |
16372 | 6873 |
(changeInfo last) className:clsName. |
6874 |
"/ changeClassNames at:changeClassNames size put:clsName. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6875 |
NoColoring ~~ true ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6876 |
changeType := changeType allItalic. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6877 |
changeType emphasisAllAdd:(#color -> UserPreferences current commentColor). |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6878 |
"/ changeString := clsName allItalic. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6879 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6880 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6881 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6882 |
changeDelta := '?' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6883 |
] ifFalse:[ |
15087 | 6884 |
(changeClass comment = (args at:1) evaluate) ifTrue:[ |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6885 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6886 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6887 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6888 |
]. |
15087 | 6889 |
"/ sel := nil. |
6890 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6891 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6892 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6893 |
(sel == #removeSelector:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6894 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6895 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6896 |
|
15087 | 6897 |
sel := (args at:1) evaluate. |
16372 | 6898 |
(changeInfo last) className:clsName. |
6899 |
"/ changeClassNames at:changeClassNames size put:clsName. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6900 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6901 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6902 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6903 |
changeDelta := '?' |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6904 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6905 |
(changeClass includesSelector:sel asSymbol) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6906 |
changeDelta := '-'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6907 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6908 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6909 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6910 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6911 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6912 |
changeType := '(remove)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6913 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
15087 | 6914 |
"/ sel := nil. |
6915 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6916 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6917 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6918 |
(p notNil |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6919 |
and:[p ~~ #Error |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6920 |
and:[p isMessage |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6921 |
and:[rec isMessage |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6922 |
and:[rec selector == #compiledMethodAt:]]]]) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6923 |
nameAndClass := self extractClassAndClassNameFromParseTree:rec receiver. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6924 |
clsName := nameAndClass key. changeClass := nameAndClass value. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6925 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6926 |
(sel == #category:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6927 |
sel := (rec args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6928 |
changeType := '(category change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6929 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
16372 | 6930 |
(changeInfo last) className:clsName. |
6931 |
"/ changeClassNames at:changeClassNames size put:clsName. |
|
15012 | 6932 |
autoCompare value ifTrue:[ |
6933 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
|
6934 |
changeDelta := '?' |
|
6935 |
] ifFalse:[ |
|
6936 |
m := changeClass compiledMethodAt:sel asSymbol. |
|
6937 |
m notNil ifTrue:[ |
|
6938 |
m category = (p args at:1) evaluate ifTrue:[ |
|
6939 |
changeDelta := '='. |
|
6940 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6941 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6942 |
] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6943 |
]. |
15087 | 6944 |
^ self. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6945 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6946 |
(sel == #privacy:) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6947 |
sel := (rec args at:1) evaluate. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6948 |
changeType := '(privacy change)'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6949 |
changeString := self contractClass:clsName selector:sel to:maxLen. |
16372 | 6950 |
(changeInfo last) className:clsName. |
6951 |
"/ changeClassNames at:changeClassNames size put:clsName. |
|
15012 | 6952 |
autoCompare value ifTrue:[ |
6953 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
|
6954 |
changeDelta := '?' |
|
6955 |
] ifFalse:[ |
|
6956 |
changeDelta := ' ' |
|
6957 |
] |
|
6958 |
]. |
|
15087 | 6959 |
^ self. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6960 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6961 |
sel := nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6962 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6963 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6964 |
(Class definitionSelectors includes:sel) ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6965 |
changeType := '(class definition)'. |
15087 | 6966 |
clsName := (args at:1) evaluate. |
16372 | 6967 |
(changeInfo last) className:clsName. |
6968 |
"/ changeClassNames at:changeClassNames size put:clsName. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6969 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6970 |
"/ is it a private-class ? |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6971 |
('*privateIn:' match:sel) ifTrue:[ |
15087 | 6972 |
ownerTree := args last. |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6973 |
ownerName := ownerTree name asString. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6974 |
clsName := ownerName , '::' , clsName |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6975 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6976 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6977 |
changeString := clsName. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6978 |
NoColoring ~~ true ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6979 |
changeType := changeType allBold. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6980 |
changeString := changeString allBold. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6981 |
]. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6982 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6983 |
autoCompare value ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6984 |
cls := (self nameSpaceForApply) at:clsName asSymbol ifAbsent:nil. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6985 |
cls isNil ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6986 |
changeDelta := '+'. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6987 |
] ifFalse:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6988 |
(cls definitionSelector = sel |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6989 |
or:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6990 |
"/ could be an ST/V, VAge or Dolphin definition |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6991 |
cls definitionSelector = (sel , 'category:') |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6992 |
]) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6993 |
ifTrue:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6994 |
((cls superclass isNil |
16390 | 6995 |
and:[p receiver isLiteral |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6996 |
and:[p receiver evaluate isNil]]) |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6997 |
or:[ |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
6998 |
cls superclass notNil |
16390 | 6999 |
and:[p receiver isLiteral not |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7000 |
and:[cls superclass name = p receiver name]] |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7001 |
]) ifTrue:[ |
15087 | 7002 |
(sel == #'variableByteSubclass:classVariableNames:poolDictionaries:category:') |
7003 |
ifTrue:[ |
|
7004 |
"/ VSE definition message |
|
7005 |
instVarsArg := ''. |
|
7006 |
classVarsArg := (args at:2) evaluate. |
|
7007 |
categoryArg := (args at:4) evaluate. |
|
7008 |
] ifFalse:[ |
|
7009 |
instVarsArg := (args at:2) evaluate. |
|
7010 |
classVarsArg := (args at:3) evaluate. |
|
7011 |
categoryArg := (args at:5) evaluate. |
|
7012 |
]. |
|
7013 |
cls instanceVariableString asCollectionOfWords = instVarsArg asCollectionOfWords ifTrue:[ |
|
7014 |
cls classVariableString asCollectionOfWords = classVarsArg asCollectionOfWords ifTrue:[ |
|
7015 |
cls definitionSelector = (sel , 'category:') |
|
7016 |
ifTrue:[ |
|
7017 |
"/ ST/V, VAge or Dolphin definition |
|
7018 |
changeDelta := '='. |
|
7019 |
] ifFalse:[ |
|
7020 |
cls category = categoryArg ifTrue:[ |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7021 |
changeDelta := '='. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7022 |
] ifFalse:[ |
15087 | 7023 |
changeType := '(class category change)'. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7024 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7025 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7026 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7027 |
] |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7028 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7029 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7030 |
] |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7031 |
]. |
15087 | 7032 |
"/ sel := nil. |
7033 |
^ self. |
|
7034 |
]. |
|
7035 |
||
7036 |
(#( |
|
7037 |
#'primitiveDefinitions:' |
|
7038 |
#'primitiveFunctions:' |
|
7039 |
#'primitiveVariables:' |
|
7040 |
) includes:sel) ifTrue:[ |
|
7041 |
changeType := '(class definition)'. |
|
7042 |
clsName := rec name. |
|
7043 |
^ self. |
|
7044 |
]. |
|
7045 |
||
7046 |
((sel == #instanceVariableNames:) |
|
7047 |
and:[rec isMessage |
|
7048 |
and:[rec selector == #class]]) ifTrue:[ |
|
7049 |
clsName := rec receiver name. |
|
7050 |
changeClass := (self nameSpaceForApply) classNamed:clsName. |
|
7051 |
changeType := '(class definition)'. |
|
16372 | 7052 |
(changeInfo last) className:clsName. |
7053 |
"/ changeClassNames at:changeClassNames size put:clsName. |
|
15087 | 7054 |
|
7055 |
autoCompare value ifTrue:[ |
|
7056 |
changeClass isNil ifTrue:[ |
|
7057 |
changeDelta := '?'. |
|
7058 |
] ifFalse:[ |
|
7059 |
s := (p args at:1) evaluate. |
|
7060 |
s = changeClass class instanceVariableString ifTrue:[ |
|
7061 |
changeDelta := '='. |
|
7062 |
] |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7063 |
] |
15087 | 7064 |
]. |
7065 |
^ self. |
|
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7066 |
]. |
9548 | 7067 |
|
16372 | 7068 |
"Modified: / 01-05-2016 / 19:19:54 / cg" |
6530
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7069 |
! |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7070 |
|
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7071 |
processSnapshotChunk |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7072 |
changeType := ''. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7073 |
headerLine := chunkText. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7074 |
changeString := (chunkText contractTo:maxLen) withoutSeparators. |
6bb6d5670055
refactorings to make reader cleaner;
Claus Gittinger <cg@exept.de>
parents:
6516
diff
changeset
|
7075 |
timeStampInfo := nil. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7076 |
! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7077 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7078 |
readChangesFile |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7079 |
"read the changes file, create a list of header-lines (changeChunks) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7080 |
and a list of chunk-positions (changePositions). |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7081 |
Starting with 2.10.3, the entries are multi-col entries; |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7082 |
the cols are: |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7083 |
1 delta (only if comparing) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7084 |
'+' -> new method (w.r.t. current state) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7085 |
'-' -> removed method (w.r.t. current state) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7086 |
'?' -> class does not exist currently |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7087 |
'=' -> change is the same as current methods source |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7088 |
'~' -> change is almost the same as current methods source |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7089 |
2 class/selector |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7090 |
3 type of change |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7091 |
doit |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7092 |
method |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7093 |
category change |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7094 |
4 timestamp |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7095 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7096 |
since comparing slows down startup time, it is now disabled by |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7097 |
default and can be enabled via a toggle." |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7098 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7099 |
|excla| |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7100 |
|
16372 | 7101 |
changeInfo := OrderedCollection new. |
7102 |
||
7103 |
"/ changeChunks := OrderedCollection new. |
|
7104 |
"/ changeClassNames := OrderedCollection new. |
|
7105 |
"/ changeHeaderLines := OrderedCollection new. |
|
7106 |
"/ changePositions := OrderedCollection new. |
|
7107 |
"/ changeTimeStamps := OrderedCollection new. |
|
7108 |
"/ changeIsFollowupMethodChange := OrderedCollection new. |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7109 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7110 |
excla := inStream class chunkSeparator. |
9515 | 7111 |
maxLen := 100. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7112 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7113 |
[inStream atEnd] whileFalse:[ |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7114 |
" |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7115 |
get a chunk (separated by excla) |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7116 |
" |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7117 |
inStream skipSeparators. |
13314 | 7118 |
chunkPosition := inStream position + 1. |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7119 |
|
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7120 |
sawExcla := inStream peekFor:excla. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7121 |
chunkText := fullChunkText := inStream nextChunk. |
7619
95943c1bc289
Ignore empty chunks when reading from changes file
Stefan Vogel <sv@exept.de>
parents:
7618
diff
changeset
|
7122 |
chunkText notEmptyOrNil ifTrue:[ |
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7123 |
self processChunk. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7124 |
] |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7125 |
]. |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7126 |
|
9515 | 7127 |
"Modified: / 27-08-1995 / 23:06:55 / claus" |
16372 | 7128 |
"Modified: / 01-05-2016 / 18:33:36 / cg" |
7129 |
! ! |
|
7130 |
||
7131 |
!ChangesBrowser::ChangeInfo methodsFor:'accessing'! |
|
7132 |
||
7133 |
chunk |
|
7134 |
^ chunk |
|
7135 |
! |
|
7136 |
||
7137 |
className |
|
7138 |
^ className |
|
7139 |
! |
|
7140 |
||
7141 |
className:something |
|
7142 |
className := something. |
|
7143 |
! |
|
7144 |
||
7145 |
headerLine |
|
7146 |
^ headerLine |
|
7147 |
! |
|
7148 |
||
7149 |
headerLine:something |
|
7150 |
headerLine := something. |
|
7151 |
! |
|
7152 |
||
7153 |
isFollowupChange |
|
7154 |
^ isFollowupChange |
|
7155 |
! |
|
7156 |
||
7157 |
position |
|
7158 |
^ position |
|
7159 |
! |
|
7160 |
||
7161 |
position:positionArg chunk:chunkArg className:classNameArg selector:selectorArg headerLine:headerLineArg |
|
7162 |
timestamp:timestampArg isFollowupChange:isFollowupChangeArg |
|
7163 |
||
7164 |
position := positionArg. |
|
7165 |
chunk := chunkArg. |
|
7166 |
className := classNameArg. |
|
7167 |
selector := selectorArg. |
|
7168 |
headerLine := headerLineArg. |
|
7169 |
timestamp := timestampArg. |
|
7170 |
isFollowupChange := isFollowupChangeArg. |
|
7171 |
||
7172 |
"Created: / 01-05-2016 / 19:01:03 / cg" |
|
7173 |
! |
|
7174 |
||
7175 |
selector |
|
7176 |
^ selector |
|
7177 |
! |
|
7178 |
||
7179 |
selector:something |
|
7180 |
selector := something. |
|
7181 |
! |
|
7182 |
||
7183 |
timestamp |
|
7184 |
^ timestamp |
|
6512
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7185 |
! ! |
ee424e762e33
started to refacvtorreadChanges into separate helper class.
Claus Gittinger <cg@exept.de>
parents:
6482
diff
changeset
|
7186 |
|
761 | 7187 |
!ChangesBrowser class methodsFor:'documentation'! |
202 | 7188 |
|
7189 |
version |
|
15683 | 7190 |
^ '$Header$' |
8978 | 7191 |
! |
7192 |
||
7193 |
version_CVS |
|
15683 | 7194 |
^ '$Header$' |
276
017219e571e4
more stuff for autoloaded classes
Claus Gittinger <cg@exept.de>
parents:
275
diff
changeset
|
7195 |
! ! |
12428 | 7196 |