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