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