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