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