author | Claus Gittinger <cg@exept.de> |
Tue, 26 Nov 2002 14:53:50 +0100 | |
changeset 4316 | a0d59a6735e2 |
parent 4279 | 1fbb8fa63669 |
child 4430 | 665173b18b94 |
permissions | -rw-r--r-- |
30 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
45 | 3 |
All Rights Reserved |
30 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
13 |
"{ Package: 'stx:libtool' }" |
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
14 |
|
30 | 15 |
ChangesBrowser subclass:#ChangeSetBrowser |
1470 | 16 |
instanceVariableNames:'changeSet originalChangeSet' |
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Interface-Browsers' |
|
30 | 20 |
! |
21 |
||
22 |
!ChangeSetBrowser class methodsFor:'documentation'! |
|
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
45 | 27 |
All Rights Reserved |
30 | 28 |
|
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
40 |
like a changesBrowser, but manipulates the per-project change-lists. |
|
41 |
" |
|
42 |
! ! |
|
43 |
||
44 |
!ChangeSetBrowser class methodsFor:'instance creation'! |
|
45 |
||
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
46 |
open |
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
47 |
"create a changes browser on the current change set" |
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
48 |
|
3898 | 49 |
^ self openOn:(ChangeSet current) |
50 |
||
51 |
" |
|
52 |
ChangeSetBrowser open |
|
53 |
" |
|
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
54 |
! |
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
55 |
|
40 | 56 |
openOn:aChangeSet |
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
57 |
"create a changes browser on a change set" |
30 | 58 |
|
45 | 59 |
^ ((self new label:'ChangeSet Browser') changeSet:aChangeSet) open |
4232 | 60 |
! |
61 |
||
62 |
openOnFile:aFileName |
|
63 |
|changeSet| |
|
64 |
||
65 |
changeSet := ChangeSet fromFile:aFileName. |
|
66 |
^ self openOn:changeSet |
|
30 | 67 |
! ! |
68 |
||
1470 | 69 |
!ChangeSetBrowser class methodsFor:'defaults'! |
70 |
||
71 |
defaultLabel |
|
72 |
^ 'ChangeSet Browser' |
|
73 |
||
74 |
"Created: / 6.2.1998 / 13:25:47 / cg" |
|
75 |
! ! |
|
76 |
||
3203 | 77 |
!ChangeSetBrowser class methodsFor:'menu specs'! |
78 |
||
79 |
menuSpec |
|
80 |
"This resource specification was automatically generated |
|
81 |
by the MenuEditor of ST/X." |
|
82 |
||
83 |
"Do not manually edit this!! If it is corrupted, |
|
84 |
the MenuEditor may not be able to read the specification." |
|
85 |
||
86 |
" |
|
87 |
MenuEditor new openOnClass:ChangeSetBrowser andSelector:#menuSpec |
|
88 |
(Menu new fromLiteralArrayEncoding:(ChangeSetBrowser menuSpec)) startUp |
|
89 |
" |
|
90 |
||
91 |
<resource: #menu> |
|
92 |
||
93 |
^ |
|
94 |
#(#Menu |
|
95 |
#( |
|
96 |
#(#MenuItem |
|
97 |
#label: 'File' |
|
98 |
#translateLabel: true |
|
99 |
#submenu: |
|
100 |
#(#Menu |
|
101 |
#( |
|
102 |
#(#MenuItem |
|
103 |
#label: 'Compress' |
|
104 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
105 |
#isVisible: #notEditingClassSourceAndNotReadOnly |
3203 | 106 |
#value: #doCompress |
107 |
) |
|
108 |
#(#MenuItem |
|
109 |
#label: 'Compress for Class' |
|
110 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
111 |
#isVisible: #notEditingClassSourceAndNotReadOnly |
3203 | 112 |
#value: #doCompressClass |
113 |
#enabled: #hasSelection |
|
114 |
) |
|
115 |
#(#MenuItem |
|
116 |
#label: 'Compare and Compress' |
|
117 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
118 |
#isVisible: #notEditingClassSourceAndNotReadOnly |
3203 | 119 |
#value: #doCompareAndCompress |
120 |
) |
|
121 |
#(#MenuItem |
|
122 |
#label: '-' |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
123 |
#isVisible: #notEditingClassSourceAndNotReadOnly |
3203 | 124 |
) |
125 |
#(#MenuItem |
|
126 |
#label: 'Fileout && Delete all Changes for Class' |
|
127 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
128 |
#isVisible: #notEditingClassSourceAndNotReadOnly |
3203 | 129 |
#value: #doFileoutAndDeleteClassAll |
130 |
#enabled: #hasSelection |
|
131 |
) |
|
132 |
#(#MenuItem |
|
133 |
#label: 'CheckIn && Delete all Changes for Class' |
|
134 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
135 |
#isVisible: #notEditingClassSourceAndNotReadOnly |
3203 | 136 |
#value: #doCheckinAndDeleteClassAll |
137 |
#enabled: #hasSelection |
|
138 |
) |
|
139 |
#(#MenuItem |
|
140 |
#label: '-' |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
141 |
#isVisible: #notEditingClassSourceAndNotReadOnly |
3203 | 142 |
) |
143 |
#(#MenuItem |
|
144 |
#label: 'Save in...' |
|
145 |
#translateLabel: true |
|
146 |
#value: #doSave |
|
147 |
#enabled: #hasSelection |
|
148 |
) |
|
149 |
#(#MenuItem |
|
150 |
#label: 'Save to End in...' |
|
151 |
#translateLabel: true |
|
152 |
#value: #doSaveRest |
|
153 |
#enabled: #hasSelection |
|
154 |
) |
|
155 |
#(#MenuItem |
|
156 |
#label: 'Save for Class to End in...' |
|
157 |
#translateLabel: true |
|
158 |
#value: #doSaveClassRest |
|
159 |
#enabled: #hasSelection |
|
160 |
) |
|
161 |
#(#MenuItem |
|
162 |
#label: 'Save All for Class in...' |
|
163 |
#translateLabel: true |
|
164 |
#value: #doSaveClassAll |
|
165 |
#enabled: #hasSelection |
|
166 |
) |
|
167 |
#(#MenuItem |
|
168 |
#label: '-' |
|
169 |
) |
|
170 |
#(#MenuItem |
|
171 |
#label: 'Saveback ChangeSet' |
|
172 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
173 |
#isVisible: #notReadOnly |
3203 | 174 |
#value: #doSaveBack |
175 |
) |
|
176 |
#(#MenuItem |
|
3554 | 177 |
#label: '-' |
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
178 |
#isVisible: #notReadOnly |
3203 | 179 |
) |
180 |
#(#MenuItem |
|
181 |
#label: 'Update' |
|
182 |
#translateLabel: true |
|
3554 | 183 |
#isVisible: #notReadOnly |
3203 | 184 |
#value: #doUpdate |
185 |
) |
|
186 |
#(#MenuItem |
|
187 |
#label: '-' |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
188 |
#isVisible: #notReadOnly |
3203 | 189 |
) |
190 |
#(#MenuItem |
|
191 |
#label: 'Exit' |
|
192 |
#translateLabel: true |
|
193 |
#value: #menuExit |
|
194 |
) |
|
195 |
) |
|
196 |
nil |
|
197 |
nil |
|
198 |
) |
|
199 |
) |
|
200 |
#(#MenuItem |
|
3554 | 201 |
#label: 'Change' |
202 |
#translateLabel: true |
|
203 |
#submenu: |
|
204 |
#(#Menu |
|
205 |
#( |
|
206 |
#(#MenuItem |
|
3857 | 207 |
#label: 'Undo (undelete Method)' |
208 |
#translateLabel: true |
|
209 |
#value: #doUndoRemoveMethod |
|
210 |
#isVisible: #hasUndoableRemoveMethodChangeSelected |
|
211 |
) |
|
212 |
#(#MenuItem |
|
213 |
#label: 'Undo (previous Version)' |
|
214 |
#translateLabel: true |
|
215 |
#value: #doUndoMethodChange |
|
216 |
#isVisible: #hasUndoableMethodChangeSelected |
|
217 |
) |
|
218 |
#(#MenuItem |
|
219 |
#label: 'Undo' |
|
220 |
#translateLabel: true |
|
221 |
#value: #doUndoMethodChange |
|
222 |
#enabled: false |
|
223 |
#isVisible: #hasNotUndoableChangeSelected |
|
224 |
) |
|
225 |
#(#MenuItem |
|
226 |
#label: '-' |
|
227 |
) |
|
228 |
#(#MenuItem |
|
3554 | 229 |
#label: 'Apply' |
230 |
#translateLabel: true |
|
231 |
#value: #doApply |
|
232 |
#enabled: #hasSelection |
|
233 |
) |
|
234 |
#(#MenuItem |
|
235 |
#label: 'Apply to End' |
|
236 |
#translateLabel: true |
|
237 |
#value: #doApplyRest |
|
238 |
#enabled: #hasSelection |
|
239 |
) |
|
240 |
#(#MenuItem |
|
241 |
#label: 'Apply for Class to End' |
|
242 |
#translateLabel: true |
|
243 |
#value: #doApplyClassRest |
|
244 |
#enabled: #hasSelection |
|
245 |
) |
|
246 |
#(#MenuItem |
|
247 |
#label: 'Apply All' |
|
248 |
#translateLabel: true |
|
249 |
#value: #doApplyAll |
|
250 |
#enabled: #hasNoSelection |
|
251 |
) |
|
252 |
#(#MenuItem |
|
253 |
#label: '-' |
|
254 |
) |
|
255 |
#(#MenuItem |
|
256 |
#label: 'Delete' |
|
257 |
#translateLabel: true |
|
258 |
#isVisible: #notReadOnly |
|
259 |
#value: #doDelete |
|
260 |
#enabled: #hasSelection |
|
261 |
) |
|
262 |
#(#MenuItem |
|
263 |
#label: 'Delete to End' |
|
264 |
#translateLabel: true |
|
265 |
#isVisible: #notReadOnly |
|
266 |
#value: #doDeleteRest |
|
267 |
#enabled: #hasSelection |
|
268 |
) |
|
269 |
#(#MenuItem |
|
270 |
#label: 'Delete for Class to End' |
|
271 |
#translateLabel: true |
|
272 |
#isVisible: #notReadOnly |
|
273 |
#value: #doDeleteClassRest |
|
274 |
#enabled: #hasSelection |
|
275 |
) |
|
276 |
#(#MenuItem |
|
277 |
#label: 'Delete for Class from Begin' |
|
278 |
#translateLabel: true |
|
279 |
#isVisible: #notReadOnly |
|
280 |
#value: #doDeleteClassFromBeginning |
|
281 |
#enabled: #hasSelection |
|
282 |
) |
|
283 |
#(#MenuItem |
|
284 |
#label: 'Delete All for Class' |
|
285 |
#translateLabel: true |
|
286 |
#isVisible: #notReadOnly |
|
287 |
#value: #doDeleteClassAll |
|
288 |
#enabled: #hasSelection |
|
289 |
) |
|
290 |
#(#MenuItem |
|
291 |
#label: 'Delete All for Class && its Private Classes' |
|
292 |
#translateLabel: true |
|
293 |
#isVisible: #notReadOnly |
|
294 |
#value: #doDeleteClassAndPrivateClassesAll |
|
295 |
#enabled: #hasSelection |
|
296 |
) |
|
297 |
#(#MenuItem |
|
298 |
#label: '-' |
|
299 |
#isVisible: #notReadOnly |
|
300 |
) |
|
301 |
#(#MenuItem |
|
302 |
#label: 'Compare with Current' |
|
303 |
#translateLabel: true |
|
304 |
#value: #doCompare |
|
305 |
#enabled: #hasSelection |
|
306 |
) |
|
307 |
#(#MenuItem |
|
308 |
#label: 'Browse' |
|
309 |
#translateLabel: true |
|
310 |
#value: #doBrowse |
|
311 |
#enabled: #hasSelection |
|
312 |
) |
|
313 |
#(#MenuItem |
|
314 |
#label: '-' |
|
315 |
) |
|
316 |
#(#MenuItem |
|
317 |
#label: 'Make Change a Patch' |
|
318 |
#translateLabel: true |
|
319 |
#value: #doMakePatch |
|
320 |
#enabled: #hasSelection |
|
321 |
) |
|
322 |
) |
|
323 |
nil |
|
324 |
nil |
|
325 |
) |
|
326 |
) |
|
327 |
#(#MenuItem |
|
3203 | 328 |
#label: 'Search' |
329 |
#translateLabel: true |
|
330 |
#submenu: |
|
331 |
#(#Menu |
|
332 |
#( |
|
333 |
#(#MenuItem |
|
334 |
#label: 'Class...' |
|
335 |
#translateLabel: true |
|
336 |
#value: #findClass |
|
337 |
) |
|
338 |
#(#MenuItem |
|
339 |
#label: 'Previous for Class' |
|
340 |
#translateLabel: true |
|
341 |
#value: #findPreviousForClass |
|
342 |
#enabled: #hasSelection |
|
343 |
) |
|
344 |
#(#MenuItem |
|
345 |
#label: 'Next for Class' |
|
346 |
#translateLabel: true |
|
347 |
#value: #findNextForClass |
|
348 |
#enabled: #hasSelection |
|
349 |
) |
|
350 |
#(#MenuItem |
|
351 |
#label: '-' |
|
352 |
) |
|
353 |
#(#MenuItem |
|
354 |
#label: 'Selector...' |
|
355 |
#translateLabel: true |
|
356 |
#value: #findSelector |
|
357 |
) |
|
358 |
#(#MenuItem |
|
359 |
#label: 'Previous for Selector' |
|
360 |
#translateLabel: true |
|
361 |
#value: #findPreviousForSelector |
|
362 |
#enabled: #hasSelection |
|
363 |
) |
|
364 |
#(#MenuItem |
|
365 |
#label: 'Next for Selector' |
|
366 |
#translateLabel: true |
|
367 |
#value: #findNextForSelector |
|
368 |
#enabled: #hasSelection |
|
369 |
) |
|
370 |
#(#MenuItem |
|
371 |
#label: '-' |
|
372 |
) |
|
373 |
#(#MenuItem |
|
374 |
#label: 'String...' |
|
375 |
#translateLabel: true |
|
376 |
#value: #findString |
|
377 |
) |
|
378 |
#(#MenuItem |
|
379 |
#label: 'Previous with String' |
|
380 |
#translateLabel: true |
|
381 |
#value: #findPreviousForString |
|
382 |
#enabled: #hasSelection |
|
383 |
) |
|
384 |
#(#MenuItem |
|
385 |
#label: 'Next with String' |
|
386 |
#translateLabel: true |
|
387 |
#value: #findNextForString |
|
388 |
#enabled: #hasSelection |
|
389 |
) |
|
390 |
#(#MenuItem |
|
391 |
#label: '-' |
|
392 |
) |
|
393 |
#(#MenuItem |
|
394 |
#label: 'Previous Snapshot' |
|
395 |
#translateLabel: true |
|
396 |
#value: #findPreviousSnapshot |
|
397 |
#enabled: #hasSelection |
|
398 |
) |
|
399 |
#(#MenuItem |
|
400 |
#label: 'Next Snapshot' |
|
401 |
#translateLabel: true |
|
402 |
#value: #findNextSnapshot |
|
403 |
#enabled: #hasSelection |
|
404 |
) |
|
405 |
) |
|
406 |
nil |
|
407 |
nil |
|
408 |
) |
|
409 |
) |
|
410 |
#(#MenuItem |
|
3554 | 411 |
#label: 'Browse' |
3203 | 412 |
#translateLabel: true |
413 |
#submenu: |
|
414 |
#(#Menu |
|
415 |
#( |
|
416 |
#(#MenuItem |
|
3554 | 417 |
#label: 'Class' |
3203 | 418 |
#translateLabel: true |
3554 | 419 |
#value: #doBrowse |
420 |
#enabled: #hasSingleSelection |
|
3203 | 421 |
) |
422 |
#(#MenuItem |
|
423 |
#label: '-' |
|
424 |
) |
|
425 |
#(#MenuItem |
|
3554 | 426 |
#label: 'Senders...' |
3203 | 427 |
#translateLabel: true |
3554 | 428 |
#value: #doBrowseSenders |
3203 | 429 |
) |
430 |
#(#MenuItem |
|
3554 | 431 |
#label: 'Implementors...' |
3203 | 432 |
#translateLabel: true |
3554 | 433 |
#value: #doBrowseImplementors |
3203 | 434 |
) |
435 |
) |
|
436 |
nil |
|
437 |
nil |
|
438 |
) |
|
439 |
) |
|
440 |
#(#MenuItem |
|
441 |
#label: 'Settings' |
|
442 |
#translateLabel: true |
|
443 |
#submenu: |
|
444 |
#(#Menu |
|
445 |
#( |
|
446 |
#(#MenuItem |
|
447 |
#label: 'Auto Compare' |
|
448 |
#translateLabel: true |
|
449 |
#indication: #autoCompare |
|
450 |
) |
|
451 |
#(#MenuItem |
|
452 |
#label: 'Auto Update' |
|
453 |
#translateLabel: true |
|
3554 | 454 |
#isVisible: #notReadOnly |
3203 | 455 |
#indication: #autoUpdate |
456 |
) |
|
457 |
#(#MenuItem |
|
458 |
#label: '-' |
|
459 |
) |
|
460 |
#(#MenuItem |
|
461 |
#label: 'Apply in Original NameSpace' |
|
462 |
#translateLabel: true |
|
463 |
#indication: #applyInOriginalNameSpace |
|
464 |
) |
|
4279
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
465 |
#(#MenuItem |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
466 |
#label: 'Apply in NameSpace...' |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
467 |
#translateLabel: true |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
468 |
#indication: #applyInNameSpace |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
469 |
) |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
470 |
#(#MenuItem |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
471 |
#label: 'Apply into Package...' |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
472 |
#translateLabel: true |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
473 |
#indication: #applyInPackage |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
474 |
) |
3203 | 475 |
) |
476 |
nil |
|
477 |
nil |
|
478 |
) |
|
479 |
) |
|
480 |
#(#MenuItem |
|
481 |
#label: 'Help' |
|
482 |
#translateLabel: true |
|
483 |
#startGroup: #right |
|
484 |
#submenu: |
|
485 |
#(#Menu |
|
486 |
#( |
|
487 |
#(#MenuItem |
|
488 |
#label: 'ChangesBrowser Documentation' |
|
489 |
#translateLabel: true |
|
490 |
#value: #openHTMLDocument: |
|
491 |
#argument: 'tools/cbrowser/TOP.html' |
|
492 |
) |
|
3205 | 493 |
#(#MenuItem |
494 |
#label: '-' |
|
495 |
) |
|
496 |
#(#MenuItem |
|
497 |
#label: 'About ChangesBrowser...' |
|
498 |
#translateLabel: true |
|
499 |
#value: #openAboutThisApplication |
|
500 |
) |
|
3203 | 501 |
) |
502 |
nil |
|
503 |
nil |
|
504 |
) |
|
505 |
) |
|
506 |
) |
|
507 |
nil |
|
508 |
nil |
|
509 |
) |
|
510 |
! ! |
|
511 |
||
30 | 512 |
!ChangeSetBrowser methodsFor:'initialize / release'! |
513 |
||
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
514 |
askIfChangesAreToBeWrittenBack |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
515 |
|action| |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
516 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
517 |
anyChanges ifFalse:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
518 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
519 |
action := OptionBox |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
520 |
request:(resources at:'The modified changeSet has not been saved.\\Update the changeSet before closing ?') withCRs |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
521 |
label:'ChangesBrowser' |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
522 |
form:(WarningBox iconBitmap) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
523 |
buttonLabels:(resources array:#('Cancel' 'Don''t Update' 'Update')) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
524 |
values:#(#abort #ignore #save) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
525 |
default:#save |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
526 |
onCancel:#abort. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
527 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
528 |
action == #abort ifTrue:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
529 |
action == #save ifTrue:[ |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
530 |
self saveBackChanges |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
531 |
]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
532 |
! |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
533 |
|
224 | 534 |
changeListMenu |
3203 | 535 |
<resource: #programMenu > |
536 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
537 |
|items m| |
30 | 538 |
|
3203 | 539 |
items := #( |
540 |
('Apply' doApply) |
|
541 |
('Apply to End' doApplyRest) |
|
542 |
('Apply All changes' doApplyAll) |
|
543 |
('-' ) |
|
544 |
('Delete' doDelete) |
|
545 |
('Delete to End' doDeleteRest) |
|
546 |
('Delete for Class to End' doDeleteClassRest) |
|
547 |
('Delete All for Class' doDeleteClassAll) |
|
548 |
('-' ) |
|
4316 | 549 |
"/ ('Compress' doCompress) |
3203 | 550 |
('Compare with Current' doCompare) |
551 |
('-' ) |
|
552 |
('Make Change a Patch' doMakePatch) |
|
553 |
('-' ) |
|
554 |
('Saveback ChangeSet' doSaveBack) |
|
555 |
('-' ) |
|
556 |
('Update' doUpdate) |
|
557 |
). |
|
224 | 558 |
|
4316 | 559 |
device ctrlDown ifTrue:[ |
560 |
items := #( |
|
561 |
('Inspect Change' doInspectChange) |
|
562 |
). |
|
563 |
]. |
|
564 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
565 |
m := PopUpMenu |
3203 | 566 |
itemList:items |
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
567 |
resources:resources. |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
568 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
569 |
readOnly == true ifTrue:[ |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
570 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
571 |
doDeleteClassAndPrivateClassesAll doCompress |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
572 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
573 |
doWriteBack doSaveBack doUpdate |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
574 |
doApplyAll doApplyRest) |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
575 |
]. |
3228 | 576 |
|
577 |
self hasSelection ifTrue:[ |
|
578 |
m disable:#doApplyAll |
|
579 |
]. |
|
580 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
581 |
^ m |
224 | 582 |
|
583 |
"Created: 3.12.1995 / 18:06:35 / cg" |
|
584 |
"Modified: 3.12.1995 / 18:13:06 / cg" |
|
30 | 585 |
! ! |
586 |
||
3857 | 587 |
!ChangeSetBrowser methodsFor:'menu aspects'! |
588 |
||
589 |
hasNotUndoableChangeSelected |
|
590 |
^ (self hasUndoableMethodChangeSelected |
|
591 |
or:[self hasUndoableRemoveMethodChangeSelected]) not |
|
592 |
! |
|
593 |
||
594 |
hasUndoableMethodChangeSelected |
|
595 |
|nr chg| |
|
596 |
||
597 |
self hasSingleSelection ifTrue:[ |
|
598 |
nr := self theSingleSelection. |
|
599 |
nr notNil ifTrue:[ |
|
600 |
chg := changeSet at:nr. |
|
601 |
chg isMethodChange ifTrue:[ |
|
602 |
chg isMethodRemoveChange ifFalse:[ |
|
603 |
chg previousVersion notNil ifTrue:[ |
|
604 |
^ true |
|
605 |
] |
|
606 |
] |
|
607 |
] |
|
608 |
] |
|
609 |
]. |
|
610 |
^ false |
|
611 |
! |
|
612 |
||
613 |
hasUndoableRemoveMethodChangeSelected |
|
614 |
|nr chg| |
|
615 |
||
616 |
self hasSingleSelection ifTrue:[ |
|
617 |
nr := self theSingleSelection. |
|
618 |
nr notNil ifTrue:[ |
|
619 |
chg := changeSet at:nr. |
|
620 |
chg isMethodRemoveChange ifTrue:[ |
|
621 |
chg previousVersion notNil ifTrue:[ |
|
622 |
^ true |
|
623 |
] |
|
624 |
] |
|
625 |
] |
|
626 |
]. |
|
627 |
^ false |
|
628 |
! ! |
|
629 |
||
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
630 |
!ChangeSetBrowser methodsFor:'private'! |
1474 | 631 |
|
632 |
applyChange:changeNr |
|
633 |
"fileIn a change" |
|
634 |
||
635 |
|nm applyAction| |
|
636 |
||
637 |
nm := self classNameOfChange:changeNr. |
|
638 |
nm notNil ifTrue:[ |
|
639 |
|cls| |
|
640 |
||
641 |
cls := Smalltalk at:(nm asSymbol) ifAbsent:[]. |
|
642 |
cls notNil ifTrue:[ |
|
643 |
cls isLoaded ifFalse:[ |
|
644 |
cls autoload |
|
645 |
] |
|
646 |
] |
|
647 |
]. |
|
648 |
||
649 |
changeNrProcessed := changeNr. |
|
650 |
||
651 |
applyAction := [ |
|
652 |
|sig| |
|
653 |
||
654 |
(skipSignal notNil) ifTrue:[ |
|
655 |
sig := skipSignal |
|
656 |
] ifFalse:[ |
|
657 |
sig := Object abortSignal |
|
658 |
]. |
|
659 |
sig catch:[ |
|
4279
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
660 |
|
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
661 |
Parser::ParseError handle:[:ex | |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
662 |
ex signal == Parser::UndefinedSuperclassError ifTrue:[ |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
663 |
codeView error:(ex errorString) position:1 to:nil from:nil |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
664 |
] ifFalse:[ |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
665 |
codeView error:(ex errorMessage) position:(ex startPosition) to:(ex endPosition) from:(ex parser) |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
666 |
] |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
667 |
] do:[ |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
668 |
(changeSet at:changeNr) apply. |
1fbb8fa63669
care for parser errors when applying
Claus Gittinger <cg@exept.de>
parents:
4232
diff
changeset
|
669 |
] |
1474 | 670 |
]. |
671 |
changeNrProcessed := nil. |
|
672 |
]. |
|
673 |
||
674 |
"/ |
|
675 |
"/ if I am showing the changes file, dont update it |
|
676 |
"/ |
|
677 |
changeFileName = ObjectMemory nameForChanges ifTrue:[ |
|
678 |
Class withoutUpdatingChangesDo:applyAction |
|
679 |
] ifFalse:[ |
|
680 |
applyAction value |
|
681 |
]. |
|
682 |
||
683 |
"Created: / 7.2.1998 / 19:32:35 / cg" |
|
684 |
"Modified: / 7.2.1998 / 19:35:11 / cg" |
|
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
685 |
! |
30 | 686 |
|
1470 | 687 |
changeIsFollowupMethodChange:changeNr |
688 |
^ false |
|
689 |
||
690 |
"Created: / 6.2.1998 / 13:04:59 / cg" |
|
1474 | 691 |
"Modified: / 7.2.1998 / 19:28:52 / cg" |
1470 | 692 |
! |
693 |
||
30 | 694 |
changeSet:aChangeSet |
695 |
originalChangeSet := aChangeSet. |
|
696 |
changeSet := OrderedCollection new. |
|
106 | 697 |
originalChangeSet notNil ifTrue:[ |
698 |
originalChangeSet do:[:aChange | |
|
699 |
changeSet add:aChange |
|
700 |
]. |
|
30 | 701 |
]. |
702 |
! |
|
703 |
||
222 | 704 |
checkIfFileHasChanged |
705 |
Processor removeTimedBlock:checkBlock. |
|
706 |
changeSet size ~= originalChangeSet size ifTrue:[ |
|
707 |
self newLabel:'(outdated)'. |
|
3203 | 708 |
autoUpdate value ifTrue:[ |
222 | 709 |
self doUpdate |
710 |
] |
|
711 |
] ifFalse:[ |
|
712 |
self newLabel:'' |
|
713 |
]. |
|
714 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
|
715 |
||
716 |
"Created: 3.12.1995 / 13:52:30 / cg" |
|
717 |
"Modified: 3.12.1995 / 14:15:06 / cg" |
|
718 |
! |
|
719 |
||
1470 | 720 |
fullClassNameOfChange:nr |
721 |
^ (changeSet at:nr) className |
|
722 |
||
723 |
"Created: / 6.2.1998 / 13:02:25 / cg" |
|
724 |
"Modified: / 6.2.1998 / 13:07:02 / cg" |
|
725 |
! |
|
726 |
||
3203 | 727 |
isChangeSetBrowser |
728 |
^ true |
|
729 |
! |
|
730 |
||
224 | 731 |
numberOfChanges |
732 |
^ changeSet size |
|
733 |
||
734 |
"Created: 3.12.1995 / 18:15:56 / cg" |
|
735 |
! |
|
736 |
||
222 | 737 |
queryCloseText |
738 |
^ 'Quit without updating changeSet ?' |
|
739 |
! |
|
740 |
||
45 | 741 |
readChangesFileInBackground:dummy |
30 | 742 |
"read the changeSet, create a list of header-lines" |
743 |
||
3673 | 744 |
|tabSpec| |
30 | 745 |
|
746 |
self withCursor:(Cursor read) do:[ |
|
3673 | 747 |
changeSet size == 0 ifTrue:[ |
748 |
changeFileName notNil ifTrue:[ |
|
749 |
changeSet := self class readXMLChangesFromFile:changeFileName inBackground:false. |
|
750 |
]. |
|
751 |
]. |
|
752 |
changeSet size == 0 ifTrue:[ |
|
753 |
^ nil |
|
754 |
]. |
|
755 |
||
756 |
tabSpec := TabulatorSpecification new. |
|
757 |
tabSpec unit:#inch. |
|
758 |
tabSpec positions:#(-1 0 5 8.5 ). |
|
759 |
" +/- cls>>sel type info" |
|
760 |
tabSpec align: #(#left #left #left #left). |
|
30 | 761 |
|
3673 | 762 |
changeChunks := OrderedCollection new. |
763 |
changeHeaderLines := OrderedCollection new. |
|
764 |
||
765 |
changeSet do:[:aChange | |entry| |
|
766 |
changeChunks add:(aChange printString). |
|
767 |
"/ changeHeaderLines add:(aChange printString) |
|
768 |
entry := MultiColListEntry new. |
|
769 |
entry tabulatorSpecification:tabSpec. |
|
770 |
entry colAt:1 put:''. "/ changeDelta. |
|
771 |
entry colAt:2 put:aChange printString. |
|
772 |
entry colAt:3 put:''. "/ changeType. |
|
773 |
||
774 |
(aChange respondsTo:#timeOfChangeIfKnown) ifTrue:[ |
|
775 |
aChange timeOfChangeIfKnown notNil ifTrue:[ |
|
776 |
entry colAt:4 put:(aChange timeOfChangeIfKnown printString). |
|
777 |
] |
|
778 |
]. |
|
779 |
changeHeaderLines add:entry |
|
780 |
]. |
|
781 |
changeClassNames := OrderedCollection new:(changeChunks size). |
|
782 |
anyChanges := false |
|
224 | 783 |
]. |
784 |
self newLabel:''. |
|
785 |
||
786 |
"Created: 3.12.1995 / 18:02:39 / cg" |
|
30 | 787 |
! |
788 |
||
3364 | 789 |
realClassNameOfChange:nr |
790 |
^ (changeSet at:nr) className. |
|
791 |
||
792 |
"Created: / 5.11.2001 / 18:10:38 / cg" |
|
793 |
! |
|
794 |
||
30 | 795 |
saveBackChanges |
796 |
"save back the change set" |
|
797 |
||
798 |
[originalChangeSet isEmpty] whileFalse:[ |
|
45 | 799 |
originalChangeSet removeLast |
30 | 800 |
]. |
801 |
changeSet do:[:aChange | |
|
45 | 802 |
originalChangeSet add:aChange |
30 | 803 |
] |
804 |
! |
|
805 |
||
1470 | 806 |
selectorOfMethodChange:changeNr |
807 |
^ (changeSet at:changeNr) selector |
|
808 |
||
809 |
"Created: / 6.2.1998 / 13:28:20 / cg" |
|
810 |
"Modified: / 6.2.1998 / 13:29:59 / cg" |
|
811 |
! |
|
812 |
||
30 | 813 |
silentDeleteChange:changeNr |
814 |
"delete a change do not update changeListView" |
|
815 |
||
1474 | 816 |
changeSet removeIndex:changeNr. |
817 |
super silentDeleteChange:changeNr. |
|
818 |
||
819 |
"Created: / 3.12.1995 / 18:14:17 / cg" |
|
820 |
"Modified: / 7.2.1998 / 19:57:57 / cg" |
|
821 |
! |
|
224 | 822 |
|
1474 | 823 |
silentDeleteInternalChange:changeNr |
824 |
"delete a change do not update changeListView" |
|
825 |
||
826 |
changeSet removeIndex:changeNr. |
|
827 |
super silentDeleteInternalChange:changeNr. |
|
828 |
||
829 |
"Modified: / 7.2.1998 / 19:44:45 / cg" |
|
830 |
"Created: / 7.2.1998 / 19:58:02 / cg" |
|
222 | 831 |
! |
832 |
||
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
833 |
sourceOfChange:changeNr |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
834 |
"answer a changes source" |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
835 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
836 |
|change| |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
837 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
838 |
change := changeSet at:changeNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
839 |
change isNil ifTrue:[^nil]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
840 |
^ change source |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
841 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
842 |
"Modified: / 7.2.1998 / 19:52:44 / cg" |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
843 |
! |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
844 |
|
222 | 845 |
streamForChange:changeNr |
846 |
"answer a stream for change" |
|
847 |
||
1474 | 848 |
|change s| |
222 | 849 |
|
850 |
change := changeSet at:changeNr. |
|
851 |
change isNil ifTrue:[^nil]. |
|
1474 | 852 |
change isMethodChange ifTrue:[ |
853 |
s := '!!' , change className , |
|
854 |
' methodsFor:''' , change methodCategory , '''!!\' withCRs , |
|
855 |
change source , '\' withCRs , '!! !!\' withCRs. |
|
856 |
^ ReadStream on:s |
|
857 |
]. |
|
222 | 858 |
^ ReadStream on:(change source) |
1474 | 859 |
|
860 |
"Modified: / 7.2.1998 / 19:52:44 / cg" |
|
30 | 861 |
! ! |
862 |
||
863 |
!ChangeSetBrowser methodsFor:'user actions'! |
|
864 |
||
4316 | 865 |
doInspectChange |
866 |
self withSelectedChangesDo:[:changeNr | |
|
867 |
(changeSet at:changeNr) inspect |
|
868 |
]. |
|
869 |
! |
|
870 |
||
30 | 871 |
doSaveBack |
872 |
anyChanges ifTrue:[ |
|
45 | 873 |
self saveBackChanges. |
874 |
self doUpdate |
|
30 | 875 |
] |
222 | 876 |
! |
877 |
||
878 |
doUpdate |
|
879 |
changeSet := OrderedCollection new. |
|
880 |
originalChangeSet notNil ifTrue:[ |
|
881 |
originalChangeSet do:[:aChange | |
|
882 |
changeSet add:aChange |
|
883 |
]. |
|
884 |
]. |
|
885 |
super doUpdate |
|
886 |
||
887 |
"Created: 3.12.1995 / 13:54:14 / cg" |
|
30 | 888 |
! ! |
222 | 889 |
|
890 |
!ChangeSetBrowser class methodsFor:'documentation'! |
|
891 |
||
892 |
version |
|
4316 | 893 |
^ '$Header: /cvs/stx/stx/libtool/ChangeSetBrowser.st,v 1.30 2002-11-26 13:53:50 cg Exp $' |
222 | 894 |
! ! |