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