author | Claus Gittinger <cg@exept.de> |
Fri, 18 Nov 2016 16:14:26 +0100 | |
changeset 1180 | 92753f6cc822 |
parent 831 | 67993e20403d |
permissions | -rw-r--r-- |
639 | 1 |
" |
2 |
Copyright (c) 2007-2010 Jan Vrany |
|
3 |
Copyright (c) 2009-2010 eXept Software AG |
|
4 |
||
5 |
Permission is hereby granted, free of charge, to any person |
|
6 |
obtaining a copy of this software and associated documentation |
|
7 |
files (the 'Software'), to deal in the Software without |
|
8 |
restriction, including without limitation the rights to use, |
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10 |
copies of the Software, and to permit persons to whom the |
|
11 |
Software is furnished to do so, subject to the following |
|
12 |
conditions: |
|
13 |
||
14 |
The above copyright notice and this permission notice shall be |
|
15 |
included in all copies or substantial portions of the Software. |
|
16 |
||
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
24 |
OTHER DEALINGS IN THE SOFTWARE. |
|
25 |
" |
|
26 |
"{ Package: 'stx:libsvn' }" |
|
27 |
||
28 |
"{ NameSpace: SVN }" |
|
29 |
||
30 |
ApplicationModel subclass:#DiffViewApp |
|
31 |
instanceVariableNames:'diffView diffHolder versionALabelHolder versionBLabelHolder |
|
32 |
versionATextHolder versionBTextHolder' |
|
33 |
classVariableNames:'' |
|
34 |
poolDictionaries:'' |
|
35 |
category:'SVN-UI-Browsers-Diff' |
|
36 |
! |
|
37 |
||
38 |
Tools::DiffCodeView2 subclass:#Diff2TextView |
|
39 |
instanceVariableNames:'' |
|
40 |
classVariableNames:'' |
|
41 |
poolDictionaries:'' |
|
42 |
privateIn:DiffViewApp |
|
43 |
! |
|
44 |
||
45 |
DiffTextView subclass:#Diff3TextView |
|
46 |
instanceVariableNames:'' |
|
47 |
classVariableNames:'' |
|
48 |
poolDictionaries:'' |
|
49 |
privateIn:DiffViewApp |
|
50 |
! |
|
51 |
||
52 |
!DiffViewApp class methodsFor:'documentation'! |
|
53 |
||
54 |
copyright |
|
55 |
" |
|
56 |
Copyright (c) 2007-2010 Jan Vrany |
|
57 |
Copyright (c) 2009-2010 eXept Software AG |
|
58 |
||
59 |
Permission is hereby granted, free of charge, to any person |
|
60 |
obtaining a copy of this software and associated documentation |
|
61 |
files (the 'Software'), to deal in the Software without |
|
62 |
restriction, including without limitation the rights to use, |
|
63 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
64 |
copies of the Software, and to permit persons to whom the |
|
65 |
Software is furnished to do so, subject to the following |
|
66 |
conditions: |
|
67 |
||
68 |
The above copyright notice and this permission notice shall be |
|
69 |
included in all copies or substantial portions of the Software. |
|
70 |
||
71 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
72 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
73 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
74 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
75 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
76 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
77 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
78 |
OTHER DEALINGS IN THE SOFTWARE. |
|
79 |
||
80 |
" |
|
81 |
! ! |
|
82 |
||
83 |
!DiffViewApp class methodsFor:'image specs'! |
|
84 |
||
85 |
versionA24x24 |
|
86 |
||
87 |
^IconLibrary versionA24x24 |
|
88 |
||
89 |
"Created: / 24-03-2010 / 20:49:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
90 |
! |
|
91 |
||
92 |
versionB24x24 |
|
93 |
||
94 |
^IconLibrary versionB24x24 |
|
95 |
||
96 |
"Created: / 24-03-2010 / 20:50:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
97 |
! |
|
98 |
||
99 |
versionBase24x24 |
|
100 |
||
101 |
^IconLibrary versionBase24x24 |
|
102 |
||
103 |
"Created: / 24-03-2010 / 20:50:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
104 |
! ! |
|
105 |
||
106 |
!DiffViewApp class methodsFor:'interface specs'! |
|
107 |
||
108 |
diffSpec_ThreeWay |
|
109 |
"This resource specification was automatically generated |
|
110 |
by the UIPainter of ST/X." |
|
111 |
||
112 |
"Do not manually edit this!! If it is corrupted, |
|
113 |
the UIPainter may not be able to read the specification." |
|
114 |
||
115 |
" |
|
116 |
UIPainter new openOnClass:SVN::DiffBrowser andSelector:#diffSpec_ThreeWay |
|
117 |
SVN::DiffBrowser new openInterface:#diffSpec_ThreeWay |
|
118 |
" |
|
119 |
||
120 |
<resource: #canvas> |
|
121 |
||
122 |
^ |
|
123 |
#(FullSpec |
|
124 |
name: #'diffSpec_ThreeWay' |
|
125 |
window: |
|
126 |
(WindowSpec |
|
127 |
label: 'Three-way diff view' |
|
128 |
name: 'Three-way diff view' |
|
129 |
min: (Point 10 10) |
|
130 |
bounds: (Rectangle 0 0 782 506) |
|
131 |
) |
|
132 |
component: |
|
133 |
(SpecCollection |
|
134 |
collection: ( |
|
135 |
(TransparentBoxSpec |
|
136 |
name: '3Labels' |
|
137 |
layout: (LayoutFrame 0 0 0 0 -16 1 30 0) |
|
138 |
component: |
|
139 |
(SpecCollection |
|
140 |
collection: ( |
|
141 |
(UISubSpecification |
|
142 |
name: 'VersionA' |
|
143 |
layout: (LayoutFrame 0 0 0 0 0 0.33 30 0) |
|
144 |
minorKey: versionALabelSpec |
|
145 |
) |
|
146 |
(UISubSpecification |
|
147 |
name: 'VersionB' |
|
148 |
layout: (LayoutFrame 2 0.33 0 0 0 0.66 30 0) |
|
149 |
minorKey: versionBLabelSpec |
|
150 |
) |
|
151 |
(UISubSpecification |
|
152 |
name: 'VersionBase' |
|
153 |
layout: (LayoutFrame 3 0.66 0 0 0 1 30 0) |
|
154 |
minorKey: versionBaseLabelSpec |
|
155 |
) |
|
156 |
) |
|
157 |
||
158 |
) |
|
159 |
) |
|
160 |
(ArbitraryComponentSpec |
|
161 |
name: 'Diff3TextView' |
|
162 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
163 |
hasHorizontalScrollBar: true |
|
164 |
hasVerticalScrollBar: true |
|
165 |
autoHideScrollBars: false |
|
166 |
hasBorder: false |
|
167 |
component: #'SVN::DiffViewApp::Diff3TextView' |
|
168 |
postBuildCallback: postBuildDiffView: |
|
169 |
) |
|
170 |
) |
|
171 |
||
172 |
) |
|
173 |
) |
|
174 |
||
175 |
"Modified: / 23-11-2009 / 18:12:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
176 |
! |
|
177 |
||
178 |
diffSpec_TwoWay |
|
179 |
"This resource specification was automatically generated |
|
180 |
by the UIPainter of ST/X." |
|
181 |
||
182 |
"Do not manually edit this!! If it is corrupted, |
|
183 |
the UIPainter may not be able to read the specification." |
|
184 |
||
185 |
" |
|
186 |
UIPainter new openOnClass:SVN::DiffViewApp andSelector:#diffSpec_TwoWay |
|
187 |
SVN::DiffViewApp new openInterface:#diffSpec_TwoWay |
|
188 |
" |
|
189 |
||
190 |
<resource: #canvas> |
|
191 |
||
192 |
^ |
|
193 |
#(FullSpec |
|
194 |
name: #'diffSpec_TwoWay' |
|
195 |
window: |
|
196 |
(WindowSpec |
|
197 |
label: 'Three-way diff view' |
|
198 |
name: 'Three-way diff view' |
|
199 |
min: (Point 10 10) |
|
200 |
bounds: (Rectangle 0 0 782 506) |
|
201 |
) |
|
202 |
component: |
|
203 |
(SpecCollection |
|
204 |
collection: ( |
|
205 |
(ViewSpec |
|
206 |
name: '2Labels' |
|
207 |
layout: (LayoutFrame 0 0 0 0 -16 1 30 0) |
|
208 |
component: |
|
209 |
(SpecCollection |
|
210 |
collection: ( |
|
211 |
(UISubSpecification |
|
212 |
name: 'VersionA' |
|
213 |
layout: (LayoutFrame 0 0 0 0 0 0.5 30 0) |
|
214 |
minorKey: versionALabelSpec |
|
215 |
) |
|
216 |
(UISubSpecification |
|
217 |
name: 'VersionB' |
|
218 |
layout: (LayoutFrame 5 0.5 0 0 0 1 30 0) |
|
219 |
minorKey: versionBLabelSpec |
|
220 |
) |
|
221 |
) |
|
222 |
||
223 |
) |
|
224 |
) |
|
225 |
(ArbitraryComponentSpec |
|
226 |
name: 'Diff2TextView' |
|
227 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
228 |
hasHorizontalScrollBar: false |
|
229 |
hasVerticalScrollBar: false |
|
230 |
autoHideScrollBars: false |
|
231 |
hasBorder: false |
|
232 |
component: #'SVN::DiffViewApp::Diff2TextView' |
|
233 |
postBuildCallback: postBuildDiffView: |
|
234 |
) |
|
235 |
) |
|
236 |
||
237 |
) |
|
238 |
) |
|
239 |
! |
|
240 |
||
241 |
windowSpec |
|
242 |
"This resource specification was automatically generated |
|
243 |
by the UIPainter of ST/X." |
|
244 |
||
245 |
"Do not manually edit this!! If it is corrupted, |
|
246 |
the UIPainter may not be able to read the specification." |
|
247 |
||
248 |
" |
|
249 |
UIPainter new openOnClass:SVN::DiffViewApp andSelector:#windowSpec |
|
250 |
SVN::DiffViewApp new openInterface:#windowSpec |
|
251 |
SVN::DiffViewApp open |
|
252 |
" |
|
253 |
||
254 |
<resource: #canvas> |
|
255 |
||
256 |
^ |
|
257 |
#(FullSpec |
|
258 |
name: windowSpec |
|
259 |
window: |
|
260 |
(WindowSpec |
|
261 |
label: 'Diff View' |
|
262 |
name: 'Diff View' |
|
263 |
min: (Point 10 10) |
|
264 |
bounds: (Rectangle 0 0 818 594) |
|
265 |
) |
|
266 |
component: |
|
267 |
(SpecCollection |
|
268 |
collection: ( |
|
269 |
(UISubSpecification |
|
270 |
name: 'DiffView' |
|
271 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
272 |
minorKey: #'diffSpec_TwoWay' |
|
273 |
) |
|
274 |
) |
|
275 |
||
276 |
) |
|
277 |
) |
|
278 |
! ! |
|
279 |
||
280 |
!DiffViewApp class methodsFor:'interface specs - labels'! |
|
281 |
||
282 |
versionALabelSpec |
|
283 |
"This resource specification was automatically generated |
|
284 |
by the UIPainter of ST/X." |
|
285 |
||
286 |
"Do not manually edit this!! If it is corrupted, |
|
287 |
the UIPainter may not be able to read the specification." |
|
288 |
||
289 |
" |
|
290 |
UIPainter new openOnClass:SVN::DiffViewApp andSelector:#versionALabelSpec |
|
291 |
SVN::DiffViewApp new openInterface:#versionALabelSpec |
|
292 |
" |
|
293 |
||
294 |
<resource: #canvas> |
|
295 |
||
296 |
^ |
|
297 |
#(FullSpec |
|
298 |
name: versionALabelSpec |
|
299 |
window: |
|
300 |
(WindowSpec |
|
301 |
label: 'Version A' |
|
302 |
name: 'Version A' |
|
303 |
min: (Point 10 10) |
|
304 |
bounds: (Rectangle 0 0 300 30) |
|
305 |
) |
|
306 |
component: |
|
307 |
(SpecCollection |
|
308 |
collection: ( |
|
309 |
(LabelSpec |
|
310 |
label: 'versionA24x24' |
|
311 |
name: 'VersionAIcon' |
|
312 |
layout: (LayoutFrame 0 0 -12 0.5 27 0 12 0.5) |
|
313 |
hasCharacterOrientedLabel: false |
|
314 |
translateLabel: true |
|
315 |
) |
|
316 |
(LabelSpec |
|
317 |
label: 'Version A' |
|
318 |
name: 'VersionALabel' |
|
319 |
layout: (LayoutFrame 30 0 0 0 0 1 0 1) |
|
320 |
translateLabel: true |
|
321 |
labelChannel: versionALabelHolder |
|
322 |
resizeForLabel: true |
|
323 |
adjust: left |
|
324 |
) |
|
325 |
) |
|
326 |
||
327 |
) |
|
328 |
) |
|
329 |
! |
|
330 |
||
331 |
versionBLabelSpec |
|
332 |
"This resource specification was automatically generated |
|
333 |
by the UIPainter of ST/X." |
|
334 |
||
335 |
"Do not manually edit this!! If it is corrupted, |
|
336 |
the UIPainter may not be able to read the specification." |
|
337 |
||
338 |
" |
|
339 |
UIPainter new openOnClass:SVN::DiffViewApp andSelector:#versionBLabelSpec |
|
340 |
SVN::DiffViewApp new openInterface:#versionBLabelSpec |
|
341 |
" |
|
342 |
||
343 |
<resource: #canvas> |
|
344 |
||
345 |
^ |
|
346 |
#(FullSpec |
|
347 |
name: versionBLabelSpec |
|
348 |
window: |
|
349 |
(WindowSpec |
|
350 |
label: 'Version B' |
|
351 |
name: 'Version B' |
|
352 |
min: (Point 10 10) |
|
353 |
bounds: (Rectangle 0 0 300 30) |
|
354 |
) |
|
355 |
component: |
|
356 |
(SpecCollection |
|
357 |
collection: ( |
|
358 |
(LabelSpec |
|
359 |
label: 'versionB24x24' |
|
360 |
name: 'VersionBIcon' |
|
361 |
layout: (LayoutFrame 0 0 -12 0.5 27 0 12 0.5) |
|
362 |
hasCharacterOrientedLabel: false |
|
363 |
translateLabel: true |
|
364 |
) |
|
365 |
(LabelSpec |
|
366 |
label: 'Version B' |
|
367 |
name: 'VersionBLabel' |
|
368 |
layout: (LayoutFrame 30 0 0 0 0 1 0 1) |
|
369 |
translateLabel: true |
|
370 |
labelChannel: versionBLabelHolder |
|
371 |
resizeForLabel: true |
|
372 |
adjust: left |
|
373 |
useDynamicPreferredWidth: true |
|
374 |
usePreferredWidth: true |
|
375 |
) |
|
376 |
) |
|
377 |
||
378 |
) |
|
379 |
) |
|
380 |
! |
|
381 |
||
382 |
versionBaseLabelSpec |
|
383 |
"This resource specification was automatically generated |
|
384 |
by the UIPainter of ST/X." |
|
385 |
||
386 |
"Do not manually edit this!! If it is corrupted, |
|
387 |
the UIPainter may not be able to read the specification." |
|
388 |
||
389 |
" |
|
390 |
UIPainter new openOnClass:SVN::DiffViewApp andSelector:#versionBaseLabelSpec |
|
391 |
SVN::DiffViewApp new openInterface:#versionBaseLabelSpec |
|
392 |
" |
|
393 |
||
394 |
<resource: #canvas> |
|
395 |
||
396 |
^ |
|
397 |
#(FullSpec |
|
398 |
name: versionBaseLabelSpec |
|
399 |
window: |
|
400 |
(WindowSpec |
|
401 |
label: 'Version Base' |
|
402 |
name: 'Version Base' |
|
403 |
min: (Point 10 10) |
|
404 |
bounds: (Rectangle 0 0 300 30) |
|
405 |
) |
|
406 |
component: |
|
407 |
(SpecCollection |
|
408 |
collection: ( |
|
409 |
(LabelSpec |
|
410 |
label: 'versionBase24x24' |
|
411 |
name: 'VersionBaseIcon' |
|
412 |
layout: (LayoutFrame 0 0 -12 0.5 27 0 12 0.5) |
|
413 |
hasCharacterOrientedLabel: false |
|
414 |
translateLabel: true |
|
415 |
) |
|
416 |
(LabelSpec |
|
417 |
label: 'Version Base' |
|
418 |
name: 'VersionBaseLabel' |
|
419 |
layout: (LayoutFrame 30 0 5 0 191 0 0 1) |
|
420 |
translateLabel: true |
|
421 |
labelChannel: versionBaseLabelAspect |
|
422 |
resizeForLabel: true |
|
423 |
adjust: left |
|
424 |
useDynamicPreferredWidth: true |
|
425 |
usePreferredWidth: true |
|
426 |
) |
|
427 |
) |
|
428 |
||
429 |
) |
|
430 |
) |
|
431 |
||
432 |
"Modified: / 24-03-2010 / 20:51:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
433 |
! ! |
|
434 |
||
831
67993e20403d
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
639
diff
changeset
|
435 |
!DiffViewApp class methodsFor:'others'! |
67993e20403d
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
639
diff
changeset
|
436 |
|
67993e20403d
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
639
diff
changeset
|
437 |
version_CVS |
67993e20403d
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
639
diff
changeset
|
438 |
^ '$Header$' |
67993e20403d
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
639
diff
changeset
|
439 |
! ! |
67993e20403d
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
639
diff
changeset
|
440 |
|
639 | 441 |
!DiffViewApp class methodsFor:'plugIn spec'! |
442 |
||
443 |
aspectSelectors |
|
444 |
"This resource specification was automatically generated |
|
445 |
by the UIPainter of ST/X." |
|
446 |
||
447 |
"Do not manually edit this. If it is corrupted, |
|
448 |
the UIPainter may not be able to read the specification." |
|
449 |
||
450 |
"Return a description of exported aspects; |
|
451 |
these can be connected to aspects of an embedding application |
|
452 |
(if this app is embedded in a subCanvas)." |
|
453 |
||
454 |
^ #( |
|
455 |
#diffHolder |
|
456 |
). |
|
457 |
||
458 |
! ! |
|
459 |
||
460 |
!DiffViewApp methodsFor:'accessing'! |
|
461 |
||
462 |
diffitem |
|
463 |
||
464 |
||
465 |
^self diffHolder value. |
|
466 |
||
467 |
"Created: / 09-11-2009 / 12:22:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
468 |
"Modified: / 10-11-2009 / 11:01:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
469 |
! |
|
470 |
||
471 |
title: aString |
|
472 |
||
473 |
"Created: / 25-06-2010 / 11:37:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
474 |
! |
|
475 |
||
476 |
versionA: textA versionB: textB |
|
477 |
||
478 |
self versionATextHolder setValue: textA. |
|
479 |
self versionBTextHolder setValue: textB. |
|
480 |
self updateTexts |
|
481 |
||
482 |
"Created: / 25-06-2010 / 11:34:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
483 |
! |
|
484 |
||
485 |
versionALabel: aString |
|
486 |
||
487 |
^self versionALabelHolder value: aString. |
|
488 |
||
489 |
"Created: / 25-06-2010 / 11:34:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
490 |
! |
|
491 |
||
492 |
versionBLabel: aString |
|
493 |
||
494 |
^self versionBLabelHolder value: aString. |
|
495 |
||
496 |
"Created: / 25-06-2010 / 11:34:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
497 |
! ! |
|
498 |
||
499 |
!DiffViewApp methodsFor:'aspects'! |
|
500 |
||
501 |
diffHolder |
|
502 |
"return/create the 'diffitemHolder' value holder (automatically generated)" |
|
503 |
||
504 |
diffHolder isNil ifTrue:[ |
|
505 |
diffHolder := ValueHolder new. |
|
506 |
diffHolder addDependent:self. |
|
507 |
]. |
|
508 |
^ diffHolder |
|
509 |
||
510 |
"Created: / 09-11-2009 / 12:45:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
511 |
! |
|
512 |
||
513 |
diffHolder:aValueModel |
|
514 |
"set the 'diffitemHolder' value holder (automatically generated)" |
|
515 |
||
516 |
|oldValue newValue| |
|
517 |
||
518 |
diffHolder notNil ifTrue:[ |
|
519 |
oldValue := diffHolder value. |
|
520 |
diffHolder removeDependent:self. |
|
521 |
]. |
|
522 |
diffHolder := aValueModel. |
|
523 |
diffHolder notNil ifTrue:[ |
|
524 |
diffHolder addDependent:self. |
|
525 |
]. |
|
526 |
newValue := diffHolder value. |
|
527 |
oldValue ~~ newValue ifTrue:[ |
|
528 |
self update:#value with:newValue from:diffHolder. |
|
529 |
]. |
|
530 |
||
531 |
"Created: / 09-11-2009 / 12:45:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
532 |
! |
|
533 |
||
534 |
versionALabelHolder |
|
535 |
"return/create the 'versionALabelHolder' value holder (automatically generated)" |
|
536 |
||
537 |
versionALabelHolder isNil ifTrue:[ |
|
538 |
versionALabelHolder := ValueHolder with: 'Version A'. |
|
539 |
]. |
|
540 |
^ versionALabelHolder |
|
541 |
||
542 |
"Modified: / 24-06-2010 / 18:54:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
543 |
! |
|
544 |
||
545 |
versionALabelHolder:something |
|
546 |
"set the 'versionALabelHolder' value holder (automatically generated)" |
|
547 |
||
548 |
versionALabelHolder := something. |
|
549 |
! |
|
550 |
||
551 |
versionATextHolder |
|
552 |
"return/create the 'versionATextHolder' value holder (automatically generated)" |
|
553 |
||
554 |
versionATextHolder isNil ifTrue:[ |
|
555 |
versionATextHolder := ValueHolder new. |
|
556 |
versionATextHolder addDependent:self. |
|
557 |
]. |
|
558 |
^ versionATextHolder |
|
559 |
! |
|
560 |
||
561 |
versionATextHolder:something |
|
562 |
"set the 'versionATextHolder' value holder (automatically generated)" |
|
563 |
||
564 |
|oldValue newValue| |
|
565 |
||
566 |
versionATextHolder notNil ifTrue:[ |
|
567 |
oldValue := versionATextHolder value. |
|
568 |
versionATextHolder removeDependent:self. |
|
569 |
]. |
|
570 |
versionATextHolder := something. |
|
571 |
versionATextHolder notNil ifTrue:[ |
|
572 |
versionATextHolder addDependent:self. |
|
573 |
]. |
|
574 |
newValue := versionATextHolder value. |
|
575 |
oldValue ~~ newValue ifTrue:[ |
|
576 |
self update:#value with:newValue from:versionATextHolder. |
|
577 |
]. |
|
578 |
! |
|
579 |
||
580 |
versionBLabelHolder |
|
581 |
"return/create the 'versionBLabelHolder' value holder (automatically generated)" |
|
582 |
||
583 |
versionBLabelHolder isNil ifTrue:[ |
|
584 |
versionBLabelHolder := ValueHolder with: 'Version B'. |
|
585 |
]. |
|
586 |
^ versionBLabelHolder |
|
587 |
||
588 |
"Modified: / 24-06-2010 / 18:54:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
589 |
! |
|
590 |
||
591 |
versionBLabelHolder:something |
|
592 |
"set the 'versionBLabelHolder' value holder (automatically generated)" |
|
593 |
||
594 |
versionBLabelHolder := something. |
|
595 |
! |
|
596 |
||
597 |
versionBTextHolder |
|
598 |
"return/create the 'versionBTextHolder' value holder (automatically generated)" |
|
599 |
||
600 |
versionBTextHolder isNil ifTrue:[ |
|
601 |
versionBTextHolder := ValueHolder new. |
|
602 |
versionBTextHolder addDependent:self. |
|
603 |
]. |
|
604 |
^ versionBTextHolder |
|
605 |
! |
|
606 |
||
607 |
versionBTextHolder:something |
|
608 |
"set the 'versionBTextHolder' value holder (automatically generated)" |
|
609 |
||
610 |
|oldValue newValue| |
|
611 |
||
612 |
versionBTextHolder notNil ifTrue:[ |
|
613 |
oldValue := versionBTextHolder value. |
|
614 |
versionBTextHolder removeDependent:self. |
|
615 |
]. |
|
616 |
versionBTextHolder := something. |
|
617 |
versionBTextHolder notNil ifTrue:[ |
|
618 |
versionBTextHolder addDependent:self. |
|
619 |
]. |
|
620 |
newValue := versionBTextHolder value. |
|
621 |
oldValue ~~ newValue ifTrue:[ |
|
622 |
self update:#value with:newValue from:versionBTextHolder. |
|
623 |
]. |
|
624 |
! |
|
625 |
||
626 |
versionBaseLabelAspect |
|
627 |
||
628 |
<resource: #uiAspect> |
|
629 |
||
630 |
^(AspectAdaptor forAspect: #versionBaseLabel) |
|
631 |
subjectChannel: self diffHolder |
|
632 |
||
633 |
"Created: / 24-11-2009 / 09:30:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
634 |
! ! |
|
635 |
||
636 |
!DiffViewApp methodsFor:'callbacks'! |
|
637 |
||
638 |
commonPostOpen |
|
639 |
||
640 |
^self updateTexts |
|
641 |
||
642 |
"Created: / 25-06-2010 / 11:38:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
643 |
! |
|
644 |
||
645 |
postBuildDiffView: aView |
|
646 |
||
647 |
diffView := aView. |
|
648 |
||
649 |
"Created: / 09-11-2009 / 12:09:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
650 |
! ! |
|
651 |
||
652 |
!DiffViewApp methodsFor:'change & update'! |
|
653 |
||
654 |
update:aspect with:param from:sender |
|
655 |
||
656 |
(sender == versionATextHolder or:[sender == versionBTextHolder]) |
|
657 |
ifTrue:[^self updateTexts]. |
|
658 |
||
659 |
sender == diffHolder |
|
660 |
ifTrue:[ ^ self updateDiff ]. |
|
661 |
||
662 |
^ super |
|
663 |
update:aspect |
|
664 |
with:param |
|
665 |
from:sender |
|
666 |
||
667 |
"Created: / 09-11-2009 / 12:20:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
668 |
"Modified: / 24-06-2010 / 19:08:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
669 |
! |
|
670 |
||
671 |
updateDiff |
|
672 |
||
673 |
diffView ifNil:[ ^ self ]. |
|
674 |
self diffitem ifNil: [ ^ self ]. |
|
675 |
||
676 |
self versionALabelHolder value: self diffitem versionALabel. |
|
677 |
self versionBLabelHolder value: self diffitem versionBLabel. |
|
678 |
||
679 |
||
680 |
self versionATextHolder setValue: (self sourceOf: self diffitem versionA). |
|
681 |
self versionBTextHolder setValue: (self sourceOf: self diffitem versionB). |
|
682 |
||
683 |
self updateTexts |
|
684 |
||
685 |
"Created: / 24-06-2010 / 19:01:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
686 |
! |
|
687 |
||
688 |
updateTexts |
|
689 |
||
690 |
diffView ifNil:[^self]. |
|
691 |
diffView |
|
692 |
text1: versionATextHolder value |
|
693 |
text2: versionBTextHolder value |
|
694 |
||
695 |
"Created: / 24-06-2010 / 18:57:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
696 |
"Modified: / 25-06-2010 / 11:38:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
697 |
! ! |
|
698 |
||
699 |
!DiffViewApp methodsFor:'private'! |
|
700 |
||
701 |
sourceOf: aChange |
|
702 |
||
703 |
^(aChange isNil or:[aChange isClassRemoveChange or: [aChange isMethodRemoveChange]]) |
|
704 |
ifTrue:[SVN::DiffBrowser versionNotPresentText] |
|
705 |
ifFalse:[aChange source] |
|
706 |
||
707 |
"Created: / 03-11-2009 / 13:21:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
708 |
"Modified: / 24-11-2009 / 12:34:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
709 |
! ! |
|
710 |
||
711 |
!DiffViewApp::Diff3TextView class methodsFor:'defaults'! |
|
712 |
||
713 |
numberOfViews |
|
714 |
"return the number of the synced subViews. |
|
715 |
Usually redefined in subclasses" |
|
716 |
||
717 |
^ 3 |
|
718 |
||
719 |
"Created: / 03-11-2009 / 13:02:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
720 |
! ! |
|
721 |
||
722 |
!DiffViewApp::Diff3TextView methodsFor:'accessing'! |
|
723 |
||
724 |
change1: c1 change2: c2 change3: c3 |
|
725 |
||
726 |
"Sorry. no three-way diff here. I'm too lazy :-) |
|
727 |
Waiting for pure smalltalk diff implementation... |
|
728 |
" |
|
729 |
c1 isNil | c2 isNil |
|
730 |
ifTrue: |
|
731 |
[textViews first contents: (self sourceOf: c1). |
|
732 |
textViews second contents: (self sourceOf: c2)] |
|
733 |
ifFalse: |
|
734 |
[self |
|
735 |
text1: (self sourceOf: c1) |
|
736 |
text2: (self sourceOf: c2) ]. |
|
737 |
textViews third contents: (self sourceOf: c3) |
|
738 |
||
739 |
"Created: / 04-11-2009 / 09:53:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
740 |
! ! |
|
741 |
||
742 |
!DiffViewApp::Diff3TextView methodsFor:'private'! |
|
743 |
||
744 |
sourceOf: aChange |
|
745 |
||
746 |
^(aChange isNil or:[aChange isClassRemoveChange or: [aChange isMethodRemoveChange]]) |
|
747 |
ifTrue:[SVN::DiffBrowser versionNotPresentText] |
|
748 |
ifFalse:[aChange source] |
|
749 |
||
750 |
"Created: / 03-11-2009 / 13:21:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
751 |
"Modified: / 24-11-2009 / 12:34:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
752 |
! ! |
|
753 |
||
754 |
!DiffViewApp class methodsFor:'documentation'! |
|
755 |
||
756 |
version |
|
757 |
^ '$Header$' |
|
758 |
! |
|
759 |
||
760 |
version_SVN |
|
831
67993e20403d
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
639
diff
changeset
|
761 |
^ '§Id: SVN__DiffViewApp.st 362 2011-08-08 13:07:42Z vranyj1 §' |
639 | 762 |
! ! |