author | Claus Gittinger <cg@exept.de> |
Thu, 17 Jan 2013 11:40:20 +0100 | |
changeset 12108 | efa871deeab7 |
parent 11795 | 894f104886b8 |
child 12401 | 4714b9640528 |
child 12405 | 76f9a872362b |
child 12577 | 3ca47412263f |
permissions | -rw-r--r-- |
10009 | 1 |
" |
10064 | 2 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
3 |
All Rights Reserved |
|
10009 | 4 |
|
10064 | 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. |
|
10009 | 25 |
" |
26 |
"{ Package: 'stx:libtool' }" |
|
27 |
||
28 |
"{ NameSpace: Tools }" |
|
29 |
||
10925 | 30 |
BrowserListWithFilter subclass:#ChangeList |
11194 | 31 |
instanceVariableNames:'listHolder showRemovedHolder showSameHolder allowRemoveHolder |
11794 | 32 |
allowAcceptHolder applyAction' |
10009 | 33 |
classVariableNames:'LastSelectionConditionString' |
34 |
poolDictionaries:'' |
|
35 |
category:'Interface-Browsers-ChangeSet' |
|
36 |
! |
|
37 |
||
38 |
HierarchicalItem subclass:#ListEntry |
|
39 |
instanceVariableNames:'change application x' |
|
40 |
classVariableNames:'' |
|
41 |
poolDictionaries:'' |
|
42 |
privateIn:ChangeList |
|
43 |
! |
|
44 |
||
45 |
!ChangeList class methodsFor:'documentation'! |
|
46 |
||
47 |
copyright |
|
48 |
" |
|
10064 | 49 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
50 |
All Rights Reserved |
|
51 |
||
52 |
Permission is hereby granted, free of charge, to any person |
|
53 |
obtaining a copy of this software and associated documentation |
|
54 |
files (the 'Software'), to deal in the Software without |
|
55 |
restriction, including without limitation the rights to use, |
|
56 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
57 |
copies of the Software, and to permit persons to whom the |
|
58 |
Software is furnished to do so, subject to the following |
|
59 |
conditions: |
|
10009 | 60 |
|
10064 | 61 |
The above copyright notice and this permission notice shall be |
62 |
included in all copies or substantial portions of the Software. |
|
63 |
||
64 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
65 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
66 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
67 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
68 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
69 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
70 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
71 |
OTHER DEALINGS IN THE SOFTWARE. |
|
10009 | 72 |
" |
73 |
! ! |
|
74 |
||
75 |
!ChangeList class methodsFor:'image specs'! |
|
76 |
||
77 |
iconEqual |
|
10657 | 78 |
^ ToolbarIconLibrary iconEqual12x12 |
10009 | 79 |
|
10657 | 80 |
"Modified: / 31-08-2011 / 10:52:34 / cg" |
10009 | 81 |
! |
82 |
||
83 |
iconEqualGrayed |
|
10657 | 84 |
^ ToolbarIconLibrary iconEqualGray12x12 |
10009 | 85 |
|
10657 | 86 |
"Modified: / 31-08-2011 / 10:54:00 / cg" |
10009 | 87 |
! |
88 |
||
89 |
iconMinus |
|
11657 | 90 |
^ ToolbarIconLibrary iconMinusRed12x12 |
10009 | 91 |
|
11657 | 92 |
"Modified: / 24-07-2012 / 16:43:36 / cg" |
10009 | 93 |
! |
94 |
||
95 |
iconMinusGrayed |
|
10657 | 96 |
^ ToolbarIconLibrary iconMinusGray12x12 |
10009 | 97 |
|
10657 | 98 |
"Modified: / 31-08-2011 / 10:54:40 / cg" |
10009 | 99 |
! |
100 |
||
101 |
iconPlus |
|
11657 | 102 |
^ ToolbarIconLibrary iconPlusBlue12x12 |
10009 | 103 |
|
11657 | 104 |
"Modified: / 24-07-2012 / 16:43:31 / cg" |
10009 | 105 |
! |
106 |
||
107 |
iconPlusGrayed |
|
10657 | 108 |
^ ToolbarIconLibrary iconPlusGray12x12 |
10009 | 109 |
|
10657 | 110 |
"Modified: / 31-08-2011 / 10:54:46 / cg" |
10009 | 111 |
! ! |
112 |
||
113 |
!ChangeList class methodsFor:'interface specs'! |
|
114 |
||
115 |
windowSpec |
|
116 |
"This resource specification was automatically generated |
|
117 |
by the UIPainter of ST/X." |
|
118 |
||
119 |
"Do not manually edit this!! If it is corrupted, |
|
120 |
the UIPainter may not be able to read the specification." |
|
121 |
||
122 |
" |
|
123 |
UIPainter new openOnClass:Tools::ChangeList andSelector:#windowSpec |
|
124 |
Tools::ChangeList new openInterface:#windowSpec |
|
125 |
Tools::ChangeList open |
|
126 |
" |
|
127 |
||
128 |
<resource: #canvas> |
|
129 |
||
130 |
^ |
|
131 |
#(FullSpec |
|
132 |
name: windowSpec |
|
133 |
window: |
|
134 |
(WindowSpec |
|
135 |
label: 'Change List' |
|
136 |
name: 'Change List' |
|
137 |
min: (Point 10 10) |
|
138 |
bounds: (Rectangle 0 0 300 300) |
|
139 |
) |
|
140 |
component: |
|
141 |
(SpecCollection |
|
142 |
collection: ( |
|
143 |
(SelectionInListModelViewSpec |
|
10449 | 144 |
name: 'List' |
10009 | 145 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
146 |
model: selectionHolder |
|
10925 | 147 |
menu: menuHolderWithShowFilter |
10009 | 148 |
hasHorizontalScrollBar: true |
149 |
hasVerticalScrollBar: true |
|
150 |
listModel: listHolder |
|
151 |
multipleSelectOk: true |
|
152 |
useIndex: false |
|
153 |
highlightMode: line |
|
154 |
doubleClickSelector: selectionDoubleclicked |
|
10925 | 155 |
postBuildCallback: postBuildListView: |
156 |
) |
|
157 |
(InputFieldSpec |
|
158 |
name: 'Filter' |
|
159 |
layout: (LayoutFrame 0 0 0 0 0 1 26 0) |
|
160 |
initiallyInvisible: true |
|
161 |
model: filterPatternHolder |
|
162 |
immediateAccept: true |
|
163 |
acceptOnLeave: false |
|
164 |
acceptOnReturn: false |
|
165 |
acceptOnTab: false |
|
166 |
acceptOnPointerLeave: false |
|
167 |
emptyFieldReplacementText: 'Search Filter...' |
|
168 |
usePreferredHeight: true |
|
169 |
useDynamicPreferredHeight: true |
|
170 |
postBuildCallback: postBuildFilterView: |
|
10009 | 171 |
) |
172 |
) |
|
173 |
||
174 |
) |
|
175 |
) |
|
10925 | 176 |
|
177 |
"Modified: / 29-11-2011 / 15:52:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10009 | 178 |
! ! |
179 |
||
180 |
!ChangeList class methodsFor:'menu specs'! |
|
181 |
||
182 |
listMenu |
|
183 |
"This resource specification was automatically generated |
|
184 |
by the MenuEditor of ST/X." |
|
185 |
||
186 |
"Do not manually edit this!! If it is corrupted, |
|
187 |
the MenuEditor may not be able to read the specification." |
|
188 |
||
11194 | 189 |
|
10009 | 190 |
" |
191 |
MenuEditor new openOnClass:Tools::ChangeList andSelector:#listMenu |
|
192 |
(Menu new fromLiteralArrayEncoding:(Tools::ChangeList listMenu)) startUp |
|
193 |
" |
|
194 |
||
195 |
<resource: #menu> |
|
196 |
||
197 |
^ |
|
198 |
#(Menu |
|
199 |
( |
|
200 |
(MenuItem |
|
201 |
enabled: hasChangeSelectedAndNotRemoved |
|
202 |
label: 'Apply' |
|
203 |
itemValue: listMenuApply |
|
204 |
translateLabel: true |
|
11194 | 205 |
isVisible: allowAcceptHolder |
10009 | 206 |
shortcutKey: Accept |
207 |
) |
|
208 |
(MenuItem |
|
209 |
label: 'Apply all' |
|
210 |
itemValue: listMenuApplyAll |
|
211 |
translateLabel: true |
|
11194 | 212 |
isVisible: allowAcceptHolder |
10009 | 213 |
) |
214 |
(MenuItem |
|
215 |
enabled: hasSingleChangeSelectedAndCanBrowse |
|
216 |
label: 'Browse' |
|
217 |
itemValue: listMenuBrowse |
|
218 |
translateLabel: true |
|
219 |
) |
|
220 |
(MenuItem |
|
221 |
label: '-' |
|
222 |
) |
|
223 |
(MenuItem |
|
224 |
label: 'Delete' |
|
225 |
itemValue: listMenuDeleteSelection |
|
226 |
nameKey: Delete |
|
227 |
translateLabel: true |
|
11194 | 228 |
isVisible: allowRemoveHolder |
10009 | 229 |
shortcutKey: Delete |
230 |
) |
|
231 |
(MenuItem |
|
232 |
label: '-' |
|
11194 | 233 |
isVisible: allowRemoveHolder |
10009 | 234 |
) |
235 |
(MenuItem |
|
236 |
label: 'Select...' |
|
237 |
translateLabel: true |
|
238 |
submenu: |
|
239 |
(Menu |
|
240 |
( |
|
241 |
(MenuItem |
|
242 |
label: 'Select same' |
|
243 |
itemValue: listMenuSelectSame |
|
244 |
translateLabel: true |
|
245 |
) |
|
246 |
(MenuItem |
|
247 |
label: 'Select additions (new classes/methods)' |
|
248 |
itemValue: listMenuSelectAdditions |
|
249 |
translateLabel: true |
|
250 |
) |
|
251 |
(MenuItem |
|
252 |
label: 'Select removals' |
|
253 |
itemValue: listMenuSelectRemovals |
|
254 |
translateLabel: true |
|
255 |
) |
|
256 |
(MenuItem |
|
257 |
label: '-' |
|
258 |
) |
|
259 |
(MenuItem |
|
260 |
label: 'Select all' |
|
261 |
itemValue: listMenuSelectAll |
|
262 |
translateLabel: true |
|
263 |
) |
|
264 |
(MenuItem |
|
265 |
label: 'Select none' |
|
266 |
itemValue: listMenuSelectNone |
|
267 |
translateLabel: true |
|
268 |
) |
|
269 |
(MenuItem |
|
270 |
label: '-' |
|
271 |
) |
|
272 |
(MenuItem |
|
273 |
label: 'Select using block' |
|
274 |
itemValue: listMenuSelectUsingBlock |
|
275 |
translateLabel: true |
|
276 |
) |
|
277 |
) |
|
278 |
nil |
|
279 |
nil |
|
280 |
) |
|
281 |
) |
|
282 |
(MenuItem |
|
283 |
label: '-' |
|
284 |
) |
|
285 |
(MenuItem |
|
286 |
label: 'Show Deleted' |
|
287 |
translateLabel: true |
|
11194 | 288 |
isVisible: allowRemoveHolder |
10009 | 289 |
indication: showRemovedHolder |
290 |
) |
|
291 |
(MenuItem |
|
292 |
label: 'Inspect change' |
|
293 |
itemValue: listMenuInspect |
|
294 |
translateLabel: true |
|
295 |
) |
|
296 |
) |
|
297 |
nil |
|
298 |
nil |
|
299 |
) |
|
300 |
! ! |
|
301 |
||
302 |
!ChangeList class methodsFor:'plugIn spec'! |
|
303 |
||
304 |
aspectSelectors |
|
305 |
"This resource specification was automatically generated |
|
306 |
by the UIPainter of ST/X." |
|
307 |
||
308 |
"Do not manually edit this. If it is corrupted, |
|
309 |
the UIPainter may not be able to read the specification." |
|
310 |
||
311 |
"Return a description of exported aspects; |
|
312 |
these can be connected to aspects of an embedding application |
|
313 |
(if this app is embedded in a subCanvas)." |
|
314 |
||
315 |
^ #( |
|
11194 | 316 |
#allowAcceptHolder |
317 |
#allowRemoveHolder |
|
318 |
||
10009 | 319 |
#inGeneratorHolder |
320 |
#menuHolder |
|
321 |
#outGeneratorHolder |
|
322 |
#selectionHolder |
|
323 |
#showRemovedHolder |
|
10449 | 324 |
#showSameHolder |
10009 | 325 |
). |
326 |
||
11194 | 327 |
"Modified: / 24-01-2012 / 19:54:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 328 |
! ! |
329 |
||
330 |
!ChangeList methodsFor:'accessing'! |
|
331 |
||
11245
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
332 |
acceptEnabled |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
333 |
^ self allowAccept |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
334 |
|
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
335 |
"Created: / 08-02-2012 / 14:45:12 / cg" |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
336 |
! |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
337 |
|
11194 | 338 |
allowAccept |
339 |
^ self allowAcceptHolder value |
|
10009 | 340 |
|
11194 | 341 |
"Created: / 24-01-2012 / 19:52:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 342 |
! |
343 |
||
11194 | 344 |
allowAccept: aBoolean |
345 |
^ self allowAcceptHolder value: aBoolean |
|
10009 | 346 |
|
11194 | 347 |
"Created: / 24-01-2012 / 19:52:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
348 |
! |
|
349 |
||
350 |
allowRemoved |
|
351 |
^ self allowRemoveHolder value ? true |
|
352 |
||
353 |
"Created: / 05-12-2009 / 14:28:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10009 | 354 |
! |
355 |
||
11795 | 356 |
applyAction:aBlock |
357 |
applyAction := aBlock. |
|
358 |
||
359 |
"Modified (format): / 10-09-2012 / 14:15:30 / cg" |
|
11794 | 360 |
! |
361 |
||
11035 | 362 |
list |
363 |
^ listHolder value |
|
364 |
||
365 |
"Created: / 05-12-2009 / 14:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
366 |
"Created: / 27-12-2011 / 14:18:25 / cg" |
|
367 |
! |
|
368 |
||
10009 | 369 |
selection |
370 |
||
371 |
^self selectionHolder value |
|
372 |
||
373 |
"Created: / 05-12-2009 / 14:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
374 |
! |
|
375 |
||
11035 | 376 |
selectionIndices |
377 |
|sel| |
|
378 |
||
379 |
(sel := self selectionHolder value) isEmptyOrNil ifTrue:[^ #()]. |
|
380 |
^ sel collect:[:each | self list identityIndexOf:each]. |
|
381 |
||
382 |
"Created: / 05-12-2009 / 14:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
383 |
"Created: / 27-12-2011 / 10:56:20 / cg" |
|
384 |
! |
|
385 |
||
10009 | 386 |
showRemoved |
387 |
||
388 |
^self showRemovedHolder value ? true |
|
389 |
||
390 |
"Created: / 05-12-2009 / 14:28:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
391 |
! ! |
|
392 |
||
393 |
!ChangeList methodsFor:'actions'! |
|
394 |
||
395 |
selectionDoubleclicked |
|
396 |
||
11194 | 397 |
self listMenuBrowse |
398 |
"/ | app | |
|
399 |
"/ |
|
400 |
"/ self selection do: |
|
401 |
"/ [:e|e removed: e removed not]. |
|
402 |
"/ ((app := self masterApplication) respondsTo: #redrawChangeListViews) |
|
403 |
"/ ifTrue:[app redrawChangeListViews]. |
|
10009 | 404 |
|
11194 | 405 |
"Modified: / 24-01-2012 / 22:01:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 406 |
! ! |
407 |
||
408 |
!ChangeList methodsFor:'aspects'! |
|
409 |
||
11194 | 410 |
allowAcceptHolder |
10009 | 411 |
"return/create the valueHolder 'acceptEnabledHolder'" |
412 |
||
11194 | 413 |
allowAcceptHolder isNil ifTrue:[ |
414 |
allowAcceptHolder := ValueHolder with:nil "defaultValue here". |
|
10009 | 415 |
]. |
11194 | 416 |
^ allowAcceptHolder |
417 |
||
418 |
"Created: / 24-01-2012 / 19:53:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
419 |
! |
|
420 |
||
421 |
allowAcceptHolder:something |
|
422 |
"set the 'allowAcceptHolder' value holder (automatically generated)" |
|
423 |
||
424 |
allowAcceptHolder := something. |
|
10009 | 425 |
! |
426 |
||
11194 | 427 |
allowRemoveHolder |
428 |
"return/create the 'allowRemoveHolder' value holder (automatically generated)" |
|
429 |
||
430 |
allowRemoveHolder isNil ifTrue:[ |
|
431 |
allowRemoveHolder := ValueHolder with:true. |
|
432 |
allowRemoveHolder addDependent:self. |
|
433 |
]. |
|
434 |
^ allowRemoveHolder |
|
435 |
||
436 |
"Modified (comment): / 24-01-2012 / 19:44:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
437 |
! |
|
438 |
||
439 |
allowRemoveHolder:something |
|
440 |
"set the 'showRemovedHolder' value holder (automatically generated)" |
|
441 |
||
442 |
|oldValue newValue| |
|
443 |
||
444 |
allowRemoveHolder notNil ifTrue:[ |
|
445 |
oldValue := allowRemoveHolder value. |
|
446 |
allowRemoveHolder removeDependent:self. |
|
447 |
]. |
|
448 |
allowRemoveHolder := something. |
|
449 |
allowRemoveHolder notNil ifTrue:[ |
|
450 |
allowRemoveHolder addDependent:self. |
|
451 |
]. |
|
452 |
newValue := allowRemoveHolder value. |
|
453 |
oldValue ~~ newValue ifTrue:[ |
|
454 |
self |
|
455 |
update:#value |
|
456 |
with:newValue |
|
457 |
from:allowRemoveHolder. |
|
458 |
]. |
|
10009 | 459 |
! |
460 |
||
461 |
listHolder |
|
462 |
listHolder isNil ifTrue:[ |
|
463 |
listHolder := ValueHolder new. |
|
464 |
]. |
|
465 |
^ listHolder |
|
466 |
! |
|
467 |
||
468 |
showRemovedHolder |
|
469 |
"return/create the 'showRemovedHolder' value holder (automatically generated)" |
|
470 |
||
471 |
showRemovedHolder isNil ifTrue:[ |
|
472 |
showRemovedHolder := ValueHolder with: true. |
|
473 |
showRemovedHolder addDependent: self. |
|
474 |
]. |
|
475 |
^ showRemovedHolder |
|
476 |
! |
|
477 |
||
10449 | 478 |
showRemovedHolder:something |
10009 | 479 |
"set the 'showRemovedHolder' value holder (automatically generated)" |
480 |
||
10449 | 481 |
|oldValue newValue| |
482 |
||
483 |
showRemovedHolder notNil ifTrue:[ |
|
484 |
oldValue := showRemovedHolder value. |
|
485 |
showRemovedHolder removeDependent:self. |
|
486 |
]. |
|
487 |
showRemovedHolder := something. |
|
488 |
showRemovedHolder notNil ifTrue:[ |
|
489 |
showRemovedHolder addDependent:self. |
|
490 |
]. |
|
491 |
newValue := showRemovedHolder value. |
|
492 |
oldValue ~~ newValue ifTrue:[ |
|
493 |
self update:#value with:newValue from:showRemovedHolder. |
|
494 |
]. |
|
495 |
! |
|
496 |
||
497 |
showSameHolder |
|
498 |
"return/create the 'showSameHolder' value holder (automatically generated)" |
|
499 |
||
500 |
showSameHolder isNil ifTrue:[ |
|
501 |
showSameHolder := ValueHolder with: true. |
|
502 |
showSameHolder addDependent:self. |
|
503 |
]. |
|
504 |
^ showSameHolder |
|
505 |
||
506 |
"Modified: / 04-08-2011 / 18:39:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
507 |
! |
|
508 |
||
509 |
showSameHolder:something |
|
510 |
"set the 'showSameHolder' value holder (automatically generated)" |
|
511 |
||
512 |
|oldValue newValue| |
|
513 |
||
514 |
showSameHolder notNil ifTrue:[ |
|
515 |
oldValue := showSameHolder value. |
|
516 |
showSameHolder removeDependent:self. |
|
517 |
]. |
|
518 |
showSameHolder := something. |
|
519 |
showSameHolder notNil ifTrue:[ |
|
520 |
showSameHolder addDependent:self. |
|
521 |
]. |
|
522 |
newValue := showSameHolder value. |
|
523 |
oldValue ~~ newValue ifTrue:[ |
|
524 |
self update:#value with:newValue from:showSameHolder. |
|
525 |
]. |
|
10009 | 526 |
! ! |
527 |
||
528 |
!ChangeList methodsFor:'change & update'! |
|
529 |
||
530 |
update: aspect with: param from: sender |
|
531 |
||
10449 | 532 |
sender == selectionHolder ifTrue:[ |
533 |
self selectionChanged. |
|
534 |
^self |
|
535 |
]. |
|
536 |
sender == showSameHolder ifTrue:[ |
|
537 |
self updateList |
|
538 |
]. |
|
539 |
sender == showRemovedHolder ifTrue:[ |
|
540 |
self updateList |
|
541 |
]. |
|
542 |
||
10009 | 543 |
^super update: aspect with: param from: sender |
544 |
||
545 |
"Created: / 24-10-2009 / 19:47:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11036 | 546 |
"Modified (format): / 27-12-2011 / 14:20:30 / cg" |
10009 | 547 |
! ! |
548 |
||
549 |
!ChangeList methodsFor:'event processing'! |
|
550 |
||
551 |
buttonPress:button x:x y:y view:aView |
|
552 |
||
553 |
| itemIndex item | |
|
554 |
||
555 |
button ~= 1 ifTrue:[^aView buttonPress:button x:x y:y]. |
|
556 |
||
557 |
itemIndex := aView yVisibleToLineNr:y. |
|
10881
07359595b386
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
10657
diff
changeset
|
558 |
itemIndex isNil ifTrue:[^self]. |
10009 | 559 |
itemIndex == 0 ifTrue:[^self]. |
560 |
itemIndex > aView list size ifTrue:[^self]. |
|
561 |
item := aView list at: itemIndex. |
|
562 |
||
563 |
((aView left + x) between: (item x) and: (item x + 16)) |
|
564 |
ifFalse:[^aView buttonPress:button x:x y:y]. |
|
565 |
||
566 |
item removed: item removed not. |
|
567 |
aView invalidate |
|
568 |
||
569 |
"Created: / 08-12-2009 / 14:12:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10881
07359595b386
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
10657
diff
changeset
|
570 |
"Modified: / 18-11-2011 / 14:55:41 / cg" |
10009 | 571 |
! |
572 |
||
573 |
handlesButtonPress:button inView:aView |
|
574 |
||
10957 | 575 |
^listView scrolledView == aView |
10009 | 576 |
|
577 |
"Created: / 08-12-2009 / 14:08:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11245
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
578 |
! |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
579 |
|
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
580 |
handlesKeyPress:key inView:aView |
12108 | 581 |
<resource: #keyboard (#Accept #Ctrls)> |
582 |
||
11245
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
583 |
^(key == #Accept or:[ key == #Ctrls]) |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
584 |
and:[ listView scrolledView == aView ] |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
585 |
|
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
586 |
"Created: / 08-02-2012 / 14:43:11 / cg" |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
587 |
! |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
588 |
|
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
589 |
keyPress:key x:x y:y view:aView |
12108 | 590 |
<resource: #keyboard (#Ctrls #Accept)> |
591 |
||
11245
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
592 |
(key == #Accept or:[ key == #Ctrls]) ifTrue:[ |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
593 |
self listMenuApply. |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
594 |
^ self |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
595 |
]. |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
596 |
|
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
597 |
"Created: / 08-02-2012 / 14:42:18 / cg" |
10009 | 598 |
! ! |
599 |
||
600 |
!ChangeList methodsFor:'generators'! |
|
601 |
||
602 |
makeGenerator |
|
603 |
"Superclass Tools::BrowserList says that I am responsible to implement this method" |
|
604 |
||
605 |
^Iterator on: |
|
606 |
[:whatToDo| |
|
607 |
selectionHolder value do: |
|
608 |
[:changeListItem| | change | |
|
609 |
change := changeListItem change. |
|
610 |
change isCompositeChange ifTrue: |
|
611 |
[change changes do: whatToDo]]]. |
|
612 |
||
613 |
"Modified: / 24-07-2009 / 23:00:41 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
614 |
"Modified: / 24-10-2009 / 20:00:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
615 |
! ! |
|
616 |
||
617 |
!ChangeList methodsFor:'hooks'! |
|
618 |
||
10925 | 619 |
postBuildListView: aView |
10009 | 620 |
|
10925 | 621 |
super postBuildListView: aView. |
10957 | 622 |
listView scrolledView delegate: self. |
10009 | 623 |
|
10925 | 624 |
"Created: / 29-11-2011 / 14:56:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 625 |
! ! |
626 |
||
627 |
!ChangeList methodsFor:'initialization'! |
|
628 |
||
629 |
initialize |
|
11794 | 630 |
super initialize. |
10009 | 631 |
|
632 |
menuHolder := [self menuFor: #listMenu]. |
|
11794 | 633 |
applyAction isNil ifTrue:[ |
634 |
applyAction := [:change | change apply ]. |
|
635 |
]. |
|
10009 | 636 |
|
637 |
"Created: / 29-10-2010 / 12:50:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11794 | 638 |
"Modified: / 10-09-2012 / 13:57:20 / cg" |
10009 | 639 |
! ! |
640 |
||
641 |
!ChangeList methodsFor:'menu actions'! |
|
642 |
||
643 |
listMenuApply |
|
11245
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
644 |
|sel list idx| |
10009 | 645 |
|
646 |
self acceptEnabled ifFalse:[^self]. |
|
647 |
||
11794 | 648 |
(sel := self selectionHolder value) do:[:e| applyAction value:e change]. |
11245
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
649 |
sel size == 1 ifTrue:[ |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
650 |
list := self listHolder value. |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
651 |
idx := list indexOf:(sel first). |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
652 |
idx < list size ifTrue:[ |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
653 |
self selectionHolder value:(Array with:(list at:idx+1)) |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
654 |
] ifFalse:[ |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
655 |
self selectionHolder value:#() |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
656 |
]. |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
657 |
]. |
10009 | 658 |
|
659 |
"Modified: / 24-10-2009 / 22:02:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11794 | 660 |
"Modified: / 10-09-2012 / 13:57:46 / cg" |
10009 | 661 |
! |
662 |
||
663 |
listMenuApplyAll |
|
664 |
||
665 |
self acceptEnabled ifFalse:[^self]. |
|
666 |
||
667 |
self selection value do: |
|
11794 | 668 |
[:e|e removed ifFalse:[applyAction value:e change]]. |
10009 | 669 |
|
670 |
"Created: / 05-12-2009 / 14:53:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11794 | 671 |
"Modified: / 10-09-2012 / 13:57:58 / cg" |
10009 | 672 |
! |
673 |
||
674 |
listMenuBrowse |
|
675 |
||
11194 | 676 |
self listMenuBrowseChanges: |
677 |
((self selectionHolder value ? #()) collect:[:e|e change]) |
|
678 |
||
679 |
"Modified: / 24-01-2012 / 22:00:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
680 |
! |
|
681 |
||
682 |
listMenuBrowseChanges: changes |
|
683 |
||
10009 | 684 |
| classes methods methodsOnly | |
685 |
classes := Set new. |
|
686 |
methods := Set new. |
|
687 |
methodsOnly := true. |
|
11194 | 688 |
changes do: |
10009 | 689 |
[:each| |
11194 | 690 |
each isClassChange ifTrue: |
691 |
[each changeClass ifNotNil: |
|
692 |
[classes add: each changeClass. |
|
693 |
each isMethodCodeChange |
|
10009 | 694 |
ifTrue: |
11194 | 695 |
[each changeMethod ifNotNil: |
696 |
[methods add:each changeMethod]] |
|
10009 | 697 |
ifFalse: |
698 |
[methodsOnly := false]]]]. |
|
699 |
methodsOnly |
|
700 |
ifTrue: |
|
701 |
[methods size = 1 |
|
702 |
ifTrue:[Smalltalk browserClass openInMethod: methods anyOne] |
|
703 |
ifFalse:[Smalltalk browserClass browseMethods: methods asArray title: 'Selected methods from changeset' sort: true]] |
|
704 |
ifFalse: |
|
705 |
[classes size = 1 |
|
706 |
ifTrue:[Smalltalk browserClass browseClass: classes anyOne] |
|
707 |
ifFalse:[Smalltalk browserClass browseClasses: classes]] |
|
708 |
||
709 |
"Modified: / 24-10-2009 / 22:02:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11194 | 710 |
"Created: / 24-01-2012 / 22:00:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 711 |
! |
712 |
||
713 |
listMenuDeleteSelection |
|
714 |
||
715 |
self selectionHolder value do: |
|
716 |
[:each|each removed: true]. |
|
717 |
self updateList |
|
718 |
! |
|
719 |
||
720 |
listMenuInspect |
|
721 |
||
722 |
| selection | |
|
723 |
||
724 |
selection := self selectionHolder value collect:[:e|e change]. |
|
725 |
selection size = 1 |
|
726 |
ifTrue:[selection anyOne inspect] |
|
727 |
ifFalse:[selection inspect]. |
|
728 |
||
729 |
"Modified: / 24-10-2009 / 22:02:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
730 |
! |
|
731 |
||
732 |
listMenuSelectAdditions |
|
733 |
||
734 |
self listMenuSelectAllSuchThat:[:change|change delta = #+] |
|
735 |
! |
|
736 |
||
737 |
listMenuSelectAll |
|
738 |
||
739 |
self listMenuSelectAllSuchThat:[:change|true] |
|
740 |
! |
|
741 |
||
742 |
listMenuSelectAllSuchThat:conditionBlock |
|
743 |
|newSelection| |
|
744 |
||
745 |
newSelection := self listHolder value |
|
746 |
select:[:entry | conditionBlock value:entry change ]. |
|
747 |
self selectionHolder value:newSelection |
|
748 |
! |
|
749 |
||
750 |
listMenuSelectNone |
|
751 |
||
752 |
self listMenuSelectAllSuchThat:[:change|false] |
|
753 |
! |
|
754 |
||
755 |
listMenuSelectRemovals |
|
756 |
||
757 |
self listMenuSelectAllSuchThat:[:change|change delta = #-] |
|
758 |
! |
|
759 |
||
760 |
listMenuSelectSame |
|
761 |
||
762 |
self listMenuSelectAllSuchThat:[:change|change delta = #=] |
|
763 |
! |
|
764 |
||
765 |
listMenuSelectUsingBlock |
|
766 |
||
767 |
|conditionBlockString conditionBlock dialog textHolder template| |
|
768 |
||
769 |
template := |
|
770 |
'[:change| |
|
771 |
"/ Define condition for selection below: |
|
772 |
"/ change is an instance of Change |
|
773 |
"/ change will be selected if and only if block returns true |
|
774 |
||
775 |
||
776 |
true"/always select the change |
|
777 |
] |
|
778 |
'. |
|
779 |
||
780 |
LastSelectionConditionString isNil ifTrue:[ |
|
781 |
LastSelectionConditionString := template. |
|
782 |
]. |
|
783 |
||
784 |
||
785 |
textHolder := ValueHolder new. |
|
786 |
dialog := Dialog |
|
787 |
forRequestText:(resources string:'Enter condition for selection') |
|
788 |
lines:20 |
|
789 |
columns:70 |
|
790 |
initialAnswer:LastSelectionConditionString |
|
791 |
model:textHolder. |
|
792 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
793 |
dialog open. |
|
794 |
dialog accepted ifFalse:[^ self]. |
|
795 |
||
796 |
conditionBlockString := textHolder value. |
|
797 |
LastSelectionConditionString := conditionBlockString. |
|
798 |
||
799 |
conditionBlock := Parser evaluate:conditionBlockString. |
|
800 |
conditionBlock isBlock ifFalse:[ |
|
801 |
self error:'Bad selection block (syntax error?)'. |
|
802 |
^ self |
|
803 |
]. |
|
804 |
||
805 |
self listMenuSelectAllSuchThat: conditionBlock |
|
806 |
! |
|
807 |
||
808 |
listMenuUndeleteSelection |
|
809 |
||
810 |
self selectionHolder value do: |
|
811 |
[:each|each removed: false]. |
|
812 |
self updateList |
|
813 |
! ! |
|
814 |
||
815 |
!ChangeList methodsFor:'private'! |
|
816 |
||
817 |
application |
|
818 |
||
819 |
^self |
|
820 |
||
821 |
"Created: / 05-12-2009 / 14:10:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
822 |
! |
|
823 |
||
824 |
browserNameList |
|
825 |
||
826 |
^'Change list' |
|
827 |
||
828 |
"Modified: / 24-07-2009 / 22:06:53 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
829 |
! |
|
830 |
||
831 |
listEntryFor:chg |
|
832 |
^ListEntry change:chg application: self |
|
833 |
||
834 |
"Modified: / 05-12-2009 / 14:39:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
835 |
! |
|
836 |
||
837 |
makeDependent |
|
838 |
||
839 |
"Modified: / 24-07-2009 / 22:06:32 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
840 |
! |
|
841 |
||
842 |
makeIndependent |
|
843 |
||
844 |
"Modified: / 24-07-2009 / 22:06:37 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
845 |
! |
|
846 |
||
847 |
parentOrModel |
|
848 |
||
849 |
^self |
|
850 |
||
851 |
"Created: / 05-12-2009 / 14:14:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
852 |
! |
|
853 |
||
854 |
updateList |
|
10925 | 855 |
|inGenerator changeset newList | |
10009 | 856 |
|
857 |
inGenerator := self inGeneratorHolder value. |
|
858 |
changeset := inGenerator ifNil:[ #() ] ifNotNil:[ inGenerator ]. |
|
10925 | 859 |
newList := changeset |
10449 | 860 |
select: |
861 |
[:chg | |
|
862 |
(self showRemovedHolder value or:[ chg removed not ]) |
|
10451 | 863 |
and:[self showSameHolder value or:[chg delta ~~ #=]] |
10925 | 864 |
]. |
865 |
newList := self filterList: newList. |
|
866 |
newList := newList collect:[:chg | self listEntryFor:chg ]. |
|
11039 | 867 |
self listHolder value ~= newList ifTrue:[ |
868 |
self listHolder value: newList. |
|
869 |
] |
|
10449 | 870 |
|
10925 | 871 |
"Modified: / 29-11-2011 / 15:38:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11039 | 872 |
"Modified: / 28-12-2011 / 15:46:15 / cg" |
10009 | 873 |
! ! |
874 |
||
875 |
!ChangeList methodsFor:'queries'! |
|
876 |
||
877 |
hasChangeSelected |
|
878 |
||
879 |
^self selectionHolder value size > 0 |
|
880 |
! |
|
881 |
||
882 |
hasChangeSelectedAndNotRemoved |
|
883 |
||
884 |
| selection | |
|
885 |
selection := self selectionHolder value ? #(). |
|
886 |
^selection size > 0 and: |
|
887 |
[selection allSatisfy:[:e|e removed not]]. |
|
888 |
! |
|
889 |
||
890 |
hasSingleChangeSelected |
|
891 |
||
892 |
^self selectionHolder value size = 1 |
|
893 |
! |
|
894 |
||
895 |
hasSingleChangeSelectedAndCanBrowse |
|
896 |
||
897 |
||
898 |
self selectionHolder value ? #() do: |
|
899 |
[:each| |
|
900 |
(each change isClassChange and: |
|
901 |
[each change isMethodChange not |
|
902 |
or:[each change isMethodCodeChange]]) ifFalse:[^false]]. |
|
903 |
^true |
|
904 |
! ! |
|
905 |
||
906 |
!ChangeList::ListEntry class methodsFor:'instance creation'! |
|
907 |
||
908 |
change: aChange |
|
909 |
||
910 |
^self new change: aChange |
|
911 |
||
912 |
"Created: / 24-07-2009 / 22:43:41 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
913 |
! |
|
914 |
||
915 |
change: aChange application: anApplicationModel |
|
916 |
||
917 |
^self new change: aChange; application: anApplicationModel |
|
918 |
||
919 |
"Created: / 05-12-2009 / 14:16:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
920 |
! |
|
921 |
||
922 |
change: aChange parent: aChangeList |
|
923 |
||
924 |
^self new change: aChange; parent: aChangeList |
|
925 |
||
926 |
"Created: / 25-07-2009 / 23:33:00 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
927 |
! ! |
|
928 |
||
929 |
!ChangeList::ListEntry methodsFor:'accessing'! |
|
930 |
||
931 |
application |
|
932 |
^ application ifNil:[super application] |
|
933 |
||
934 |
"Modified: / 05-12-2009 / 14:16:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
935 |
! |
|
936 |
||
937 |
application:anApplicationModel |
|
938 |
application := anApplicationModel. |
|
939 |
||
940 |
"Modified: / 05-12-2009 / 14:15:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
941 |
! |
|
942 |
||
943 |
change |
|
944 |
^ change |
|
945 |
! |
|
946 |
||
947 |
change:aChange |
|
948 |
self assert: ((aChange isKindOf: Change) or:[aChange isKindOf: RefactoryChange]). |
|
949 |
change := aChange. |
|
950 |
||
951 |
"Modified: / 25-07-2009 / 23:40:38 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
10957 | 952 |
"Modified (format): / 04-12-2011 / 14:58:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 953 |
! |
954 |
||
955 |
changeClass |
|
956 |
||
957 |
^change changeClass |
|
958 |
! |
|
959 |
||
10334 | 960 |
changeSource |
11662 | 961 |
"the changes source" |
10334 | 962 |
|
963 |
^change changeSource |
|
964 |
||
965 |
"Created: / 19-07-2011 / 12:03:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11662 | 966 |
"Modified (comment): / 25-07-2012 / 17:39:39 / cg" |
10334 | 967 |
! |
968 |
||
10009 | 969 |
children |
970 |
||
10881
07359595b386
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
10657
diff
changeset
|
971 |
children isNil ifTrue:[ |
10957 | 972 |
change isCompositeChange ifTrue:[ |
973 |
children := OrderedCollection new: change changes size. |
|
974 |
change changes do:[:chg| |
|
975 |
((self application showRemovedHolder value or:[ chg removed not ]) |
|
976 |
and:[self application showSameHolder value or:[chg delta ~~ #=]]) |
|
977 |
ifTrue:[ |
|
978 |
children add: ((self application listEntryFor: chg) parent: self) |
|
979 |
] |
|
980 |
]. |
|
981 |
] ifFalse:[ |
|
982 |
children := #() |
|
983 |
] |
|
10881
07359595b386
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
10657
diff
changeset
|
984 |
]. |
10009 | 985 |
^children |
986 |
||
987 |
"Created: / 25-07-2009 / 23:32:39 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
10881
07359595b386
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
10657
diff
changeset
|
988 |
"Modified (format): / 18-11-2011 / 14:56:25 / cg" |
10957 | 989 |
"Modified: / 04-12-2011 / 15:08:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 990 |
! |
991 |
||
992 |
delta |
|
10657 | 993 |
"/ obsolete: please use deltaDetail |
10009 | 994 |
|
995 |
^change delta |
|
996 |
||
997 |
"Created: / 29-10-2010 / 14:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10657 | 998 |
"Modified (comment): / 31-08-2011 / 10:30:02 / cg" |
999 |
! |
|
1000 |
||
1001 |
deltaDetail |
|
1002 |
||
1003 |
^change deltaDetail |
|
1004 |
||
1005 |
"Created: / 29-10-2010 / 14:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1006 |
"Created: / 31-08-2011 / 10:29:21 / cg" |
|
10009 | 1007 |
! |
1008 |
||
1009 |
iconDelta |
|
1010 |
||
1011 |
| iconSelector | |
|
1012 |
iconSelector := self iconSelector. |
|
10881
07359595b386
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
10657
diff
changeset
|
1013 |
iconSelector isNil ifTrue:[^nil]. |
10009 | 1014 |
self removed ifTrue:[iconSelector := iconSelector , #Grayed]. |
1015 |
^self application class perform: iconSelector asSymbol. |
|
1016 |
||
1017 |
"Created: / 05-12-2009 / 14:11:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10881
07359595b386
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
10657
diff
changeset
|
1018 |
"Modified: / 18-11-2011 / 14:56:33 / cg" |
10009 | 1019 |
! |
1020 |
||
1021 |
iconRemoved |
|
1022 |
||
1023 |
^self removed |
|
1024 |
ifTrue: [self application class uncheckedIcon ] |
|
1025 |
ifFalse:[self application class checkedIcon ] |
|
1026 |
||
1027 |
"Created: / 05-12-2009 / 14:11:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1028 |
! |
|
1029 |
||
10334 | 1030 |
imageSource |
11662 | 1031 |
"return the source for the in-image version of the change" |
10334 | 1032 |
|
11662 | 1033 |
^ change imageSource |
10334 | 1034 |
|
1035 |
"Created: / 19-07-2011 / 12:03:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11662 | 1036 |
"Modified (comment): / 25-07-2012 / 17:38:57 / cg" |
10334 | 1037 |
! |
1038 |
||
10009 | 1039 |
label |
11710 | 1040 |
| label | |
10009 | 1041 |
|
1042 |
label := change displayString. |
|
1043 |
self removed ifTrue:[label := label asText colorizeAllWith: Color gray]. |
|
1044 |
^label |
|
1045 |
||
1046 |
"Created: / 05-11-2008 / 08:20:02 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1047 |
"Modified: / 25-07-2009 / 23:43:23 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1048 |
"Modified: / 05-12-2009 / 14:46:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11710 | 1049 |
"Modified (format): / 27-07-2012 / 21:26:34 / cg" |
10009 | 1050 |
! |
1051 |
||
1052 |
removed |
|
1053 |
^ change removed |
|
1054 |
! |
|
1055 |
||
1056 |
removed:aBoolean |
|
1057 |
change removed: aBoolean. |
|
1058 |
! |
|
1059 |
||
1060 |
source |
|
1061 |
||
1062 |
^change source |
|
1063 |
! |
|
1064 |
||
1065 |
x |
|
1066 |
^ x |
|
1067 |
! ! |
|
1068 |
||
1069 |
!ChangeList::ListEntry methodsFor:'displaying'! |
|
1070 |
||
1071 |
displayLabel:aLabel h:lH on:aGC x:newX y:y h:h |
|
11710 | 1072 |
| cx icon | |
10009 | 1073 |
|
1074 |
cx := x := newX. |
|
11710 | 1075 |
self application allowRemoveHolder value ifTrue:[ |
1076 |
(icon := self iconRemoved) notNil ifTrue:[ |
|
1077 |
icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2) |
|
1078 |
]. |
|
1079 |
cx := cx + 22."experimental value - this looks good" |
|
1080 |
]. |
|
1081 |
(icon := self iconDelta) notNil ifTrue:[ |
|
1082 |
icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2) |
|
1083 |
]. |
|
10009 | 1084 |
cx := cx + 16."12 + 2px gap" |
1085 |
||
1086 |
super displayLabel:aLabel h:lH on:aGC x:cx y:y h:h |
|
1087 |
||
11194 | 1088 |
"Modified: / 24-01-2012 / 21:44:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11710 | 1089 |
"Modified: / 27-07-2012 / 21:26:23 / cg" |
10009 | 1090 |
! ! |
1091 |
||
1092 |
!ChangeList::ListEntry methodsFor:'private'! |
|
1093 |
||
1094 |
iconSelector |
|
10657 | 1095 |
| delta | |
10009 | 1096 |
|
10657 | 1097 |
delta := change deltaDetail. |
1098 |
delta shortDeltaSymbol = #+ ifTrue:[^#iconPlus]. |
|
1099 |
delta shortDeltaSymbol = #- ifTrue:[^#iconMinus]. |
|
1100 |
delta shortDeltaSymbol = #= ifTrue:[^#iconEqual]. |
|
10009 | 1101 |
|
10657 | 1102 |
^ nil. |
1103 |
||
1104 |
"Modified: / 31-08-2011 / 10:39:32 / cg" |
|
10009 | 1105 |
! ! |
1106 |
||
10957 | 1107 |
!ChangeList::ListEntry methodsFor:'protocol-queries'! |
1108 |
||
1109 |
hasChildren |
|
1110 |
^ change isCompositeChange and:[change changes notEmptyOrNil ]. |
|
1111 |
||
1112 |
"Created: / 04-12-2011 / 14:45:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11710 | 1113 |
"Modified (format): / 27-07-2012 / 21:25:34 / cg" |
10957 | 1114 |
! ! |
1115 |
||
10009 | 1116 |
!ChangeList class methodsFor:'documentation'! |
1117 |
||
10451 | 1118 |
version |
12108 | 1119 |
^ '$Header: /cvs/stx/stx/libtool/Tools__ChangeList.st,v 1.20 2013-01-17 10:40:20 cg Exp $' |
10451 | 1120 |
! |
1121 |
||
10009 | 1122 |
version_CVS |
12108 | 1123 |
^ '$Header: /cvs/stx/stx/libtool/Tools__ChangeList.st,v 1.20 2013-01-17 10:40:20 cg Exp $' |
10009 | 1124 |
! |
1125 |
||
1126 |
version_SVN |
|
1127 |
^ '§Id: Tools__ChangeList.st 7486 2009-10-26 22:06:24Z vranyj1 §' |
|
1128 |
! ! |
|
12108 | 1129 |