author | Claus Gittinger <cg@exept.de> |
Mon, 10 Sep 2012 14:01:52 +0200 | |
changeset 11794 | 3d2efe798a56 |
parent 11710 | f2c0566732e7 |
child 11795 | 894f104886b8 |
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 |
||
11794 | 356 |
applyAction:something |
357 |
applyAction := something. |
|
358 |
! |
|
359 |
||
11035 | 360 |
list |
361 |
^ listHolder value |
|
362 |
||
363 |
"Created: / 05-12-2009 / 14:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
364 |
"Created: / 27-12-2011 / 14:18:25 / cg" |
|
365 |
! |
|
366 |
||
10009 | 367 |
selection |
368 |
||
369 |
^self selectionHolder value |
|
370 |
||
371 |
"Created: / 05-12-2009 / 14:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
372 |
! |
|
373 |
||
11035 | 374 |
selectionIndices |
375 |
|sel| |
|
376 |
||
377 |
(sel := self selectionHolder value) isEmptyOrNil ifTrue:[^ #()]. |
|
378 |
^ sel collect:[:each | self list identityIndexOf:each]. |
|
379 |
||
380 |
"Created: / 05-12-2009 / 14:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
381 |
"Created: / 27-12-2011 / 10:56:20 / cg" |
|
382 |
! |
|
383 |
||
10009 | 384 |
showRemoved |
385 |
||
386 |
^self showRemovedHolder value ? true |
|
387 |
||
388 |
"Created: / 05-12-2009 / 14:28:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
389 |
! ! |
|
390 |
||
391 |
!ChangeList methodsFor:'actions'! |
|
392 |
||
393 |
selectionDoubleclicked |
|
394 |
||
11194 | 395 |
self listMenuBrowse |
396 |
"/ | app | |
|
397 |
"/ |
|
398 |
"/ self selection do: |
|
399 |
"/ [:e|e removed: e removed not]. |
|
400 |
"/ ((app := self masterApplication) respondsTo: #redrawChangeListViews) |
|
401 |
"/ ifTrue:[app redrawChangeListViews]. |
|
10009 | 402 |
|
11194 | 403 |
"Modified: / 24-01-2012 / 22:01:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 404 |
! ! |
405 |
||
406 |
!ChangeList methodsFor:'aspects'! |
|
407 |
||
11194 | 408 |
allowAcceptHolder |
10009 | 409 |
"return/create the valueHolder 'acceptEnabledHolder'" |
410 |
||
11194 | 411 |
allowAcceptHolder isNil ifTrue:[ |
412 |
allowAcceptHolder := ValueHolder with:nil "defaultValue here". |
|
10009 | 413 |
]. |
11194 | 414 |
^ allowAcceptHolder |
415 |
||
416 |
"Created: / 24-01-2012 / 19:53:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
417 |
! |
|
418 |
||
419 |
allowAcceptHolder:something |
|
420 |
"set the 'allowAcceptHolder' value holder (automatically generated)" |
|
421 |
||
422 |
allowAcceptHolder := something. |
|
10009 | 423 |
! |
424 |
||
11194 | 425 |
allowRemoveHolder |
426 |
"return/create the 'allowRemoveHolder' value holder (automatically generated)" |
|
427 |
||
428 |
allowRemoveHolder isNil ifTrue:[ |
|
429 |
allowRemoveHolder := ValueHolder with:true. |
|
430 |
allowRemoveHolder addDependent:self. |
|
431 |
]. |
|
432 |
^ allowRemoveHolder |
|
433 |
||
434 |
"Modified (comment): / 24-01-2012 / 19:44:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
435 |
! |
|
436 |
||
437 |
allowRemoveHolder:something |
|
438 |
"set the 'showRemovedHolder' value holder (automatically generated)" |
|
439 |
||
440 |
|oldValue newValue| |
|
441 |
||
442 |
allowRemoveHolder notNil ifTrue:[ |
|
443 |
oldValue := allowRemoveHolder value. |
|
444 |
allowRemoveHolder removeDependent:self. |
|
445 |
]. |
|
446 |
allowRemoveHolder := something. |
|
447 |
allowRemoveHolder notNil ifTrue:[ |
|
448 |
allowRemoveHolder addDependent:self. |
|
449 |
]. |
|
450 |
newValue := allowRemoveHolder value. |
|
451 |
oldValue ~~ newValue ifTrue:[ |
|
452 |
self |
|
453 |
update:#value |
|
454 |
with:newValue |
|
455 |
from:allowRemoveHolder. |
|
456 |
]. |
|
10009 | 457 |
! |
458 |
||
459 |
listHolder |
|
460 |
listHolder isNil ifTrue:[ |
|
461 |
listHolder := ValueHolder new. |
|
462 |
]. |
|
463 |
^ listHolder |
|
464 |
! |
|
465 |
||
466 |
showRemovedHolder |
|
467 |
"return/create the 'showRemovedHolder' value holder (automatically generated)" |
|
468 |
||
469 |
showRemovedHolder isNil ifTrue:[ |
|
470 |
showRemovedHolder := ValueHolder with: true. |
|
471 |
showRemovedHolder addDependent: self. |
|
472 |
]. |
|
473 |
^ showRemovedHolder |
|
474 |
! |
|
475 |
||
10449 | 476 |
showRemovedHolder:something |
10009 | 477 |
"set the 'showRemovedHolder' value holder (automatically generated)" |
478 |
||
10449 | 479 |
|oldValue newValue| |
480 |
||
481 |
showRemovedHolder notNil ifTrue:[ |
|
482 |
oldValue := showRemovedHolder value. |
|
483 |
showRemovedHolder removeDependent:self. |
|
484 |
]. |
|
485 |
showRemovedHolder := something. |
|
486 |
showRemovedHolder notNil ifTrue:[ |
|
487 |
showRemovedHolder addDependent:self. |
|
488 |
]. |
|
489 |
newValue := showRemovedHolder value. |
|
490 |
oldValue ~~ newValue ifTrue:[ |
|
491 |
self update:#value with:newValue from:showRemovedHolder. |
|
492 |
]. |
|
493 |
! |
|
494 |
||
495 |
showSameHolder |
|
496 |
"return/create the 'showSameHolder' value holder (automatically generated)" |
|
497 |
||
498 |
showSameHolder isNil ifTrue:[ |
|
499 |
showSameHolder := ValueHolder with: true. |
|
500 |
showSameHolder addDependent:self. |
|
501 |
]. |
|
502 |
^ showSameHolder |
|
503 |
||
504 |
"Modified: / 04-08-2011 / 18:39:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
505 |
! |
|
506 |
||
507 |
showSameHolder:something |
|
508 |
"set the 'showSameHolder' value holder (automatically generated)" |
|
509 |
||
510 |
|oldValue newValue| |
|
511 |
||
512 |
showSameHolder notNil ifTrue:[ |
|
513 |
oldValue := showSameHolder value. |
|
514 |
showSameHolder removeDependent:self. |
|
515 |
]. |
|
516 |
showSameHolder := something. |
|
517 |
showSameHolder notNil ifTrue:[ |
|
518 |
showSameHolder addDependent:self. |
|
519 |
]. |
|
520 |
newValue := showSameHolder value. |
|
521 |
oldValue ~~ newValue ifTrue:[ |
|
522 |
self update:#value with:newValue from:showSameHolder. |
|
523 |
]. |
|
10009 | 524 |
! ! |
525 |
||
526 |
!ChangeList methodsFor:'change & update'! |
|
527 |
||
528 |
update: aspect with: param from: sender |
|
529 |
||
10449 | 530 |
sender == selectionHolder ifTrue:[ |
531 |
self selectionChanged. |
|
532 |
^self |
|
533 |
]. |
|
534 |
sender == showSameHolder ifTrue:[ |
|
535 |
self updateList |
|
536 |
]. |
|
537 |
sender == showRemovedHolder ifTrue:[ |
|
538 |
self updateList |
|
539 |
]. |
|
540 |
||
10009 | 541 |
^super update: aspect with: param from: sender |
542 |
||
543 |
"Created: / 24-10-2009 / 19:47:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11036 | 544 |
"Modified (format): / 27-12-2011 / 14:20:30 / cg" |
10009 | 545 |
! ! |
546 |
||
547 |
!ChangeList methodsFor:'event processing'! |
|
548 |
||
549 |
buttonPress:button x:x y:y view:aView |
|
550 |
||
551 |
| itemIndex item | |
|
552 |
||
553 |
button ~= 1 ifTrue:[^aView buttonPress:button x:x y:y]. |
|
554 |
||
555 |
itemIndex := aView yVisibleToLineNr:y. |
|
10881
07359595b386
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
10657
diff
changeset
|
556 |
itemIndex isNil ifTrue:[^self]. |
10009 | 557 |
itemIndex == 0 ifTrue:[^self]. |
558 |
itemIndex > aView list size ifTrue:[^self]. |
|
559 |
item := aView list at: itemIndex. |
|
560 |
||
561 |
((aView left + x) between: (item x) and: (item x + 16)) |
|
562 |
ifFalse:[^aView buttonPress:button x:x y:y]. |
|
563 |
||
564 |
item removed: item removed not. |
|
565 |
aView invalidate |
|
566 |
||
567 |
"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
|
568 |
"Modified: / 18-11-2011 / 14:55:41 / cg" |
10009 | 569 |
! |
570 |
||
571 |
handlesButtonPress:button inView:aView |
|
572 |
||
10957 | 573 |
^listView scrolledView == aView |
10009 | 574 |
|
575 |
"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
|
576 |
! |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
577 |
|
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
578 |
handlesKeyPress:key inView:aView |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
579 |
^(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
|
580 |
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
|
581 |
|
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
582 |
"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
|
583 |
! |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
584 |
|
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
585 |
keyPress:key x:x y:y view:aView |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
586 |
(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
|
587 |
self listMenuApply. |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
588 |
^ self |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
589 |
]. |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
590 |
|
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
591 |
"Created: / 08-02-2012 / 14:42:18 / cg" |
10009 | 592 |
! ! |
593 |
||
594 |
!ChangeList methodsFor:'generators'! |
|
595 |
||
596 |
makeGenerator |
|
597 |
"Superclass Tools::BrowserList says that I am responsible to implement this method" |
|
598 |
||
599 |
^Iterator on: |
|
600 |
[:whatToDo| |
|
601 |
selectionHolder value do: |
|
602 |
[:changeListItem| | change | |
|
603 |
change := changeListItem change. |
|
604 |
change isCompositeChange ifTrue: |
|
605 |
[change changes do: whatToDo]]]. |
|
606 |
||
607 |
"Modified: / 24-07-2009 / 23:00:41 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
608 |
"Modified: / 24-10-2009 / 20:00:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
609 |
! ! |
|
610 |
||
611 |
!ChangeList methodsFor:'hooks'! |
|
612 |
||
10925 | 613 |
postBuildListView: aView |
10009 | 614 |
|
10925 | 615 |
super postBuildListView: aView. |
10957 | 616 |
listView scrolledView delegate: self. |
10009 | 617 |
|
10925 | 618 |
"Created: / 29-11-2011 / 14:56:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 619 |
! ! |
620 |
||
621 |
!ChangeList methodsFor:'initialization'! |
|
622 |
||
623 |
initialize |
|
11794 | 624 |
super initialize. |
10009 | 625 |
|
626 |
menuHolder := [self menuFor: #listMenu]. |
|
11794 | 627 |
applyAction isNil ifTrue:[ |
628 |
applyAction := [:change | change apply ]. |
|
629 |
]. |
|
10009 | 630 |
|
631 |
"Created: / 29-10-2010 / 12:50:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11794 | 632 |
"Modified: / 10-09-2012 / 13:57:20 / cg" |
10009 | 633 |
! ! |
634 |
||
635 |
!ChangeList methodsFor:'menu actions'! |
|
636 |
||
637 |
listMenuApply |
|
11245
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
638 |
|sel list idx| |
10009 | 639 |
|
640 |
self acceptEnabled ifFalse:[^self]. |
|
641 |
||
11794 | 642 |
(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
|
643 |
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
|
644 |
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
|
645 |
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
|
646 |
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
|
647 |
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
|
648 |
] ifFalse:[ |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
649 |
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
|
650 |
]. |
bd76570b2cc4
accept (Ctrl-s) (implement it - not only claim it in the menu!);
Claus Gittinger <cg@exept.de>
parents:
11194
diff
changeset
|
651 |
]. |
10009 | 652 |
|
653 |
"Modified: / 24-10-2009 / 22:02:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11794 | 654 |
"Modified: / 10-09-2012 / 13:57:46 / cg" |
10009 | 655 |
! |
656 |
||
657 |
listMenuApplyAll |
|
658 |
||
659 |
self acceptEnabled ifFalse:[^self]. |
|
660 |
||
661 |
self selection value do: |
|
11794 | 662 |
[:e|e removed ifFalse:[applyAction value:e change]]. |
10009 | 663 |
|
664 |
"Created: / 05-12-2009 / 14:53:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11794 | 665 |
"Modified: / 10-09-2012 / 13:57:58 / cg" |
10009 | 666 |
! |
667 |
||
668 |
listMenuBrowse |
|
669 |
||
11194 | 670 |
self listMenuBrowseChanges: |
671 |
((self selectionHolder value ? #()) collect:[:e|e change]) |
|
672 |
||
673 |
"Modified: / 24-01-2012 / 22:00:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
674 |
! |
|
675 |
||
676 |
listMenuBrowseChanges: changes |
|
677 |
||
10009 | 678 |
| classes methods methodsOnly | |
679 |
classes := Set new. |
|
680 |
methods := Set new. |
|
681 |
methodsOnly := true. |
|
11194 | 682 |
changes do: |
10009 | 683 |
[:each| |
11194 | 684 |
each isClassChange ifTrue: |
685 |
[each changeClass ifNotNil: |
|
686 |
[classes add: each changeClass. |
|
687 |
each isMethodCodeChange |
|
10009 | 688 |
ifTrue: |
11194 | 689 |
[each changeMethod ifNotNil: |
690 |
[methods add:each changeMethod]] |
|
10009 | 691 |
ifFalse: |
692 |
[methodsOnly := false]]]]. |
|
693 |
methodsOnly |
|
694 |
ifTrue: |
|
695 |
[methods size = 1 |
|
696 |
ifTrue:[Smalltalk browserClass openInMethod: methods anyOne] |
|
697 |
ifFalse:[Smalltalk browserClass browseMethods: methods asArray title: 'Selected methods from changeset' sort: true]] |
|
698 |
ifFalse: |
|
699 |
[classes size = 1 |
|
700 |
ifTrue:[Smalltalk browserClass browseClass: classes anyOne] |
|
701 |
ifFalse:[Smalltalk browserClass browseClasses: classes]] |
|
702 |
||
703 |
"Modified: / 24-10-2009 / 22:02:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11194 | 704 |
"Created: / 24-01-2012 / 22:00:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 705 |
! |
706 |
||
707 |
listMenuDeleteSelection |
|
708 |
||
709 |
self selectionHolder value do: |
|
710 |
[:each|each removed: true]. |
|
711 |
self updateList |
|
712 |
! |
|
713 |
||
714 |
listMenuInspect |
|
715 |
||
716 |
| selection | |
|
717 |
||
718 |
selection := self selectionHolder value collect:[:e|e change]. |
|
719 |
selection size = 1 |
|
720 |
ifTrue:[selection anyOne inspect] |
|
721 |
ifFalse:[selection inspect]. |
|
722 |
||
723 |
"Modified: / 24-10-2009 / 22:02:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
724 |
! |
|
725 |
||
726 |
listMenuSelectAdditions |
|
727 |
||
728 |
self listMenuSelectAllSuchThat:[:change|change delta = #+] |
|
729 |
! |
|
730 |
||
731 |
listMenuSelectAll |
|
732 |
||
733 |
self listMenuSelectAllSuchThat:[:change|true] |
|
734 |
! |
|
735 |
||
736 |
listMenuSelectAllSuchThat:conditionBlock |
|
737 |
|newSelection| |
|
738 |
||
739 |
newSelection := self listHolder value |
|
740 |
select:[:entry | conditionBlock value:entry change ]. |
|
741 |
self selectionHolder value:newSelection |
|
742 |
! |
|
743 |
||
744 |
listMenuSelectNone |
|
745 |
||
746 |
self listMenuSelectAllSuchThat:[:change|false] |
|
747 |
! |
|
748 |
||
749 |
listMenuSelectRemovals |
|
750 |
||
751 |
self listMenuSelectAllSuchThat:[:change|change delta = #-] |
|
752 |
! |
|
753 |
||
754 |
listMenuSelectSame |
|
755 |
||
756 |
self listMenuSelectAllSuchThat:[:change|change delta = #=] |
|
757 |
! |
|
758 |
||
759 |
listMenuSelectUsingBlock |
|
760 |
||
761 |
|conditionBlockString conditionBlock dialog textHolder template| |
|
762 |
||
763 |
template := |
|
764 |
'[:change| |
|
765 |
"/ Define condition for selection below: |
|
766 |
"/ change is an instance of Change |
|
767 |
"/ change will be selected if and only if block returns true |
|
768 |
||
769 |
||
770 |
true"/always select the change |
|
771 |
] |
|
772 |
'. |
|
773 |
||
774 |
LastSelectionConditionString isNil ifTrue:[ |
|
775 |
LastSelectionConditionString := template. |
|
776 |
]. |
|
777 |
||
778 |
||
779 |
textHolder := ValueHolder new. |
|
780 |
dialog := Dialog |
|
781 |
forRequestText:(resources string:'Enter condition for selection') |
|
782 |
lines:20 |
|
783 |
columns:70 |
|
784 |
initialAnswer:LastSelectionConditionString |
|
785 |
model:textHolder. |
|
786 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
787 |
dialog open. |
|
788 |
dialog accepted ifFalse:[^ self]. |
|
789 |
||
790 |
conditionBlockString := textHolder value. |
|
791 |
LastSelectionConditionString := conditionBlockString. |
|
792 |
||
793 |
conditionBlock := Parser evaluate:conditionBlockString. |
|
794 |
conditionBlock isBlock ifFalse:[ |
|
795 |
self error:'Bad selection block (syntax error?)'. |
|
796 |
^ self |
|
797 |
]. |
|
798 |
||
799 |
self listMenuSelectAllSuchThat: conditionBlock |
|
800 |
! |
|
801 |
||
802 |
listMenuUndeleteSelection |
|
803 |
||
804 |
self selectionHolder value do: |
|
805 |
[:each|each removed: false]. |
|
806 |
self updateList |
|
807 |
! ! |
|
808 |
||
809 |
!ChangeList methodsFor:'private'! |
|
810 |
||
811 |
application |
|
812 |
||
813 |
^self |
|
814 |
||
815 |
"Created: / 05-12-2009 / 14:10:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
816 |
! |
|
817 |
||
818 |
browserNameList |
|
819 |
||
820 |
^'Change list' |
|
821 |
||
822 |
"Modified: / 24-07-2009 / 22:06:53 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
823 |
! |
|
824 |
||
825 |
listEntryFor:chg |
|
826 |
^ListEntry change:chg application: self |
|
827 |
||
828 |
"Modified: / 05-12-2009 / 14:39:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
829 |
! |
|
830 |
||
831 |
makeDependent |
|
832 |
||
833 |
"Modified: / 24-07-2009 / 22:06:32 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
834 |
! |
|
835 |
||
836 |
makeIndependent |
|
837 |
||
838 |
"Modified: / 24-07-2009 / 22:06:37 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
839 |
! |
|
840 |
||
841 |
parentOrModel |
|
842 |
||
843 |
^self |
|
844 |
||
845 |
"Created: / 05-12-2009 / 14:14:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
846 |
! |
|
847 |
||
848 |
updateList |
|
10925 | 849 |
|inGenerator changeset newList | |
10009 | 850 |
|
851 |
inGenerator := self inGeneratorHolder value. |
|
852 |
changeset := inGenerator ifNil:[ #() ] ifNotNil:[ inGenerator ]. |
|
10925 | 853 |
newList := changeset |
10449 | 854 |
select: |
855 |
[:chg | |
|
856 |
(self showRemovedHolder value or:[ chg removed not ]) |
|
10451 | 857 |
and:[self showSameHolder value or:[chg delta ~~ #=]] |
10925 | 858 |
]. |
859 |
newList := self filterList: newList. |
|
860 |
newList := newList collect:[:chg | self listEntryFor:chg ]. |
|
11039 | 861 |
self listHolder value ~= newList ifTrue:[ |
862 |
self listHolder value: newList. |
|
863 |
] |
|
10449 | 864 |
|
10925 | 865 |
"Modified: / 29-11-2011 / 15:38:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11039 | 866 |
"Modified: / 28-12-2011 / 15:46:15 / cg" |
10009 | 867 |
! ! |
868 |
||
869 |
!ChangeList methodsFor:'queries'! |
|
870 |
||
871 |
hasChangeSelected |
|
872 |
||
873 |
^self selectionHolder value size > 0 |
|
874 |
! |
|
875 |
||
876 |
hasChangeSelectedAndNotRemoved |
|
877 |
||
878 |
| selection | |
|
879 |
selection := self selectionHolder value ? #(). |
|
880 |
^selection size > 0 and: |
|
881 |
[selection allSatisfy:[:e|e removed not]]. |
|
882 |
! |
|
883 |
||
884 |
hasSingleChangeSelected |
|
885 |
||
886 |
^self selectionHolder value size = 1 |
|
887 |
! |
|
888 |
||
889 |
hasSingleChangeSelectedAndCanBrowse |
|
890 |
||
891 |
||
892 |
self selectionHolder value ? #() do: |
|
893 |
[:each| |
|
894 |
(each change isClassChange and: |
|
895 |
[each change isMethodChange not |
|
896 |
or:[each change isMethodCodeChange]]) ifFalse:[^false]]. |
|
897 |
^true |
|
898 |
! ! |
|
899 |
||
900 |
!ChangeList::ListEntry class methodsFor:'instance creation'! |
|
901 |
||
902 |
change: aChange |
|
903 |
||
904 |
^self new change: aChange |
|
905 |
||
906 |
"Created: / 24-07-2009 / 22:43:41 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
907 |
! |
|
908 |
||
909 |
change: aChange application: anApplicationModel |
|
910 |
||
911 |
^self new change: aChange; application: anApplicationModel |
|
912 |
||
913 |
"Created: / 05-12-2009 / 14:16:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
914 |
! |
|
915 |
||
916 |
change: aChange parent: aChangeList |
|
917 |
||
918 |
^self new change: aChange; parent: aChangeList |
|
919 |
||
920 |
"Created: / 25-07-2009 / 23:33:00 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
921 |
! ! |
|
922 |
||
923 |
!ChangeList::ListEntry methodsFor:'accessing'! |
|
924 |
||
925 |
application |
|
926 |
^ application ifNil:[super application] |
|
927 |
||
928 |
"Modified: / 05-12-2009 / 14:16:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
929 |
! |
|
930 |
||
931 |
application:anApplicationModel |
|
932 |
application := anApplicationModel. |
|
933 |
||
934 |
"Modified: / 05-12-2009 / 14:15:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
935 |
! |
|
936 |
||
937 |
change |
|
938 |
^ change |
|
939 |
! |
|
940 |
||
941 |
change:aChange |
|
942 |
self assert: ((aChange isKindOf: Change) or:[aChange isKindOf: RefactoryChange]). |
|
943 |
change := aChange. |
|
944 |
||
945 |
"Modified: / 25-07-2009 / 23:40:38 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
10957 | 946 |
"Modified (format): / 04-12-2011 / 14:58:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 947 |
! |
948 |
||
949 |
changeClass |
|
950 |
||
951 |
^change changeClass |
|
952 |
! |
|
953 |
||
10334 | 954 |
changeSource |
11662 | 955 |
"the changes source" |
10334 | 956 |
|
957 |
^change changeSource |
|
958 |
||
959 |
"Created: / 19-07-2011 / 12:03:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11662 | 960 |
"Modified (comment): / 25-07-2012 / 17:39:39 / cg" |
10334 | 961 |
! |
962 |
||
10009 | 963 |
children |
964 |
||
10881
07359595b386
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
10657
diff
changeset
|
965 |
children isNil ifTrue:[ |
10957 | 966 |
change isCompositeChange ifTrue:[ |
967 |
children := OrderedCollection new: change changes size. |
|
968 |
change changes do:[:chg| |
|
969 |
((self application showRemovedHolder value or:[ chg removed not ]) |
|
970 |
and:[self application showSameHolder value or:[chg delta ~~ #=]]) |
|
971 |
ifTrue:[ |
|
972 |
children add: ((self application listEntryFor: chg) parent: self) |
|
973 |
] |
|
974 |
]. |
|
975 |
] ifFalse:[ |
|
976 |
children := #() |
|
977 |
] |
|
10881
07359595b386
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
10657
diff
changeset
|
978 |
]. |
10009 | 979 |
^children |
980 |
||
981 |
"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
|
982 |
"Modified (format): / 18-11-2011 / 14:56:25 / cg" |
10957 | 983 |
"Modified: / 04-12-2011 / 15:08:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 984 |
! |
985 |
||
986 |
delta |
|
10657 | 987 |
"/ obsolete: please use deltaDetail |
10009 | 988 |
|
989 |
^change delta |
|
990 |
||
991 |
"Created: / 29-10-2010 / 14:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10657 | 992 |
"Modified (comment): / 31-08-2011 / 10:30:02 / cg" |
993 |
! |
|
994 |
||
995 |
deltaDetail |
|
996 |
||
997 |
^change deltaDetail |
|
998 |
||
999 |
"Created: / 29-10-2010 / 14:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1000 |
"Created: / 31-08-2011 / 10:29:21 / cg" |
|
10009 | 1001 |
! |
1002 |
||
1003 |
iconDelta |
|
1004 |
||
1005 |
| iconSelector | |
|
1006 |
iconSelector := self iconSelector. |
|
10881
07359595b386
changed: #buttonPress:x:y:view:
Claus Gittinger <cg@exept.de>
parents:
10657
diff
changeset
|
1007 |
iconSelector isNil ifTrue:[^nil]. |
10009 | 1008 |
self removed ifTrue:[iconSelector := iconSelector , #Grayed]. |
1009 |
^self application class perform: iconSelector asSymbol. |
|
1010 |
||
1011 |
"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
|
1012 |
"Modified: / 18-11-2011 / 14:56:33 / cg" |
10009 | 1013 |
! |
1014 |
||
1015 |
iconRemoved |
|
1016 |
||
1017 |
^self removed |
|
1018 |
ifTrue: [self application class uncheckedIcon ] |
|
1019 |
ifFalse:[self application class checkedIcon ] |
|
1020 |
||
1021 |
"Created: / 05-12-2009 / 14:11:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1022 |
! |
|
1023 |
||
10334 | 1024 |
imageSource |
11662 | 1025 |
"return the source for the in-image version of the change" |
10334 | 1026 |
|
11662 | 1027 |
^ change imageSource |
10334 | 1028 |
|
1029 |
"Created: / 19-07-2011 / 12:03:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11662 | 1030 |
"Modified (comment): / 25-07-2012 / 17:38:57 / cg" |
10334 | 1031 |
! |
1032 |
||
10009 | 1033 |
label |
11710 | 1034 |
| label | |
10009 | 1035 |
|
1036 |
label := change displayString. |
|
1037 |
self removed ifTrue:[label := label asText colorizeAllWith: Color gray]. |
|
1038 |
^label |
|
1039 |
||
1040 |
"Created: / 05-11-2008 / 08:20:02 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1041 |
"Modified: / 25-07-2009 / 23:43:23 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1042 |
"Modified: / 05-12-2009 / 14:46:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11710 | 1043 |
"Modified (format): / 27-07-2012 / 21:26:34 / cg" |
10009 | 1044 |
! |
1045 |
||
1046 |
removed |
|
1047 |
^ change removed |
|
1048 |
! |
|
1049 |
||
1050 |
removed:aBoolean |
|
1051 |
change removed: aBoolean. |
|
1052 |
! |
|
1053 |
||
1054 |
source |
|
1055 |
||
1056 |
^change source |
|
1057 |
! |
|
1058 |
||
1059 |
x |
|
1060 |
^ x |
|
1061 |
! ! |
|
1062 |
||
1063 |
!ChangeList::ListEntry methodsFor:'displaying'! |
|
1064 |
||
1065 |
displayLabel:aLabel h:lH on:aGC x:newX y:y h:h |
|
11710 | 1066 |
| cx icon | |
10009 | 1067 |
|
1068 |
cx := x := newX. |
|
11710 | 1069 |
self application allowRemoveHolder value ifTrue:[ |
1070 |
(icon := self iconRemoved) notNil ifTrue:[ |
|
1071 |
icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2) |
|
1072 |
]. |
|
1073 |
cx := cx + 22."experimental value - this looks good" |
|
1074 |
]. |
|
1075 |
(icon := self iconDelta) notNil ifTrue:[ |
|
1076 |
icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2) |
|
1077 |
]. |
|
10009 | 1078 |
cx := cx + 16."12 + 2px gap" |
1079 |
||
1080 |
super displayLabel:aLabel h:lH on:aGC x:cx y:y h:h |
|
1081 |
||
11194 | 1082 |
"Modified: / 24-01-2012 / 21:44:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11710 | 1083 |
"Modified: / 27-07-2012 / 21:26:23 / cg" |
10009 | 1084 |
! ! |
1085 |
||
1086 |
!ChangeList::ListEntry methodsFor:'private'! |
|
1087 |
||
1088 |
iconSelector |
|
10657 | 1089 |
| delta | |
10009 | 1090 |
|
10657 | 1091 |
delta := change deltaDetail. |
1092 |
delta shortDeltaSymbol = #+ ifTrue:[^#iconPlus]. |
|
1093 |
delta shortDeltaSymbol = #- ifTrue:[^#iconMinus]. |
|
1094 |
delta shortDeltaSymbol = #= ifTrue:[^#iconEqual]. |
|
10009 | 1095 |
|
10657 | 1096 |
^ nil. |
1097 |
||
1098 |
"Modified: / 31-08-2011 / 10:39:32 / cg" |
|
10009 | 1099 |
! ! |
1100 |
||
10957 | 1101 |
!ChangeList::ListEntry methodsFor:'protocol-queries'! |
1102 |
||
1103 |
hasChildren |
|
1104 |
^ change isCompositeChange and:[change changes notEmptyOrNil ]. |
|
1105 |
||
1106 |
"Created: / 04-12-2011 / 14:45:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11710 | 1107 |
"Modified (format): / 27-07-2012 / 21:25:34 / cg" |
10957 | 1108 |
! ! |
1109 |
||
10009 | 1110 |
!ChangeList class methodsFor:'documentation'! |
1111 |
||
10451 | 1112 |
version |
11794 | 1113 |
^ '$Header: /cvs/stx/stx/libtool/Tools__ChangeList.st,v 1.18 2012-09-10 12:01:52 cg Exp $' |
10451 | 1114 |
! |
1115 |
||
10009 | 1116 |
version_CVS |
11794 | 1117 |
^ '$Header: /cvs/stx/stx/libtool/Tools__ChangeList.st,v 1.18 2012-09-10 12:01:52 cg Exp $' |
10009 | 1118 |
! |
1119 |
||
1120 |
version_SVN |
|
1121 |
^ '§Id: Tools__ChangeList.st 7486 2009-10-26 22:06:24Z vranyj1 §' |
|
1122 |
! ! |