author | Stefan Vogel <sv@exept.de> |
Fri, 17 May 2019 17:13:19 +0200 | |
changeset 18768 | cd6d15fb40b4 |
parent 18689 | 6afc138dedfd |
permissions | -rw-r--r-- |
18689 | 1 |
"{ Encoding: utf8 }" |
2 |
||
10192 | 3 |
" |
4 |
Copyright (c) 2007-2010 Jan Vrany |
|
5 |
Copyright (c) 2009-2010 eXept Software AG |
|
6 |
||
7 |
Permission is hereby granted, free of charge, to any person |
|
8 |
obtaining a copy of this software and associated documentation |
|
9 |
files (the 'Software'), to deal in the Software without |
|
10 |
restriction, including without limitation the rights to use, |
|
11 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
12 |
copies of the Software, and to permit persons to whom the |
|
13 |
Software is furnished to do so, subject to the following |
|
14 |
conditions: |
|
15 |
||
16 |
The above copyright notice and this permission notice shall be |
|
17 |
included in all copies or substantial portions of the Software. |
|
18 |
||
19 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
20 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
21 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
22 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
23 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
24 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
25 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
26 |
OTHER DEALINGS IN THE SOFTWARE. |
|
27 |
" |
|
10217 | 28 |
"{ Package: 'stx:libtool' }" |
10192 | 29 |
|
30 |
"{ NameSpace: Tools }" |
|
31 |
||
10926 | 32 |
BrowserListWithFilter subclass:#ChangeSetDiffList |
13863 | 33 |
instanceVariableNames:'listHolder listSelectionHolder listEntryLabelGenerator |
34 |
listEntryIconGenerator showVersionMethodDiffsHolder |
|
35 |
showCopyrightMethodDiffsHolder highlightConflictsHolder' |
|
10192 | 36 |
classVariableNames:'' |
37 |
poolDictionaries:'' |
|
38 |
category:'Interface-Diff' |
|
39 |
! |
|
40 |
||
41 |
Object subclass:#ListEntry |
|
42 |
instanceVariableNames:'model application' |
|
43 |
classVariableNames:'' |
|
44 |
poolDictionaries:'' |
|
45 |
privateIn:ChangeSetDiffList |
|
46 |
! |
|
47 |
||
48 |
!ChangeSetDiffList class methodsFor:'documentation'! |
|
49 |
||
50 |
copyright |
|
51 |
" |
|
52 |
Copyright (c) 2007-2010 Jan Vrany |
|
53 |
Copyright (c) 2009-2010 eXept Software AG |
|
54 |
||
55 |
Permission is hereby granted, free of charge, to any person |
|
56 |
obtaining a copy of this software and associated documentation |
|
57 |
files (the 'Software'), to deal in the Software without |
|
58 |
restriction, including without limitation the rights to use, |
|
59 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
60 |
copies of the Software, and to permit persons to whom the |
|
61 |
Software is furnished to do so, subject to the following |
|
62 |
conditions: |
|
63 |
||
64 |
The above copyright notice and this permission notice shall be |
|
65 |
included in all copies or substantial portions of the Software. |
|
66 |
||
67 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
68 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
69 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
70 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
71 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
72 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
73 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
74 |
OTHER DEALINGS IN THE SOFTWARE. |
|
75 |
||
76 |
" |
|
77 |
! ! |
|
78 |
||
79 |
!ChangeSetDiffList class methodsFor:'interface specs'! |
|
80 |
||
81 |
windowSpec |
|
82 |
"This resource specification was automatically generated |
|
83 |
by the UIPainter of ST/X." |
|
84 |
||
85 |
"Do not manually edit this!! If it is corrupted, |
|
86 |
the UIPainter may not be able to read the specification." |
|
87 |
||
88 |
" |
|
10938 | 89 |
UIPainter new openOnClass:Tools::ChangeSetDiffList andSelector:#windowSpec |
90 |
Tools::ChangeSetDiffList new openInterface:#windowSpec |
|
91 |
Tools::ChangeSetDiffList open |
|
10192 | 92 |
" |
93 |
||
94 |
<resource: #canvas> |
|
95 |
||
96 |
^ |
|
97 |
#(FullSpec |
|
98 |
name: windowSpec |
|
99 |
window: |
|
100 |
(WindowSpec |
|
101 |
label: 'Diff List' |
|
102 |
name: 'Diff List' |
|
103 |
min: (Point 10 10) |
|
104 |
bounds: (Rectangle 0 0 300 300) |
|
105 |
) |
|
106 |
component: |
|
107 |
(SpecCollection |
|
108 |
collection: ( |
|
10938 | 109 |
(InputFieldSpec |
110 |
name: 'Filter' |
|
13863 | 111 |
layout: (LayoutFrame 0 0 0 0 0 1 22 0) |
10938 | 112 |
initiallyInvisible: true |
113 |
model: filterPatternHolder |
|
114 |
immediateAccept: true |
|
115 |
acceptOnLeave: false |
|
116 |
acceptOnReturn: false |
|
117 |
acceptOnTab: false |
|
118 |
acceptOnPointerLeave: false |
|
119 |
emptyFieldReplacementText: 'Search Filter...' |
|
120 |
postBuildCallback: postBuildFilterView: |
|
121 |
) |
|
10192 | 122 |
(SelectionInListModelViewSpec |
123 |
name: 'List' |
|
124 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
13863 | 125 |
model: listSelectionHolder |
10926 | 126 |
menu: menuHolderWithShowFilter |
10192 | 127 |
hasHorizontalScrollBar: true |
128 |
hasVerticalScrollBar: true |
|
129 |
listModel: listHolder |
|
130 |
multipleSelectOk: true |
|
131 |
useIndex: false |
|
132 |
highlightMode: line |
|
13863 | 133 |
ignoreReselect: false |
134 |
postBuildCallback: postBuildListView: |
|
10192 | 135 |
) |
136 |
) |
|
137 |
||
138 |
) |
|
139 |
) |
|
140 |
! ! |
|
141 |
||
142 |
!ChangeSetDiffList class methodsFor:'plugIn spec'! |
|
143 |
||
144 |
aspectSelectors |
|
145 |
"This resource specification was automatically generated |
|
146 |
by the UIPainter of ST/X." |
|
147 |
||
148 |
"Do not manually edit this. If it is corrupted, |
|
149 |
the UIPainter may not be able to read the specification." |
|
150 |
||
151 |
"Return a description of exported aspects; |
|
152 |
these can be connected to aspects of an embedding application |
|
153 |
(if this app is embedded in a subCanvas)." |
|
154 |
||
155 |
^ #( |
|
14014
e58870fa0034
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13863
diff
changeset
|
156 |
environmentHolder |
13863 | 157 |
#highlightConflictsHolder |
10192 | 158 |
#inGeneratorHolder |
10938 | 159 |
#listEntryIconGenerator |
160 |
#listEntryLabelGenerator |
|
10192 | 161 |
#menuHolder |
10938 | 162 |
#outGeneratorHolder |
13863 | 163 |
#showCopyrightMethodDiffsHolder |
164 |
#showFilterHolder |
|
165 |
#showVersionMethodDiffsHolder |
|
10192 | 166 |
). |
167 |
||
14014
e58870fa0034
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13863
diff
changeset
|
168 |
"Modified: / 24-02-2014 / 10:37:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10192 | 169 |
! ! |
170 |
||
171 |
!ChangeSetDiffList methodsFor:'accessing'! |
|
172 |
||
173 |
listEntryIconGenerator |
|
174 |
^ listEntryIconGenerator |
|
175 |
! |
|
176 |
||
177 |
listEntryIconGenerator:aBlock |
|
178 |
listEntryIconGenerator := aBlock. |
|
179 |
! |
|
180 |
||
181 |
listEntryLabelGenerator |
|
182 |
^ listEntryLabelGenerator |
|
183 |
! |
|
184 |
||
185 |
listEntryLabelGenerator:aBlock |
|
186 |
listEntryLabelGenerator := aBlock. |
|
13863 | 187 |
! |
188 |
||
189 |
selection: entry |
|
190 |
self updateList. |
|
191 |
self selectionHolder value: (Array with: entry). |
|
192 |
||
193 |
"Created: / 17-01-2013 / 13:41:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
194 |
"Modified: / 17-01-2013 / 16:37:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10192 | 195 |
! ! |
196 |
||
197 |
!ChangeSetDiffList methodsFor:'aspects'! |
|
198 |
||
13863 | 199 |
highlightConflictsHolder |
200 |
"return/create the 'highlightConflictsHolder' value holder (automatically generated)" |
|
201 |
||
202 |
highlightConflictsHolder isNil ifTrue:[ |
|
203 |
highlightConflictsHolder := ValueHolder new. |
|
204 |
highlightConflictsHolder addDependent:self. |
|
205 |
]. |
|
206 |
^ highlightConflictsHolder |
|
207 |
||
208 |
"Modified (format): / 03-08-2012 / 14:02:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
209 |
! |
|
210 |
||
211 |
highlightConflictsHolder:something |
|
212 |
"set the 'highlightConflictsHolder' value holder (automatically generated)" |
|
213 |
||
214 |
|oldValue newValue| |
|
215 |
||
216 |
highlightConflictsHolder notNil ifTrue:[ |
|
217 |
oldValue := highlightConflictsHolder value. |
|
218 |
highlightConflictsHolder removeDependent:self. |
|
219 |
]. |
|
220 |
highlightConflictsHolder := something. |
|
221 |
highlightConflictsHolder notNil ifTrue:[ |
|
222 |
highlightConflictsHolder addDependent:self. |
|
223 |
]. |
|
224 |
newValue := highlightConflictsHolder value. |
|
225 |
oldValue ~~ newValue ifTrue:[ |
|
226 |
self update:#value with:newValue from:highlightConflictsHolder. |
|
227 |
]. |
|
228 |
! |
|
229 |
||
10192 | 230 |
listHolder |
231 |
"return/create the 'difflistHolder' value holder (automatically generated)" |
|
232 |
||
233 |
listHolder isNil ifTrue:[ |
|
234 |
listHolder := ValueHolder new. |
|
235 |
]. |
|
236 |
^ listHolder |
|
13863 | 237 |
! |
238 |
||
239 |
listSelectionHolder |
|
240 |
"return/create the 'listSelectionHolder' value holder (automatically generated)" |
|
241 |
||
242 |
listSelectionHolder isNil ifTrue:[ |
|
243 |
listSelectionHolder := ValueHolder new. |
|
244 |
listSelectionHolder addDependent:self. |
|
245 |
]. |
|
246 |
^ listSelectionHolder |
|
247 |
||
248 |
"Modified: / 17-01-2013 / 16:51:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
249 |
! |
|
250 |
||
251 |
showCopyrightMethodDiffsHolder |
|
252 |
"return/create the 'showCopyrightMethodDiffsHolder' value holder (automatically generated)" |
|
253 |
||
254 |
showCopyrightMethodDiffsHolder isNil ifTrue:[ |
|
255 |
showCopyrightMethodDiffsHolder := ValueHolder new. |
|
256 |
showCopyrightMethodDiffsHolder addDependent:self. |
|
257 |
]. |
|
258 |
^ showCopyrightMethodDiffsHolder |
|
259 |
! |
|
260 |
||
261 |
showCopyrightMethodDiffsHolder:something |
|
262 |
"set the 'showCopyrightMethodDiffsHolder' value holder (automatically generated)" |
|
263 |
||
264 |
|oldValue newValue| |
|
265 |
||
266 |
showCopyrightMethodDiffsHolder notNil ifTrue:[ |
|
267 |
oldValue := showCopyrightMethodDiffsHolder value. |
|
268 |
showCopyrightMethodDiffsHolder removeDependent:self. |
|
269 |
]. |
|
270 |
showCopyrightMethodDiffsHolder := something. |
|
271 |
showCopyrightMethodDiffsHolder notNil ifTrue:[ |
|
272 |
showCopyrightMethodDiffsHolder addDependent:self. |
|
273 |
]. |
|
274 |
newValue := showCopyrightMethodDiffsHolder value. |
|
275 |
oldValue ~~ newValue ifTrue:[ |
|
276 |
self update:#value with:newValue from:showCopyrightMethodDiffsHolder. |
|
277 |
]. |
|
278 |
! |
|
279 |
||
280 |
showVersionMethodDiffsHolder |
|
281 |
"return/create the 'showVersionMethodDiffsHolder' value holder (automatically generated)" |
|
282 |
||
283 |
showVersionMethodDiffsHolder isNil ifTrue:[ |
|
284 |
showVersionMethodDiffsHolder := ValueHolder new. |
|
285 |
showVersionMethodDiffsHolder addDependent:self. |
|
286 |
]. |
|
287 |
^ showVersionMethodDiffsHolder |
|
288 |
! |
|
289 |
||
290 |
showVersionMethodDiffsHolder:something |
|
291 |
"set the 'showVersionMethodDiffsHolder' value holder (automatically generated)" |
|
292 |
||
293 |
|oldValue newValue| |
|
294 |
||
295 |
showVersionMethodDiffsHolder notNil ifTrue:[ |
|
296 |
oldValue := showVersionMethodDiffsHolder value. |
|
297 |
showVersionMethodDiffsHolder removeDependent:self. |
|
298 |
]. |
|
299 |
showVersionMethodDiffsHolder := something. |
|
300 |
showVersionMethodDiffsHolder notNil ifTrue:[ |
|
301 |
showVersionMethodDiffsHolder addDependent:self. |
|
302 |
]. |
|
303 |
newValue := showVersionMethodDiffsHolder value. |
|
304 |
oldValue ~~ newValue ifTrue:[ |
|
305 |
self update:#value with:newValue from:showVersionMethodDiffsHolder. |
|
306 |
]. |
|
10192 | 307 |
! ! |
308 |
||
309 |
!ChangeSetDiffList methodsFor:'change & update'! |
|
310 |
||
13863 | 311 |
enqueueDelayedUpdate:something with:aParameter from:changedObject |
312 |
immediateUpdate value ifTrue:[ |
|
313 |
self delayedUpdate:something with:aParameter from:changedObject |
|
314 |
] ifFalse:[ |
|
315 |
super enqueueDelayedUpdate:something with:aParameter from:changedObject |
|
316 |
] |
|
317 |
||
318 |
"Created: / 17-01-2013 / 16:25:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
319 |
! |
|
320 |
||
321 |
listSelectionChanged |
|
322 |
| lsel | |
|
323 |
||
324 |
lsel := listSelectionHolder value ? #(). |
|
325 |
self selectionHolder |
|
326 |
removeDependent: self; |
|
327 |
value: (lsel collect:[:e | e model ]); |
|
328 |
addDependent: self. |
|
329 |
self enqueueDelayedUpdateOutputGenerator |
|
330 |
||
331 |
"Created: / 17-01-2013 / 14:26:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
332 |
"Modified: / 17-01-2013 / 16:23:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
333 |
! |
|
334 |
||
335 |
selectionChanged |
|
336 |
| sel lsel llist | |
|
337 |
||
338 |
listSelectionHolder isNil ifTrue:[ ^ self ]. |
|
339 |
||
340 |
listSelectionHolder removeDependent: self. |
|
341 |
sel := (self selectionHolder value) ? #(). |
|
342 |
llist := self listHolder value. |
|
343 |
lsel := llist select:[:leach | sel includesIdentical: leach model]. |
|
344 |
listSelectionHolder value: lsel. |
|
345 |
listSelectionHolder addDependent: self. |
|
346 |
||
347 |
super selectionChanged. |
|
348 |
||
349 |
"Created: / 17-01-2013 / 14:11:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
350 |
"Modified: / 17-01-2013 / 16:36:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
351 |
! |
|
352 |
||
10192 | 353 |
update: aspect with: param from: sender |
354 |
||
355 |
aspect == #resolution ifTrue:[^(self componentAt: #List) invalidateRepairNow: true]. |
|
13863 | 356 |
|
357 |
sender == listSelectionHolder ifTrue:[ |
|
358 |
self listSelectionChanged. |
|
359 |
^self |
|
360 |
]. |
|
10192 | 361 |
|
13863 | 362 |
sender == selectionHolder ifTrue:[ |
363 |
self selectionChanged. |
|
364 |
^self. |
|
365 |
]. |
|
366 |
sender == showVersionMethodDiffsHolder ifTrue:[ |
|
367 |
^self updateList. |
|
368 |
self. |
|
369 |
]. |
|
370 |
||
371 |
sender == showCopyrightMethodDiffsHolder ifTrue:[ |
|
372 |
^self updateList. |
|
373 |
self. |
|
374 |
]. |
|
375 |
||
376 |
sender == highlightConflictsHolder ifTrue:[ |
|
377 |
listView notNil ifTrue:[ |
|
378 |
listView scrolledView invalidate. |
|
379 |
]. |
|
380 |
^self. |
|
381 |
]. |
|
382 |
||
383 |
||
384 |
||
10192 | 385 |
super update: aspect with: param from: sender. |
386 |
||
13863 | 387 |
"Modified: / 17-01-2013 / 15:26:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10192 | 388 |
! ! |
389 |
||
390 |
!ChangeSetDiffList methodsFor:'generators'! |
|
391 |
||
392 |
makeGenerator |
|
393 |
||
394 |
^Iterator on: |
|
395 |
[:whatToDo| |
|
396 |
self selectionHolder value do: |
|
13863 | 397 |
[:each|each notNil ifTrue:[each do: whatToDo]]] |
398 |
||
399 |
"Modified: / 17-01-2013 / 17:12:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
400 |
! ! |
|
401 |
||
402 |
!ChangeSetDiffList methodsFor:'initialization'! |
|
403 |
||
404 |
initialize |
|
405 |
"Invoked when a new instance is created." |
|
10192 | 406 |
|
13863 | 407 |
"/ please change as required (and remove this comment) |
408 |
"/ listHolder := nil. |
|
409 |
"/ listSelectionHolder := nil. |
|
410 |
"/ listEntryLabelGenerator := nil. |
|
411 |
"/ listEntryIconGenerator := nil. |
|
412 |
"/ showVersionMethodDiffsHolder := nil. |
|
413 |
"/ showCopyrightMethodDiffsHolder := nil. |
|
414 |
"/ highlightConflictsHolder := nil. |
|
415 |
||
416 |
super initialize. |
|
417 |
immediateUpdate := true asValue. |
|
418 |
||
419 |
"Modified: / 17-01-2013 / 16:51:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10192 | 420 |
! ! |
421 |
||
422 |
!ChangeSetDiffList methodsFor:'private'! |
|
423 |
||
424 |
listEntryIconFor:aDiffComponent |
|
425 |
|a hasA b hasB hasBase| |
|
426 |
||
427 |
aDiffComponent isDiffSet ifTrue:[ |
|
428 |
^ nil |
|
429 |
]. |
|
430 |
hasA := (a := aDiffComponent versionA) notNil and:[a isMethodRemoveChange not]. |
|
431 |
hasB := (b := aDiffComponent versionB) notNil and:[b isMethodRemoveChange not]. |
|
432 |
hasBase := aDiffComponent versionBase notNil. |
|
433 |
(hasA & hasB & hasBase) ifTrue:[ |
|
10217 | 434 |
^ ToolbarIconLibrary versionABBase12x12 |
10192 | 435 |
]. |
436 |
(hasA & hasB) ifTrue:[ |
|
10217 | 437 |
^ ToolbarIconLibrary versionAB12x12 |
10192 | 438 |
]. |
439 |
(hasA & hasBase) ifTrue:[ |
|
10217 | 440 |
^ ToolbarIconLibrary versionABase12x12 |
10192 | 441 |
]. |
442 |
(hasA) ifTrue:[ |
|
10217 | 443 |
^ ToolbarIconLibrary versionA12x12 |
10192 | 444 |
]. |
445 |
(hasB & hasBase) ifTrue:[ |
|
10217 | 446 |
^ ToolbarIconLibrary versionBBase12x12 |
10192 | 447 |
]. |
448 |
(hasB) ifTrue:[ |
|
10217 | 449 |
^ ToolbarIconLibrary versionB12x12 |
10192 | 450 |
]. |
451 |
^ nil |
|
452 |
||
453 |
"Created: / 21-11-2009 / 21:58:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
454 |
"Modified: / 09-06-2011 / 08:19:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10217 | 455 |
"Modified: / 06-07-2011 / 16:38:33 / jv" |
10192 | 456 |
! |
457 |
||
458 |
listEntryLabelFor:diff |
|
459 |
||
460 |
^listEntryLabelGenerator |
|
461 |
ifNotNil: [listEntryLabelGenerator value: diff] |
|
462 |
ifNil:[diff name] |
|
463 |
||
464 |
"Modified: / 24-11-2009 / 10:00:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
465 |
! |
|
466 |
||
467 |
makeDependent |
|
468 |
||
469 |
"Nothing to do" |
|
470 |
! |
|
471 |
||
472 |
makeIndependent |
|
473 |
||
474 |
"Nothing to do" |
|
475 |
! |
|
476 |
||
13863 | 477 |
shouldDisplayDiff: aDiffCompoment |
478 |
"Return true if given diff component should be displayed" |
|
479 |
||
480 |
(showVersionMethodDiffsHolder value not and:[aDiffCompoment isForVersionMethod]) |
|
481 |
ifTrue:[ ^ false ]. |
|
482 |
||
483 |
(showCopyrightMethodDiffsHolder value not and:[aDiffCompoment isForCopyrightMethod]) |
|
484 |
ifTrue:[ ^ false ]. |
|
485 |
||
486 |
aDiffCompoment isDiffSet |
|
487 |
ifTrue:[ ^ aDiffCompoment diffs anySatisfy:[:diff|self shouldDisplayDiff: diff]]. |
|
488 |
||
489 |
^true |
|
490 |
||
491 |
"Created: / 03-08-2012 / 14:38:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
492 |
! |
|
493 |
||
10192 | 494 |
updateList |
495 |
"Superclass Tools::BrowserList says that I am responsible to implement this method" |
|
496 |
||
497 |
| newDiffs newList | |
|
498 |
self listHolder value ? #() do: [:entry|entry model removeDependent: self]. |
|
499 |
||
500 |
newDiffs := self inGeneratorHolder value ? #(). |
|
10246 | 501 |
(newDiffs isKindOf: ChangeSetDiffComponent) ifTrue: |
10192 | 502 |
[newDiffs := newDiffs diffs]. |
10926 | 503 |
newDiffs := self filterList: newDiffs. |
13264
4a0cdaf356ec
class: Tools::ChangeSetDiffList
Claus Gittinger <cg@exept.de>
parents:
10938
diff
changeset
|
504 |
newList := OrderedCollection new. |
13863 | 505 |
newDiffs do: [:item| |
506 |
(self shouldDisplayDiff: item) ifTrue:[ |
|
507 |
newList add:(ListEntry model: item application: self). |
|
508 |
item addDependent: self |
|
509 |
]. |
|
510 |
]. |
|
10251 | 511 |
|
512 |
newList sort:[:a :b|a label < b label]. |
|
10192 | 513 |
self listHolder value:newList |
514 |
||
10251 | 515 |
"Modified: / 07-07-2011 / 14:17:26 / jv" |
13264
4a0cdaf356ec
class: Tools::ChangeSetDiffList
Claus Gittinger <cg@exept.de>
parents:
10938
diff
changeset
|
516 |
"Modified: / 30-07-2013 / 19:30:18 / cg" |
13863 | 517 |
"Modified: / 11-11-2013 / 11:00:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10192 | 518 |
! ! |
519 |
||
520 |
!ChangeSetDiffList::ListEntry class methodsFor:'instance creation'! |
|
521 |
||
522 |
model: model application: application |
|
523 |
||
524 |
^self new |
|
525 |
model: model; |
|
526 |
application: application |
|
527 |
||
528 |
"Created: / 24-11-2009 / 18:29:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
529 |
! ! |
|
530 |
||
531 |
!ChangeSetDiffList::ListEntry methodsFor:'accessing'! |
|
532 |
||
533 |
application |
|
534 |
^ application |
|
535 |
! |
|
536 |
||
537 |
application:aDiffList |
|
538 |
application := aDiffList. |
|
539 |
! |
|
540 |
||
541 |
icon |
|
542 |
||
543 |
^application |
|
544 |
ifNotNil:[application listEntryIconFor: model] |
|
545 |
ifNil:[nil] |
|
546 |
||
547 |
"Created: / 24-11-2009 / 18:26:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
548 |
! |
|
549 |
||
550 |
label |
|
551 |
||
552 |
^application |
|
553 |
ifNotNil:[application listEntryLabelFor: model] |
|
554 |
ifNil:[model displayString] |
|
555 |
||
556 |
"Created: / 24-11-2009 / 18:26:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
557 |
"Modified: / 26-11-2009 / 17:33:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
558 |
! |
|
559 |
||
560 |
model |
|
561 |
^ model |
|
562 |
! |
|
563 |
||
564 |
model:aDiffComponent |
|
565 |
model := aDiffComponent. |
|
566 |
! ! |
|
567 |
||
568 |
!ChangeSetDiffList::ListEntry methodsFor:'displaying'! |
|
569 |
||
570 |
displayOn: aGC x: x y: y opaque: opaque |
|
571 |
||
13863 | 572 |
| label icon oldPaint | |
573 |
label := self label. |
|
574 |
"/ ((application topApplication askFor:#isMerge) and:[model isMerged not]) ifTrue:[ |
|
575 |
(application highlightConflictsHolder value and:[model "isConflict"isMerged not]) ifTrue:[ |
|
576 |
oldPaint := aGC paint. |
|
577 |
aGC paint: TextDiff3Tool colorConflict. |
|
578 |
'!!' displayOn: aGC x: x y:y opaque: opaque. |
|
579 |
aGC paint: oldPaint. |
|
18689 | 580 |
label := label allBold"/; colorizeAllWith: Color red darker. |
13863 | 581 |
]. |
582 |
(icon := self icon) notNil ifTrue:[icon displayOn: aGC x: x + 10 y: y - icon height opaque: opaque]. |
|
583 |
label displayOn: aGC x: x + 10 + 16 y:y opaque: opaque |
|
10192 | 584 |
|
585 |
"Created: / 24-11-2009 / 18:21:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13863 | 586 |
"Modified: / 15-01-2013 / 11:35:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
18689 | 587 |
"Modified: / 13-03-2019 / 22:06:45 / Claus Gittinger" |
10192 | 588 |
! ! |
589 |
||
590 |
!ChangeSetDiffList class methodsFor:'documentation'! |
|
591 |
||
592 |
version_CVS |
|
18689 | 593 |
^ '$Header$' |
10192 | 594 |
! |
595 |
||
596 |
version_SVN |
|
18689 | 597 |
^ '$Id$' |
10192 | 598 |
! ! |
13264
4a0cdaf356ec
class: Tools::ChangeSetDiffList
Claus Gittinger <cg@exept.de>
parents:
10938
diff
changeset
|
599 |