author | Stefan Vogel <sv@exept.de> |
Thu, 04 Dec 2003 12:54:00 +0100 | |
changeset 5396 | d924769c9cc4 |
parent 5395 | ff5fc88d4a4b |
child 6288 | 4767ba5caf5b |
permissions | -rw-r--r-- |
2740
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
1 |
"{ Package: 'stx:libtool' }" |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2 |
|
1545 | 3 |
ToolApplicationModel subclass:#NewChangesBrowser |
1546 | 4 |
instanceVariableNames:'changes changeFileName skipSignal changeFileTimestamp |
5 |
autoUpdateBlock filterCompletionBlock editingClassSource modified' |
|
1545 | 6 |
classVariableNames:'AutoUpdate CompressSnapshotInfo CategoryColumn DeltaInfoColumn |
1568 | 7 |
TypeColumn TimeStampColumn PositionsColumn PrivateAsSeparate' |
1545 | 8 |
poolDictionaries:'' |
9 |
category:'Interface-Browsers' |
|
10 |
! |
|
11 |
||
12 |
Object subclass:#Change |
|
1568 | 13 |
instanceVariableNames:'delta string type timeStamp category chunk lastPosition position |
14 |
className followUp' |
|
1545 | 15 |
classVariableNames:'' |
16 |
poolDictionaries:'' |
|
17 |
privateIn:NewChangesBrowser |
|
18 |
! |
|
19 |
||
20 |
!NewChangesBrowser class methodsFor:'documentation'! |
|
21 |
||
22 |
documentation |
|
23 |
" |
|
24 |
The future Changes Browser. |
|
25 |
||
26 |
[start with:] |
|
2250 | 27 |
NewChangesBrowser open |
28 |
NewChangesBrowser openOnFile:aFileName |
|
1545 | 29 |
|
30 |
[author:] |
|
2250 | 31 |
Thomas Zwick, eXept Software AG |
1545 | 32 |
" |
33 |
||
34 |
||
35 |
! ! |
|
36 |
||
37 |
!NewChangesBrowser class methodsFor:'instance creation'! |
|
38 |
||
1938 | 39 |
openOn:aFileName |
40 |
"opens a Changes Browser with the changes of the aFileName" |
|
41 |
||
42 |
^self openOnFile:aFileName |
|
43 |
||
44 |
"Created: / 17.10.1998 / 14:41:28 / cg" |
|
45 |
! |
|
46 |
||
1545 | 47 |
openOnFile:aFileName |
1546 | 48 |
"opens a Changes Browser with the changes of the aFileName" |
49 |
||
50 |
^self new |
|
2250 | 51 |
changeFileName:aFileName; |
52 |
open |
|
1545 | 53 |
|
54 |
! ! |
|
55 |
||
56 |
!NewChangesBrowser class methodsFor:'accessing'! |
|
57 |
||
58 |
autoSelectNext |
|
1546 | 59 |
"returns true here, makes a Delete operation automatically |
1545 | 60 |
select the next change" |
61 |
||
62 |
^ true |
|
63 |
||
64 |
||
65 |
! |
|
66 |
||
67 |
label |
|
1546 | 68 |
"returns my label" |
1545 | 69 |
|
70 |
^'Changes Browser' |
|
71 |
! ! |
|
72 |
||
73 |
!NewChangesBrowser class methodsFor:'help specs'! |
|
74 |
||
75 |
helpSpec |
|
76 |
"This resource specification was automatically generated |
|
77 |
by the UIHelpTool of ST/X." |
|
78 |
||
79 |
"Do not manually edit this!! If it is corrupted, |
|
80 |
the UIHelpTool may not be able to read the specification." |
|
81 |
||
82 |
" |
|
83 |
UIHelpTool openOnClass:NewChangesBrowser |
|
84 |
" |
|
85 |
||
86 |
<resource: #help> |
|
87 |
||
88 |
^super helpSpec addPairsFrom:#( |
|
89 |
||
90 |
#applyAll |
|
1650 | 91 |
'Apply all changes.' |
1545 | 92 |
|
93 |
#applyForClassToEnd |
|
1650 | 94 |
'Apply changes to the end which affect this class.' |
1545 | 95 |
|
96 |
#applyFromLastSnapshot |
|
1650 | 97 |
'Apply changes from the last snapshot to the end.' |
1545 | 98 |
|
99 |
#applyLine |
|
100 |
'Apply the selected change.' |
|
101 |
||
102 |
#applyToEnd |
|
1650 | 103 |
'Apply all changes from the selected one to the end.' |
1545 | 104 |
|
1546 | 105 |
#deleteAll |
1650 | 106 |
'Deletes all changes.' |
1546 | 107 |
|
1545 | 108 |
#deleteCompress |
1650 | 109 |
'Deletes all obsolete changes.' |
1545 | 110 |
|
111 |
#deleteCompressForClass |
|
1650 | 112 |
'Deletes obsolete changes for this class, leaving the last one.' |
1545 | 113 |
|
114 |
#deleteForClassToEnd |
|
1650 | 115 |
'Deletes changes for this class from the selection to the end.' |
1545 | 116 |
|
117 |
#deleteLine |
|
1650 | 118 |
'Deletes the selected change.' |
1545 | 119 |
|
120 |
#deleteToEnd |
|
1650 | 121 |
'Deletes changes from the selected one to the end.' |
1545 | 122 |
|
1556 | 123 |
#fileLoad |
1650 | 124 |
'Opens a dialog for selecting and loading another changes file.' |
1545 | 125 |
|
126 |
#fileReload |
|
127 |
'Reloads the changes file (undo your modifications).' |
|
128 |
||
129 |
#fileSave |
|
1650 | 130 |
'Saves the list of changes into the current changes file.' |
1545 | 131 |
|
1556 | 132 |
#filterField |
1650 | 133 |
'Matching patterns filtering the changes (separate patterns by blanks).' |
1556 | 134 |
|
1545 | 135 |
#settingsAutoUpdate |
1650 | 136 |
'Toggle automatic update.' |
1545 | 137 |
|
138 |
#settingsColumns |
|
1650 | 139 |
'Configure which columns are shown in the list.' |
1545 | 140 |
|
141 |
#settingsColumnsCategory |
|
1650 | 142 |
'Toggle display of the changes category in the list.' |
1545 | 143 |
|
144 |
#settingsColumnsDeltaInfo |
|
1650 | 145 |
'Toggle display of the delta-info in the list.' |
1545 | 146 |
|
147 |
#settingsColumnsPosition |
|
1650 | 148 |
'Togle display of the changes file-position in the list.' |
1545 | 149 |
|
150 |
#settingsColumnsTimeStamp |
|
1650 | 151 |
'Toggle display of the changes time stamp in the list.' |
1545 | 152 |
|
153 |
#settingsColumnsType |
|
1650 | 154 |
'Toggle display of the change-type in the list.' |
1545 | 155 |
|
1546 | 156 |
#settingsPrivateAsSeparate |
1650 | 157 |
'Toggle if changes for private private are included when applying, deleting, or compressing for a class.' |
1546 | 158 |
|
1545 | 159 |
#testCompareWithCurrentVersion |
1650 | 160 |
'Opens a info dialog showing the difference between the changes code and the method current code.' |
1545 | 161 |
|
162 |
#testFindLastSnapshot |
|
1650 | 163 |
'Searches backward for the latest snapshot entry.' |
1545 | 164 |
|
165 |
#testFindNextSnapshot |
|
1650 | 166 |
'Searches forward for the next snapshot entry.' |
1545 | 167 |
|
168 |
) |
|
1650 | 169 |
|
170 |
"Modified: / 19.5.1998 / 17:59:39 / cg" |
|
1545 | 171 |
! ! |
172 |
||
173 |
!NewChangesBrowser class methodsFor:'image specs'! |
|
174 |
||
175 |
applyFromLastSnapshotIcon |
|
176 |
"This resource specification was automatically generated |
|
177 |
by the ImageEditor of ST/X." |
|
178 |
||
179 |
"Do not manually edit this!! If it is corrupted, |
|
180 |
the ImageEditor may not be able to read the specification." |
|
181 |
||
182 |
" |
|
183 |
ImageEditor openOnClass:self andSelector:#applyFromLastSnapshotIcon |
|
184 |
" |
|
185 |
||
186 |
<resource: #image> |
|
187 |
||
188 |
^Icon |
|
2250 | 189 |
constantNamed:#'NewChangesBrowser applyFromLastSnapshotIcon' |
3220 | 190 |
ifAbsentPut:[(Depth4Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@QDQ<@@@@@@@@@@AH"H@@@@@@@@@@@D"H @@@@@@@@@@@RH"@@@@@@@@@@@AH"H@@@@@@@@@@@@@@@@@@@@@@@@@<@@@@@@@@@@@@@@@@@@@@@@@;.;.; @@@@@@@@C.;.;.@@@@@@@@@@@@@@8@@N@@@@C?????C @@@N@@@O????<@@@8@@@@@@@@@C0@@@@8@@O????<O@@C @@@@?????0@@@@C @@@@@@@O@@@N@@@@DQDQDP<@C @@@@@_??DQ@@@@@@@@@A????D@@@@@@@@@DQDQDP@@@@C @@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127 127 127 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@C<@@C<@@C<@@C<@@C<@@A<@@D@@?<@@?<@@?<LC?<\C?<\C?<8O?08O?10O?10??C ??[@??_@?<^@?<_@?<_@') ; yourself); yourself] |
191 |
! |
|
1545 | 192 |
|
193 |
applyIcon |
|
194 |
"This resource specification was automatically generated |
|
195 |
by the ImageEditor of ST/X." |
|
196 |
||
197 |
"Do not manually edit this!! If it is corrupted, |
|
198 |
the ImageEditor may not be able to read the specification." |
|
199 |
||
200 |
" |
|
201 |
ImageEditor openOnClass:self andSelector:#applyIcon |
|
202 |
" |
|
203 |
||
204 |
<resource: #image> |
|
205 |
||
206 |
^Icon |
|
2250 | 207 |
constantNamed:#'NewChangesBrowser applyIcon' |
3220 | 208 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPUUUUUUUPUUUUUUU[UUUUUUUPP@@@@@@QQUUUUUTPQUUUUUTVQ**UUUTPQUUUUUTPQUUUUUTXQ***UUTPQ**UUUTPQ*****TPQ***%UTPQ****)TPQUUUUUTPQUUUUUTUP@@@@@@PUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUP') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 255 0 0]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8_??8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself] |
209 |
! |
|
1545 | 210 |
|
211 |
applyToEndIcon |
|
212 |
"This resource specification was automatically generated |
|
213 |
by the ImageEditor of ST/X." |
|
214 |
||
215 |
"Do not manually edit this!! If it is corrupted, |
|
216 |
the ImageEditor may not be able to read the specification." |
|
217 |
||
218 |
" |
|
219 |
ImageEditor openOnClass:self andSelector:#applyToEndIcon |
|
220 |
" |
|
221 |
||
222 |
<resource: #image> |
|
223 |
||
224 |
^Icon |
|
2250 | 225 |
constantNamed:#'NewChangesBrowser applyToEndIcon' |
3220 | 226 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@B** H@@@B** H@@@@@@ @@@@**( @@@@**(@J@@@@@H@@@@O??H@@@@O??@@@@@@@C@H@@C??3@@ @C??0@ @@@@@0@B@@UUT0B@K@UUT@@H@@@@D@H@CEUUDB@@JG?U@@@@MG?=@@@@@EUU@@B@@@@@@@@@H') ; colorMapFromArray:#[0 0 0 255 255 255 127 127 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@C?0@C?0@C?0@O?0@O?0@O?0@??@@??@@??LC?<\C?<\C?<8O?08O?10O?10??C ??[@??_@?<^@?<_@?<_@') ; yourself); yourself] |
227 |
! |
|
1545 | 228 |
|
229 |
compressIcon |
|
230 |
"This resource specification was automatically generated |
|
231 |
by the ImageEditor of ST/X." |
|
232 |
||
233 |
"Do not manually edit this!! If it is corrupted, |
|
234 |
the ImageEditor may not be able to read the specification." |
|
235 |
||
236 |
" |
|
237 |
ImageEditor openOnClass:self andSelector:#compressIcon |
|
238 |
" |
|
239 |
||
240 |
<resource: #image> |
|
241 |
||
242 |
^Icon |
|
2250 | 243 |
constantNamed:#'NewChangesBrowser compressIcon' |
3220 | 244 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@????<@@@:***(@@@8@@@8@@@8@@@8@@@@@@@8@@@@@@@8A@@@@@@8@@:**0@8HC**+@@8@@@@@@@8H@@@@@@8@@@@@@@8@@@@@@@8@@@@@@@8@@C????8@@C****(@@@@@@@@H@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[0 0 0 124 124 124 170 170 170 255 255 255]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@??0A??8A??8A??8A8A8G>A8@@A8G?98O?18_?!!8??A8@@A8G>A8@0A8C??8C??8C??8C??0@0@@D2@@G>@@D2@@') ; yourself); yourself] |
245 |
! |
|
1545 | 246 |
|
247 |
deleteIcon |
|
248 |
"This resource specification was automatically generated |
|
249 |
by the ImageEditor of ST/X." |
|
250 |
||
251 |
"Do not manually edit this!! If it is corrupted, |
|
252 |
the ImageEditor may not be able to read the specification." |
|
253 |
||
254 |
" |
|
255 |
ImageEditor openOnClass:self andSelector:#deleteIcon |
|
256 |
" |
|
257 |
||
258 |
<resource: #image> |
|
259 |
||
260 |
^Icon |
|
2250 | 261 |
constantNamed:#'NewChangesBrowser deleteIcon' |
3220 | 262 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@AUUUU@@OA??UU@@@AUUUU@@@AUUUU@B@A???U@H@A??5U@@@A???0@@@AUUUB@B@@@@@@@@@@@@@A@BK@@@@A_:@@@@@AO2G@@@@AL2@@@@@AL2C@@@@AL2@@@@@AL2@@@@@AL2H@@@@AL2@@@@@A\:@@@@@H_8 @@@@@@@H') ; colorMapFromArray:#[0 0 0 255 255 255 127 127 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?<@_?<@_?<P_?<P_?<X_?<X_?<H_? H_?O<_?XL@@_<@@_<@@_<@@_<@@_<@@_<@@_<@@_<@@_<@@_<@@_<@@G0') ; yourself); yourself] |
263 |
! |
|
1545 | 264 |
|
265 |
deleteToEndIcon |
|
266 |
"This resource specification was automatically generated |
|
267 |
by the ImageEditor of ST/X." |
|
268 |
||
269 |
"Do not manually edit this!! If it is corrupted, |
|
270 |
the ImageEditor may not be able to read the specification." |
|
271 |
||
272 |
" |
|
273 |
ImageEditor openOnClass:self andSelector:#deleteToEndIcon |
|
274 |
" |
|
275 |
||
276 |
<resource: #image> |
|
277 |
||
278 |
^Icon |
|
2250 | 279 |
constantNamed:#'NewChangesBrowser deleteToEndIcon' |
3220 | 280 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@B** @@O@B** @@@@@@@ @@@@??< @B@@??<@@H@@@@L@@@@EUUL@@@@G?U@B@B@G?=@@@@@EUU@A@BK@@@@A_:@@@@@AO2G@@@@AL2@@@@@AL2C@@@@AL2@@@@@AL2@@@@@AL2H@@@@AL2@@@@@A\:@@@@@H_8 @@@@@@@H') ; colorMapFromArray:#[0 0 0 255 255 255 127 127 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C?0@C?0@C?0PO?0PO?0XO?0X??@H??@H??O<?<XL?<_<?<_<@@_<@@_<@@_<@@_<@@_<@@_<@@_<@@_<@@_<@@G0') ; yourself); yourself] |
281 |
! |
|
1545 | 282 |
|
283 |
findLastSnapshotIcon |
|
284 |
"This resource specification was automatically generated |
|
285 |
by the ImageEditor of ST/X." |
|
286 |
||
287 |
"Do not manually edit this!! If it is corrupted, |
|
288 |
the ImageEditor may not be able to read the specification." |
|
289 |
||
290 |
" |
|
291 |
ImageEditor openOnClass:self andSelector:#findLastSnapshotIcon |
|
292 |
" |
|
293 |
||
294 |
<resource: #image> |
|
295 |
||
296 |
^Icon |
|
2250 | 297 |
constantNamed:#'NewChangesBrowser findLastSnapshotIcon' |
3220 | 298 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@EUUUW@A@F***(@@@F***(@@@F***(@@@F***(@@@F***(@@@F***(@@@F***(@A@F***(@M@F***(@H@F***(@@@F***(@@@F***(@I@L@@@@@@@@@@@@@A@P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C??@C??@C??@C??@C??@C??@C??@C??@C??@C??@C??@C??@C??@C??B@@@B@C@B@G B@O0@@_8@@G @@G @@G @') ; yourself); yourself] |
299 |
! |
|
1545 | 300 |
|
301 |
findNextSnapshotIcon |
|
302 |
"This resource specification was automatically generated |
|
303 |
by the ImageEditor of ST/X." |
|
304 |
||
305 |
"Do not manually edit this!! If it is corrupted, |
|
306 |
the ImageEditor may not be able to read the specification." |
|
307 |
||
308 |
" |
|
309 |
ImageEditor openOnClass:self andSelector:#findNextSnapshotIcon |
|
310 |
" |
|
311 |
||
312 |
<resource: #image> |
|
313 |
||
314 |
^Icon |
|
2250 | 315 |
constantNamed:#'NewChangesBrowser findNextSnapshotIcon' |
3220 | 316 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@DA@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@D@B@@@@@@@@@@@@@@@E@@@@@@@@@EUUUW@N@F***(@@@F***(@@@F***(@@@F***(@@@F***(@@@F***(@@@V***(@H@F***(@@@F***(@@@F***(@@@F***(@@@F***(@@@L@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@G @@G @@G @@_8@@O0@@G @@C@@@@@@C??@C??@C??@C??@C??@C??BC??BC??BC??BC??@C??@C??@C??@C??@') ; yourself); yourself] |
317 |
! ! |
|
1545 | 318 |
|
319 |
!NewChangesBrowser class methodsFor:'interface specs'! |
|
320 |
||
321 |
windowSpec |
|
322 |
"This resource specification was automatically generated |
|
323 |
by the UIPainter of ST/X." |
|
324 |
||
325 |
"Do not manually edit this!! If it is corrupted, |
|
326 |
the UIPainter may not be able to read the specification." |
|
327 |
||
328 |
" |
|
329 |
UIPainter new openOnClass:NewChangesBrowser andSelector:#windowSpec |
|
330 |
NewChangesBrowser new openInterface:#windowSpec |
|
331 |
NewChangesBrowser open |
|
332 |
" |
|
333 |
||
334 |
<resource: #canvas> |
|
335 |
||
336 |
^ |
|
337 |
||
338 |
#(#FullSpec |
|
2250 | 339 |
#window: |
340 |
#(#WindowSpec |
|
341 |
#name: 'Changes Browser' |
|
342 |
#layout: #(#LayoutFrame 53 0 92 0 687 0 583 0) |
|
343 |
#label: 'Changes Browser' |
|
344 |
#min: #(#Point 10 10) |
|
345 |
#max: #(#Point 1152 900) |
|
346 |
#bounds: #(#Rectangle 53 92 688 584) |
|
347 |
#menu: #menu |
|
348 |
#usePreferredExtent: false |
|
349 |
) |
|
350 |
#component: |
|
351 |
#(#SpecCollection |
|
352 |
#collection: |
|
353 |
#( |
|
354 |
#(#MenuPanelSpec |
|
355 |
#name: 'menuToolbarView' |
|
356 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
357 |
#menu: #menuToolbar |
|
358 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
359 |
#showSeparatingLines: true |
|
360 |
) |
|
361 |
#(#VariableVerticalPanelSpec |
|
362 |
#name: 'variableVerticalPanel1' |
|
363 |
#layout: #(#LayoutFrame 0 0.0 34 0 0 1.0 -26 1.0) |
|
364 |
#component: |
|
365 |
#(#SpecCollection |
|
366 |
#collection: |
|
367 |
#( |
|
368 |
#(#ViewSpec |
|
369 |
#name: 'Box1' |
|
370 |
#component: |
|
371 |
#(#SpecCollection |
|
372 |
#collection: |
|
373 |
#( |
|
374 |
#(#DataSetSpec |
|
375 |
#name: 'changesDataSetView' |
|
376 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -28 1.0) |
|
377 |
#model: #selectionOfChange |
|
378 |
#menu: #menuTable |
|
379 |
#hasHorizontalScrollBar: true |
|
380 |
#hasVerticalScrollBar: true |
|
381 |
#miniScrollerHorizontal: true |
|
382 |
#dataList: #listOfChanges |
|
383 |
#useIndex: false |
|
384 |
#has3Dsepartors: true |
|
385 |
#doubleClickSelector: #doBrowseClass |
|
386 |
#columnHolder: #listOfChangeColumns |
|
387 |
#valueChangeSelector: #changeSelected: |
|
388 |
) |
|
389 |
#(#ViewSpec |
|
390 |
#name: 'Box2' |
|
391 |
#layout: #(#LayoutFrame 0 0.0 -28 1 0 1.0 0 1.0) |
|
392 |
#component: |
|
393 |
#(#SpecCollection |
|
394 |
#collection: |
|
395 |
#( |
|
396 |
#(#LabelSpec |
|
397 |
#name: 'filterLabel' |
|
398 |
#layout: #(#AlignmentOrigin 37 0 13 0.0 1 0.5) |
|
399 |
#label: 'Filter:' |
|
400 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
401 |
#adjust: #left |
|
402 |
) |
|
403 |
#(#InputFieldSpec |
|
404 |
#name: 'filterField' |
|
405 |
#layout: #(#LayoutFrame 41 0.0 3 0 250 0 25 0) |
|
406 |
#activeHelpKey: #filterField |
|
407 |
#model: #valueOfFilter |
|
408 |
#immediateAccept: false |
|
409 |
) |
|
410 |
#(#ProgressIndicatorSpec |
|
411 |
#name: 'readProgressIndicator' |
|
412 |
#layout: #(#LayoutFrame 41 0 3 0 250 0 25 0) |
|
413 |
#model: #valueOfReadProgress |
|
414 |
#foregroundColor: #(#Color 0.0 60.0 60.0) |
|
415 |
) |
|
416 |
#(#ActionButtonSpec |
|
417 |
#name: 'allButton' |
|
418 |
#layout: #(#LayoutFrame 258 0.0 2 0.0 268 0 13 0) |
|
419 |
#label: ' ' |
|
420 |
#model: #doFilter: |
|
421 |
) |
|
422 |
#(#LabelSpec |
|
423 |
#name: 'allLabel' |
|
424 |
#layout: #(#LayoutFrame 273 0 0 0.0 310 0 14 0) |
|
425 |
#label: '= all' |
|
426 |
#translateLabel: true |
|
427 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
428 |
#adjust: #left |
|
429 |
) |
|
430 |
#(#ActionButtonSpec |
|
431 |
#name: 'methodChangesButton' |
|
432 |
#layout: #(#LayoutFrame 359 0.0 2 0.0 369 0 13 0) |
|
433 |
#label: ' ' |
|
434 |
#backgroundColor: #(#Color 100.0 100.0 100.0) |
|
435 |
#model: #doFilterType: |
|
436 |
#actionValue: 'method' |
|
437 |
) |
|
438 |
#(#LabelSpec |
|
439 |
#name: 'methodChangesLabel' |
|
440 |
#layout: #(#LayoutFrame 373 0 0 0.0 458 0 14 0) |
|
441 |
#label: '= method' |
|
442 |
#translateLabel: true |
|
443 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
444 |
#adjust: #left |
|
445 |
) |
|
446 |
#(#ActionButtonSpec |
|
447 |
#name: 'classChangesButton' |
|
448 |
#layout: #(#LayoutFrame 455 0.0 2 0.0 465 0 13 0) |
|
449 |
#label: ' ' |
|
450 |
#backgroundColor: #(#Color 50.0008 50.0008 50.0008) |
|
451 |
#model: #doFilterType: |
|
452 |
#actionValue: 'class' |
|
453 |
) |
|
454 |
#(#LabelSpec |
|
455 |
#name: 'classChangesLabel' |
|
456 |
#layout: #(#LayoutFrame 470 0 0 0.0 580 0 14 0) |
|
457 |
#label: '= class change' |
|
458 |
#translateLabel: true |
|
459 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
460 |
#adjust: #left |
|
461 |
) |
|
462 |
#(#ActionButtonSpec |
|
463 |
#name: 'snapshotButton' |
|
464 |
#layout: #(#LayoutFrame 258 0.0 16 0.0 268 0 27 0) |
|
465 |
#label: ' ' |
|
466 |
#backgroundColor: #(#Color 100.0 0.0 0.0) |
|
467 |
#model: #doFilterType: |
|
468 |
#actionValue: 'image' |
|
469 |
) |
|
470 |
#(#LabelSpec |
|
471 |
#name: 'snapshotLabel' |
|
472 |
#layout: #(#LayoutFrame 273 0 14 0.0 355 0 28 0) |
|
473 |
#label: '= snapshot' |
|
474 |
#translateLabel: true |
|
475 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
476 |
#adjust: #left |
|
477 |
) |
|
478 |
#(#ActionButtonSpec |
|
479 |
#name: 'fileInButton' |
|
480 |
#layout: #(#LayoutFrame 359 0.0 16 0.0 369 0 27 0) |
|
481 |
#label: ' ' |
|
482 |
#backgroundColor: #(#Color 0.0 80.0 80.0) |
|
483 |
#model: #doFilterSourceType: |
|
484 |
#actionValue: '* file*' |
|
485 |
) |
|
486 |
#(#LabelSpec |
|
487 |
#name: 'fileInLabel' |
|
488 |
#layout: #(#LayoutFrame 374 0 14 0.0 440 0 28 0) |
|
489 |
#label: '= fileIn' |
|
490 |
#translateLabel: true |
|
491 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
492 |
#adjust: #left |
|
493 |
) |
|
494 |
#(#ActionButtonSpec |
|
495 |
#name: 'checkInButton' |
|
496 |
#layout: #(#LayoutFrame 455 0.0 16 0.0 465 0 27 0) |
|
497 |
#label: ' ' |
|
498 |
#backgroundColor: #(#Color 0.0 0.0 100.0) |
|
499 |
#model: #doFilterSourceType: |
|
500 |
#actionValue: '* checkin*' |
|
501 |
) |
|
502 |
#(#LabelSpec |
|
503 |
#name: 'checkInLabel' |
|
504 |
#layout: #(#LayoutFrame 470 0 14 0.0 550 0 28 0) |
|
505 |
#label: '= checkIn' |
|
506 |
#translateLabel: true |
|
507 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
508 |
#adjust: #left |
|
509 |
) |
|
510 |
) |
|
511 |
) |
|
512 |
) |
|
513 |
) |
|
514 |
) |
|
515 |
) |
|
516 |
#(#WorkspaceSpec |
|
517 |
#name: 'changeTextEditor' |
|
518 |
#model: #valueOfChangeText |
|
519 |
#hasHorizontalScrollBar: true |
|
520 |
#hasVerticalScrollBar: true |
|
521 |
#miniScrollerHorizontal: true |
|
522 |
#isReadOnly: true |
|
523 |
) |
|
524 |
) |
|
525 |
) |
|
526 |
#handles: #(#Any 0.5 1.0) |
|
527 |
) |
|
528 |
#(#UISubSpecification |
|
529 |
#name: 'windowSpecForInfoBar' |
|
530 |
#layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
|
531 |
#majorKey: #ToolApplicationModel |
|
532 |
#minorKey: #windowSpecForInfoBar |
|
533 |
) |
|
534 |
) |
|
535 |
) |
|
1545 | 536 |
) |
1647 | 537 |
|
1653 | 538 |
"Modified: / 19.5.1998 / 18:58:47 / cg" |
1545 | 539 |
! ! |
540 |
||
541 |
!NewChangesBrowser class methodsFor:'list specs'! |
|
542 |
||
1641 | 543 |
tableColumnsForChangeAttributes |
544 |
"This resource specification was automatically generated |
|
545 |
by the DataSetBuilder of ST/X." |
|
546 |
||
547 |
"Do not manually edit this!! If it is corrupted, |
|
548 |
the DataSetBuilder may not be able to read the specification." |
|
549 |
||
550 |
" |
|
551 |
DataSetBuilder new openOnClass:NewChangesBrowser andSelector:#tableColumnsForChangeAttributes |
|
552 |
" |
|
553 |
||
554 |
<resource: #tableColumns> |
|
555 |
||
556 |
||
557 |
^ #( |
|
2250 | 558 |
#(#DataSetColumnSpec |
559 |
#rendererType: #rowSelector |
|
560 |
#backgroundSelector: #listColor |
|
561 |
#showSelectionHighLighted: false |
|
1641 | 562 |
) |
2250 | 563 |
#(#DataSetColumnSpec |
564 |
#label: 'Change' |
|
565 |
#id: #change |
|
566 |
#translateLabel: true |
|
567 |
#labelAlignment: #left |
|
568 |
#model: #string |
|
569 |
#canSelect: false |
|
1641 | 570 |
) |
2250 | 571 |
#(#DataSetColumnSpec |
572 |
#label: 'Category' |
|
573 |
#id: #category |
|
574 |
#translateLabel: true |
|
575 |
#labelAlignment: #left |
|
576 |
#model: #category |
|
577 |
#canSelect: false |
|
1641 | 578 |
) |
2250 | 579 |
#(#DataSetColumnSpec |
580 |
#label: 'Delta Info' |
|
581 |
#id: #deltaInfo |
|
582 |
#translateLabel: true |
|
583 |
#labelAlignment: #left |
|
584 |
#model: #delta |
|
585 |
#canSelect: false |
|
1641 | 586 |
) |
2250 | 587 |
#(#DataSetColumnSpec |
588 |
#label: 'Time Stamp' |
|
589 |
#id: #timeStamp |
|
590 |
#translateLabel: true |
|
591 |
#labelAlignment: #left |
|
592 |
#model: #timeStamp |
|
593 |
#canSelect: false |
|
1641 | 594 |
) |
2250 | 595 |
#(#DataSetColumnSpec |
596 |
#label: 'Type' |
|
597 |
#id: #type |
|
598 |
#translateLabel: true |
|
599 |
#labelAlignment: #left |
|
600 |
#model: #type |
|
601 |
#canSelect: false |
|
1641 | 602 |
) |
2250 | 603 |
#(#DataSetColumnSpec |
604 |
#label: 'Position' |
|
605 |
#id: #position |
|
606 |
#translateLabel: true |
|
607 |
#labelAlignment: #left |
|
608 |
#model: #positions |
|
609 |
#canSelect: false |
|
1641 | 610 |
) |
611 |
) |
|
1545 | 612 |
! ! |
613 |
||
614 |
!NewChangesBrowser class methodsFor:'menu specs'! |
|
615 |
||
616 |
menu |
|
617 |
"This resource specification was automatically generated |
|
618 |
by the MenuEditor of ST/X." |
|
619 |
||
620 |
"Do not manually edit this!! If it is corrupted, |
|
621 |
the MenuEditor may not be able to read the specification." |
|
622 |
||
623 |
" |
|
624 |
MenuEditor new openOnClass:NewChangesBrowser andSelector:#menu |
|
625 |
(Menu new fromLiteralArrayEncoding:(NewChangesBrowser menu)) startUp |
|
626 |
" |
|
627 |
||
628 |
<resource: #menu> |
|
629 |
||
630 |
^ |
|
631 |
||
632 |
#(#Menu |
|
633 |
||
2250 | 634 |
#( |
635 |
#(#MenuItem |
|
636 |
#label: 'About' |
|
637 |
#translateLabel: true |
|
638 |
#activeHelpKey: #about |
|
639 |
#labelImage: #(#ResourceRetriever nil #menuIcon) |
|
640 |
#submenuChannel: #menuAbout |
|
641 |
) |
|
642 |
#(#MenuItem |
|
643 |
#label: 'File' |
|
644 |
#translateLabel: true |
|
645 |
#activeHelpKey: #file |
|
646 |
#submenu: |
|
647 |
#(#Menu |
|
1545 | 648 |
|
2250 | 649 |
#( |
650 |
#(#MenuItem |
|
651 |
#label: 'Reload' |
|
652 |
#translateLabel: true |
|
653 |
#value: #doReload |
|
654 |
#activeHelpKey: #fileReload |
|
655 |
#enabled: #valueOfNotReading |
|
656 |
) |
|
657 |
#(#MenuItem |
|
658 |
#label: '-' |
|
659 |
) |
|
660 |
#(#MenuItem |
|
661 |
#label: 'Load...' |
|
662 |
#translateLabel: true |
|
663 |
#value: #doLoad |
|
664 |
#activeHelpKey: #fileLoad |
|
665 |
#enabled: #valueOfNotSaving |
|
666 |
) |
|
667 |
#(#MenuItem |
|
668 |
#label: '-' |
|
669 |
) |
|
670 |
#(#MenuItem |
|
671 |
#label: 'Save' |
|
672 |
#translateLabel: true |
|
673 |
#value: #doSave |
|
674 |
#activeHelpKey: #fileSave |
|
675 |
#enabled: #valueOfNotReading |
|
676 |
) |
|
677 |
#(#MenuItem |
|
678 |
#label: '-' |
|
679 |
) |
|
680 |
#(#MenuItem |
|
681 |
#label: 'Browse Class' |
|
682 |
#translateLabel: true |
|
683 |
#value: #doBrowseClass |
|
684 |
#activeHelpKey: #fileBrowseClass |
|
685 |
#enabled: #valueOfHavingChangeSelection |
|
686 |
) |
|
687 |
#(#MenuItem |
|
688 |
#label: '-' |
|
689 |
) |
|
690 |
#(#MenuItem |
|
691 |
#label: 'Exit' |
|
692 |
#translateLabel: true |
|
693 |
#value: #closeRequest |
|
694 |
#activeHelpKey: #fileExit |
|
695 |
#enabled: #valueOfNotSaving |
|
696 |
) |
|
697 |
) nil |
|
698 |
nil |
|
699 |
) |
|
700 |
) |
|
701 |
#(#MenuItem |
|
702 |
#label: 'Apply' |
|
703 |
#translateLabel: true |
|
704 |
#submenu: |
|
705 |
#(#Menu |
|
1545 | 706 |
|
2250 | 707 |
#( |
708 |
#(#MenuItem |
|
709 |
#label: 'Change' |
|
710 |
#translateLabel: true |
|
711 |
#value: #doApply |
|
712 |
#activeHelpKey: #applyLine |
|
713 |
#enabled: #valueOfHavingChangeSelection |
|
714 |
) |
|
715 |
#(#MenuItem |
|
716 |
#label: '-' |
|
717 |
) |
|
718 |
#(#MenuItem |
|
719 |
#label: 'All' |
|
720 |
#translateLabel: true |
|
721 |
#value: #doApplyAll |
|
722 |
#activeHelpKey: #applyAll |
|
723 |
#enabled: #valueOfNotReading |
|
724 |
) |
|
725 |
#(#MenuItem |
|
726 |
#label: 'To End' |
|
727 |
#translateLabel: true |
|
728 |
#value: #doApplyToEnd |
|
729 |
#activeHelpKey: #applyToEnd |
|
730 |
#enabled: #valueOfHavingSelection |
|
731 |
) |
|
732 |
#(#MenuItem |
|
733 |
#label: 'All for Class' |
|
734 |
#translateLabel: true |
|
735 |
#value: #doApplyAllForClass |
|
736 |
#activeHelpKey: #applyForClassToEnd |
|
737 |
#enabled: #valueOfHavingChangeSelection |
|
738 |
) |
|
739 |
#(#MenuItem |
|
740 |
#label: 'For Class to End' |
|
741 |
#translateLabel: true |
|
742 |
#value: #doApplyForClassToEnd |
|
743 |
#activeHelpKey: #applyForClassToEnd |
|
744 |
#enabled: #valueOfHavingChangeSelection |
|
745 |
) |
|
746 |
#(#MenuItem |
|
747 |
#label: '-' |
|
748 |
) |
|
749 |
#(#MenuItem |
|
750 |
#label: 'From last Snapshot' |
|
751 |
#translateLabel: true |
|
752 |
#value: #doApplyFromLastSnapshot |
|
753 |
#activeHelpKey: #applyFromLastSnapshot |
|
754 |
#enabled: #valueOfNotReading |
|
755 |
) |
|
756 |
) nil |
|
757 |
nil |
|
758 |
) |
|
759 |
) |
|
760 |
#(#MenuItem |
|
761 |
#label: 'Delete' |
|
762 |
#translateLabel: true |
|
763 |
#activeHelpKey: #edit |
|
764 |
#submenu: |
|
765 |
#(#Menu |
|
1545 | 766 |
|
2250 | 767 |
#( |
768 |
#(#MenuItem |
|
769 |
#label: 'Change' |
|
770 |
#translateLabel: true |
|
771 |
#value: #doDelete |
|
772 |
#activeHelpKey: #deleteLine |
|
773 |
#enabled: #valueOfHavingSelection |
|
774 |
) |
|
775 |
#(#MenuItem |
|
776 |
#label: '-' |
|
777 |
) |
|
778 |
#(#MenuItem |
|
779 |
#label: 'All' |
|
780 |
#translateLabel: true |
|
781 |
#value: #doDeleteAll |
|
782 |
#activeHelpKey: #deleteAll |
|
783 |
#enabled: #valueOfNotReading |
|
784 |
) |
|
785 |
#(#MenuItem |
|
786 |
#label: 'To End' |
|
787 |
#translateLabel: true |
|
788 |
#value: #doDeleteToEnd |
|
789 |
#activeHelpKey: #deleteToEnd |
|
790 |
#enabled: #valueOfHavingSelection |
|
791 |
) |
|
792 |
#(#MenuItem |
|
793 |
#label: 'All for Class' |
|
794 |
#translateLabel: true |
|
795 |
#value: #doDeleteAllForClass |
|
796 |
#activeHelpKey: #applyForClassToEnd |
|
797 |
#enabled: #valueOfHavingChangeSelection |
|
798 |
) |
|
799 |
#(#MenuItem |
|
800 |
#label: 'For Class to End' |
|
801 |
#translateLabel: true |
|
802 |
#value: #doDeleteForClassToEnd |
|
803 |
#activeHelpKey: #deleteForClassToEnd |
|
804 |
#enabled: #valueOfHavingChangeSelection |
|
805 |
) |
|
806 |
#(#MenuItem |
|
807 |
#label: '-' |
|
808 |
) |
|
809 |
#(#MenuItem |
|
810 |
#label: 'Compress' |
|
811 |
#translateLabel: true |
|
812 |
#value: #doCompress |
|
813 |
#activeHelpKey: #deleteCompress |
|
814 |
#enabled: #valueOfNotReading |
|
815 |
) |
|
816 |
#(#MenuItem |
|
817 |
#label: 'Compress for Class' |
|
818 |
#translateLabel: true |
|
819 |
#value: #doCompressForClass |
|
820 |
#activeHelpKey: #deleteCompressForClass |
|
821 |
#enabled: #valueOfHavingChangeSelection |
|
822 |
) |
|
823 |
) nil |
|
824 |
nil |
|
825 |
) |
|
826 |
) |
|
827 |
#(#MenuItem |
|
828 |
#label: 'Test' |
|
829 |
#translateLabel: true |
|
830 |
#activeHelpKey: #test |
|
831 |
#submenu: |
|
832 |
#(#Menu |
|
1545 | 833 |
|
2250 | 834 |
#( |
835 |
#(#MenuItem |
|
836 |
#label: 'Find last Snapshot' |
|
837 |
#translateLabel: true |
|
838 |
#value: #doFindSnapshot: |
|
839 |
#activeHelpKey: #testFindLastSnapshot |
|
840 |
#enabled: #valueOfHavingSelection |
|
841 |
#argument: 'last' |
|
842 |
) |
|
843 |
#(#MenuItem |
|
844 |
#label: 'Find next Snapshot' |
|
845 |
#translateLabel: true |
|
846 |
#value: #doFindSnapshot: |
|
847 |
#activeHelpKey: #testFindNextSnapshot |
|
848 |
#enabled: #valueOfHavingSelection |
|
849 |
#argument: 'next' |
|
850 |
) |
|
851 |
#(#MenuItem |
|
852 |
#label: '-' |
|
853 |
) |
|
854 |
#(#MenuItem |
|
855 |
#label: 'Compare with Current Version' |
|
856 |
#translateLabel: true |
|
857 |
#value: #doCompare |
|
858 |
#activeHelpKey: #testCompareWithCurrentVersion |
|
859 |
#enabled: #valueOfHavingChangeSelection |
|
860 |
) |
|
861 |
) nil |
|
862 |
nil |
|
863 |
) |
|
864 |
) |
|
865 |
#(#MenuItem |
|
866 |
#label: 'Settings' |
|
867 |
#translateLabel: true |
|
868 |
#activeHelpKey: #settings |
|
869 |
#submenu: |
|
870 |
#(#Menu |
|
1545 | 871 |
|
2250 | 872 |
#( |
873 |
#(#MenuItem |
|
874 |
#label: 'Auto Update' |
|
875 |
#translateLabel: true |
|
876 |
#activeHelpKey: #settingsAutoUpdate |
|
877 |
#enabled: #valueOfNotReading |
|
878 |
#indication: #autoUpdateMode: |
|
879 |
) |
|
880 |
#(#MenuItem |
|
881 |
#label: '-' |
|
882 |
) |
|
883 |
#(#MenuItem |
|
884 |
#label: 'Private Classes as Separate' |
|
885 |
#translateLabel: true |
|
886 |
#activeHelpKey: #settingsPrivateAsSeparate |
|
887 |
#enabled: #valueOfNotReading |
|
888 |
#indication: #privateAsSeparate: |
|
889 |
) |
|
890 |
#(#MenuItem |
|
891 |
#label: '-' |
|
892 |
) |
|
893 |
#(#MenuItem |
|
894 |
#label: 'Columns' |
|
895 |
#translateLabel: true |
|
896 |
#activeHelpKey: #settingsColumns |
|
897 |
#submenu: |
|
898 |
#(#Menu |
|
1545 | 899 |
|
2250 | 900 |
#( |
901 |
#(#MenuItem |
|
902 |
#label: 'Category' |
|
903 |
#activeHelpKey: #settingsColumnsCategory |
|
904 |
#indication: #categoryColumn: |
|
905 |
) |
|
906 |
#(#MenuItem |
|
907 |
#label: 'Delta Info' |
|
908 |
#activeHelpKey: #settingsColumnsDeltaInfo |
|
909 |
#indication: #deltaInfoColumn: |
|
910 |
) |
|
911 |
#(#MenuItem |
|
912 |
#label: 'Type' |
|
913 |
#activeHelpKey: #settingsColumnsType |
|
914 |
#indication: #typeColumn: |
|
915 |
) |
|
916 |
#(#MenuItem |
|
917 |
#label: 'Time Stamp' |
|
918 |
#activeHelpKey: #settingsColumnsTimeStamp |
|
919 |
#indication: #timeStampColumn: |
|
920 |
) |
|
921 |
#(#MenuItem |
|
922 |
#label: 'Positions' |
|
923 |
#activeHelpKey: #settingsColumnsPosition |
|
924 |
#indication: #positionsColumn: |
|
925 |
) |
|
926 |
) nil |
|
927 |
nil |
|
928 |
) |
|
929 |
) |
|
930 |
#(#MenuItem |
|
931 |
#label: '-' |
|
932 |
) |
|
933 |
#(#MenuItem |
|
934 |
#label: 'Fonts' |
|
935 |
#translateLabel: true |
|
936 |
#enabled: #valueOfNotReading |
|
937 |
#submenuChannel: #menuFont |
|
938 |
) |
|
939 |
) nil |
|
940 |
nil |
|
941 |
) |
|
942 |
) |
|
943 |
#(#MenuItem |
|
944 |
#label: 'History' |
|
945 |
#translateLabel: true |
|
946 |
#submenuChannel: #menuHistory |
|
947 |
) |
|
948 |
#(#MenuItem |
|
949 |
#label: 'Help' |
|
950 |
#translateLabel: true |
|
951 |
#startGroup: #right |
|
952 |
#activeHelpKey: #help |
|
953 |
#submenuChannel: #menuHelp |
|
954 |
) |
|
955 |
) nil |
|
956 |
nil |
|
1545 | 957 |
) |
1650 | 958 |
|
1653 | 959 |
"Modified: / 19.5.1998 / 18:17:27 / cg" |
1545 | 960 |
! |
961 |
||
962 |
menuTable |
|
963 |
"This resource specification was automatically generated |
|
964 |
by the MenuEditor of ST/X." |
|
965 |
||
966 |
"Do not manually edit this!! If it is corrupted, |
|
967 |
the MenuEditor may not be able to read the specification." |
|
968 |
||
969 |
" |
|
970 |
MenuEditor new openOnClass:NewChangesBrowser andSelector:#menuTable |
|
971 |
(Menu new fromLiteralArrayEncoding:(NewChangesBrowser menuTable)) startUp |
|
972 |
" |
|
973 |
||
974 |
<resource: #menu> |
|
975 |
||
976 |
^ |
|
977 |
||
978 |
#(#Menu |
|
979 |
||
2250 | 980 |
#( |
981 |
#(#MenuItem |
|
982 |
#label: 'Apply' |
|
983 |
#translateLabel: true |
|
984 |
#value: #doApply |
|
985 |
#activeHelpKey: #applyLine |
|
986 |
#enabled: #valueOfHavingChangeSelection |
|
987 |
) |
|
988 |
#(#MenuItem |
|
989 |
#label: 'Apply To End' |
|
990 |
#translateLabel: true |
|
991 |
#value: #doApplyToEnd |
|
992 |
#activeHelpKey: #applyToEnd |
|
993 |
#enabled: #valueOfHavingSelection |
|
994 |
) |
|
995 |
#(#MenuItem |
|
996 |
#label: 'Apply All For Class' |
|
997 |
#translateLabel: true |
|
998 |
#value: #doApplyAllForClass |
|
999 |
#activeHelpKey: #applyForClassToEnd |
|
1000 |
#enabled: #valueOfHavingChangeSelection |
|
1001 |
) |
|
1002 |
#(#MenuItem |
|
1003 |
#label: 'Apply For Class To End' |
|
1004 |
#translateLabel: true |
|
1005 |
#value: #doApplyForClassToEnd |
|
1006 |
#activeHelpKey: #applyForClassToEnd |
|
1007 |
#enabled: #valueOfHavingChangeSelection |
|
1008 |
) |
|
1009 |
#(#MenuItem |
|
1010 |
#label: '-' |
|
1011 |
) |
|
1012 |
#(#MenuItem |
|
1013 |
#label: 'Delete' |
|
1014 |
#translateLabel: true |
|
1015 |
#value: #doDelete |
|
1016 |
#activeHelpKey: #deleteLine |
|
1017 |
#enabled: #valueOfHavingSelection |
|
1018 |
) |
|
1019 |
#(#MenuItem |
|
1020 |
#label: 'Delete To End' |
|
1021 |
#translateLabel: true |
|
1022 |
#value: #doDeleteToEnd |
|
1023 |
#activeHelpKey: #deleteToEnd |
|
1024 |
#enabled: #valueOfHavingSelection |
|
1025 |
) |
|
1026 |
#(#MenuItem |
|
1027 |
#label: 'Delete All For Class' |
|
1028 |
#translateLabel: true |
|
1029 |
#value: #doDeleteAllForClass |
|
1030 |
#activeHelpKey: #applyForClassToEnd |
|
1031 |
#enabled: #valueOfHavingChangeSelection |
|
1032 |
) |
|
1033 |
#(#MenuItem |
|
1034 |
#label: 'Delete For Class To End' |
|
1035 |
#translateLabel: true |
|
1036 |
#value: #doDeleteForClassToEnd |
|
1037 |
#activeHelpKey: #deleteForClassToEnd |
|
1038 |
#enabled: #valueOfHavingChangeSelection |
|
1039 |
) |
|
1040 |
#(#MenuItem |
|
1041 |
#label: '-' |
|
1042 |
) |
|
1043 |
#(#MenuItem |
|
1044 |
#label: 'Browse Class' |
|
1045 |
#translateLabel: true |
|
1046 |
#value: #doBrowseClass |
|
1047 |
#activeHelpKey: #fileBrowseClass |
|
1048 |
#enabled: #valueOfHavingChangeSelection |
|
1049 |
) |
|
1050 |
#(#MenuItem |
|
1051 |
#label: '-' |
|
1052 |
) |
|
1053 |
#(#MenuItem |
|
1054 |
#label: 'Compress For Class' |
|
1055 |
#translateLabel: true |
|
1056 |
#value: #doCompressForClass |
|
1057 |
#activeHelpKey: #deleteCompressForClass |
|
1058 |
#enabled: #valueOfHavingChangeSelection |
|
1059 |
) |
|
1060 |
) nil |
|
1061 |
nil |
|
1545 | 1062 |
) |
1650 | 1063 |
|
1064 |
"Modified: / 19.5.1998 / 18:03:59 / cg" |
|
1545 | 1065 |
! |
1066 |
||
1067 |
menuToolbar |
|
1068 |
"This resource specification was automatically generated |
|
1069 |
by the MenuEditor of ST/X." |
|
1070 |
||
1071 |
"Do not manually edit this!! If it is corrupted, |
|
1072 |
the MenuEditor may not be able to read the specification." |
|
1073 |
||
1074 |
" |
|
1075 |
MenuEditor new openOnClass:NewChangesBrowser andSelector:#menuToolbar |
|
1076 |
(Menu new fromLiteralArrayEncoding:(NewChangesBrowser menuToolbar)) startUp |
|
1077 |
" |
|
1078 |
||
1079 |
<resource: #menu> |
|
1080 |
||
1081 |
^ |
|
1082 |
||
1083 |
#(#Menu |
|
1084 |
||
2250 | 1085 |
#( |
1086 |
#(#MenuItem |
|
1087 |
#label: 'Load' |
|
1088 |
#isButton: true |
|
1089 |
#value: #doLoad |
|
1090 |
#activeHelpKey: #fileLoad |
|
1091 |
#enabled: #valueOfNotReading |
|
1092 |
#labelImage: #(#ResourceRetriever #Icon #loadIcon) |
|
1093 |
) |
|
1094 |
#(#MenuItem |
|
1095 |
#label: 'Save' |
|
1096 |
#isButton: true |
|
1097 |
#value: #doSave |
|
1098 |
#activeHelpKey: #fileSave |
|
1099 |
#enabled: #valueOfNotSaving |
|
1100 |
#labelImage: #(#ResourceRetriever #Icon #saveIcon) |
|
1101 |
) |
|
1102 |
#(#MenuItem |
|
1103 |
#label: '' |
|
1104 |
) |
|
1105 |
#(#MenuItem |
|
1106 |
#label: 'Compress' |
|
1107 |
#isButton: true |
|
1108 |
#value: #doCompress |
|
1109 |
#activeHelpKey: #deleteCompress |
|
1110 |
#enabled: #valueOfNotReading |
|
1111 |
#labelImage: #(#ResourceRetriever nil #compressIcon) |
|
1112 |
) |
|
1113 |
#(#MenuItem |
|
1114 |
#label: '' |
|
1115 |
) |
|
1116 |
#(#MenuItem |
|
1117 |
#label: 'Apply' |
|
1118 |
#isButton: true |
|
1119 |
#value: #doApply |
|
1120 |
#activeHelpKey: #applyLine |
|
1121 |
#enabled: #valueOfHavingChangeSelection |
|
1122 |
#labelImage: #(#ResourceRetriever nil #applyIcon) |
|
1123 |
) |
|
1124 |
#(#MenuItem |
|
1125 |
#label: 'Apply To End' |
|
1126 |
#isButton: true |
|
1127 |
#value: #doApplyToEnd |
|
1128 |
#activeHelpKey: #applyToEnd |
|
1129 |
#enabled: #valueOfHavingSelection |
|
1130 |
#labelImage: #(#ResourceRetriever nil #applyToEndIcon) |
|
1131 |
) |
|
1132 |
#(#MenuItem |
|
1133 |
#label: 'Apply From Last Snapshot' |
|
1134 |
#isButton: true |
|
1135 |
#value: #doApplyFromLastSnapshot |
|
1136 |
#activeHelpKey: #applyFromLastSnapshot |
|
1137 |
#enabled: #valueOfNotReading |
|
1138 |
#labelImage: #(#ResourceRetriever nil #applyFromLastSnapshotIcon) |
|
1139 |
) |
|
1140 |
#(#MenuItem |
|
1141 |
#label: '' |
|
1142 |
) |
|
1143 |
#(#MenuItem |
|
1144 |
#label: 'Delete' |
|
1145 |
#isButton: true |
|
1146 |
#value: #doDelete |
|
1147 |
#activeHelpKey: #deleteLine |
|
1148 |
#enabled: #valueOfHavingSelection |
|
1149 |
#labelImage: #(#ResourceRetriever nil #deleteIcon) |
|
1150 |
) |
|
1151 |
#(#MenuItem |
|
1152 |
#label: 'Delete To End' |
|
1153 |
#isButton: true |
|
1154 |
#value: #doDeleteToEnd |
|
1155 |
#activeHelpKey: #deleteToEnd |
|
1156 |
#enabled: #valueOfHavingSelection |
|
1157 |
#labelImage: #(#ResourceRetriever nil #deleteToEndIcon) |
|
1158 |
) |
|
1159 |
#(#MenuItem |
|
1160 |
#label: '' |
|
1161 |
) |
|
1162 |
#(#MenuItem |
|
1163 |
#label: 'Find Last Snapshot' |
|
1164 |
#isButton: true |
|
1165 |
#value: #doFindSnapshot: |
|
1166 |
#activeHelpKey: #testFindLastSnapshot |
|
1167 |
#enabled: #valueOfHavingSelection |
|
1168 |
#argument: 'last' |
|
1169 |
#labelImage: #(#ResourceRetriever nil #findLastSnapshotIcon) |
|
1170 |
) |
|
1171 |
#(#MenuItem |
|
1172 |
#label: 'Find Next Snapshot' |
|
1173 |
#isButton: true |
|
1174 |
#value: #doFindSnapshot: |
|
1175 |
#activeHelpKey: #testFindNextSnapshot |
|
1176 |
#enabled: #valueOfHavingSelection |
|
1177 |
#argument: 'next' |
|
1178 |
#labelImage: #(#ResourceRetriever nil #findNextSnapshotIcon) |
|
1179 |
) |
|
1180 |
) nil |
|
1181 |
nil |
|
1545 | 1182 |
) |
1183 |
! ! |
|
1184 |
||
1185 |
!NewChangesBrowser methodsFor:'accesssing - columns'! |
|
1186 |
||
1187 |
categoryColumn |
|
1546 | 1188 |
"returns whether the column for the category attribute of the changes is shown" |
1545 | 1189 |
|
1553 | 1190 |
^CategoryColumn ? (CategoryColumn := false) |
1545 | 1191 |
! |
1192 |
||
1193 |
categoryColumn: aBoolean |
|
1546 | 1194 |
"sets whether the column for the category attribute of the changes is shown" |
1545 | 1195 |
|
1653 | 1196 |
self changeColumn: #category add: (CategoryColumn := aBoolean) |
1197 |
||
1198 |
"Modified: / 19.5.1998 / 20:30:13 / cg" |
|
1545 | 1199 |
! |
1200 |
||
1201 |
deltaInfoColumn |
|
1546 | 1202 |
"returns whether the column for the delta info attribute of the changes is shown" |
1545 | 1203 |
|
1204 |
^DeltaInfoColumn ? (DeltaInfoColumn := false) |
|
1205 |
! |
|
1206 |
||
1207 |
deltaInfoColumn: aBoolean |
|
1546 | 1208 |
"sets whether the column for the delta info attribute of the changes is shown; and updates" |
1209 |
||
1653 | 1210 |
self changeColumn: #deltaInfo add: (DeltaInfoColumn := aBoolean). |
1546 | 1211 |
(self window notNil and: [DeltaInfoColumn]) ifTrue: [self doReload] |
1653 | 1212 |
|
1213 |
"Modified: / 19.5.1998 / 20:30:21 / cg" |
|
1545 | 1214 |
! |
1215 |
||
1568 | 1216 |
positionsColumn |
1546 | 1217 |
"returns whether the column for the position attribute of the changes is shown" |
1545 | 1218 |
|
1568 | 1219 |
^PositionsColumn ? (PositionsColumn := false) |
1545 | 1220 |
! |
1221 |
||
1568 | 1222 |
positionsColumn: aBoolean |
1223 |
"sets whether the column for the positions attribute of the changes is shown" |
|
1224 |
||
1653 | 1225 |
self changeColumn: #position add: (PositionsColumn := aBoolean) |
1226 |
||
1227 |
"Modified: / 19.5.1998 / 20:30:37 / cg" |
|
1545 | 1228 |
! |
1229 |
||
1230 |
timeStampColumn |
|
1546 | 1231 |
"returns whether the column for the time stamp attribute of the changes is shown" |
1545 | 1232 |
|
1233 |
^TimeStampColumn ? (TimeStampColumn := false) |
|
1234 |
! |
|
1235 |
||
1236 |
timeStampColumn: aBoolean |
|
1546 | 1237 |
"sets whether the column for the time stamp attribute of the changes is shown" |
1545 | 1238 |
|
1653 | 1239 |
self changeColumn: #timeStamp add: (TimeStampColumn := aBoolean) |
1240 |
||
1241 |
"Modified: / 19.5.1998 / 20:30:42 / cg" |
|
1545 | 1242 |
! |
1243 |
||
1244 |
typeColumn |
|
1546 | 1245 |
"returns whether the column for the type attribute of the changes is shown" |
1545 | 1246 |
|
1247 |
^TypeColumn ? (TypeColumn := false) |
|
1248 |
! |
|
1249 |
||
1250 |
typeColumn: aBoolean |
|
1546 | 1251 |
"sets whether the column for the type attribute of the changes is shown" |
1545 | 1252 |
|
1653 | 1253 |
self changeColumn: #type add: (TypeColumn := aBoolean) |
1254 |
||
1255 |
"Modified: / 19.5.1998 / 20:30:46 / cg" |
|
1545 | 1256 |
! ! |
1257 |
||
1258 |
!NewChangesBrowser methodsFor:'accesssing - views'! |
|
1259 |
||
1568 | 1260 |
changeTextEditor |
1261 |
"returns the view of the changeTextEditor" |
|
1262 |
||
1263 |
^builder componentAt: #changeTextEditor |
|
1264 |
||
1265 |
||
1266 |
||
1267 |
! |
|
1268 |
||
1545 | 1269 |
filterField |
1546 | 1270 |
"returns the view of the filterField" |
1545 | 1271 |
|
1272 |
^builder componentAt: #filterField |
|
1273 |
||
1274 |
||
1275 |
||
1276 |
! |
|
1277 |
||
1278 |
filterLabel |
|
1546 | 1279 |
"returns the view of the filterLabel" |
1545 | 1280 |
|
1281 |
^builder componentAt: #filterLabel |
|
1282 |
||
1283 |
||
1284 |
||
1285 |
! |
|
1286 |
||
1287 |
readProgressIndicator |
|
1546 | 1288 |
"returns the view of the readProgressIndicator" |
1545 | 1289 |
|
1290 |
^builder componentAt: #readProgressIndicator |
|
1291 |
||
1292 |
||
1293 |
||
1294 |
! ! |
|
1295 |
||
1296 |
!NewChangesBrowser methodsFor:'aspects'! |
|
1297 |
||
1298 |
listOfChangeColumns |
|
1546 | 1299 |
"initializes (during the startup) and returns the value holder for the columns" |
1545 | 1300 |
|
1301 |
|holder| |
|
1302 |
(holder := builder bindingAt:#listOfChangeColumns) isNil ifTrue:[ |
|
2740
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
1303 |
builder aspectAt:#listOfChangeColumns put:(holder := List new). |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
1304 |
self changeColumn: nil add: true. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
1305 |
self changeColumn: #change add: true. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
1306 |
self categoryColumn: self categoryColumn. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
1307 |
self timeStampColumn: self timeStampColumn. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
1308 |
self typeColumn: self typeColumn. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
1309 |
"/ self deltaInfoColumn: self deltaInfoColumn. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
1310 |
self positionsColumn: self positionsColumn. |
1545 | 1311 |
]. |
1312 |
^ holder |
|
1313 |
||
1653 | 1314 |
"Modified: / 19.5.1998 / 20:30:31 / cg" |
1545 | 1315 |
! |
1316 |
||
1317 |
listOfChanges |
|
1546 | 1318 |
"returns the value holder for the changes" |
1545 | 1319 |
|
1320 |
|holder| |
|
1321 |
(holder := builder bindingAt:#listOfChanges) isNil ifTrue:[ |
|
2250 | 1322 |
builder aspectAt:#listOfChanges put:(holder := List new) |
1545 | 1323 |
]. |
1324 |
^ holder |
|
1325 |
! |
|
1326 |
||
1327 |
selectionOfChange |
|
1546 | 1328 |
"returns the value holder for the selected change" |
1545 | 1329 |
|
1330 |
|holder| |
|
1331 |
(holder := builder bindingAt:#selectionOfChange) isNil ifTrue:[ |
|
2250 | 1332 |
builder aspectAt:#selectionOfChange put:(holder := ValueHolder new). |
1545 | 1333 |
]. |
1334 |
^ holder |
|
1335 |
! |
|
1336 |
||
1337 |
valueOfChangeText |
|
1546 | 1338 |
"returns the value holder for the source code of the selected change" |
1545 | 1339 |
|
1340 |
|holder| |
|
1341 |
(holder := builder bindingAt:#valueOfChangeText) isNil ifTrue:[ |
|
2250 | 1342 |
builder aspectAt:#valueOfChangeText put:(holder := ValueHolder new). |
1545 | 1343 |
]. |
1344 |
^ holder |
|
1345 |
! |
|
1346 |
||
1347 |
valueOfFilter |
|
1546 | 1348 |
"returns the value holder for the string of the filter" |
1545 | 1349 |
|
1350 |
|holder| |
|
1351 |
(holder := builder bindingAt:#valueOfFilter) isNil ifTrue:[ |
|
2250 | 1352 |
builder aspectAt:#valueOfFilter put:(holder := ValueHolder new). |
1353 |
holder addDependent: self |
|
1545 | 1354 |
]. |
1355 |
^ holder |
|
1356 |
! |
|
1357 |
||
1358 |
valueOfHavingChangeSelection |
|
1546 | 1359 |
"returns whether the selected change can be applied as value holder" |
1545 | 1360 |
|
1361 |
|holder| |
|
1362 |
(holder := builder bindingAt:#valueOfHavingChangeSelection) isNil ifTrue:[ |
|
2250 | 1363 |
builder aspectAt:#valueOfHavingChangeSelection put:(holder := false asValue). |
1545 | 1364 |
]. |
1365 |
^ holder |
|
1366 |
! |
|
1367 |
||
1368 |
valueOfHavingSelection |
|
1546 | 1369 |
"returns whether a change is selected as value holder" |
1545 | 1370 |
|
1371 |
|holder| |
|
1372 |
(holder := builder bindingAt:#valueOfHavingSelection) isNil ifTrue:[ |
|
2250 | 1373 |
builder aspectAt:#valueOfHavingSelection put:(holder := false asValue). |
1545 | 1374 |
]. |
1375 |
^ holder |
|
1376 |
! |
|
1377 |
||
1378 |
valueOfNotReading |
|
1546 | 1379 |
"returns whether it is not reading or compressing as value holder" |
1545 | 1380 |
|
1381 |
|holder| |
|
1382 |
(holder := builder bindingAt:#valueOfReading) isNil ifTrue:[ |
|
2250 | 1383 |
builder aspectAt:#valueOfReading put:(holder := true asValue). |
1545 | 1384 |
]. |
1385 |
^ holder |
|
1386 |
! |
|
1387 |
||
1568 | 1388 |
valueOfNotSaving |
1389 |
"returns whether it is not saving as value holder" |
|
1390 |
||
1391 |
|holder| |
|
1392 |
(holder := builder bindingAt:#valueOfNotSaving) isNil ifTrue:[ |
|
2250 | 1393 |
builder aspectAt:#valueOfNotSaving put:(holder := true asValue). |
1568 | 1394 |
]. |
1395 |
^ holder |
|
1396 |
! |
|
1397 |
||
1545 | 1398 |
valueOfReadProgress |
1546 | 1399 |
"returns the stage of reading or compressing as value holder" |
1545 | 1400 |
|
1401 |
|holder| |
|
1402 |
(holder := builder bindingAt:#valueOfReadProgress) isNil ifTrue:[ |
|
2250 | 1403 |
builder aspectAt:#valueOfReadProgress put:(holder := ValueHolder with: 0). |
1545 | 1404 |
]. |
1405 |
^ holder |
|
1406 |
! ! |
|
1407 |
||
1408 |
!NewChangesBrowser methodsFor:'callbacks'! |
|
1409 |
||
1410 |
changeSelected: lineNr |
|
1546 | 1411 |
"fetches the source code of the change and shows it in the codeView" |
1545 | 1412 |
|
1413 |
|aStream sawExcla chunk selectedRow changeNr| |
|
1414 |
||
1415 |
lineNr == 0 ifTrue: [^nil]. |
|
1416 |
changeNr := changes indexOf: (self listOfChanges at: lineNr). |
|
1417 |
aStream := self streamForChange: (changes at: changeNr). |
|
1418 |
aStream isNil ifTrue:[^ self]. |
|
1419 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
|
1420 |
chunk := aStream nextChunk. |
|
1421 |
sawExcla ifTrue:[ |
|
2250 | 1422 |
chunk := aStream nextChunk |
1545 | 1423 |
]. |
1424 |
aStream close. |
|
1425 |
self valueOfChangeText value:chunk. |
|
1426 |
||
1546 | 1427 |
self updateChannels |
1428 |
! ! |
|
1429 |
||
1430 |
!NewChangesBrowser methodsFor:'change & update'! |
|
1431 |
||
1432 |
update:something with:aParameter from:changedObject |
|
1433 |
"evaluates the filterCompletionBlock after returning the filter string" |
|
1434 |
||
1435 |
super update:something with:aParameter from:changedObject. |
|
1436 |
||
1437 |
changedObject == self valueOfFilter |
|
1568 | 1438 |
ifTrue: |
1636 | 1439 |
[ |
2250 | 1440 |
filterCompletionBlock value: changedObject value. |
1441 |
self listOfChanges size > 0 ifTrue: [self addToHistory: changedObject value -> #doFilter:] |
|
1568 | 1442 |
] |
1546 | 1443 |
|
1444 |
||
1445 |
||
1446 |
||
1447 |
||
1448 |
||
1449 |
! |
|
1450 |
||
1451 |
updateChannels |
|
1452 |
"updates my channels" |
|
1453 |
||
1454 |
|change| |
|
1455 |
(change := self selectionOfChange value) notNil |
|
1545 | 1456 |
ifTrue: |
1457 |
[ |
|
2250 | 1458 |
self valueOfHavingSelection value: true. |
1459 |
self valueOfHavingChangeSelection value: |
|
1460 |
((change type = 'method') or: [(change type = 'class')]) |
|
1546 | 1461 |
] |
1462 |
ifFalse: |
|
1463 |
[ |
|
2250 | 1464 |
self valueOfHavingSelection value: false. |
1465 |
self valueOfHavingChangeSelection value: false |
|
1545 | 1466 |
] |
1546 | 1467 |
|
1468 |
||
1469 |
||
1470 |
||
1471 |
||
1472 |
||
1545 | 1473 |
! ! |
1474 |
||
1475 |
!NewChangesBrowser methodsFor:'compiler interface'! |
|
1476 |
||
1477 |
wantChangeLog |
|
1478 |
"sent by the compiler to ask if a changeLog entry should |
|
1479 |
be written. Return false here." |
|
1480 |
||
1481 |
^ false |
|
1482 |
||
1483 |
||
1484 |
! ! |
|
1485 |
||
1568 | 1486 |
!NewChangesBrowser methodsFor:'error handling'! |
1487 |
||
1488 |
correctableError:aString position:relPos to:relEndPos from:aCompiler |
|
1489 |
"compiler notifys us of an error - this should really not happen since |
|
1490 |
changes ought to be correct (did someone edit the changes file ??). |
|
1491 |
Show the bad change in the codeView and let codeView hilight the error; |
|
1492 |
no corrections allowed here therefore return false" |
|
1493 |
||
1494 |
self error:aString position:relPos to:relEndPos from:aCompiler. |
|
1495 |
^ false |
|
1496 |
! |
|
1497 |
||
1498 |
error:aString position:relPos to:relEndPos from:aCompiler |
|
1499 |
"compiler notifys us of an error - this should really not happen since |
|
1500 |
changes ought to be correct (did someone edit the changes file ??). |
|
1501 |
Show the bad change in the codeView and let codeView hilight the error" |
|
1502 |
||
1503 |
|action| |
|
1504 |
||
1505 |
(skipSignal notNil) ifTrue:[ |
|
1506 |
||
2250 | 1507 |
self changeTextEditor highlightingErrorPosition:relPos to:relEndPos do:[ |
1508 |
|box| |
|
1509 |
||
1510 |
" |
|
1511 |
start dialog - make certain cleanup is done |
|
1512 |
" |
|
1513 |
action := OptionBox |
|
1514 |
request:aString |
|
1515 |
label:'Error' |
|
1516 |
form:(WarningBox iconBitmap) |
|
1517 |
buttonLabels:#('cancel' 'skip' 'continue') |
|
1518 |
values:#(#abort #skip #continue) |
|
1519 |
default:#continue. |
|
1520 |
]. |
|
1521 |
||
1522 |
action == #abort ifTrue:[ |
|
1523 |
Object abortSignal raise. |
|
1524 |
^ false |
|
1525 |
]. |
|
1526 |
action == #skip ifTrue:[ |
|
1527 |
skipSignal raise. |
|
1528 |
^ false |
|
1529 |
]. |
|
1530 |
^ false |
|
1568 | 1531 |
]. |
1532 |
^self changeTextEditor error:aString position:relPos to:relEndPos from:aCompiler |
|
1533 |
||
1534 |
! |
|
1535 |
||
1536 |
warning:aString position:relPos to:relEndPos from:aCompiler |
|
1537 |
"compiler notifys us of a warning - ignore it" |
|
1538 |
||
1539 |
^ self |
|
1540 |
||
1541 |
! ! |
|
1542 |
||
1545 | 1543 |
!NewChangesBrowser methodsFor:'help'! |
1544 |
||
1545 |
defaultInfoLabel |
|
1546 | 1546 |
"returns the default label for the info bar" |
1545 | 1547 |
|
1548 |
changeFileName asFilename exists ifTrue: [^changeFileName]. |
|
1549 |
^'No change file name defined.' |
|
1550 |
||
1551 |
||
1552 |
||
1553 |
! ! |
|
1554 |
||
1555 |
!NewChangesBrowser methodsFor:'initialization'! |
|
1556 |
||
1557 |
initialize |
|
1546 | 1558 |
"initializes the instance variables" |
1545 | 1559 |
|
1560 |
super initialize. |
|
1561 |
||
1546 | 1562 |
changes := List new. |
1563 |
self changeFileName: ObjectMemory nameForChanges. |
|
1564 |
AutoUpdate := AutoUpdate ? false. |
|
1565 |
PrivateAsSeparate := PrivateAsSeparate ? false. |
|
1545 | 1566 |
|
1567 |
ObjectMemory addDependent:self. |
|
1568 |
! ! |
|
1569 |
||
1570 |
!NewChangesBrowser methodsFor:'menu modes'! |
|
1571 |
||
1572 |
autoUpdateMode |
|
1573 |
"returns whether autoUpdate is on/off" |
|
1574 |
||
1575 |
^AutoUpdate |
|
1576 |
||
1577 |
! |
|
1578 |
||
1579 |
autoUpdateMode: aMode |
|
1580 |
"sets the autoUpdate to aMode" |
|
1581 |
||
1582 |
AutoUpdate := aMode |
|
1583 |
||
1546 | 1584 |
! |
1585 |
||
1586 |
privateAsSeparate |
|
1587 |
"returns whether private classes are handled as separate changes" |
|
1588 |
||
1589 |
^PrivateAsSeparate |
|
1590 |
||
1591 |
! |
|
1592 |
||
1593 |
privateAsSeparate: aMode |
|
1594 |
"sets the PrivateAsSeparate to aMode" |
|
1595 |
||
1596 |
PrivateAsSeparate := aMode |
|
1597 |
||
1545 | 1598 |
! ! |
1599 |
||
1600 |
!NewChangesBrowser methodsFor:'private'! |
|
1601 |
||
1546 | 1602 |
applyChange:aChange |
1603 |
"applies aChange" |
|
1545 | 1604 |
|
1605 |
|aStream nm applyAction changeNr| |
|
1606 |
||
1546 | 1607 |
aStream := self streamForChange:aChange. |
1545 | 1608 |
aStream isNil ifTrue:[^ self]. |
1609 |
||
1546 | 1610 |
nm := self classNameOfChange:aChange. |
1545 | 1611 |
nm notNil ifTrue:[ |
2250 | 1612 |
|cls| |
1613 |
||
1614 |
cls := Smalltalk at:(nm asSymbol) ifAbsent:[]. |
|
1615 |
cls notNil ifTrue:[ |
|
1616 |
cls isLoaded ifFalse:[ |
|
1617 |
cls autoload |
|
1618 |
] |
|
1619 |
] |
|
1545 | 1620 |
]. |
1621 |
||
1622 |
applyAction := [ |
|
2250 | 1623 |
|sig| |
1624 |
||
1625 |
(skipSignal notNil) ifTrue:[ |
|
1626 |
sig := skipSignal |
|
1627 |
] ifFalse:[ |
|
1628 |
sig := Object abortSignal |
|
1629 |
]. |
|
1630 |
sig catch:[ |
|
1631 |
|reader doItChunk methodsForChunk| |
|
1632 |
||
1633 |
"/ a followup methodsFor: chunk... |
|
1634 |
aChange followUp ifTrue:[ |
|
1635 |
methodsForChunk := aChange chunk. |
|
1636 |
] ifFalse:[ |
|
1637 |
doItChunk := aStream nextChunk. "/ an empty chunk sometimes... |
|
1638 |
doItChunk notEmpty ifTrue:[ |
|
1639 |
Compiler evaluate:doItChunk notifying:self. |
|
1640 |
] ifFalse:[ |
|
1641 |
methodsForChunk := aStream nextChunk. "/ the real one |
|
1642 |
] |
|
1643 |
]. |
|
1644 |
methodsForChunk notNil ifTrue:[ |
|
1645 |
Class methodRedefinitionSignal handle:[:ex | |
|
1646 |
ex proceedWith:#keep |
|
1647 |
] do:[ |
|
1648 |
reader := Compiler evaluate:methodsForChunk notifying:self. |
|
1649 |
reader fileInFrom:aStream notifying:self passChunk:false single:true. |
|
1650 |
] |
|
1651 |
] |
|
1652 |
]. |
|
1545 | 1653 |
]. |
1654 |
||
1655 |
"/ |
|
1656 |
"/ if I am showing the changes file, dont update it |
|
1657 |
"/ |
|
1877
f0dbf0801e4d
care for pathName being the same, where the change-fileName is not
Claus Gittinger <cg@exept.de>
parents:
1798
diff
changeset
|
1658 |
changeFileName asFilename pathName = ObjectMemory nameForChanges asFilename pathName ifTrue:[ |
2250 | 1659 |
Class withoutUpdatingChangesDo:applyAction |
1545 | 1660 |
] ifFalse:[ |
2250 | 1661 |
applyAction value |
1545 | 1662 |
]. |
1663 |
aStream close |
|
1877
f0dbf0801e4d
care for pathName being the same, where the change-fileName is not
Claus Gittinger <cg@exept.de>
parents:
1798
diff
changeset
|
1664 |
|
f0dbf0801e4d
care for pathName being the same, where the change-fileName is not
Claus Gittinger <cg@exept.de>
parents:
1798
diff
changeset
|
1665 |
"Modified: / 8.9.1998 / 12:48:01 / cg" |
1545 | 1666 |
! |
1667 |
||
1546 | 1668 |
autoSelectChange:aChange |
1669 |
"selects aChange" |
|
1545 | 1670 |
|
1671 |
self class autoSelectNext ifTrue:[ |
|
2250 | 1672 |
((self listOfChanges indexOf: aChange) <= self listOfChanges size) ifTrue:[ |
1673 |
self selectionOfChange value: aChange. |
|
1674 |
self changeSelected:(self listOfChanges indexOf: aChange). |
|
1675 |
self updateChannels. |
|
1676 |
^ self |
|
1677 |
] |
|
1569 | 1678 |
]. |
1546 | 1679 |
self updateChannels. |
1680 |
self unselectChange |
|
1569 | 1681 |
|
1545 | 1682 |
! |
1683 |
||
1684 |
autoSelectLast |
|
1546 | 1685 |
"selects the last change" |
1686 |
||
1687 |
self autoSelectChange: (self listOfChanges at: self listOfChanges size ifAbsent: nil). |
|
1688 |
self updateChannels. |
|
1689 |
||
1545 | 1690 |
! |
1691 |
||
1546 | 1692 |
autoSelectOrEnd:aChange |
1693 |
"selects aChange or the last" |
|
1545 | 1694 |
|
1695 |
|last| |
|
1696 |
||
1697 |
last := self listOfChanges size. |
|
1546 | 1698 |
aChange notNil ifTrue:[ |
2250 | 1699 |
self autoSelectChange:aChange |
1545 | 1700 |
] ifFalse:[ |
2250 | 1701 |
self selectionOfChange value: (self listOfChanges at: last ifAbsent: nil). |
1702 |
self changeSelected: last |
|
1546 | 1703 |
]. |
1704 |
self updateChannels |
|
1545 | 1705 |
! |
1706 |
||
1653 | 1707 |
changeColumn: aColumnId add: addOrRemove |
1546 | 1708 |
"adds or removes a attribute column to the table" |
1545 | 1709 |
|
1569 | 1710 |
|newListOfChangeColumns| |
1711 |
||
1712 |
newListOfChangeColumns := self listOfChangeColumns asOrderedCollection. |
|
1545 | 1713 |
addOrRemove |
1714 |
ifTrue: |
|
1569 | 1715 |
[ |
2250 | 1716 |
newListOfChangeColumns add: |
1717 |
((self class tableColumnsForChangeAttributes |
|
1718 |
collect: [:i| i decodeAsLiteralArray]) |
|
1719 |
detect: [:column| column id = aColumnId]) |
|
1568 | 1720 |
] |
1545 | 1721 |
ifFalse: |
1722 |
[ |
|
2250 | 1723 |
newListOfChangeColumns remove: |
1724 |
(self listOfChangeColumns detect: [:column| column id = aColumnId] ifNone: nil) ifAbsent: nil |
|
1553 | 1725 |
]. |
1569 | 1726 |
self listOfChangeColumns contents: newListOfChangeColumns. |
1553 | 1727 |
self autoSelectLast |
1545 | 1728 |
|
1653 | 1729 |
"Modified: / 19.5.1998 / 20:32:53 / cg" |
1545 | 1730 |
! |
1731 |
||
1546 | 1732 |
changeFileName:aFileName |
1733 |
"sets the name of the file with the changes" |
|
1734 |
||
1938 | 1735 |
changeFileName := aFileName asFilename name. |
1736 |
"/ (Filename currentDirectory asAbsoluteFilename construct: aFileName) name. |
|
1737 |
||
1738 |
"Modified: / 17.10.1998 / 14:43:01 / cg" |
|
1546 | 1739 |
! |
1740 |
||
1545 | 1741 |
checkClassIsLoaded:aClass |
1546 | 1742 |
"returns true if aClass is loaded" |
1545 | 1743 |
|
1744 |
|cls| |
|
1745 |
aClass isMeta ifTrue:[ |
|
2250 | 1746 |
cls := aClass soleInstance |
1545 | 1747 |
] ifFalse:[ |
2250 | 1748 |
cls := aClass |
1545 | 1749 |
]. |
1750 |
cls isLoaded ifFalse:[ |
|
2250 | 1751 |
(self confirm:(cls name , ' is an autoloaded class.\I can only compare the methods texts if its loaded first.\\Load the class first ?') withCRs) |
1752 |
ifTrue:[ |
|
1753 |
cls autoload |
|
1754 |
] |
|
1545 | 1755 |
]. |
1756 |
^ cls isLoaded |
|
1757 |
! |
|
1758 |
||
1759 |
checkIfFileHasChanged |
|
1546 | 1760 |
"checks if changes file has changed" |
1761 |
||
1762 |
|f info| |
|
1545 | 1763 |
|
1764 |
Processor removeTimedBlock:autoUpdateBlock. |
|
1765 |
f := changeFileName asFilename. |
|
1766 |
(info := f info) isNil ifTrue:[ |
|
5396 | 1767 |
self newLabel:'unaccessable' |
1545 | 1768 |
] ifFalse:[ |
5396 | 1769 |
(info modificationTime) > changeFileTimestamp ifTrue:[ |
1770 |
self newLabel:'outdated'. |
|
1771 |
AutoUpdate ifTrue:[ |
|
1772 |
self doReload |
|
1773 |
] |
|
1774 |
] ifFalse:[ |
|
1775 |
self newLabel:'' |
|
1776 |
] |
|
1545 | 1777 |
]. |
1778 |
Processor addTimedBlock:autoUpdateBlock afterSeconds:5. |
|
1779 |
! |
|
1780 |
||
1546 | 1781 |
classNameOfChange:aChange |
1782 |
"returns the classname of aChange |
|
1545 | 1783 |
(for classChanges (i.e. xxx class), the non-metaClassName (i.e. xxx) is returned)" |
1784 |
||
1785 |
|name| |
|
1786 |
||
1546 | 1787 |
name := self fullClassNameOfChange:aChange. |
1545 | 1788 |
name isNil ifTrue:[^ nil]. |
1789 |
(name endsWith:' class') ifTrue:[ |
|
2250 | 1790 |
^ name copyWithoutLast:6 |
1545 | 1791 |
]. |
1792 |
^ name |
|
1793 |
! |
|
1794 |
||
1546 | 1795 |
compareChange:aChange |
1796 |
"compares aChange with the current version" |
|
1545 | 1797 |
|
1798 |
|aStream chunk sawExcla parseTree thisClass cat oldSource newSource |
|
1799 |
parser sel oldMethod outcome showDiff d t1 t2 selector isLoaded |
|
1800 |
method beep| |
|
1801 |
||
1546 | 1802 |
aStream := self streamForChange:aChange. |
1545 | 1803 |
aStream isNil ifTrue:[^ self]. |
1804 |
||
1805 |
showDiff := false. |
|
1806 |
||
1546 | 1807 |
aChange followUp ifFalse:[ |
2250 | 1808 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
1809 |
chunk := aStream nextChunk. |
|
1545 | 1810 |
] ifTrue:[ |
2250 | 1811 |
chunk := aChange chunk. |
1812 |
sawExcla := true. |
|
1545 | 1813 |
]. |
1814 |
||
1815 |
beep := false. |
|
1816 |
sawExcla ifFalse:[ |
|
2250 | 1817 |
outcome := 'Cannot compare this change\(i.e. this is not a method change)!!'. |
1818 |
||
1819 |
parseTree := Parser parseExpression:chunk. |
|
1820 |
(parseTree notNil and:[parseTree isMessage]) ifTrue:[ |
|
1821 |
((selector := parseTree selector) == #removeSelector:) ifTrue:[ |
|
1822 |
thisClass := (parseTree receiver evaluate). |
|
1823 |
thisClass isBehavior ifTrue:[ |
|
1824 |
(self checkClassIsLoaded:thisClass) ifTrue:[ |
|
1825 |
selector := (parseTree arg1 evaluate). |
|
1826 |
(thisClass includesSelector:selector) ifTrue:[ |
|
1827 |
outcome := 'Change removes the #' , selector , ' method from ' , thisClass name. |
|
1828 |
] ifFalse:[ |
|
1829 |
outcome := 'Change has no effect\(there is no method for #' , selector , ' in ' , thisClass name , ')' |
|
1830 |
] |
|
1831 |
] ifFalse:[ |
|
1832 |
beep := true. |
|
1833 |
outcome := 'Cannot compare this change (compare requires class to be loaded)!!'. |
|
1834 |
] |
|
1835 |
] |
|
1836 |
]. |
|
1837 |
selector == #category: ifTrue:[ |
|
1838 |
parseTree receiver isMessage ifTrue:[ |
|
1839 |
parseTree receiver selector == #compiledMethodAt: ifTrue:[ |
|
1840 |
(method := parseTree receiver evaluate) isMethod ifTrue:[ |
|
1841 |
method category = parseTree arg1 evaluate ifTrue:[ |
|
1842 |
outcome := 'Change has no effect\(same category)'. |
|
1843 |
] ifFalse:[ |
|
1844 |
outcome := 'Category is different (''' , method category , ''' vs. ''' , parseTree arg1 evaluate , ''')' |
|
1845 |
] |
|
1846 |
] ifFalse:[ |
|
1847 |
beep := true. |
|
1848 |
outcome := 'There is no such method!!' |
|
1849 |
] |
|
1850 |
] |
|
1851 |
] |
|
1852 |
] |
|
1853 |
] |
|
1545 | 1854 |
] ifTrue:[ |
2250 | 1855 |
parseTree := Parser parseExpression:chunk. |
1856 |
(parseTree notNil |
|
1857 |
and:[parseTree ~~ #Error |
|
1858 |
and:[parseTree isMessage]]) ifTrue:[ |
|
1859 |
(parseTree selector == #methodsFor:) ifTrue:[ |
|
1860 |
thisClass := (parseTree receiver evaluate). |
|
1861 |
thisClass isBehavior ifTrue:[ |
|
1862 |
(isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[ |
|
1863 |
outcome := 'Cannot compare this change\(compare requires class to be loaded)!!'. |
|
1864 |
]. |
|
1865 |
||
1866 |
cat := parseTree arg1 evaluate. |
|
1867 |
newSource := aStream nextChunk. |
|
1868 |
||
1869 |
parser := Parser parseMethod:newSource in:thisClass. |
|
1870 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
1871 |
sel := parser selector. |
|
1872 |
oldMethod := thisClass compiledMethodAt:sel. |
|
1873 |
oldMethod notNil ifTrue:[ |
|
1874 |
(oldMethod category = cat) ifFalse:[ |
|
1875 |
Transcript showCR:'Category changed.'. |
|
1876 |
]. |
|
1877 |
oldSource := oldMethod source. |
|
1878 |
(oldSource = newSource) ifTrue:[ |
|
1879 |
outcome := 'Same source.' |
|
1880 |
] ifFalse:[ |
|
1881 |
oldSource isNil ifTrue:[ |
|
1882 |
beep := true. |
|
1883 |
outcome := 'No source for compare.' |
|
1884 |
] ifFalse:[ |
|
1885 |
"/ |
|
1886 |
"/ compare for tabulator <-> space changes |
|
1887 |
"/ before showing diff... |
|
1888 |
"/ |
|
1889 |
t1 := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
1890 |
t2 := newSource asCollectionOfLines collect:[:s | s withTabsExpanded]. |
|
1891 |
t1 = t2 ifTrue:[ |
|
1892 |
outcome := 'Same source.' |
|
1893 |
] ifFalse:[ |
|
1894 |
outcome := 'Source changed!!'. |
|
1895 |
showDiff := true. |
|
1896 |
||
1897 |
"/ |
|
1898 |
"/ check if only historyLine diffs |
|
1899 |
"/ |
|
1900 |
(HistoryManager notNil |
|
1901 |
and:[HistoryManager isActive]) ifTrue:[ |
|
1902 |
(HistoryManager withoutHistoryLines:newSource) |
|
1903 |
= |
|
1904 |
(HistoryManager withoutHistoryLines:oldSource) |
|
1905 |
ifTrue:[ |
|
1906 |
outcome := 'Same source (history only).'. |
|
1907 |
showDiff := false. |
|
1908 |
] |
|
1909 |
]. |
|
1910 |
] |
|
1911 |
] |
|
1912 |
] |
|
1913 |
] ifFalse:[ |
|
1914 |
isLoaded ifTrue:[ |
|
1915 |
beep := true. |
|
1916 |
outcome := 'Method does not exist!!' |
|
1917 |
] |
|
1918 |
] |
|
1919 |
] ifFalse:[ |
|
1920 |
outcome := 'Change unparsable!!' |
|
1921 |
]. |
|
1922 |
(showDiff and:[oldSource notNil and:[newSource notNil]]) ifTrue:[ |
|
1923 |
d := DiffTextView |
|
1924 |
openOn:oldSource label:'Current version (in image)' |
|
1925 |
and:newSource label:'Change version'. |
|
1926 |
d label:'method differences'. |
|
1927 |
] |
|
1928 |
] ifFalse:[ |
|
1929 |
beep := true. |
|
1930 |
outcome := 'Class does not exist!!' |
|
1931 |
] |
|
1932 |
] ifFalse:[ |
|
1933 |
beep := true. |
|
1934 |
outcome := 'Not comparable!!' |
|
1935 |
] |
|
1936 |
] ifFalse:[ |
|
1937 |
beep := true. |
|
1938 |
outcome := 'Not comparable!!' |
|
1939 |
] |
|
1545 | 1940 |
]. |
1941 |
aStream close. |
|
1942 |
showDiff ifFalse:[ |
|
2250 | 1943 |
beep ifTrue:[ |
1944 |
self warn:outcome withCRs. |
|
1945 |
] ifFalse:[ |
|
1946 |
self information:outcome withCRs. |
|
1947 |
] |
|
1545 | 1948 |
] |
1949 |
! |
|
1950 |
||
1951 |
compressForClass:aClassNameOrNil |
|
1546 | 1952 |
"compresses the list of changes; |
1545 | 1953 |
this replaces multiple method-changes by the last (i.e. the most recent) change. |
1954 |
If the class argument is nil, compress for all classes. |
|
1955 |
otherwise, only changes for that class are compressed." |
|
1956 |
||
1957 |
|aStream searchIndex anyMore deleteSet index |
|
1958 |
str snapshotProto snapshotPrefix snapshotNameIndex fileName| |
|
1959 |
||
1960 |
aStream := FileStream readonlyFileNamed:changeFileName. |
|
1961 |
aStream isNil ifTrue:[^ self]. |
|
1962 |
||
1963 |
aClassNameOrNil isNil ifTrue:[ |
|
2250 | 1964 |
self newLabel:'compressing...'. |
1545 | 1965 |
] ifFalse:[ |
2250 | 1966 |
self newLabel:'compressing for ' , aClassNameOrNil. |
1545 | 1967 |
]. |
1968 |
||
1969 |
CompressSnapshotInfo == true ifTrue:[ |
|
2250 | 1970 |
" |
1971 |
get a prototype snapshot record (to be independent of |
|
1972 |
the actual format .. |
|
1973 |
" |
|
1974 |
str := WriteStream on:String new. |
|
1975 |
Class addChangeRecordForSnapshot:'foo' to:str. |
|
1976 |
snapshotProto := str contents. |
|
1977 |
snapshotPrefix := snapshotProto copyTo:10. |
|
1978 |
snapshotNameIndex := snapshotProto findString:'foo'. |
|
1545 | 1979 |
]. |
1980 |
||
1981 |
self valueOfNotReading value: false. |
|
1982 |
self valueOfHavingSelection value: false. |
|
1983 |
self valueOfHavingChangeSelection value: false. |
|
1984 |
self valueOfReadProgress value: 0. |
|
1985 |
self readProgressIndicator raise. |
|
1986 |
self filterLabel label: 'Comp:'; redraw. |
|
1987 |
||
1988 |
self withExecuteCursorDo:[ |
|
2250 | 1989 |
|numChanges classes selectors types excla sawExcla |
1990 |
changeNr chunk aParseTree parseTreeChunk |
|
1991 |
thisClass thisSelector codeChunk codeParser |
|
1992 |
compressThis oldValue| |
|
1993 |
||
1994 |
numChanges := changes size. |
|
1995 |
classes := Array new:numChanges. |
|
1996 |
selectors := Array new:numChanges. |
|
1997 |
types := Array new:numChanges. |
|
1998 |
||
1999 |
"starting at the end, get the change class and change selector; |
|
2000 |
collect all in classes / selectors" |
|
2001 |
||
2002 |
changeNr := numChanges. |
|
2003 |
excla := aStream class chunkSeparator. |
|
2004 |
||
2005 |
[changeNr >= 1] whileTrue:[ |
|
2006 |
oldValue := self valueOfReadProgress value. |
|
2007 |
self valueOfReadProgress value: (100 - ((aStream position/aStream size) * 100) rounded). |
|
2008 |
oldValue ~~ self valueOfReadProgress value |
|
2009 |
ifTrue: [self readProgressIndicator redrawEdges;redraw]. |
|
2010 |
aStream position:(changes at: changeNr) position. |
|
2011 |
sawExcla := aStream peekFor:excla. |
|
2012 |
chunk := aStream nextChunk. |
|
2013 |
sawExcla ifTrue:[ |
|
2014 |
"optimize a bit if multiple methods for same category arrive" |
|
2015 |
(chunk = parseTreeChunk) ifFalse:[ |
|
2016 |
aParseTree := Parser parseExpression:chunk. |
|
2017 |
parseTreeChunk := chunk |
|
2018 |
]. |
|
2019 |
(aParseTree notNil |
|
2020 |
and:[(aParseTree ~~ #Error) |
|
2021 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
2022 |
(aParseTree selector == #methodsFor:) ifTrue:[ |
|
2023 |
thisClass := (aParseTree receiver evaluate). |
|
2024 |
codeChunk := aStream nextChunk. |
|
2025 |
codeParser := Parser |
|
2026 |
parseMethodSpecification:codeChunk |
|
2027 |
in:thisClass |
|
2028 |
ignoreErrors:true |
|
2029 |
ignoreWarnings:true. |
|
2030 |
(codeParser notNil and:[codeParser ~~ #Error]) ifTrue:[ |
|
2031 |
selectors at:changeNr put:(codeParser selector). |
|
2032 |
classes at:changeNr put:thisClass. |
|
2033 |
types at:changeNr put:#methodsFor |
|
2034 |
] |
|
2035 |
] |
|
2036 |
] |
|
2037 |
] ifFalse:[ |
|
2038 |
aParseTree := Parser parseExpression:chunk. |
|
2039 |
parseTreeChunk := chunk. |
|
2040 |
(aParseTree notNil |
|
2041 |
and:[(aParseTree ~~ #Error) |
|
2042 |
and:[aParseTree isMessage]]) ifTrue:[ |
|
2043 |
(aParseTree selector == #removeSelector:) ifTrue:[ |
|
2044 |
selectors at:changeNr put:(aParseTree arg1 value ). |
|
2045 |
classes at:changeNr put:(aParseTree receiver evaluate). |
|
2046 |
types at:changeNr put:#removeSelector |
|
2047 |
] |
|
2048 |
] ifFalse:[ |
|
2049 |
CompressSnapshotInfo == true ifTrue:[ |
|
2050 |
(chunk startsWith:snapshotPrefix) ifTrue:[ |
|
2051 |
str := chunk readStream position:snapshotNameIndex. |
|
2052 |
fileName := str upTo:(Character space). |
|
2053 |
" |
|
2054 |
kludge to allow use of match-check below |
|
2055 |
" |
|
2056 |
selectors at:changeNr put:snapshotPrefix. |
|
2057 |
classes at:changeNr put:fileName. |
|
2058 |
] |
|
2059 |
] |
|
2060 |
] |
|
2061 |
]. |
|
2062 |
changeNr := changeNr - 1 |
|
2063 |
]. |
|
2064 |
aStream close. |
|
2065 |
||
2066 |
"for all changes, look for another class/selector occurence later |
|
2067 |
in the list and, if there is one, add change number to the delete set" |
|
2068 |
||
2069 |
deleteSet := OrderedCollection new. |
|
2070 |
changeNr := 1. |
|
2071 |
[changeNr < changes size] whileTrue:[ |
|
2072 |
thisClass := classes at:changeNr. |
|
2073 |
||
2074 |
compressThis := false. |
|
2075 |
aClassNameOrNil isNil ifTrue:[ |
|
2076 |
compressThis := true |
|
2077 |
] ifFalse:[ |
|
2078 |
"/ skipping unloaded/unknown classes |
|
2079 |
thisClass isBehavior ifTrue:[ |
|
2080 |
thisClass isMeta ifTrue:[ |
|
2081 |
compressThis := aClassNameOrNil = thisClass soleInstance name. |
|
2082 |
] ifFalse:[ |
|
2083 |
compressThis := aClassNameOrNil = thisClass name. |
|
2084 |
(PrivateAsSeparate not and: [thisClass isPrivate]) |
|
2085 |
ifTrue:[compressThis := aClassNameOrNil = thisClass owningClass name] |
|
2086 |
] |
|
2087 |
] |
|
2088 |
]. |
|
2089 |
||
2090 |
compressThis ifTrue:[ |
|
2091 |
thisSelector := selectors at:changeNr. |
|
2092 |
searchIndex := changeNr. |
|
2093 |
anyMore := true. |
|
2094 |
[anyMore] whileTrue:[ |
|
2095 |
searchIndex := classes indexOf:thisClass |
|
2096 |
startingAt:(searchIndex + 1). |
|
2097 |
(searchIndex ~~ 0) ifTrue:[ |
|
2098 |
((selectors at:searchIndex) == thisSelector) ifTrue:[ |
|
2099 |
thisClass notNil ifTrue:[ |
|
2100 |
deleteSet add:changeNr. |
|
2101 |
anyMore := false |
|
2102 |
] |
|
2103 |
] |
|
2104 |
] ifFalse:[ |
|
2105 |
anyMore := false |
|
2106 |
] |
|
2107 |
]. |
|
2108 |
]. |
|
2109 |
||
2110 |
changeNr := changeNr + 1 |
|
2111 |
]. |
|
2112 |
||
2113 |
"finally delete what has been found" |
|
2114 |
||
2115 |
(deleteSet size > 0) ifTrue:[ |
|
2116 |
index := deleteSet size. |
|
2117 |
[index > 0] whileTrue:[ |
|
2118 |
self silentDeleteChange: (changes at: (deleteSet at:index)). |
|
2119 |
index := index - 1 |
|
2120 |
]. |
|
2121 |
self setChangeList |
|
2122 |
]. |
|
1545 | 2123 |
]. |
2124 |
self valueOfNotReading value: true. |
|
2125 |
self filterField raise. |
|
2126 |
self filterLabel label: 'Filter:'. |
|
2127 |
self newLabel: '' |
|
2128 |
! |
|
2129 |
||
2130 |
contractClass:className selector:selector to:maxLen |
|
2131 |
|s l| |
|
2132 |
||
2133 |
s := className , ' ', selector. |
|
2134 |
s size > maxLen ifTrue:[ |
|
2250 | 2135 |
l := maxLen - 1 - selector size max:20. |
2136 |
s := (className contractTo:l) , ' ' , selector. |
|
2137 |
||
2138 |
s size > maxLen ifTrue:[ |
|
2139 |
l := maxLen - 1 - className size max:20. |
|
2140 |
s := className , ' ', (selector contractTo:l). |
|
2141 |
||
2142 |
s size > maxLen ifTrue:[ |
|
2143 |
s := (className contractTo:(maxLen // 2 - 1)) , ' ' , (selector contractTo:maxLen // 2) |
|
2144 |
] |
|
2145 |
] |
|
1545 | 2146 |
]. |
2147 |
^ s |
|
2148 |
||
2149 |
! |
|
2150 |
||
2151 |
deleteChangesFrom:start to:stop |
|
1546 | 2152 |
"deletes a range of changes" |
1545 | 2153 |
|
1712 | 2154 |
self unselectChange. |
1545 | 2155 |
stop to:start by:-1 do:[:changeNr| |
2250 | 2156 |
self silentDeleteChange:(self listOfChanges at: changeNr) |
1546 | 2157 |
]. |
2158 |
self setChangeList |
|
1545 | 2159 |
! |
2160 |
||
1546 | 2161 |
fullClassNameOfChange:aChange |
2162 |
"returns the full classname of aChange |
|
1545 | 2163 |
(for classChanges (i.e. xxx class), a string ending in ' class' is returned. |
2164 |
- since parsing ascii methods is slow, keep result cached in |
|
2165 |
changeClassNames for the next query" |
|
2166 |
||
2167 |
|chunk aParseTree recTree sel name arg1Tree isMeta prevMethodDefNr |
|
2168 |
words changeStream fullParseTree ownerTree ownerName oldDollarSetting| |
|
2169 |
||
1546 | 2170 |
aChange isNil ifTrue:[^ nil]. |
1545 | 2171 |
|
2172 |
" |
|
2173 |
first look, if not already known |
|
2174 |
" |
|
1546 | 2175 |
name := aChange className. |
1545 | 2176 |
name notNil ifTrue:[^ name]. |
2177 |
||
1546 | 2178 |
prevMethodDefNr := changes indexOf: aChange. |
1545 | 2179 |
[(changes at:prevMethodDefNr) followUp] whileTrue:[ |
2250 | 2180 |
prevMethodDefNr := prevMethodDefNr - 1. |
1545 | 2181 |
]. |
2182 |
||
2183 |
" |
|
2184 |
get the chunk |
|
2185 |
" |
|
2186 |
chunk := (changes at:prevMethodDefNr) chunk. |
|
2187 |
chunk isNil ifTrue:[^ nil]. "mhmh - empty" |
|
2188 |
||
2189 |
(chunk startsWith:'''---') ifTrue:[ |
|
2250 | 2190 |
words := chunk asCollectionOfWords. |
2191 |
words size > 2 ifTrue:[ |
|
2192 |
(words at:2) = 'checkin' ifTrue:[ |
|
2193 |
name := words at:3. |
|
2194 |
aChange className: name. |
|
2195 |
^ name |
|
2196 |
] |
|
2197 |
]. |
|
1545 | 2198 |
]. |
2199 |
||
2200 |
"/ fix it - otherwise, it cannot be parsed |
|
2201 |
(chunk endsWith:'primitiveDefinitions:') ifTrue:[ |
|
2250 | 2202 |
chunk := chunk , '''''' |
1545 | 2203 |
]. |
2204 |
(chunk endsWith:'primitiveFunctions:') ifTrue:[ |
|
2250 | 2205 |
chunk := chunk , '''''' |
1545 | 2206 |
]. |
2207 |
(chunk endsWith:'primitiveVariables:') ifTrue:[ |
|
2250 | 2208 |
chunk := chunk , '''''' |
1545 | 2209 |
]. |
2210 |
||
2211 |
" |
|
2212 |
use parser to construct a parseTree |
|
2213 |
" |
|
2214 |
oldDollarSetting := Parser allowDollarInIdentifier. |
|
2215 |
[ |
|
2250 | 2216 |
Parser allowDollarInIdentifier:true. |
2217 |
aParseTree := Parser parseExpression:chunk. |
|
1545 | 2218 |
] valueNowOrOnUnwindDo:[ |
2250 | 2219 |
Parser allowDollarInIdentifier:oldDollarSetting |
1545 | 2220 |
]. |
2221 |
||
2222 |
(aParseTree isNil or:[aParseTree == #Error]) ifTrue:[ |
|
2250 | 2223 |
^ nil "seems strange... (could be a comment)" |
1545 | 2224 |
]. |
2225 |
aParseTree isMessage ifFalse:[ |
|
2250 | 2226 |
^ nil "very strange... (whats that ?)" |
1545 | 2227 |
]. |
2228 |
||
2229 |
" |
|
2230 |
ask parser for selector |
|
2231 |
" |
|
2232 |
sel := aParseTree selector. |
|
2233 |
recTree := aParseTree receiver. |
|
2234 |
||
2235 |
" |
|
2236 |
is it a method-change, methodRemove or comment-change ? |
|
2237 |
" |
|
2238 |
(#(#'methodsFor:' |
|
2239 |
#'privateMethodsFor:' |
|
2240 |
#'protectedMethodsFor:' |
|
2241 |
#'publicMethodsFor:' |
|
2242 |
#'removeSelector:' |
|
2243 |
#'comment:' |
|
2244 |
#'primitiveDefinitions:' |
|
2245 |
#'primitiveFunctions:' |
|
2246 |
#'primitiveVariables:' |
|
2247 |
#'renameCategory:to:' |
|
2248 |
#'instanceVariableNames:' |
|
2249 |
) includes:sel) ifTrue:[ |
|
2250 | 2250 |
" |
2251 |
yes, the className is the receiver |
|
2252 |
" |
|
2253 |
(recTree notNil and:[recTree ~~ #Error]) ifTrue:[ |
|
2254 |
isMeta := false. |
|
2255 |
recTree isUnaryMessage ifTrue:[ |
|
2256 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
2257 |
"id class methodsFor:..." |
|
2258 |
recTree := recTree receiver. |
|
2259 |
isMeta := true. |
|
2260 |
]. |
|
2261 |
recTree isPrimary ifTrue:[ |
|
2262 |
name := recTree name. |
|
2263 |
isMeta ifTrue:[ |
|
2264 |
name := name , ' class'. |
|
2265 |
]. |
|
2266 |
aChange className: name. |
|
2267 |
^ name |
|
2268 |
] |
|
2269 |
]. |
|
2270 |
"more strange things" |
|
2271 |
^ nil |
|
1545 | 2272 |
]. |
2273 |
||
2274 |
" |
|
2275 |
is it a change in a class-description ? |
|
2276 |
" |
|
2277 |
(('subclass:*' match:sel) |
|
2278 |
or:[('variable*subclass:*' match:sel)]) ifTrue:[ |
|
2250 | 2279 |
"/ must parse the full changes text, to get |
2280 |
"/ privacy information. |
|
2281 |
||
2282 |
changeStream := self streamForChange:aChange. |
|
2283 |
changeStream notNil ifTrue:[ |
|
2284 |
chunk := changeStream nextChunk. |
|
2285 |
changeStream close. |
|
2286 |
fullParseTree := Parser parseExpression:chunk. |
|
2287 |
(fullParseTree isNil or:[fullParseTree == #Error]) ifTrue:[ |
|
2288 |
fullParseTree := nil |
|
2289 |
]. |
|
2290 |
fullParseTree isMessage ifFalse:[ |
|
2291 |
fullParseTree := nil |
|
2292 |
]. |
|
2293 |
"/ actually, the nil case cannot happen |
|
2294 |
fullParseTree notNil ifTrue:[ |
|
2295 |
aParseTree := fullParseTree. |
|
2296 |
sel := aParseTree selector. |
|
2297 |
]. |
|
2298 |
]. |
|
2299 |
||
2300 |
arg1Tree := aParseTree arg1. |
|
2301 |
(arg1Tree notNil and:[arg1Tree isConstant]) ifTrue:[ |
|
2302 |
name := arg1Tree value asString. |
|
2303 |
||
2304 |
"/ is it a private-class ? |
|
2305 |
('*privateIn:' match:sel) ifTrue:[ |
|
2306 |
ownerTree := aParseTree args last. |
|
2307 |
ownerName := ownerTree name asString. |
|
2308 |
name := ownerName , '::' , name |
|
2309 |
]. |
|
2310 |
aChange className: name. |
|
2311 |
^ name |
|
2312 |
]. |
|
2313 |
"very strange" |
|
2314 |
^ nil |
|
1545 | 2315 |
]. |
2316 |
||
2317 |
" |
|
2318 |
is it a class remove ? |
|
2319 |
" |
|
2320 |
(sel == #removeClass:) ifTrue:[ |
|
2250 | 2321 |
(recTree notNil |
2322 |
and:[recTree ~~ #Error |
|
2323 |
and:[recTree isPrimary |
|
2324 |
and:[recTree name = 'Smalltalk']]]) ifTrue:[ |
|
2325 |
arg1Tree := aParseTree arg1. |
|
2326 |
(arg1Tree notNil and:[arg1Tree isPrimary]) ifTrue:[ |
|
2327 |
name := arg1Tree name. |
|
2328 |
aChange className: name. |
|
2329 |
^ name |
|
2330 |
]. |
|
2331 |
] |
|
1545 | 2332 |
]. |
2333 |
||
2334 |
" |
|
2335 |
is it a method category change ? |
|
2336 |
" |
|
2337 |
((sel == #category:) |
|
2338 |
or:[sel == #privacy:]) ifTrue:[ |
|
2250 | 2339 |
(recTree notNil |
2340 |
and:[recTree ~~ #Error |
|
2341 |
and:[recTree isMessage |
|
2342 |
and:[recTree selector == #compiledMethodAt:]]]) ifTrue:[ |
|
2343 |
isMeta := false. |
|
2344 |
recTree := recTree receiver. |
|
2345 |
recTree isUnaryMessage ifTrue:[ |
|
2346 |
(recTree selector ~~ #class) ifTrue:[^ nil]. |
|
2347 |
"id class " |
|
2348 |
recTree := recTree receiver |
|
2349 |
]. |
|
2350 |
recTree isPrimary ifTrue:[ |
|
2351 |
isMeta ifTrue:[ |
|
2352 |
name := name , ' class'. |
|
2353 |
]. |
|
2354 |
name := recTree name. |
|
2355 |
aChange className: name. |
|
2356 |
^ name |
|
2357 |
] |
|
2358 |
] |
|
1545 | 2359 |
]. |
2360 |
^ nil |
|
2361 |
! |
|
2362 |
||
2363 |
newLabel:how |
|
1546 | 2364 |
"sets the label" |
1545 | 2365 |
|
2366 |
how size = 0 ifTrue: [^self window label:self class label]. |
|
1556 | 2367 |
self window label:self class label, ' (', how, ')' |
1545 | 2368 |
! |
2369 |
||
2370 |
readChangesFileInBackground:inBackground |
|
1546 | 2371 |
"reads the changes file, creates a list of header-lines (changeChunks) |
1545 | 2372 |
and a list of chunk-positions (changePositions). |
2373 |
Starting with 2.10.3, the entries are multi-col entries; |
|
2374 |
the cols are: |
|
2740
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2375 |
1 delta (only if comparing) |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2376 |
'+' -> new method (w.r.t. current state) |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2377 |
'-' -> removed method (w.r.t. current state) |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2378 |
'?' -> class does not exist currently |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2379 |
'=' -> change is same as current methods source |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2380 |
2 class/selector |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2381 |
3 type of change |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2382 |
doit |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2383 |
method |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2384 |
category change |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2385 |
4 timestamp |
1545 | 2386 |
|
2387 |
since comparing slows down startup time, it is now disabled by |
|
2388 |
default and can be enabled via a toggle." |
|
2389 |
||
2740
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2390 |
|aStream maxLen i f v| |
1545 | 2391 |
|
2392 |
self valueOfNotReading value: false. |
|
2393 |
self valueOfHavingSelection value: false. |
|
2394 |
self valueOfHavingChangeSelection value: false. |
|
2395 |
||
2396 |
editingClassSource := false. |
|
2397 |
||
2398 |
maxLen := 60. |
|
2399 |
||
2400 |
f := changeFileName asFilename. |
|
2401 |
aStream := f readStream. |
|
2402 |
aStream isNil ifTrue:[^ nil]. |
|
2403 |
||
1653 | 2404 |
self newLabel:(resources string:'updating...'). |
1545 | 2405 |
|
2406 |
i := f info. |
|
2407 |
changeFileTimestamp := i modified. |
|
2408 |
||
2409 |
self valueOfReadProgress value: 0. |
|
2740
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2410 |
v := self readProgressIndicator. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2411 |
v notNil ifTrue:[v raise]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2412 |
v := self filterLabel. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2413 |
v notNil ifTrue:[v label: 'Read:'; redraw]. |
1545 | 2414 |
|
2415 |
self withReadCursorDo:[ |
|
2740
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2416 |
|myProcess myPriority| |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2417 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2418 |
" |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2419 |
this is a time consuming operation (especially, if reading an |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2420 |
NFS-mounted directory; therefore lower my priority... |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2421 |
" |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2422 |
inBackground ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2423 |
myProcess := Processor activeProcess. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2424 |
myPriority := myProcess priority. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2425 |
myProcess priority:(Processor userBackgroundPriority). |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2426 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2427 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2428 |
[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2429 |
|excla timeStampInfo lastChange| |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2430 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2431 |
excla := aStream class chunkSeparator. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2432 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2433 |
[aStream atEnd] whileFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2434 |
|change changeDelta changeString changeType changeCategory |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2435 |
line s l changeClass sawExcla category |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2436 |
chunkText chunkPos sel oldValue| |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2437 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2438 |
change := Change new. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2439 |
" |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2440 |
get a chunk (separated by excla) |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2441 |
" |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2442 |
oldValue := self valueOfReadProgress value. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2443 |
self valueOfReadProgress value: (((aStream position/aStream size) * 100) rounded). |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2444 |
"/ oldValue ~~ self valueOfReadProgress value |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2445 |
"/ ifTrue: [self readProgressIndicator redrawEdges;redraw]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2446 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2447 |
aStream skipSeparators. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2448 |
chunkPos := aStream position. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2449 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2450 |
sawExcla := aStream peekFor:excla. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2451 |
chunkText := aStream nextChunk. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2452 |
chunkText notNil ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2453 |
|index headerLine cls| |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2454 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2455 |
(chunkText startsWith:'''---- timestamp ') ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2456 |
timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2457 |
] ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2458 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2459 |
" |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2460 |
only first line is saved in changeChunks... |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2461 |
" |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2462 |
index := chunkText indexOf:(Character cr). |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2463 |
(index ~~ 0) ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2464 |
chunkText := chunkText copyTo:(index - 1). |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2465 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2466 |
"take care for comment changes - must still be a |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2467 |
valid expression for classNameOfChange: to work" |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2468 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2469 |
(chunkText endsWith:'comment:''') ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2470 |
chunkText := chunkText , '...''' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2471 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2472 |
(chunkText endsWith:'primitiveDefinitions:''') ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2473 |
sel := 'primitiveDefinitions:'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2474 |
chunkText := chunkText copyWithoutLast:1 |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2475 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2476 |
(chunkText endsWith:'primitiveVariables:''') ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2477 |
sel := 'primitiveVariables:'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2478 |
chunkText := chunkText copyWithoutLast:1 |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2479 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2480 |
(chunkText endsWith:'primitiveFunctions:''') ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2481 |
sel := 'primitiveFunctions:'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2482 |
chunkText := chunkText copyWithoutLast:1 |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2483 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2484 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2485 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2486 |
change chunk: chunkText. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2487 |
change position: chunkPos. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2488 |
lastChange notNil ifTrue: [lastChange lastPosition: chunkPos - 1]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2489 |
lastChange := change. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2490 |
change timeStamp: timeStampInfo. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2491 |
change followUp: false. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2492 |
headerLine := nil. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2493 |
changeDelta := ' '. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2494 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2495 |
sawExcla ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2496 |
(chunkText startsWith:'''---- snap') ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2497 |
changeType := ''. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2498 |
headerLine := chunkText. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2499 |
changeString := (chunkText contractTo:maxLen). |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2500 |
timeStampInfo := nil. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2501 |
] ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2502 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2503 |
|p cls| |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2504 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2505 |
headerLine := chunkText , ' (doIt)'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2506 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2507 |
" |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2508 |
first, assume doIt - then lets have a more detailed look... |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2509 |
" |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2510 |
((chunkText startsWith:'''---- file') |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2511 |
or:[(chunkText startsWith:'''---- check')]) ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2512 |
changeType := ''. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2513 |
timeStampInfo := nil. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2514 |
] ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2515 |
changeType := 'doIt'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2516 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2517 |
changeString := (chunkText contractTo:maxLen). |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2518 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2519 |
p := Parser parseExpression:chunkText inNameSpace:Smalltalk. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2520 |
(p notNil |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2521 |
and:[p ~~ #Error |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2522 |
and:[p isMessage]]) ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2523 |
sel := p selector. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2524 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2525 |
(sel == #removeSelector:) ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2526 |
p receiver isUnaryMessage ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2527 |
cls := p receiver receiver name. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2528 |
changeClass := (Smalltalk classNamed:cls) class. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2529 |
cls := cls , ' class'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2530 |
] ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2531 |
cls := p receiver name. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2532 |
changeClass := (Smalltalk classNamed:cls) |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2533 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2534 |
sel := (p args at:1) evaluate. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2535 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2536 |
DeltaInfoColumn ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2537 |
(changeClass isNil or:[changeClass isLoaded not]) ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2538 |
changeDelta := '?' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2539 |
] ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2540 |
(changeClass implements:sel asSymbol) ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2541 |
changeDelta := '-'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2542 |
] |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2543 |
] |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2544 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2545 |
changeType := 'remove'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2546 |
changeString := self contractClass:cls selector:sel to:maxLen. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2547 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2548 |
(p ~~ #Error |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2549 |
and:[p isMessage |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2550 |
and:[p receiver isMessage |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2551 |
and:[p receiver selector == #compiledMethodAt:]]]) ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2552 |
p receiver receiver isUnaryMessage ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2553 |
cls := p receiver receiver receiver name. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2554 |
changeClass := (Smalltalk classNamed:cls) class. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2555 |
cls := cls , ' class'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2556 |
] ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2557 |
cls := p receiver receiver name. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2558 |
changeClass := (Smalltalk classNamed:cls) |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2559 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2560 |
(sel == #category:) ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2561 |
sel := (p receiver args at:1) evaluate. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2562 |
changeType := '(category change)'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2563 |
changeString := self contractClass:cls selector:sel to:maxLen. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2564 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2565 |
(sel == #privacy:) ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2566 |
sel := (p receiver args at:1) evaluate. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2567 |
changeType := 'privacy change'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2568 |
changeString := self contractClass:cls selector:sel to:maxLen. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2569 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2570 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2571 |
(#(#'subclass:' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2572 |
#'variableSubclass:' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2573 |
#'variableByteSubclass:' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2574 |
#'variableWordSubclass:' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2575 |
#'variableLongSubclass:' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2576 |
#'variableFloatSubclass:' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2577 |
#'variableDoubleSubclass:' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2578 |
#'primitiveDefinitions:' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2579 |
#'primitiveFunctions:' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2580 |
#'primitiveVariables:' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2581 |
) includes:sel) ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2582 |
changeType := 'class definition'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2583 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2584 |
] |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2585 |
] ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2586 |
|done first p className cls text methodPos| |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2587 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2588 |
" |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2589 |
method definitions actually consist of |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2590 |
two (or more) chunks; skip next chunk(s) |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2591 |
up to an empty one. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2592 |
The system only writes one chunk, |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2593 |
and we cannot handle more in this ChangesBrowser.... |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2594 |
" |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2595 |
className := nil. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2596 |
p := Parser parseExpression:chunkText inNameSpace:Smalltalk. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2597 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2598 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2599 |
sel := p selector. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2600 |
(sel == #methodsFor:) ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2601 |
p receiver isUnaryMessage ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2602 |
className := p receiver receiver name. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2603 |
changeClass := (Smalltalk classNamed:className) class. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2604 |
className := className , ' class'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2605 |
] ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2606 |
className := p receiver name. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2607 |
changeClass := Smalltalk classNamed:className |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2608 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2609 |
category := (p args at:1) evaluate. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2610 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2611 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2612 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2613 |
done := false. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2614 |
first := true. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2615 |
[done] whileFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2616 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2617 |
changeDelta := ' '. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2618 |
methodPos := aStream position. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2619 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2620 |
text := aStream nextChunk. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2621 |
text isNil ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2622 |
done := true |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2623 |
] ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2624 |
done := text isEmpty |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2625 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2626 |
done ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2627 |
first ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2628 |
change := Change new. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2629 |
change chunk: chunkText. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2630 |
change string:changeString. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2631 |
change position: methodPos. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2632 |
change className: className. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2633 |
lastChange notNil ifTrue: [lastChange lastPosition: methodPos - 1]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2634 |
lastChange := change. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2635 |
change timeStamp: timeStampInfo. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2636 |
change followUp: true. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2637 |
editingClassSource := true. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2638 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2639 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2640 |
first := false. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2641 |
" |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2642 |
try to find the selector |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2643 |
" |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2644 |
sel := nil. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2645 |
className notNil ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2646 |
p := Parser |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2647 |
parseMethodSpecification:text |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2648 |
in:nil |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2649 |
ignoreErrors:true |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2650 |
ignoreWarnings:true. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2651 |
(p notNil and:[p ~~ #Error]) ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2652 |
sel := p selector. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2653 |
] |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2654 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2655 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2656 |
sel isNil ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2657 |
changeString := (chunkText contractTo:maxLen). |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2658 |
changeType := 'change'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2659 |
headerLine := chunkText , ' (change)'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2660 |
] ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2661 |
changeString := self contractClass:className selector:sel to:maxLen. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2662 |
changeType := 'method definition'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2663 |
changeCategory := category. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2664 |
headerLine := className , ' ' , sel , ' ' , '(change category: ''' , category , ''')'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2665 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2666 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2667 |
DeltaInfoColumn ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2668 |
changeClass isNil ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2669 |
changeClass isMeta ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2670 |
cls := changeClass soleInstance |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2671 |
] ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2672 |
cls := changeClass |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2673 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2674 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2675 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2676 |
(changeClass isNil or:[cls isLoaded not]) ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2677 |
changeDelta := '?' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2678 |
] ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2679 |
(changeClass implements:sel asSymbol) ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2680 |
changeDelta := '+'. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2681 |
] ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2682 |
|m currentText t1 t2| |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2683 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2684 |
m := changeClass compiledMethodAt:sel asSymbol. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2685 |
currentText := m source. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2686 |
currentText notNil ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2687 |
text asString = currentText asString ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2688 |
changeDelta := '=' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2689 |
] ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2690 |
t1 := currentText asCollectionOfLines collect:[:s | s withTabsExpanded]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2691 |
t2 := text asCollectionOfLines collect:[:s | s withTabsExpanded]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2692 |
t1 = t2 ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2693 |
changeDelta := '=' |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2694 |
] |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2695 |
] |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2696 |
] |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2697 |
] |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2698 |
] |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2699 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2700 |
change delta:changeDelta. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2701 |
change string:changeString. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2702 |
change type:changeType. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2703 |
change category: changeCategory. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2704 |
change timeStamp:timeStampInfo. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2705 |
changes add:change. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2706 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2707 |
changeString := nil. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2708 |
headerLine := nil. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2709 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2710 |
] |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2711 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2712 |
changeString notNil ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2713 |
change delta:changeDelta. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2714 |
change string:changeString. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2715 |
change type:changeType. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2716 |
change timeStamp:timeStampInfo. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2717 |
changes add:change. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2718 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2719 |
] ifFalse:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2720 |
headerLine notNil ifTrue:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2721 |
changes add: change. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2722 |
] |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2723 |
] |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2724 |
] |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2725 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2726 |
change lastPosition: aStream position. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2727 |
]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2728 |
modified := false. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2729 |
|
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2730 |
] valueNowOrOnUnwindDo:[ |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2731 |
aStream close. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2732 |
inBackground ifTrue:[myProcess priority:myPriority]. |
6b8666356abb
oops - dont try to redraw components which are not there
Claus Gittinger <cg@exept.de>
parents:
2250
diff
changeset
|
2733 |
]. |
1545 | 2734 |
]. |
2735 |
self setChangeList. |
|
2736 |
self valueOfNotReading value: true. |
|
2737 |
self filterField raise. |
|
2738 |
self filterLabel label: 'Filter:'. |
|
2739 |
||
1653 | 2740 |
self checkIfFileHasChanged. |
2741 |
||
1771
6d6c2bde9615
dont catch halts and breakpoints while reading;
Claus Gittinger <cg@exept.de>
parents:
1712
diff
changeset
|
2742 |
"Modified: / 30.7.1998 / 11:39:58 / cg" |
1545 | 2743 |
! |
2744 |
||
1546 | 2745 |
selectorOfMethodChange:aChange |
2746 |
"returns the selector of the method change, or nil if it is not a method change" |
|
1545 | 2747 |
|
2748 |
|source parser sel| |
|
2749 |
||
1546 | 2750 |
source := self sourceOfMethodChange:aChange. |
1545 | 2751 |
source isNil ifTrue:[^ nil]. |
2752 |
||
2753 |
parser := Parser |
|
2250 | 2754 |
parseMethod:source |
2755 |
in:nil |
|
2756 |
ignoreErrors:true |
|
2757 |
ignoreWarnings:true. |
|
1545 | 2758 |
|
2759 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
2250 | 2760 |
sel := parser selector. |
1545 | 2761 |
]. |
2762 |
^ sel |
|
2763 |
! |
|
2764 |
||
2765 |
setChangeList |
|
1546 | 2766 |
"sets the list of changes into the list for the table by evaluating filterCompletionBlock" |
2767 |
||
2768 |
self unselectChange. |
|
2769 |
filterCompletionBlock value: self valueOfFilter value. |
|
1545 | 2770 |
! |
2771 |
||
1546 | 2772 |
silentDeleteChange:aChange |
2773 |
"delete aChange do not update changeListView" |
|
1545 | 2774 |
|
2775 |
modified := true. |
|
2776 |
||
1546 | 2777 |
changes remove:aChange |
1545 | 2778 |
! |
2779 |
||
2780 |
silentDeleteChangesFor:aClassName from:start to:stop |
|
1546 | 2781 |
"deletes changes for aChange in the range [start,stop] |
2782 |
and returns the number of the deleted changes" |
|
2783 |
||
2784 |
|index numDeleted clsName| |
|
1545 | 2785 |
|
2786 |
numDeleted := 0. |
|
1546 | 2787 |
index := stop. |
2788 |
[index >= start] whileTrue: |
|
2789 |
[ |
|
2250 | 2790 |
((clsName := self classNameOfChange:(self listOfChanges at: index)) notNil and: |
2791 |
[(clsName = aClassName or: [PrivateAsSeparate not and: [(clsName upTo: $:) = aClassName]])]) |
|
2792 |
ifTrue: |
|
2793 |
[ |
|
2794 |
self silentDeleteChange:(self listOfChanges at: index). |
|
2795 |
numDeleted := numDeleted + 1. |
|
2796 |
]. |
|
2797 |
index := index - 1 |
|
1545 | 2798 |
]. |
2799 |
^ numDeleted |
|
2800 |
! |
|
2801 |
||
1546 | 2802 |
sourceOfMethodChange:aChange |
2803 |
"returns the source code of the method change, or nil if it is not a method change." |
|
1545 | 2804 |
|
2805 |
|aStream chunk sawExcla parseTree sourceChunk| |
|
2806 |
||
1546 | 2807 |
aStream := self streamForChange:aChange. |
1545 | 2808 |
aStream isNil ifTrue:[^ nil]. |
2809 |
||
1546 | 2810 |
aChange followUp ifFalse:[ |
2250 | 2811 |
sawExcla := aStream peekFor:(aStream class chunkSeparator). |
2812 |
chunk := aStream nextChunk. |
|
1545 | 2813 |
] ifTrue:[ |
2250 | 2814 |
chunk := aChange chunk. |
2815 |
sawExcla := true. |
|
1545 | 2816 |
]. |
2817 |
||
2818 |
sawExcla ifTrue:[ |
|
2250 | 2819 |
parseTree := Parser parseExpression:chunk. |
2820 |
(parseTree notNil and:[parseTree isMessage]) ifTrue:[ |
|
2821 |
(parseTree selector == #methodsFor:) ifTrue:[ |
|
2822 |
sourceChunk := aStream nextChunk. |
|
2823 |
] |
|
2824 |
]. |
|
1545 | 2825 |
]. |
2826 |
aStream close. |
|
2827 |
^ sourceChunk |
|
2828 |
! |
|
2829 |
||
1546 | 2830 |
streamForChange:aChange |
2831 |
"returns the stream for aChange" |
|
1545 | 2832 |
|
2833 |
|aStream| |
|
2834 |
||
2835 |
aStream := FileStream readonlyFileNamed:changeFileName. |
|
2836 |
aStream isNil ifTrue:[^ nil]. |
|
1546 | 2837 |
aStream position:aChange position. |
1545 | 2838 |
^ aStream |
2839 |
||
2840 |
! |
|
2841 |
||
2842 |
unselectChange |
|
1546 | 2843 |
"unselects the current change" |
2844 |
||
2845 |
self selectionOfChange value: nil. |
|
2846 |
self valueOfChangeText value: nil |
|
2847 |
||
1545 | 2848 |
! |
2849 |
||
2850 |
withSelectedChangeDo:aBlock |
|
2851 |
"just a helper, check for a selected change and evaluate aBlock |
|
2852 |
with busy cursor" |
|
2853 |
||
2854 |
|change| |
|
2855 |
||
2856 |
(change := self selectionOfChange value) notNil |
|
2857 |
ifTrue:[ |
|
2250 | 2858 |
self withExecuteCursorDo:[aBlock value:change] |
1545 | 2859 |
] |
2860 |
! ! |
|
2861 |
||
2862 |
!NewChangesBrowser methodsFor:'startup / release'! |
|
2863 |
||
2864 |
closeRequest |
|
1546 | 2865 |
"asks for saving before closing" |
1545 | 2866 |
|
5395
ff5fc88d4a4b
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
3220
diff
changeset
|
2867 |
self valueOfNotSaving value ifFalse: [^ self]. |
1545 | 2868 |
|
2869 |
modified ifTrue:[ |
|
5395
ff5fc88d4a4b
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
3220
diff
changeset
|
2870 |
(OptionBox |
ff5fc88d4a4b
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
3220
diff
changeset
|
2871 |
request:(resources string:'Change list was modified. Exit anyway?') withCRs |
ff5fc88d4a4b
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
3220
diff
changeset
|
2872 |
label:'Changes Browser' |
ff5fc88d4a4b
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
3220
diff
changeset
|
2873 |
form:(WarningBox iconBitmap) |
ff5fc88d4a4b
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
3220
diff
changeset
|
2874 |
buttonLabels:(resources array:#('Cancel' 'Discard Modifications and Exit')) |
ff5fc88d4a4b
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
3220
diff
changeset
|
2875 |
values:#(abort ignore) |
ff5fc88d4a4b
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
3220
diff
changeset
|
2876 |
default:#save |
ff5fc88d4a4b
Use 'Discard Changes and Exit' instead of 'Forget it...'
Stefan Vogel <sv@exept.de>
parents:
3220
diff
changeset
|
2877 |
) == #abort ifTrue:[^ self]. |
1545 | 2878 |
]. |
2879 |
super closeRequest |
|
1656 | 2880 |
|
2881 |
"Modified: / 20.5.1998 / 03:53:47 / cg" |
|
1545 | 2882 |
! |
2883 |
||
2884 |
postOpenWith:aBuilder |
|
1546 | 2885 |
"starts reading the changes from the file and |
2886 |
builds entryCompletionBlock for the filterField before opening" |
|
1545 | 2887 |
|
2888 |
super postOpenWith:aBuilder. |
|
2889 |
||
2890 |
builder namedComponents do: |
|
2891 |
[:aView| |
|
2250 | 2892 |
aView allSubViewsDo: |
2893 |
[:v| |
|
2894 |
v redraw |
|
2895 |
] |
|
1545 | 2896 |
]. |
2897 |
||
2898 |
autoUpdateBlock := [self checkIfFileHasChanged]. |
|
2899 |
Processor addTimedBlock:autoUpdateBlock afterSeconds:5. |
|
2900 |
self updateInfoLabel. |
|
2901 |
||
2902 |
self filterField entryCompletionBlock: |
|
2903 |
(filterCompletionBlock := [:value| |
|
2250 | 2904 |
|filter filters i changesCopy| |
2905 |
self unselectChange. |
|
2906 |
filter := self filterField contents. |
|
2907 |
(filters := filter asArrayOfSubstrings) size > 0 ifTrue: |
|
2908 |
[ |
|
2909 |
i := 0. |
|
2910 |
changesCopy := changes copy. |
|
2911 |
filters do: |
|
2912 |
[:filter| |
|
2913 |
i := i + 1. |
|
2914 |
changesCopy contents: |
|
2915 |
(changesCopy select: [:row| |
|
2916 |
filter match: (row string asArrayOfSubstrings at: i ifAbsent: [''''])]) |
|
2917 |
]. |
|
2918 |
self listOfChanges contents: changesCopy |
|
2919 |
] |
|
2920 |
ifFalse: |
|
2921 |
[ |
|
2922 |
self listOfChanges contents: changes |
|
2923 |
]. |
|
2924 |
self autoSelectLast. |
|
1546 | 2925 |
]). |
2926 |
||
1771
6d6c2bde9615
dont catch halts and breakpoints while reading;
Claus Gittinger <cg@exept.de>
parents:
1712
diff
changeset
|
2927 |
Object errorSignal handle: [:ex | |
2250 | 2928 |
ex parameter signal == HaltSignal ifTrue:[ |
2929 |
ex reject |
|
2930 |
]. |
|
2931 |
ex parameter signal == MessageTracer breakpointSignal ifTrue:[ |
|
2932 |
ex reject |
|
2933 |
]. |
|
2934 |
self warn:'Error while reading changes file:\\' , ex errorString. |
|
1771
6d6c2bde9615
dont catch halts and breakpoints while reading;
Claus Gittinger <cg@exept.de>
parents:
1712
diff
changeset
|
2935 |
] do: [ |
2250 | 2936 |
self readChangesFileInBackground:true |
1771
6d6c2bde9615
dont catch halts and breakpoints while reading;
Claus Gittinger <cg@exept.de>
parents:
1712
diff
changeset
|
2937 |
]. |
6d6c2bde9615
dont catch halts and breakpoints while reading;
Claus Gittinger <cg@exept.de>
parents:
1712
diff
changeset
|
2938 |
|
6d6c2bde9615
dont catch halts and breakpoints while reading;
Claus Gittinger <cg@exept.de>
parents:
1712
diff
changeset
|
2939 |
"Modified: / 30.7.1998 / 11:37:51 / cg" |
1545 | 2940 |
! |
2941 |
||
2942 |
uninitialize |
|
1546 | 2943 |
"removes the autoUpdateBlock from the Processor and myself from the ObjectMemory" |
1545 | 2944 |
|
2945 |
Processor removeTimedBlock:autoUpdateBlock. |
|
2946 |
ObjectMemory removeDependent:self |
|
2947 |
! ! |
|
2948 |
||
2949 |
!NewChangesBrowser methodsFor:'user actions'! |
|
2950 |
||
2951 |
doApply |
|
1546 | 2952 |
"applies the selected change" |
1545 | 2953 |
|
2954 |
self withSelectedChangeDo:[:change| |
|
2250 | 2955 |
skipSignal := nil. |
2956 |
self applyChange:change. |
|
2957 |
self autoSelectChange: (self listOfChanges at: (self listOfChanges indexOf: change) + 1 ifAbsent: [^self autoSelectLast]) |
|
1545 | 2958 |
] |
2959 |
! |
|
2960 |
||
2961 |
doApplyAll |
|
1546 | 2962 |
"applies all changes" |
1545 | 2963 |
|
2964 |
self withExecuteCursorDo:[ |
|
2250 | 2965 |
|change| |
2966 |
self unselectChange. |
|
2967 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
2968 |
1 to:self listOfChanges size do:[:changeNr | |
|
2969 |
self selectionOfChange value:(change := self listOfChanges at: changeNr). |
|
2970 |
self applyChange:change |
|
2971 |
]. |
|
2972 |
self autoSelectLast |
|
1545 | 2973 |
] |
2974 |
||
2975 |
! |
|
2976 |
||
1546 | 2977 |
doApplyAllForClass |
2978 |
"applies all changes having the same class like the selected one" |
|
2979 |
||
2980 |
self doApplyForClassToEndFrom: 1 |
|
2981 |
||
2982 |
||
2983 |
! |
|
2984 |
||
1545 | 2985 |
doApplyForClassToEnd |
1546 | 2986 |
"applies all changes having the same class like the selected one from the selected to the end" |
2987 |
||
2988 |
self doApplyForClassToEndFrom: (self listOfChanges indexOf: self selectionOfChange value) |
|
2989 |
! |
|
2990 |
||
2991 |
doApplyForClassToEndFrom: start |
|
2992 |
"applies changes with same class like the selected one from start to end" |
|
1545 | 2993 |
|
2994 |
self withSelectedChangeDo:[:change| |
|
2250 | 2995 |
|classNameToApply thisClassName lastChange change2| |
2996 |
(classNameToApply := self classNameOfChange:change) notNil |
|
2997 |
ifTrue: |
|
2998 |
[ |
|
2999 |
self unselectChange. |
|
3000 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
3001 |
start to:self listOfChanges size do: |
|
3002 |
[:changeNr| |
|
3003 |
change2 := self listOfChanges at: changeNr. |
|
3004 |
((thisClassName := self classNameOfChange:change2) notNil and: |
|
3005 |
[thisClassName = classNameToApply or: |
|
3006 |
[PrivateAsSeparate not and: [(thisClassName upTo: $:) = classNameToApply]]]) |
|
3007 |
ifTrue: |
|
3008 |
[ |
|
3009 |
self selectionOfChange value: change2. |
|
3010 |
self applyChange:change2. |
|
3011 |
lastChange := change2 |
|
3012 |
] |
|
3013 |
]. |
|
3014 |
self autoSelectChange:lastChange. |
|
3015 |
] |
|
1545 | 3016 |
] |
3017 |
||
3018 |
! |
|
3019 |
||
3020 |
doApplyFromLastSnapshot |
|
1546 | 3021 |
"applies all changes made since the last snapshot" |
1545 | 3022 |
|
3023 |
self autoSelectLast. |
|
3024 |
(self doFindSnapshot: 'last') ifTrue: [self doApplyToEnd] |
|
3025 |
! |
|
3026 |
||
3027 |
doApplyToEnd |
|
1546 | 3028 |
"applies all changes from selected one to be end" |
1545 | 3029 |
|
3030 |
self withSelectedChangeDo:[:change| |
|
2250 | 3031 |
self unselectChange. |
3032 |
skipSignal isNil ifTrue:[skipSignal := Signal new]. |
|
3033 |
(self listOfChanges indexOf: change) to: self listOfChanges size do:[:changeNr| |
|
3034 |
self selectionOfChange value:(self listOfChanges at: changeNr). |
|
3035 |
self applyChange:(self listOfChanges at: changeNr) |
|
3036 |
]. |
|
3037 |
self autoSelectChange:self listOfChanges last |
|
1545 | 3038 |
] |
3039 |
||
3040 |
! |
|
3041 |
||
3042 |
doBrowseClass |
|
1546 | 3043 |
"opens a System Browser on the class of a change (and selector)" |
1545 | 3044 |
|
3045 |
|className cls isMeta| |
|
3046 |
||
3047 |
className := self fullClassNameOfChange:self selectionOfChange value. |
|
3048 |
className notNil ifTrue:[ |
|
3220 | 3049 |
isMeta := false. |
3050 |
(className endsWith:' class') ifTrue:[ |
|
3051 |
className := className copyWithoutLast:6. |
|
3052 |
isMeta := true. |
|
3053 |
]. |
|
3054 |
(cls := Smalltalk classNamed:className) notNil ifTrue:[ |
|
3055 |
isMeta ifTrue:[cls := cls class]. |
|
3056 |
cls browserClass |
|
3057 |
openInClass:cls |
|
3058 |
selector:(self selectorOfMethodChange:self selectionOfChange value) |
|
3059 |
] |
|
1545 | 3060 |
] |
3061 |
||
3220 | 3062 |
"Modified: / 26.9.2001 / 17:35:50 / cg" |
1545 | 3063 |
! |
3064 |
||
3065 |
doCompare |
|
1546 | 3066 |
"compares a change with the current system version" |
1545 | 3067 |
|
3068 |
|change| |
|
3069 |
||
3070 |
(change := self selectionOfChange value) notNil ifTrue:[ |
|
2250 | 3071 |
self withExecuteCursorDo:[self compareChange:change] |
1545 | 3072 |
]. |
3073 |
self newLabel:'' |
|
3074 |
! |
|
3075 |
||
3076 |
doCompress |
|
1546 | 3077 |
"compresses the changes, i.e. replaces multiple changes by the last change" |
1545 | 3078 |
|
3079 |
|changesSizeBefore| |
|
1546 | 3080 |
(changesSizeBefore := changes size) == 0 ifTrue: [^self warn: 'Nothing to compress!!']. |
1545 | 3081 |
self setChangeList. |
3082 |
self unselectChange. |
|
3083 |
self compressForClass:nil. |
|
1546 | 3084 |
self setChangeList. |
1545 | 3085 |
self updateInfoLabel. |
3086 |
||
3087 |
self information: |
|
2250 | 3088 |
'Compression Rate: ', (((changesSizeBefore - changes size)/changesSizeBefore) * 100) rounded printString, '%\' withCRs, |
3089 |
'Obsolete Changes: ', (changesSizeBefore - changes size) printString, ' from ', changesSizeBefore printString |
|
1545 | 3090 |
|
3091 |
||
3092 |
||
3093 |
||
3094 |
! |
|
3095 |
||
3096 |
doCompressForClass |
|
1546 | 3097 |
"compresses changes for the selected class. |
1545 | 3098 |
this replaces multiple method-changes by the last (i.e. the most recent) change." |
3099 |
||
3100 |
self withSelectedChangeDo:[:change| |
|
2250 | 3101 |
| classNameToCompress | |
3102 |
||
3103 |
(classNameToCompress := self classNameOfChange:change) notNil ifTrue:[ |
|
3104 |
self compressForClass:classNameToCompress. |
|
3105 |
filterCompletionBlock value: self valueOfFilter value. |
|
3106 |
self autoSelectLast |
|
3107 |
] |
|
1545 | 3108 |
] |
3109 |
||
3110 |
! |
|
3111 |
||
3112 |
doDelete |
|
1546 | 3113 |
"deletes the selected change" |
1545 | 3114 |
|
3115 |
|change selectionIndex| |
|
3116 |
||
3117 |
(change := self selectionOfChange value) notNil ifTrue:[ |
|
2250 | 3118 |
selectionIndex := self listOfChanges indexOf: change. |
3119 |
self unselectChange. |
|
3120 |
self silentDeleteChange:change. |
|
3121 |
self listOfChanges remove:change. |
|
3122 |
self autoSelectOrEnd: (self listOfChanges at: selectionIndex ifAbsent: [nil]). |
|
1545 | 3123 |
] |
1546 | 3124 |
! |
3125 |
||
3126 |
doDeleteAll |
|
3127 |
"deletes all changes" |
|
3128 |
||
3129 |
self deleteChangesFrom:1 to: self listOfChanges size. |
|
3130 |
self autoSelectOrEnd: nil |
|
3131 |
||
3132 |
! |
|
3133 |
||
3134 |
doDeleteAllForClass |
|
3135 |
"deletes all changes having the same class like the selected one" |
|
3136 |
||
3137 |
self doDeleteForClassToEndFrom: 1 |
|
1545 | 3138 |
|
3139 |
! |
|
3140 |
||
3141 |
doDeleteForClassToEnd |
|
1546 | 3142 |
"deletes all changes having the same class like the selected one from the selected to the end" |
3143 |
||
3144 |
self withSelectedChangeDo:[:change| |
|
2250 | 3145 |
self doDeleteForClassToEndFrom: (self listOfChanges indexOf: change) |
1546 | 3146 |
] |
3147 |
||
3148 |
||
3149 |
! |
|
3150 |
||
3151 |
doDeleteForClassToEndFrom: start |
|
3152 |
"deletes changes with same class like the selected one from start to end" |
|
1545 | 3153 |
|
3154 |
self withSelectedChangeDo:[:change| |
|
2250 | 3155 |
|classNameToDelete| |
3156 |
(classNameToDelete := self classNameOfChange:change) notNil ifTrue:[ |
|
3157 |
self unselectChange. |
|
3158 |
self silentDeleteChangesFor:classNameToDelete |
|
3159 |
from:start |
|
3160 |
to:self listOfChanges size. |
|
3161 |
self setChangeList. |
|
3162 |
self autoSelectOrEnd: nil |
|
3163 |
] |
|
1546 | 3164 |
]. |
3165 |
||
1545 | 3166 |
|
3167 |
||
3168 |
! |
|
3169 |
||
3170 |
doDeleteToEnd |
|
1546 | 3171 |
"deletes all changes from selected one to be end" |
1545 | 3172 |
|
3173 |
|changeNr| |
|
3174 |
||
3175 |
changeNr := (self listOfChanges indexOf: self selectionOfChange value). |
|
3176 |
changeNr ~~ 0 ifTrue:[ |
|
2250 | 3177 |
self deleteChangesFrom:changeNr to: self listOfChanges size. |
3178 |
self unselectChange. |
|
3179 |
self autoSelectOrEnd: nil |
|
1545 | 3180 |
] |
3181 |
||
3182 |
! |
|
3183 |
||
1568 | 3184 |
doFilter: aFilterString |
3185 |
"filter the changes with aFilterString" |
|
3186 |
||
1569 | 3187 |
self selectionOfChange value: nil. |
1568 | 3188 |
self valueOfFilter value: aFilterString withoutNotifying: self. |
3189 |
self valueOfFilter changed. |
|
3190 |
self autoSelectLast |
|
3191 |
! |
|
3192 |
||
1644 | 3193 |
doFilterSourceType: aFilterStringTypeString |
3194 |
"filter the source changes with aFilterStringTypeString" |
|
1568 | 3195 |
|
1569 | 3196 |
self selectionOfChange value: nil. |
3197 |
self listOfChanges contents: #(). |
|
3198 |
self valueOfFilter value: '' withoutNotifying: self. |
|
1644 | 3199 |
self listOfChanges contents: (changes select: [:change| change type = 'source' and: [aFilterStringTypeString match: change string]]). |
3200 |
self autoSelectLast |
|
1568 | 3201 |
|
3202 |
! |
|
3203 |
||
3204 |
doFilterType: aFilterTypeString |
|
3205 |
"filter the changes with aFilterTypeString" |
|
3206 |
||
1569 | 3207 |
self selectionOfChange value: nil. |
3208 |
self valueOfFilter value: '' withoutNotifying: self. |
|
1568 | 3209 |
self listOfChanges contents: (changes select: [:change| change type = aFilterTypeString]). |
3210 |
self autoSelectLast |
|
3211 |
||
3212 |
! |
|
3213 |
||
1545 | 3214 |
doFindSnapshot: what |
1546 | 3215 |
"finds the last made snapshot and selects it" |
1545 | 3216 |
|
1887 | 3217 |
|snapshotNr snapshotFound| |
3218 |
||
1545 | 3219 |
self listOfChanges detect: [:change| change type = 'image'] ifNone: [^self warn: 'No snapshot found!!']. |
3220 |
||
3221 |
self withSelectedChangeDo:[:change| |
|
2250 | 3222 |
snapshotNr := self listOfChanges indexOf: change. |
3223 |
snapshotFound := false. |
|
3224 |
[snapshotNr > 0 and: [snapshotFound not]] |
|
3225 |
whileTrue: |
|
3226 |
[ |
|
3227 |
what = 'last' |
|
3228 |
ifTrue: |
|
3229 |
[ |
|
3230 |
snapshotNr := snapshotNr - 1. |
|
3231 |
snapshotNr == 0 ifTrue: [snapshotNr := self listOfChanges size]. |
|
3232 |
] |
|
3233 |
ifFalse: |
|
3234 |
[ |
|
3235 |
snapshotNr := snapshotNr + 1. |
|
3236 |
snapshotNr > self listOfChanges size ifTrue: [snapshotNr := 1]. |
|
3237 |
]. |
|
3238 |
(self listOfChanges at: snapshotNr ifAbsent: [^self autoSelectChange: (what = 'last' ifTrue: [self listOfChanges last] ifFalse: [self listOfChanges first])]) type = 'image' |
|
3239 |
ifTrue: |
|
3240 |
[ |
|
3241 |
snapshotFound := true. |
|
3242 |
self autoSelectChange:(self listOfChanges at: snapshotNr) |
|
3243 |
] |
|
3244 |
] |
|
1887 | 3245 |
]. |
3246 |
||
3247 |
^snapshotFound |
|
1545 | 3248 |
! |
3249 |
||
1556 | 3250 |
doLoad |
1546 | 3251 |
"opens a dialog for loading changes from a file" |
1545 | 3252 |
|
3253 |
|fileName| |
|
3254 |
(fileName := |
|
2250 | 3255 |
(FileSelectionBrowser |
3256 |
request: 'Load Changes List' |
|
3257 |
fileName: changeFileName |
|
3258 |
withFileFilters: #('c*'))) notNil |
|
1545 | 3259 |
ifTrue: |
3260 |
[ |
|
2250 | 3261 |
changeFileName := fileName. |
3262 |
changes removeAll. |
|
3263 |
self readChangesFileInBackground:true. |
|
3264 |
self unselectChange. |
|
3265 |
Processor addTimedBlock:autoUpdateBlock afterSeconds:5. |
|
3266 |
self updateInfoLabel. |
|
3267 |
self autoSelectLast |
|
1545 | 3268 |
] |
3269 |
! |
|
3270 |
||
3271 |
doReload |
|
1546 | 3272 |
"reloads the changes from the file" |
1545 | 3273 |
|
3274 |
changes removeAll. |
|
3275 |
self unselectChange. |
|
3276 |
self readChangesFileInBackground:true. |
|
3277 |
self autoSelectLast |
|
3278 |
||
3279 |
! |
|
3280 |
||
3281 |
doSave |
|
3282 |
"write back the changes file. To avoid problems when the disk is full |
|
3283 |
or a crash occurs while writing (well, or someone kills us), |
|
3284 |
first write the stuff to a new temporary file. If this works ok, |
|
3285 |
rename the old change-file to a .bak file and finally rename the |
|
3286 |
tempfile back to the change-file. |
|
3287 |
That way, if anything happens, either the original file is left unchanged, |
|
3288 |
or we have at least a backup of the previous change file." |
|
3289 |
||
1568 | 3290 |
|inStream outStream tempfile stamp f| |
1545 | 3291 |
|
3292 |
self valueOfNotReading value ifFalse: [^nil]. |
|
3293 |
||
3294 |
editingClassSource ifTrue:[ |
|
2250 | 3295 |
(self confirm:'You are editing a classes sourceFile (not a changeFile) !!\Are you certain, you want to overwrite it ?' withCRs) |
3296 |
ifFalse:[ |
|
3297 |
^ false |
|
3298 |
] |
|
1545 | 3299 |
]. |
3300 |
||
3301 |
tempfile := Filename newTemporaryIn:nil. |
|
3302 |
tempfile exists ifTrue:[tempfile remove]. |
|
3303 |
||
3304 |
outStream := tempfile writeStream. |
|
3305 |
outStream isNil ifTrue:[ |
|
2250 | 3306 |
self warn:'Cannot create temporary file in current directory.'. |
3307 |
^ false |
|
1545 | 3308 |
]. |
3309 |
||
3310 |
inStream := FileStream readonlyFileNamed:changeFileName. |
|
3311 |
inStream isNil ifTrue:[^ false]. |
|
3312 |
||
3313 |
self withCursor:(Cursor write) do:[ |
|
2250 | 3314 |
|excla sawExcla done first chunk |
3315 |
nChanges "{Class:SmallInteger}" | |
|
3316 |
||
3317 |
Stream writeErrorSignal handle:[:ex | |
|
3318 |
self warn:('Could not update the changes file.\\' , ex errorString) withCRs. |
|
3319 |
^ false |
|
3320 |
] do:[ |
|
3321 |
||
3322 |
self valueOfNotSaving value: false. |
|
3323 |
||
3324 |
excla := inStream class chunkSeparator. |
|
3325 |
nChanges := changes size. |
|
3326 |
||
3327 |
1 to:nChanges do:[:index | |
|
3328 |
inStream position: (changes at: index) position. |
|
3329 |
sawExcla := inStream peekFor:excla. |
|
3330 |
chunk := inStream nextChunk. |
|
3331 |
||
3332 |
(chunk notNil |
|
3333 |
and:[(chunk startsWith:'''---- snap') not]) ifTrue:[ |
|
3334 |
(stamp := (changes at:index) timeStamp) notNil ifTrue:[ |
|
3335 |
outStream nextPutAll:'''---- timestamp ' , stamp , ' ----'''. |
|
3336 |
outStream nextPut:excla; cr. |
|
3337 |
]. |
|
3338 |
]. |
|
3339 |
||
3340 |
sawExcla ifTrue:[ |
|
3341 |
outStream nextPut:excla. |
|
3342 |
outStream nextChunkPut:chunk. |
|
3343 |
outStream cr; cr. |
|
3344 |
||
3345 |
" |
|
3346 |
a method-definition chunk - skip followups |
|
3347 |
" |
|
3348 |
done := false. |
|
3349 |
first := true. |
|
3350 |
[done] whileFalse:[ |
|
3351 |
chunk := inStream nextChunk. |
|
3352 |
chunk isNil ifTrue:[ |
|
3353 |
outStream cr; cr. |
|
3354 |
done := true |
|
3355 |
] ifFalse:[ |
|
3356 |
chunk isEmpty ifTrue:[ |
|
3357 |
outStream space; nextChunkPut:chunk; cr; cr. |
|
3358 |
done := true. |
|
3359 |
] ifFalse:[ |
|
3360 |
first ifFalse:[ |
|
3361 |
outStream cr; cr. |
|
3362 |
]. |
|
3363 |
outStream nextChunkPut:chunk. |
|
3364 |
]. |
|
3365 |
]. |
|
3366 |
first := false. |
|
3367 |
]. |
|
3368 |
] ifFalse:[ |
|
3369 |
outStream nextChunkPut:chunk. |
|
3370 |
outStream cr |
|
3371 |
] |
|
3372 |
]. |
|
3373 |
outStream close. |
|
3374 |
inStream close. |
|
3375 |
]. |
|
3376 |
||
3377 |
f := changeFileName asFilename. |
|
3378 |
f renameTo:(f withSuffix:'bak'). |
|
3379 |
tempfile renameTo:changeFileName. |
|
3380 |
self doReload. |
|
3381 |
modified := false. |
|
3382 |
self valueOfNotSaving value: true. |
|
1545 | 3383 |
]. |
3384 |
^ true |
|
3385 |
||
3386 |
||
3387 |
! ! |
|
3388 |
||
3389 |
!NewChangesBrowser::Change methodsFor:'accessing'! |
|
3390 |
||
3391 |
category |
|
3392 |
||
3393 |
^category |
|
3394 |
! |
|
3395 |
||
3396 |
category: aValue |
|
3397 |
||
3398 |
category := aValue |
|
3399 |
! |
|
3400 |
||
3401 |
chunk |
|
3402 |
||
3403 |
^chunk |
|
3404 |
! |
|
3405 |
||
3406 |
chunk: aValue |
|
3407 |
||
3408 |
chunk := aValue |
|
3409 |
! |
|
3410 |
||
3411 |
className |
|
3412 |
||
3413 |
^className |
|
3414 |
! |
|
3415 |
||
3416 |
className: aValue |
|
3417 |
||
3418 |
className := aValue |
|
3419 |
! |
|
3420 |
||
3421 |
delta |
|
1771
6d6c2bde9615
dont catch halts and breakpoints while reading;
Claus Gittinger <cg@exept.de>
parents:
1712
diff
changeset
|
3422 |
|cls| |
1545 | 3423 |
|
3424 |
delta size = 0 ifTrue: [^'']. |
|
3425 |
delta = '=' ifTrue: [^'Current']. |
|
1771
6d6c2bde9615
dont catch halts and breakpoints while reading;
Claus Gittinger <cg@exept.de>
parents:
1712
diff
changeset
|
3426 |
delta = '?' ifTrue: [ |
2250 | 3427 |
(className notNil and:[className knownAsSymbol]) ifTrue:[ |
3428 |
(cls := Smalltalk at:className asSymbol ifAbsent:nil) notNil ifTrue:[ |
|
3429 |
cls isBehavior ifTrue:[ |
|
3430 |
cls isLoaded ifFalse:[ |
|
3431 |
^ 'Not loaded' |
|
3432 |
] |
|
3433 |
] |
|
3434 |
] |
|
3435 |
]. |
|
3436 |
^'No class' |
|
1771
6d6c2bde9615
dont catch halts and breakpoints while reading;
Claus Gittinger <cg@exept.de>
parents:
1712
diff
changeset
|
3437 |
]. |
6d6c2bde9615
dont catch halts and breakpoints while reading;
Claus Gittinger <cg@exept.de>
parents:
1712
diff
changeset
|
3438 |
delta = '-' ifTrue: [^'Remove']. |
1545 | 3439 |
delta = '+' ifTrue: [^'New']. |
3440 |
^delta |
|
1771
6d6c2bde9615
dont catch halts and breakpoints while reading;
Claus Gittinger <cg@exept.de>
parents:
1712
diff
changeset
|
3441 |
|
6d6c2bde9615
dont catch halts and breakpoints while reading;
Claus Gittinger <cg@exept.de>
parents:
1712
diff
changeset
|
3442 |
"Modified: / 29.7.1998 / 23:08:10 / cg" |
1545 | 3443 |
! |
3444 |
||
3445 |
delta: aValue |
|
3446 |
||
3447 |
delta := aValue |
|
3448 |
! |
|
3449 |
||
3450 |
followUp |
|
3451 |
||
3452 |
^followUp |
|
3453 |
! |
|
3454 |
||
3455 |
followUp: aValue |
|
3456 |
||
3457 |
followUp := aValue |
|
3458 |
! |
|
3459 |
||
1568 | 3460 |
lastPosition: aValue |
3461 |
||
3462 |
lastPosition := aValue |
|
3463 |
! |
|
3464 |
||
1545 | 3465 |
listColor |
3466 |
||
3467 |
(string at: 3) ~~ $- ifTrue: |
|
3468 |
[ |
|
2250 | 3469 |
(self type = 'class') ifTrue: [^Color gray]. |
3470 |
^Color white |
|
1545 | 3471 |
]. |
3472 |
||
3473 |
(string includesMatchString: '---- s') ifTrue: [^Color red]. |
|
3474 |
(string includesMatchString: '---- f') ifTrue: [^Color cyan: 100 magenta: 20 yellow: 20]. |
|
3475 |
(string includesMatchString: '---- c') ifTrue: [^Color blue]. |
|
3476 |
||
3477 |
^Color white |
|
3478 |
! |
|
3479 |
||
3480 |
position |
|
3481 |
||
3482 |
^position |
|
3483 |
! |
|
3484 |
||
3485 |
position: aValue |
|
3486 |
||
3487 |
position := aValue |
|
3488 |
! |
|
3489 |
||
1568 | 3490 |
positions |
3491 |
||
3492 |
^position printString, ' - ', lastPosition printString |
|
3493 |
! |
|
3494 |
||
1545 | 3495 |
string |
3496 |
||
3497 |
^string |
|
3498 |
! |
|
3499 |
||
3500 |
string: aValue |
|
3501 |
||
3502 |
string := aValue |
|
3503 |
! |
|
3504 |
||
3505 |
timeStamp |
|
3506 |
||
3507 |
^timeStamp |
|
3508 |
! |
|
3509 |
||
3510 |
timeStamp: aValue |
|
3511 |
||
3512 |
timeStamp := aValue |
|
3513 |
! |
|
3514 |
||
3515 |
type |
|
3516 |
||
3517 |
(type = 'doIt' or: [type = 'remove']) ifTrue: [^'class']. |
|
3518 |
(type size = 0) ifTrue: [(string includesMatchString: '---- s') ifTrue: [^'image'] ifFalse: [^'source']]. |
|
3519 |
(self category = nil) ifTrue: [^'class']. |
|
3520 |
^'method' |
|
3521 |
! |
|
3522 |
||
3523 |
type: aValue |
|
3524 |
||
3525 |
type := aValue |
|
3526 |
! ! |
|
3527 |
||
3528 |
!NewChangesBrowser class methodsFor:'documentation'! |
|
3529 |
||
3530 |
version |
|
5396 | 3531 |
^ '$Header: /cvs/stx/stx/libtool/NewChangesBrowser.st,v 1.28 2003-12-04 11:54:00 stefan Exp $' |
1545 | 3532 |
! ! |