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