author | Claus Gittinger <cg@exept.de> |
Mon, 11 Nov 2002 10:39:47 +0100 | |
changeset 4232 | 88e1552f4da9 |
parent 3898 | faeed72d6eb1 |
child 4279 | 1fbb8fa63669 |
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: '-' |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
392 |
#isVisible: #notReadOnly |
3203 | 393 |
) |
394 |
#(#MenuItem |
|
395 |
#label: 'Previous Snapshot' |
|
396 |
#translateLabel: true |
|
3554 | 397 |
#isVisible: #notReadOnly |
3203 | 398 |
#value: #findPreviousSnapshot |
399 |
#enabled: #hasSelection |
|
400 |
) |
|
401 |
#(#MenuItem |
|
402 |
#label: 'Next Snapshot' |
|
403 |
#translateLabel: true |
|
3554 | 404 |
#isVisible: #notReadOnly |
3203 | 405 |
#value: #findNextSnapshot |
406 |
#enabled: #hasSelection |
|
407 |
) |
|
408 |
) |
|
409 |
nil |
|
410 |
nil |
|
411 |
) |
|
412 |
) |
|
413 |
#(#MenuItem |
|
3554 | 414 |
#label: 'Browse' |
3203 | 415 |
#translateLabel: true |
416 |
#submenu: |
|
417 |
#(#Menu |
|
418 |
#( |
|
419 |
#(#MenuItem |
|
3554 | 420 |
#label: 'Class' |
3203 | 421 |
#translateLabel: true |
3554 | 422 |
#value: #doBrowse |
423 |
#enabled: #hasSingleSelection |
|
3203 | 424 |
) |
425 |
#(#MenuItem |
|
426 |
#label: '-' |
|
427 |
) |
|
428 |
#(#MenuItem |
|
3554 | 429 |
#label: 'Senders...' |
3203 | 430 |
#translateLabel: true |
3554 | 431 |
#value: #doBrowseSenders |
3203 | 432 |
) |
433 |
#(#MenuItem |
|
3554 | 434 |
#label: 'Implementors...' |
3203 | 435 |
#translateLabel: true |
3554 | 436 |
#value: #doBrowseImplementors |
3203 | 437 |
) |
438 |
) |
|
439 |
nil |
|
440 |
nil |
|
441 |
) |
|
442 |
) |
|
443 |
#(#MenuItem |
|
444 |
#label: 'Settings' |
|
445 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
446 |
#isVisible: #notReadOnly |
3203 | 447 |
#submenu: |
448 |
#(#Menu |
|
449 |
#( |
|
450 |
#(#MenuItem |
|
451 |
#label: 'Auto Compare' |
|
452 |
#translateLabel: true |
|
3554 | 453 |
#isVisible: #notReadOnly |
3203 | 454 |
#indication: #autoCompare |
455 |
) |
|
456 |
#(#MenuItem |
|
457 |
#label: 'Auto Update' |
|
458 |
#translateLabel: true |
|
3554 | 459 |
#isVisible: #notReadOnly |
3203 | 460 |
#indication: #autoUpdate |
461 |
) |
|
462 |
#(#MenuItem |
|
463 |
#label: '-' |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
464 |
#isVisible: #notReadOnly |
3203 | 465 |
) |
466 |
#(#MenuItem |
|
467 |
#label: 'Apply in Original NameSpace' |
|
468 |
#translateLabel: true |
|
3554 | 469 |
#isVisible: #notReadOnly |
3203 | 470 |
#indication: #applyInOriginalNameSpace |
471 |
) |
|
472 |
) |
|
473 |
nil |
|
474 |
nil |
|
475 |
) |
|
476 |
) |
|
477 |
#(#MenuItem |
|
478 |
#label: 'Help' |
|
479 |
#translateLabel: true |
|
480 |
#startGroup: #right |
|
481 |
#submenu: |
|
482 |
#(#Menu |
|
483 |
#( |
|
484 |
#(#MenuItem |
|
485 |
#label: 'ChangesBrowser Documentation' |
|
486 |
#translateLabel: true |
|
487 |
#value: #openHTMLDocument: |
|
488 |
#argument: 'tools/cbrowser/TOP.html' |
|
489 |
) |
|
3205 | 490 |
#(#MenuItem |
491 |
#label: '-' |
|
492 |
) |
|
493 |
#(#MenuItem |
|
494 |
#label: 'About ChangesBrowser...' |
|
495 |
#translateLabel: true |
|
496 |
#value: #openAboutThisApplication |
|
497 |
) |
|
3203 | 498 |
) |
499 |
nil |
|
500 |
nil |
|
501 |
) |
|
502 |
) |
|
503 |
) |
|
504 |
nil |
|
505 |
nil |
|
506 |
) |
|
507 |
! ! |
|
508 |
||
30 | 509 |
!ChangeSetBrowser methodsFor:'initialize / release'! |
510 |
||
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
511 |
askIfChangesAreToBeWrittenBack |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
512 |
|action| |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
513 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
514 |
anyChanges ifFalse:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
515 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
516 |
action := OptionBox |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
517 |
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
|
518 |
label:'ChangesBrowser' |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
519 |
form:(WarningBox iconBitmap) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
520 |
buttonLabels:(resources array:#('Cancel' 'Don''t Update' 'Update')) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
521 |
values:#(#abort #ignore #save) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
522 |
default:#save |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
523 |
onCancel:#abort. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
524 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
525 |
action == #abort ifTrue:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
526 |
action == #save ifTrue:[ |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
527 |
self saveBackChanges |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
528 |
]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
529 |
! |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
530 |
|
224 | 531 |
changeListMenu |
3203 | 532 |
<resource: #programMenu > |
533 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
534 |
|items m| |
30 | 535 |
|
3203 | 536 |
items := #( |
537 |
('Apply' doApply) |
|
538 |
('Apply to End' doApplyRest) |
|
539 |
('Apply All changes' doApplyAll) |
|
540 |
('-' ) |
|
541 |
('Delete' doDelete) |
|
542 |
('Delete to End' doDeleteRest) |
|
543 |
('Delete for Class to End' doDeleteClassRest) |
|
544 |
('Delete All for Class' doDeleteClassAll) |
|
545 |
('-' ) |
|
546 |
"/ ('compress' doCompress) |
|
547 |
('Compare with Current' doCompare) |
|
548 |
('-' ) |
|
549 |
('Make Change a Patch' doMakePatch) |
|
550 |
"/ ('update sourcefile from change' doMakePermanent) |
|
551 |
('-' ) |
|
552 |
('Saveback ChangeSet' doSaveBack) |
|
553 |
('-' ) |
|
554 |
('Update' doUpdate) |
|
555 |
). |
|
224 | 556 |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
557 |
m := PopUpMenu |
3203 | 558 |
itemList:items |
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
559 |
resources:resources. |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
560 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
561 |
readOnly == true ifTrue:[ |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
562 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
563 |
doDeleteClassAndPrivateClassesAll doCompress |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
564 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
565 |
doWriteBack doSaveBack doUpdate |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
566 |
doApplyAll doApplyRest) |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
567 |
]. |
3228 | 568 |
|
569 |
self hasSelection ifTrue:[ |
|
570 |
m disable:#doApplyAll |
|
571 |
]. |
|
572 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
573 |
^ m |
224 | 574 |
|
575 |
"Created: 3.12.1995 / 18:06:35 / cg" |
|
576 |
"Modified: 3.12.1995 / 18:13:06 / cg" |
|
30 | 577 |
! ! |
578 |
||
3857 | 579 |
!ChangeSetBrowser methodsFor:'menu aspects'! |
580 |
||
581 |
hasNotUndoableChangeSelected |
|
582 |
^ (self hasUndoableMethodChangeSelected |
|
583 |
or:[self hasUndoableRemoveMethodChangeSelected]) not |
|
584 |
! |
|
585 |
||
586 |
hasUndoableMethodChangeSelected |
|
587 |
|nr chg| |
|
588 |
||
589 |
self hasSingleSelection ifTrue:[ |
|
590 |
nr := self theSingleSelection. |
|
591 |
nr notNil ifTrue:[ |
|
592 |
chg := changeSet at:nr. |
|
593 |
chg isMethodChange ifTrue:[ |
|
594 |
chg isMethodRemoveChange ifFalse:[ |
|
595 |
chg previousVersion notNil ifTrue:[ |
|
596 |
^ true |
|
597 |
] |
|
598 |
] |
|
599 |
] |
|
600 |
] |
|
601 |
]. |
|
602 |
^ false |
|
603 |
! |
|
604 |
||
605 |
hasUndoableRemoveMethodChangeSelected |
|
606 |
|nr chg| |
|
607 |
||
608 |
self hasSingleSelection ifTrue:[ |
|
609 |
nr := self theSingleSelection. |
|
610 |
nr notNil ifTrue:[ |
|
611 |
chg := changeSet at:nr. |
|
612 |
chg isMethodRemoveChange ifTrue:[ |
|
613 |
chg previousVersion notNil ifTrue:[ |
|
614 |
^ true |
|
615 |
] |
|
616 |
] |
|
617 |
] |
|
618 |
]. |
|
619 |
^ false |
|
620 |
! ! |
|
621 |
||
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
622 |
!ChangeSetBrowser methodsFor:'private'! |
1474 | 623 |
|
624 |
applyChange:changeNr |
|
625 |
"fileIn a change" |
|
626 |
||
627 |
|nm applyAction| |
|
628 |
||
629 |
nm := self classNameOfChange:changeNr. |
|
630 |
nm notNil ifTrue:[ |
|
631 |
|cls| |
|
632 |
||
633 |
cls := Smalltalk at:(nm asSymbol) ifAbsent:[]. |
|
634 |
cls notNil ifTrue:[ |
|
635 |
cls isLoaded ifFalse:[ |
|
636 |
cls autoload |
|
637 |
] |
|
638 |
] |
|
639 |
]. |
|
640 |
||
641 |
changeNrProcessed := changeNr. |
|
642 |
||
643 |
applyAction := [ |
|
644 |
|sig| |
|
645 |
||
646 |
(skipSignal notNil) ifTrue:[ |
|
647 |
sig := skipSignal |
|
648 |
] ifFalse:[ |
|
649 |
sig := Object abortSignal |
|
650 |
]. |
|
651 |
sig catch:[ |
|
3276 | 652 |
(changeSet at:changeNr) apply. |
1474 | 653 |
]. |
654 |
changeNrProcessed := nil. |
|
655 |
]. |
|
656 |
||
657 |
"/ |
|
658 |
"/ if I am showing the changes file, dont update it |
|
659 |
"/ |
|
660 |
changeFileName = ObjectMemory nameForChanges ifTrue:[ |
|
661 |
Class withoutUpdatingChangesDo:applyAction |
|
662 |
] ifFalse:[ |
|
663 |
applyAction value |
|
664 |
]. |
|
665 |
||
666 |
"Created: / 7.2.1998 / 19:32:35 / cg" |
|
667 |
"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
|
668 |
! |
30 | 669 |
|
1470 | 670 |
changeIsFollowupMethodChange:changeNr |
671 |
^ false |
|
672 |
||
673 |
"Created: / 6.2.1998 / 13:04:59 / cg" |
|
1474 | 674 |
"Modified: / 7.2.1998 / 19:28:52 / cg" |
1470 | 675 |
! |
676 |
||
30 | 677 |
changeSet:aChangeSet |
678 |
originalChangeSet := aChangeSet. |
|
679 |
changeSet := OrderedCollection new. |
|
106 | 680 |
originalChangeSet notNil ifTrue:[ |
681 |
originalChangeSet do:[:aChange | |
|
682 |
changeSet add:aChange |
|
683 |
]. |
|
30 | 684 |
]. |
685 |
! |
|
686 |
||
222 | 687 |
checkIfFileHasChanged |
688 |
Processor removeTimedBlock:checkBlock. |
|
689 |
changeSet size ~= originalChangeSet size ifTrue:[ |
|
690 |
self newLabel:'(outdated)'. |
|
3203 | 691 |
autoUpdate value ifTrue:[ |
222 | 692 |
self doUpdate |
693 |
] |
|
694 |
] ifFalse:[ |
|
695 |
self newLabel:'' |
|
696 |
]. |
|
697 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
|
698 |
||
699 |
"Created: 3.12.1995 / 13:52:30 / cg" |
|
700 |
"Modified: 3.12.1995 / 14:15:06 / cg" |
|
701 |
! |
|
702 |
||
1470 | 703 |
fullClassNameOfChange:nr |
704 |
^ (changeSet at:nr) className |
|
705 |
||
706 |
"Created: / 6.2.1998 / 13:02:25 / cg" |
|
707 |
"Modified: / 6.2.1998 / 13:07:02 / cg" |
|
708 |
! |
|
709 |
||
3203 | 710 |
isChangeSetBrowser |
711 |
^ true |
|
712 |
! |
|
713 |
||
224 | 714 |
numberOfChanges |
715 |
^ changeSet size |
|
716 |
||
717 |
"Created: 3.12.1995 / 18:15:56 / cg" |
|
718 |
! |
|
719 |
||
222 | 720 |
queryCloseText |
721 |
^ 'Quit without updating changeSet ?' |
|
722 |
! |
|
723 |
||
45 | 724 |
readChangesFileInBackground:dummy |
30 | 725 |
"read the changeSet, create a list of header-lines" |
726 |
||
3673 | 727 |
|tabSpec| |
30 | 728 |
|
729 |
self withCursor:(Cursor read) do:[ |
|
3673 | 730 |
changeSet size == 0 ifTrue:[ |
731 |
changeFileName notNil ifTrue:[ |
|
732 |
changeSet := self class readXMLChangesFromFile:changeFileName inBackground:false. |
|
733 |
]. |
|
734 |
]. |
|
735 |
changeSet size == 0 ifTrue:[ |
|
736 |
^ nil |
|
737 |
]. |
|
738 |
||
739 |
tabSpec := TabulatorSpecification new. |
|
740 |
tabSpec unit:#inch. |
|
741 |
tabSpec positions:#(-1 0 5 8.5 ). |
|
742 |
" +/- cls>>sel type info" |
|
743 |
tabSpec align: #(#left #left #left #left). |
|
30 | 744 |
|
3673 | 745 |
changeChunks := OrderedCollection new. |
746 |
changeHeaderLines := OrderedCollection new. |
|
747 |
||
748 |
changeSet do:[:aChange | |entry| |
|
749 |
changeChunks add:(aChange printString). |
|
750 |
"/ changeHeaderLines add:(aChange printString) |
|
751 |
entry := MultiColListEntry new. |
|
752 |
entry tabulatorSpecification:tabSpec. |
|
753 |
entry colAt:1 put:''. "/ changeDelta. |
|
754 |
entry colAt:2 put:aChange printString. |
|
755 |
entry colAt:3 put:''. "/ changeType. |
|
756 |
||
757 |
(aChange respondsTo:#timeOfChangeIfKnown) ifTrue:[ |
|
758 |
aChange timeOfChangeIfKnown notNil ifTrue:[ |
|
759 |
entry colAt:4 put:(aChange timeOfChangeIfKnown printString). |
|
760 |
] |
|
761 |
]. |
|
762 |
changeHeaderLines add:entry |
|
763 |
]. |
|
764 |
changeClassNames := OrderedCollection new:(changeChunks size). |
|
765 |
anyChanges := false |
|
224 | 766 |
]. |
767 |
self newLabel:''. |
|
768 |
||
769 |
"Created: 3.12.1995 / 18:02:39 / cg" |
|
30 | 770 |
! |
771 |
||
3364 | 772 |
realClassNameOfChange:nr |
773 |
^ (changeSet at:nr) className. |
|
774 |
||
775 |
"Created: / 5.11.2001 / 18:10:38 / cg" |
|
776 |
! |
|
777 |
||
30 | 778 |
saveBackChanges |
779 |
"save back the change set" |
|
780 |
||
781 |
[originalChangeSet isEmpty] whileFalse:[ |
|
45 | 782 |
originalChangeSet removeLast |
30 | 783 |
]. |
784 |
changeSet do:[:aChange | |
|
45 | 785 |
originalChangeSet add:aChange |
30 | 786 |
] |
787 |
! |
|
788 |
||
1470 | 789 |
selectorOfMethodChange:changeNr |
790 |
^ (changeSet at:changeNr) selector |
|
791 |
||
792 |
"Created: / 6.2.1998 / 13:28:20 / cg" |
|
793 |
"Modified: / 6.2.1998 / 13:29:59 / cg" |
|
794 |
! |
|
795 |
||
30 | 796 |
silentDeleteChange:changeNr |
797 |
"delete a change do not update changeListView" |
|
798 |
||
1474 | 799 |
changeSet removeIndex:changeNr. |
800 |
super silentDeleteChange:changeNr. |
|
801 |
||
802 |
"Created: / 3.12.1995 / 18:14:17 / cg" |
|
803 |
"Modified: / 7.2.1998 / 19:57:57 / cg" |
|
804 |
! |
|
224 | 805 |
|
1474 | 806 |
silentDeleteInternalChange:changeNr |
807 |
"delete a change do not update changeListView" |
|
808 |
||
809 |
changeSet removeIndex:changeNr. |
|
810 |
super silentDeleteInternalChange:changeNr. |
|
811 |
||
812 |
"Modified: / 7.2.1998 / 19:44:45 / cg" |
|
813 |
"Created: / 7.2.1998 / 19:58:02 / cg" |
|
222 | 814 |
! |
815 |
||
3785
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
816 |
sourceOfChange:changeNr |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
817 |
"answer a changes source" |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
818 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
819 |
|change| |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
820 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
821 |
change := changeSet at:changeNr. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
822 |
change isNil ifTrue:[^nil]. |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
823 |
^ change source |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
824 |
|
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
825 |
"Modified: / 7.2.1998 / 19:52:44 / cg" |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
826 |
! |
741890c870a4
oops - exclas in changeSetBrowsers method source
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
827 |
|
222 | 828 |
streamForChange:changeNr |
829 |
"answer a stream for change" |
|
830 |
||
1474 | 831 |
|change s| |
222 | 832 |
|
833 |
change := changeSet at:changeNr. |
|
834 |
change isNil ifTrue:[^nil]. |
|
1474 | 835 |
change isMethodChange ifTrue:[ |
836 |
s := '!!' , change className , |
|
837 |
' methodsFor:''' , change methodCategory , '''!!\' withCRs , |
|
838 |
change source , '\' withCRs , '!! !!\' withCRs. |
|
839 |
^ ReadStream on:s |
|
840 |
]. |
|
222 | 841 |
^ ReadStream on:(change source) |
1474 | 842 |
|
843 |
"Modified: / 7.2.1998 / 19:52:44 / cg" |
|
30 | 844 |
! ! |
845 |
||
846 |
!ChangeSetBrowser methodsFor:'user actions'! |
|
847 |
||
848 |
doSaveBack |
|
849 |
anyChanges ifTrue:[ |
|
45 | 850 |
self saveBackChanges. |
851 |
self doUpdate |
|
30 | 852 |
] |
222 | 853 |
! |
854 |
||
855 |
doUpdate |
|
856 |
changeSet := OrderedCollection new. |
|
857 |
originalChangeSet notNil ifTrue:[ |
|
858 |
originalChangeSet do:[:aChange | |
|
859 |
changeSet add:aChange |
|
860 |
]. |
|
861 |
]. |
|
862 |
super doUpdate |
|
863 |
||
864 |
"Created: 3.12.1995 / 13:54:14 / cg" |
|
30 | 865 |
! ! |
222 | 866 |
|
867 |
!ChangeSetBrowser class methodsFor:'documentation'! |
|
868 |
||
869 |
version |
|
4232 | 870 |
^ '$Header: /cvs/stx/stx/libtool/ChangeSetBrowser.st,v 1.28 2002-11-11 09:39:47 cg Exp $' |
222 | 871 |
! ! |