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