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