10196
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2006 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
10332
|
12 |
"{ Package: 'stx:libtool' }"
|
10196
|
13 |
|
|
14 |
"{ NameSpace: Tools }"
|
|
15 |
|
|
16 |
ApplicationModel subclass:#TextDiffTool
|
10332
|
17 |
instanceVariableNames:'labelAHolder textAHolder labelBHolder textBHolder classHolder
|
|
18 |
languageHolder showDiffHolder diffSpecHolder diffView
|
|
19 |
numChangedTexts codeView'
|
10196
|
20 |
classVariableNames:''
|
|
21 |
poolDictionaries:''
|
|
22 |
category:'Interface-Diff'
|
|
23 |
!
|
|
24 |
|
|
25 |
!TextDiffTool class methodsFor:'documentation'!
|
|
26 |
|
|
27 |
copyright
|
|
28 |
"
|
|
29 |
COPYRIGHT (c) 2006 by eXept Software AG
|
|
30 |
All Rights Reserved
|
|
31 |
|
|
32 |
This software is furnished under a license and may be used
|
|
33 |
only in accordance with the terms of that license and with the
|
|
34 |
inclusion of the above copyright notice. This software may not
|
|
35 |
be provided or otherwise made available to, or used by, any
|
|
36 |
other person. No title to or ownership of the software is
|
|
37 |
hereby transferred.
|
|
38 |
"
|
|
39 |
! !
|
|
40 |
|
|
41 |
!TextDiffTool class methodsFor:'image specs'!
|
|
42 |
|
|
43 |
versionA24x24
|
|
44 |
|
|
45 |
^ToolbarIconLibrary versionA24x24
|
|
46 |
|
|
47 |
"Created: / 24-03-2010 / 20:49:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
48 |
!
|
|
49 |
|
|
50 |
versionB24x24
|
|
51 |
|
|
52 |
^ToolbarIconLibrary versionB24x24
|
|
53 |
|
|
54 |
"Created: / 24-03-2010 / 20:50:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
55 |
!
|
|
56 |
|
|
57 |
versionBase24x24
|
|
58 |
|
|
59 |
^ToolbarIconLibrary versionBase24x24
|
|
60 |
|
|
61 |
"Created: / 24-03-2010 / 20:50:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
62 |
! !
|
|
63 |
|
|
64 |
!TextDiffTool class methodsFor:'interface specs'!
|
|
65 |
|
|
66 |
diffSpec
|
|
67 |
"This resource specification was automatically generated
|
|
68 |
by the UIPainter of ST/X."
|
|
69 |
|
|
70 |
"Do not manually edit this!! If it is corrupted,
|
|
71 |
the UIPainter may not be able to read the specification."
|
|
72 |
|
|
73 |
"
|
|
74 |
UIPainter new openOnClass:Tools::TextDiffTool andSelector:#diffSpec
|
|
75 |
Tools::TextDiffTool new openInterface:#diffSpec
|
|
76 |
"
|
|
77 |
|
|
78 |
<resource: #canvas>
|
|
79 |
|
|
80 |
^
|
|
81 |
#(FullSpec
|
|
82 |
name: diffSpec
|
|
83 |
window:
|
|
84 |
(WindowSpec
|
|
85 |
label: 'Text Diff Tool (for embedding)'
|
|
86 |
name: 'Text Diff Tool (for embedding)'
|
|
87 |
min: (Point 10 10)
|
|
88 |
bounds: (Rectangle 0 0 782 506)
|
|
89 |
)
|
|
90 |
component:
|
|
91 |
(SpecCollection
|
|
92 |
collection: (
|
|
93 |
(ViewSpec
|
|
94 |
name: '2Labels'
|
|
95 |
layout: (LayoutFrame 0 0 0 0 -16 1 30 0)
|
|
96 |
component:
|
|
97 |
(SpecCollection
|
|
98 |
collection: (
|
|
99 |
(UISubSpecification
|
|
100 |
name: 'VersionA'
|
|
101 |
layout: (LayoutFrame 0 0 0 0 0 0.5 30 0)
|
|
102 |
minorKey: versionALabelSpec
|
|
103 |
)
|
|
104 |
(UISubSpecification
|
|
105 |
name: 'VersionB'
|
|
106 |
layout: (LayoutFrame 5 0.5 0 0 0 1 30 0)
|
|
107 |
minorKey: versionBLabelSpec
|
|
108 |
)
|
|
109 |
)
|
|
110 |
|
|
111 |
)
|
|
112 |
)
|
|
113 |
(ArbitraryComponentSpec
|
|
114 |
name: 'Diff2TextView'
|
|
115 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1)
|
|
116 |
hasHorizontalScrollBar: false
|
|
117 |
hasVerticalScrollBar: false
|
|
118 |
autoHideScrollBars: false
|
|
119 |
hasBorder: false
|
|
120 |
component: #'Tools::DiffCodeView2'
|
|
121 |
postBuildCallback: postBuildDiffView:
|
|
122 |
)
|
|
123 |
)
|
|
124 |
|
|
125 |
)
|
|
126 |
)
|
|
127 |
!
|
|
128 |
|
10332
|
129 |
textViewSpec
|
|
130 |
"This resource specification was automatically generated
|
|
131 |
by the UIPainter of ST/X."
|
|
132 |
|
|
133 |
"Do not manually edit this!! If it is corrupted,
|
|
134 |
the UIPainter may not be able to read the specification."
|
|
135 |
|
|
136 |
"
|
|
137 |
UIPainter new openOnClass:Tools::TextDiffTool andSelector:#textViewSpec
|
|
138 |
Tools::TextDiffTool new openInterface:#textViewSpec
|
|
139 |
"
|
|
140 |
|
|
141 |
<resource: #canvas>
|
|
142 |
|
|
143 |
^
|
|
144 |
#(FullSpec
|
|
145 |
name: 'textViewSpec'
|
|
146 |
window:
|
|
147 |
(WindowSpec
|
|
148 |
label: 'Text Only'
|
|
149 |
name: 'Text Only'
|
|
150 |
min: (Point 10 10)
|
|
151 |
bounds: (Rectangle 0 0 782 506)
|
|
152 |
)
|
|
153 |
component:
|
|
154 |
(SpecCollection
|
|
155 |
collection: (
|
|
156 |
(ArbitraryComponentSpec
|
|
157 |
name: 'CodeView'
|
|
158 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1)
|
|
159 |
model: textAHolder
|
|
160 |
hasHorizontalScrollBar: false
|
|
161 |
hasVerticalScrollBar: false
|
|
162 |
autoHideScrollBars: false
|
|
163 |
hasBorder: false
|
|
164 |
component: #'Tools::CodeView2'
|
|
165 |
postBuildCallback: postBuildCodeView:
|
|
166 |
)
|
|
167 |
)
|
|
168 |
|
|
169 |
)
|
|
170 |
)
|
|
171 |
!
|
|
172 |
|
|
173 |
versionAOnlySpec
|
|
174 |
"This resource specification was automatically generated
|
|
175 |
by the UIPainter of ST/X."
|
|
176 |
|
|
177 |
"Do not manually edit this!! If it is corrupted,
|
|
178 |
the UIPainter may not be able to read the specification."
|
|
179 |
|
|
180 |
"
|
|
181 |
UIPainter new openOnClass:Tools::TextDiffTool andSelector:#versionAOnlySpec
|
|
182 |
Tools::TextDiffTool new openInterface:#versionAOnlySpec
|
|
183 |
"
|
|
184 |
|
|
185 |
<resource: #canvas>
|
|
186 |
|
|
187 |
^
|
|
188 |
#(FullSpec
|
|
189 |
name: versionAOnlySpec
|
|
190 |
window:
|
|
191 |
(WindowSpec
|
|
192 |
label: 'Version A Only'
|
|
193 |
name: 'Version A Only'
|
|
194 |
min: (Point 10 10)
|
|
195 |
bounds: (Rectangle 0 0 782 506)
|
|
196 |
)
|
|
197 |
component:
|
|
198 |
(SpecCollection
|
|
199 |
collection: (
|
|
200 |
(UISubSpecification
|
|
201 |
name: 'VersionA'
|
|
202 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0)
|
|
203 |
minorKey: versionALabelSpec
|
|
204 |
)
|
|
205 |
(UISubSpecification
|
|
206 |
name: 'Text'
|
|
207 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1)
|
|
208 |
minorKey: textViewSpec
|
|
209 |
)
|
|
210 |
)
|
|
211 |
|
|
212 |
)
|
|
213 |
)
|
|
214 |
!
|
|
215 |
|
|
216 |
versionBOnlySpec
|
|
217 |
"This resource specification was automatically generated
|
|
218 |
by the UIPainter of ST/X."
|
|
219 |
|
|
220 |
"Do not manually edit this!! If it is corrupted,
|
|
221 |
the UIPainter may not be able to read the specification."
|
|
222 |
|
|
223 |
"
|
|
224 |
UIPainter new openOnClass:Tools::TextDiffTool andSelector:#versionBOnlySpec
|
|
225 |
Tools::TextDiffTool new openInterface:#versionBOnlySpec
|
|
226 |
"
|
|
227 |
|
|
228 |
<resource: #canvas>
|
|
229 |
|
|
230 |
^
|
|
231 |
#(FullSpec
|
|
232 |
name: 'versionBOnlySpec'
|
|
233 |
window:
|
|
234 |
(WindowSpec
|
|
235 |
label: 'Version B Only'
|
|
236 |
name: 'Version B Only'
|
|
237 |
min: (Point 10 10)
|
|
238 |
bounds: (Rectangle 0 0 782 506)
|
|
239 |
)
|
|
240 |
component:
|
|
241 |
(SpecCollection
|
|
242 |
collection: (
|
|
243 |
(UISubSpecification
|
|
244 |
name: 'VersionB'
|
|
245 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0)
|
|
246 |
minorKey: versionBLabelSpec
|
|
247 |
)
|
|
248 |
(UISubSpecification
|
|
249 |
name: 'Text'
|
|
250 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1)
|
|
251 |
minorKey: textViewSpec
|
|
252 |
)
|
|
253 |
)
|
|
254 |
|
|
255 |
)
|
|
256 |
)
|
|
257 |
|
|
258 |
"Created: / 19-07-2011 / 10:06:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
259 |
!
|
|
260 |
|
10196
|
261 |
windowSpec
|
|
262 |
"This resource specification was automatically generated
|
|
263 |
by the UIPainter of ST/X."
|
|
264 |
|
|
265 |
"Do not manually edit this!! If it is corrupted,
|
|
266 |
the UIPainter may not be able to read the specification."
|
|
267 |
|
|
268 |
"
|
|
269 |
UIPainter new openOnClass:Tools::TextDiffTool andSelector:#windowSpec
|
|
270 |
Tools::TextDiffTool new openInterface:#windowSpec
|
|
271 |
Tools::TextDiffTool open
|
|
272 |
"
|
|
273 |
|
|
274 |
<resource: #canvas>
|
|
275 |
|
|
276 |
^
|
|
277 |
#(FullSpec
|
|
278 |
name: windowSpec
|
|
279 |
window:
|
|
280 |
(WindowSpec
|
|
281 |
label: 'Text Diff Tool'
|
|
282 |
name: 'Text Diff Tool'
|
|
283 |
min: (Point 10 10)
|
|
284 |
bounds: (Rectangle 0 0 640 480)
|
|
285 |
)
|
|
286 |
component:
|
|
287 |
(SpecCollection
|
|
288 |
collection: (
|
|
289 |
(UISubSpecification
|
|
290 |
name: 'Contents'
|
|
291 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1)
|
|
292 |
minorKey: windowSpecForEmbedding
|
|
293 |
)
|
|
294 |
)
|
|
295 |
|
|
296 |
)
|
|
297 |
)
|
|
298 |
|
|
299 |
"Modified: / 30-06-2011 / 20:45:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
300 |
!
|
|
301 |
|
|
302 |
windowSpecForEmbedding
|
|
303 |
"This resource specification was automatically generated
|
|
304 |
by the UIPainter of ST/X."
|
|
305 |
|
|
306 |
"Do not manually edit this!! If it is corrupted,
|
|
307 |
the UIPainter may not be able to read the specification."
|
|
308 |
|
|
309 |
"
|
|
310 |
UIPainter new openOnClass:Tools::TextDiffTool andSelector:#windowSpecForEmbedding
|
|
311 |
Tools::TextDiffTool new openInterface:#windowSpecForEmbedding
|
|
312 |
"
|
|
313 |
|
|
314 |
<resource: #canvas>
|
|
315 |
|
|
316 |
^
|
|
317 |
#(FullSpec
|
|
318 |
name: windowSpecForEmbedding
|
|
319 |
window:
|
|
320 |
(WindowSpec
|
|
321 |
label: 'Text Diff Tool (for embedding)'
|
|
322 |
name: 'Text Diff Tool (for embedding)'
|
|
323 |
min: (Point 10 10)
|
|
324 |
bounds: (Rectangle 0 0 782 506)
|
|
325 |
)
|
|
326 |
component:
|
|
327 |
(SpecCollection
|
|
328 |
collection: (
|
|
329 |
(SubCanvasSpec
|
|
330 |
name: 'Contents'
|
|
331 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1)
|
|
332 |
hasHorizontalScrollBar: false
|
|
333 |
hasVerticalScrollBar: false
|
|
334 |
specHolder: diffSpecHolder
|
|
335 |
createNewBuilder: false
|
|
336 |
)
|
|
337 |
)
|
|
338 |
|
|
339 |
)
|
|
340 |
)
|
|
341 |
! !
|
|
342 |
|
|
343 |
!TextDiffTool class methodsFor:'interface specs - labels'!
|
|
344 |
|
|
345 |
versionALabelSpec
|
|
346 |
"This resource specification was automatically generated
|
|
347 |
by the UIPainter of ST/X."
|
|
348 |
|
|
349 |
"Do not manually edit this!! If it is corrupted,
|
|
350 |
the UIPainter may not be able to read the specification."
|
|
351 |
|
|
352 |
"
|
|
353 |
UIPainter new openOnClass:SVN::DiffViewApp andSelector:#versionALabelSpec
|
|
354 |
SVN::DiffViewApp new openInterface:#versionALabelSpec
|
|
355 |
"
|
|
356 |
|
|
357 |
<resource: #canvas>
|
|
358 |
|
|
359 |
^
|
|
360 |
#(FullSpec
|
|
361 |
name: versionALabelSpec
|
|
362 |
window:
|
|
363 |
(WindowSpec
|
|
364 |
label: 'Version A'
|
|
365 |
name: 'Version A'
|
|
366 |
min: (Point 10 10)
|
|
367 |
bounds: (Rectangle 0 0 300 30)
|
|
368 |
)
|
|
369 |
component:
|
|
370 |
(SpecCollection
|
|
371 |
collection: (
|
|
372 |
(LabelSpec
|
|
373 |
label: 'versionA24x24'
|
|
374 |
name: 'VersionAIcon'
|
|
375 |
layout: (LayoutFrame 0 0 -12 0.5 27 0 12 0.5)
|
|
376 |
hasCharacterOrientedLabel: false
|
|
377 |
translateLabel: true
|
|
378 |
)
|
|
379 |
(LabelSpec
|
|
380 |
label: 'Version A'
|
|
381 |
name: 'VersionALabel'
|
|
382 |
layout: (LayoutFrame 30 0 0 0 0 1 0 1)
|
|
383 |
translateLabel: true
|
|
384 |
labelChannel: labelAHolder
|
|
385 |
resizeForLabel: true
|
|
386 |
adjust: left
|
|
387 |
)
|
|
388 |
)
|
|
389 |
|
|
390 |
)
|
|
391 |
)
|
|
392 |
|
|
393 |
"Modified: / 30-06-2011 / 20:53:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
394 |
!
|
|
395 |
|
|
396 |
versionBLabelSpec
|
|
397 |
"This resource specification was automatically generated
|
|
398 |
by the UIPainter of ST/X."
|
|
399 |
|
|
400 |
"Do not manually edit this!! If it is corrupted,
|
|
401 |
the UIPainter may not be able to read the specification."
|
|
402 |
|
|
403 |
"
|
|
404 |
UIPainter new openOnClass:SVN::DiffViewApp andSelector:#versionBLabelSpec
|
|
405 |
SVN::DiffViewApp new openInterface:#versionBLabelSpec
|
|
406 |
"
|
|
407 |
|
|
408 |
<resource: #canvas>
|
|
409 |
|
|
410 |
^
|
|
411 |
#(FullSpec
|
|
412 |
name: versionBLabelSpec
|
|
413 |
window:
|
|
414 |
(WindowSpec
|
|
415 |
label: 'Version B'
|
|
416 |
name: 'Version B'
|
|
417 |
min: (Point 10 10)
|
|
418 |
bounds: (Rectangle 0 0 300 30)
|
|
419 |
)
|
|
420 |
component:
|
|
421 |
(SpecCollection
|
|
422 |
collection: (
|
|
423 |
(LabelSpec
|
|
424 |
label: 'versionB24x24'
|
|
425 |
name: 'VersionBIcon'
|
|
426 |
layout: (LayoutFrame 0 0 -12 0.5 27 0 12 0.5)
|
|
427 |
hasCharacterOrientedLabel: false
|
|
428 |
translateLabel: true
|
|
429 |
)
|
|
430 |
(LabelSpec
|
|
431 |
label: 'Version B'
|
|
432 |
name: 'VersionBLabel'
|
|
433 |
layout: (LayoutFrame 30 0 0 0 0 1 0 1)
|
|
434 |
translateLabel: true
|
|
435 |
labelChannel: labelBHolder
|
|
436 |
resizeForLabel: true
|
|
437 |
adjust: left
|
|
438 |
useDynamicPreferredWidth: true
|
|
439 |
usePreferredWidth: true
|
|
440 |
)
|
|
441 |
)
|
|
442 |
|
|
443 |
)
|
|
444 |
)
|
|
445 |
|
|
446 |
"Modified: / 30-06-2011 / 20:53:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
447 |
!
|
|
448 |
|
|
449 |
versionBaseLabelSpec
|
|
450 |
"This resource specification was automatically generated
|
|
451 |
by the UIPainter of ST/X."
|
|
452 |
|
|
453 |
"Do not manually edit this!! If it is corrupted,
|
|
454 |
the UIPainter may not be able to read the specification."
|
|
455 |
|
|
456 |
"
|
|
457 |
UIPainter new openOnClass:SVN::DiffViewApp andSelector:#versionBaseLabelSpec
|
|
458 |
SVN::DiffViewApp new openInterface:#versionBaseLabelSpec
|
|
459 |
"
|
|
460 |
|
|
461 |
<resource: #canvas>
|
|
462 |
|
|
463 |
^
|
|
464 |
#(FullSpec
|
|
465 |
name: versionBaseLabelSpec
|
|
466 |
window:
|
|
467 |
(WindowSpec
|
|
468 |
label: 'Version Base'
|
|
469 |
name: 'Version Base'
|
|
470 |
min: (Point 10 10)
|
|
471 |
bounds: (Rectangle 0 0 300 30)
|
|
472 |
)
|
|
473 |
component:
|
|
474 |
(SpecCollection
|
|
475 |
collection: (
|
|
476 |
(LabelSpec
|
|
477 |
label: 'versionBase24x24'
|
|
478 |
name: 'VersionBaseIcon'
|
|
479 |
layout: (LayoutFrame 0 0 -12 0.5 27 0 12 0.5)
|
|
480 |
hasCharacterOrientedLabel: false
|
|
481 |
translateLabel: true
|
|
482 |
)
|
|
483 |
(LabelSpec
|
|
484 |
label: 'Version Base'
|
|
485 |
name: 'VersionBaseLabel'
|
|
486 |
layout: (LayoutFrame 30 0 5 0 191 0 0 1)
|
|
487 |
translateLabel: true
|
|
488 |
labelChannel: versionBaseLabelAspect
|
|
489 |
resizeForLabel: true
|
|
490 |
adjust: left
|
|
491 |
useDynamicPreferredWidth: true
|
|
492 |
usePreferredWidth: true
|
|
493 |
)
|
|
494 |
)
|
|
495 |
|
|
496 |
)
|
|
497 |
)
|
|
498 |
|
|
499 |
"Modified: / 24-03-2010 / 20:51:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
500 |
! !
|
|
501 |
|
|
502 |
!TextDiffTool class methodsFor:'plugIn spec'!
|
|
503 |
|
|
504 |
aspectSelectors
|
|
505 |
"This resource specification was automatically generated
|
|
506 |
by the UIPainter of ST/X."
|
|
507 |
|
|
508 |
"Do not manually edit this. If it is corrupted,
|
|
509 |
the UIPainter may not be able to read the specification."
|
|
510 |
|
|
511 |
"Return a description of exported aspects;
|
|
512 |
these can be connected to aspects of an embedding application
|
|
513 |
(if this app is embedded in a subCanvas)."
|
|
514 |
|
|
515 |
^ #(
|
|
516 |
#labelAHolder
|
|
517 |
#labelBHolder
|
10332
|
518 |
|
10196
|
519 |
#textAHolder
|
|
520 |
#textBHolder
|
10332
|
521 |
|
|
522 |
#showDiffHolder
|
|
523 |
|
|
524 |
#classHolder
|
|
525 |
#languageHolder
|
10196
|
526 |
).
|
|
527 |
|
10332
|
528 |
"Modified: / 19-07-2011 / 13:02:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10196
|
529 |
! !
|
|
530 |
|
|
531 |
!TextDiffTool methodsFor:'aspects'!
|
|
532 |
|
10332
|
533 |
classHolder
|
|
534 |
"return/create the 'classHolder' value holder (automatically generated)"
|
|
535 |
|
|
536 |
classHolder isNil ifTrue:[
|
|
537 |
classHolder := ValueHolder new.
|
|
538 |
].
|
|
539 |
^ classHolder
|
|
540 |
!
|
|
541 |
|
|
542 |
classHolder: aValueHolder
|
|
543 |
|
|
544 |
classHolder := aValueHolder.
|
|
545 |
codeView notNil ifTrue:[codeView classHolder: aValueHolder].
|
|
546 |
diffView notNil ifTrue:[diffView classHolder: aValueHolder].
|
|
547 |
|
|
548 |
"Modified: / 19-07-2011 / 12:54:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
549 |
!
|
|
550 |
|
10196
|
551 |
diffSpecHolder
|
|
552 |
"return/create the 'diffSpecHolder' value holder (automatically generated)"
|
|
553 |
|
|
554 |
diffSpecHolder isNil ifTrue:[
|
|
555 |
diffSpecHolder := ValueHolder with: #diffSpec.
|
|
556 |
diffSpecHolder addDependent:self.
|
|
557 |
].
|
|
558 |
^ diffSpecHolder
|
|
559 |
|
|
560 |
"Modified: / 06-07-2011 / 11:57:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
561 |
!
|
|
562 |
|
|
563 |
diffSpecHolder:something
|
|
564 |
"set the 'diffSpecHolder' value holder (automatically generated)"
|
|
565 |
|
|
566 |
|oldValue newValue|
|
|
567 |
|
|
568 |
diffSpecHolder notNil ifTrue:[
|
|
569 |
oldValue := diffSpecHolder value.
|
|
570 |
diffSpecHolder removeDependent:self.
|
|
571 |
].
|
|
572 |
diffSpecHolder := something.
|
|
573 |
diffSpecHolder notNil ifTrue:[
|
|
574 |
diffSpecHolder addDependent:self.
|
|
575 |
].
|
|
576 |
newValue := diffSpecHolder value.
|
|
577 |
oldValue ~~ newValue ifTrue:[
|
|
578 |
self update:#value with:newValue from:diffSpecHolder.
|
|
579 |
].
|
|
580 |
!
|
|
581 |
|
|
582 |
labelAHolder
|
|
583 |
"return/create the 'labelAHolder' value holder (automatically generated)"
|
|
584 |
|
|
585 |
labelAHolder isNil ifTrue:[
|
10332
|
586 |
labelAHolder := ValueHolder with:'Version A'.
|
10196
|
587 |
labelAHolder addDependent:self.
|
|
588 |
].
|
|
589 |
^ labelAHolder
|
10332
|
590 |
|
|
591 |
"Modified: / 19-07-2011 / 11:41:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10196
|
592 |
!
|
|
593 |
|
|
594 |
labelAHolder:something
|
|
595 |
"set the 'labelAHolder' value holder (automatically generated)"
|
|
596 |
|
|
597 |
|oldValue newValue|
|
|
598 |
|
|
599 |
labelAHolder notNil ifTrue:[
|
|
600 |
oldValue := labelAHolder value.
|
|
601 |
labelAHolder removeDependent:self.
|
|
602 |
].
|
|
603 |
labelAHolder := something.
|
|
604 |
labelAHolder notNil ifTrue:[
|
|
605 |
labelAHolder addDependent:self.
|
|
606 |
].
|
|
607 |
newValue := labelAHolder value.
|
|
608 |
oldValue ~~ newValue ifTrue:[
|
|
609 |
self update:#value with:newValue from:labelAHolder.
|
|
610 |
].
|
|
611 |
!
|
|
612 |
|
|
613 |
labelBHolder
|
|
614 |
"return/create the 'labelBHolder' value holder (automatically generated)"
|
|
615 |
|
|
616 |
labelBHolder isNil ifTrue:[
|
10332
|
617 |
labelBHolder := ValueHolder with:'Version B'.
|
10196
|
618 |
labelBHolder addDependent:self.
|
|
619 |
].
|
|
620 |
^ labelBHolder
|
10332
|
621 |
|
|
622 |
"Modified: / 19-07-2011 / 11:42:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10196
|
623 |
!
|
|
624 |
|
|
625 |
labelBHolder:something
|
|
626 |
"set the 'labelBHolder' value holder (automatically generated)"
|
|
627 |
|
|
628 |
|oldValue newValue|
|
|
629 |
|
|
630 |
labelBHolder notNil ifTrue:[
|
|
631 |
oldValue := labelBHolder value.
|
|
632 |
labelBHolder removeDependent:self.
|
|
633 |
].
|
|
634 |
labelBHolder := something.
|
|
635 |
labelBHolder notNil ifTrue:[
|
|
636 |
labelBHolder addDependent:self.
|
|
637 |
].
|
|
638 |
newValue := labelBHolder value.
|
|
639 |
oldValue ~~ newValue ifTrue:[
|
|
640 |
self update:#value with:newValue from:labelBHolder.
|
|
641 |
].
|
|
642 |
!
|
|
643 |
|
10332
|
644 |
languageHolder
|
|
645 |
"return/create the 'languageHolder' value holder (automatically generated)"
|
|
646 |
|
|
647 |
languageHolder isNil ifTrue:[
|
|
648 |
languageHolder := ValueHolder new.
|
|
649 |
].
|
|
650 |
^ languageHolder
|
|
651 |
!
|
|
652 |
|
|
653 |
languageHolder:aValueHolder
|
|
654 |
|
|
655 |
languageHolder := aValueHolder.
|
|
656 |
codeView notNil ifTrue:[codeView languageHolder: aValueHolder].
|
|
657 |
diffView notNil ifTrue:[diffView languageHolder: aValueHolder].
|
|
658 |
|
|
659 |
"Modified: / 19-07-2011 / 12:54:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
660 |
!
|
|
661 |
|
10196
|
662 |
showDiffHolder
|
|
663 |
"return/create the 'showDiffHolder' value holder (automatically generated)"
|
|
664 |
|
|
665 |
showDiffHolder isNil ifTrue:[
|
|
666 |
showDiffHolder := ValueHolder with: true.
|
|
667 |
showDiffHolder addDependent:self.
|
|
668 |
].
|
|
669 |
^ showDiffHolder
|
|
670 |
|
|
671 |
"Modified: / 30-06-2011 / 20:59:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
672 |
!
|
|
673 |
|
|
674 |
showDiffHolder:something
|
|
675 |
"set the 'showDiffHolder' value holder (automatically generated)"
|
|
676 |
|
|
677 |
|oldValue newValue|
|
|
678 |
|
|
679 |
showDiffHolder notNil ifTrue:[
|
|
680 |
oldValue := showDiffHolder value.
|
|
681 |
showDiffHolder removeDependent:self.
|
|
682 |
].
|
|
683 |
showDiffHolder := something.
|
|
684 |
showDiffHolder notNil ifTrue:[
|
|
685 |
showDiffHolder addDependent:self.
|
|
686 |
].
|
|
687 |
newValue := showDiffHolder value.
|
|
688 |
oldValue ~~ newValue ifTrue:[
|
|
689 |
self update:#value with:newValue from:showDiffHolder.
|
|
690 |
].
|
|
691 |
!
|
|
692 |
|
|
693 |
textAHolder
|
|
694 |
"return/create the 'textAHolder' value holder (automatically generated)"
|
|
695 |
|
|
696 |
textAHolder isNil ifTrue:[
|
|
697 |
textAHolder := ValueHolder new.
|
|
698 |
textAHolder addDependent:self.
|
|
699 |
].
|
|
700 |
^ textAHolder
|
|
701 |
!
|
|
702 |
|
|
703 |
textAHolder:something
|
|
704 |
"set the 'textAHolder' value holder (automatically generated)"
|
|
705 |
|
|
706 |
|oldValue newValue|
|
|
707 |
|
|
708 |
textAHolder notNil ifTrue:[
|
|
709 |
oldValue := textAHolder value.
|
|
710 |
textAHolder removeDependent:self.
|
|
711 |
].
|
|
712 |
textAHolder := something.
|
|
713 |
textAHolder notNil ifTrue:[
|
|
714 |
textAHolder addDependent:self.
|
|
715 |
].
|
|
716 |
newValue := textAHolder value.
|
|
717 |
oldValue ~~ newValue ifTrue:[
|
|
718 |
self update:#value with:newValue from:textAHolder.
|
|
719 |
].
|
|
720 |
!
|
|
721 |
|
|
722 |
textBHolder
|
|
723 |
"return/create the 'textBHolder' value holder (automatically generated)"
|
|
724 |
|
|
725 |
textBHolder isNil ifTrue:[
|
|
726 |
textBHolder := ValueHolder new.
|
|
727 |
textBHolder addDependent:self.
|
|
728 |
].
|
|
729 |
^ textBHolder
|
|
730 |
!
|
|
731 |
|
|
732 |
textBHolder:something
|
|
733 |
"set the 'textBHolder' value holder (automatically generated)"
|
|
734 |
|
|
735 |
|oldValue newValue|
|
|
736 |
|
|
737 |
textBHolder notNil ifTrue:[
|
|
738 |
oldValue := textBHolder value.
|
|
739 |
textBHolder removeDependent:self.
|
|
740 |
].
|
|
741 |
textBHolder := something.
|
|
742 |
textBHolder notNil ifTrue:[
|
|
743 |
textBHolder addDependent:self.
|
|
744 |
].
|
|
745 |
newValue := textBHolder value.
|
|
746 |
oldValue ~~ newValue ifTrue:[
|
|
747 |
self update:#value with:newValue from:textBHolder.
|
|
748 |
].
|
|
749 |
! !
|
|
750 |
|
|
751 |
!TextDiffTool methodsFor:'change & update'!
|
|
752 |
|
|
753 |
update:something with:aParameter from:changedObject
|
|
754 |
"Invoked when an object that I depend upon sends a change notification."
|
|
755 |
|
|
756 |
|
|
757 |
(changedObject == textAHolder or:[changedObject == textBHolder]) ifTrue:[
|
10332
|
758 |
self updateAfterAorBChanged.
|
|
759 |
^ self.
|
|
760 |
].
|
|
761 |
(changedObject == showDiffHolder) ifTrue:[
|
|
762 |
self updateViews.
|
|
763 |
^self.
|
|
764 |
].
|
10196
|
765 |
super update:something with:aParameter from:changedObject
|
|
766 |
|
10332
|
767 |
"Modified: / 19-07-2011 / 11:30:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10196
|
768 |
!
|
|
769 |
|
|
770 |
updateAfterAorBChanged
|
|
771 |
|
|
772 |
numChangedTexts := numChangedTexts + 1.
|
|
773 |
numChangedTexts >= 2 ifFalse:[^self].
|
|
774 |
numChangedTexts := 0.
|
|
775 |
|
10332
|
776 |
self updateViews
|
10196
|
777 |
|
|
778 |
"Created: / 06-07-2011 / 12:12:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10332
|
779 |
!
|
|
780 |
|
|
781 |
updateViews
|
|
782 |
|
|
783 |
| a b |
|
|
784 |
a := self textAHolder value.
|
|
785 |
b := self textBHolder value.
|
|
786 |
|
|
787 |
self showDiffHolder value ifFalse:[
|
|
788 |
self showTextOnly.
|
|
789 |
^ self
|
|
790 |
].
|
|
791 |
|
|
792 |
(a notNil and:[b notNil]) ifTrue:[
|
|
793 |
self showDiff.
|
|
794 |
^self
|
|
795 |
].
|
|
796 |
a notNil ifTrue:[
|
|
797 |
self showVersionA.
|
|
798 |
^self
|
|
799 |
].
|
|
800 |
b notNil ifTrue:[
|
|
801 |
self showVersionB.
|
|
802 |
^self
|
|
803 |
].
|
|
804 |
|
|
805 |
self breakPoint: #jv.
|
|
806 |
|
|
807 |
"Created: / 19-07-2011 / 11:29:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10196
|
808 |
! !
|
|
809 |
|
|
810 |
!TextDiffTool methodsFor:'hooks'!
|
|
811 |
|
10332
|
812 |
postBuildCodeView:aScrollableView
|
|
813 |
|
|
814 |
codeView := aScrollableView
|
|
815 |
|
|
816 |
"Created: / 19-07-2011 / 10:17:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
817 |
!
|
|
818 |
|
10196
|
819 |
postBuildDiffView:aScrollableView
|
|
820 |
|
|
821 |
diffView := aScrollableView
|
|
822 |
|
|
823 |
"Created: / 30-06-2011 / 20:55:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
824 |
! !
|
|
825 |
|
|
826 |
!TextDiffTool methodsFor:'initialization'!
|
|
827 |
|
|
828 |
initialize
|
|
829 |
|
|
830 |
super initialize.
|
|
831 |
numChangedTexts := 0.
|
|
832 |
|
|
833 |
"Modified: / 06-07-2011 / 12:15:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
834 |
! !
|
|
835 |
|
10332
|
836 |
!TextDiffTool methodsFor:'private'!
|
|
837 |
|
|
838 |
showDiff
|
|
839 |
|
|
840 |
self diffSpecHolder value: #diffSpec.
|
|
841 |
|
|
842 |
diffView ifNil:[^self].
|
|
843 |
diffView scrolledView ifNil:[^self].
|
|
844 |
diffView scrolledView
|
|
845 |
text1: self textAHolder value
|
|
846 |
text2: self textBHolder value
|
|
847 |
|
|
848 |
"Created: / 19-07-2011 / 10:22:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
849 |
!
|
|
850 |
|
|
851 |
showTextOnly
|
|
852 |
|
|
853 |
self diffSpecHolder value: #textViewSpec
|
|
854 |
|
|
855 |
"Created: / 19-07-2011 / 11:39:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
856 |
!
|
|
857 |
|
|
858 |
showVersionA
|
|
859 |
|
|
860 |
self diffSpecHolder value: #versionAOnlySpec
|
|
861 |
|
|
862 |
"Created: / 19-07-2011 / 10:22:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
863 |
!
|
|
864 |
|
|
865 |
showVersionB
|
|
866 |
|
|
867 |
self diffSpecHolder value: #versionBOnlySpec
|
|
868 |
|
|
869 |
"Created: / 19-07-2011 / 10:22:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
870 |
! !
|
|
871 |
|
10196
|
872 |
!TextDiffTool class methodsFor:'documentation'!
|
|
873 |
|
|
874 |
version_CVS
|
10332
|
875 |
^ '$Header: /cvs/stx/stx/libtool/Tools__TextDiffTool.st,v 1.2 2011-07-19 12:32:56 vrany Exp $'
|
10196
|
876 |
!
|
|
877 |
|
|
878 |
version_SVN
|
|
879 |
^ '§Id§'
|
|
880 |
! !
|