author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sat, 31 Mar 2012 01:16:30 +0100 | |
branch | jv |
changeset 12214 | 4b7eedbab2a7 |
parent 12213 | 63694f12baba |
child 12216 | 5698c277f043 |
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 |
||
12125 | 30 |
BrowserListWithFilter subclass:#ChangeList |
31 |
instanceVariableNames:'listHolder showRemovedHolder showSameHolder allowRemoveHolder |
|
12214
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
32 |
allowAcceptHolder scrollToBottom' |
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 |
|
12125 | 78 |
^ ToolbarIconLibrary iconEqual12x12 |
10009 | 79 |
|
12125 | 80 |
"Modified: / 31-08-2011 / 10:52:34 / cg" |
10009 | 81 |
! |
82 |
||
83 |
iconEqualGrayed |
|
12125 | 84 |
^ ToolbarIconLibrary iconEqualGray12x12 |
10009 | 85 |
|
12125 | 86 |
"Modified: / 31-08-2011 / 10:54:00 / cg" |
10009 | 87 |
! |
88 |
||
89 |
iconMinus |
|
12125 | 90 |
^ ToolbarIconLibrary iconMinus12x12 |
10009 | 91 |
|
12125 | 92 |
"Modified: / 31-08-2011 / 10:51:26 / cg" |
10009 | 93 |
! |
94 |
||
95 |
iconMinusGrayed |
|
12125 | 96 |
^ ToolbarIconLibrary iconMinusGray12x12 |
10009 | 97 |
|
12125 | 98 |
"Modified: / 31-08-2011 / 10:54:40 / cg" |
10009 | 99 |
! |
100 |
||
101 |
iconPlus |
|
12125 | 102 |
^ ToolbarIconLibrary iconPlus12x12 |
10009 | 103 |
|
12125 | 104 |
"Modified: / 31-08-2011 / 10:51:39 / cg" |
10009 | 105 |
! |
106 |
||
107 |
iconPlusGrayed |
|
12125 | 108 |
^ ToolbarIconLibrary iconPlusGray12x12 |
10009 | 109 |
|
12125 | 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 |
|
12125 | 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 |
|
12125 | 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 |
) |
|
12125 | 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 |
||
12125 | 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 |
|
12125 | 205 |
isVisible: allowAcceptHolder |
10009 | 206 |
shortcutKey: Accept |
207 |
) |
|
208 |
(MenuItem |
|
209 |
label: 'Apply all' |
|
210 |
itemValue: listMenuApplyAll |
|
211 |
translateLabel: true |
|
12125 | 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 |
|
12125 | 228 |
isVisible: allowRemoveHolder |
10009 | 229 |
shortcutKey: Delete |
230 |
) |
|
231 |
(MenuItem |
|
232 |
label: '-' |
|
12125 | 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 |
|
12125 | 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 |
||
12154
f27f8ee5ef3a
More improvements in InlineMessageDialog
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
315 |
^super aspectSelectors , #( |
12125 | 316 |
#allowAcceptHolder |
317 |
#allowRemoveHolder |
|
318 |
||
10009 | 319 |
#inGeneratorHolder |
320 |
#menuHolder |
|
321 |
#outGeneratorHolder |
|
322 |
#selectionHolder |
|
323 |
#showRemovedHolder |
|
10449 | 324 |
#showSameHolder |
10009 | 325 |
). |
326 |
||
12154
f27f8ee5ef3a
More improvements in InlineMessageDialog
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
327 |
"Modified: / 11-02-2012 / 22:45:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 328 |
! ! |
329 |
||
330 |
!ChangeList methodsFor:'accessing'! |
|
331 |
||
12158 | 332 |
acceptEnabled |
333 |
^ self allowAccept |
|
334 |
||
335 |
"Created: / 08-02-2012 / 14:45:12 / cg" |
|
336 |
! |
|
337 |
||
12125 | 338 |
allowAccept |
339 |
^ self allowAcceptHolder value |
|
10009 | 340 |
|
12125 | 341 |
"Created: / 24-01-2012 / 19:52:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
342 |
! |
|
343 |
||
344 |
allowAccept: aBoolean |
|
345 |
^ self allowAcceptHolder value: aBoolean |
|
346 |
||
347 |
"Created: / 24-01-2012 / 19:52:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11194 | 348 |
! |
349 |
||
12125 | 350 |
allowRemoved |
351 |
^ self allowRemoveHolder value ? true |
|
352 |
||
353 |
"Created: / 05-12-2009 / 14:28:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
354 |
! |
|
10009 | 355 |
|
12125 | 356 |
list |
357 |
^ listHolder value |
|
358 |
||
359 |
"Created: / 05-12-2009 / 14:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
360 |
"Created: / 27-12-2011 / 14:18:25 / cg" |
|
11035 | 361 |
! |
362 |
||
12214
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
363 |
scrollToBottom:aBoolean |
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
364 |
"If set to true, list will automaticallu scroll to bottom |
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
365 |
ehen the list is updated and clears this flag. |
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
366 |
|
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
367 |
This is required as the list is updated asynchronously" |
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
368 |
|
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
369 |
scrollToBottom := aBoolean. |
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
370 |
|
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
371 |
"Modified (comment): / 30-03-2012 / 17:05:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
372 |
! |
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
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 |
||
12213
63694f12baba
Improvements in ChangeSetBrowser2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12166
diff
changeset
|
381 |
selection: selection |
63694f12baba
Improvements in ChangeSetBrowser2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12166
diff
changeset
|
382 |
|
63694f12baba
Improvements in ChangeSetBrowser2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12166
diff
changeset
|
383 |
self selectionHolder value: selection |
63694f12baba
Improvements in ChangeSetBrowser2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12166
diff
changeset
|
384 |
|
63694f12baba
Improvements in ChangeSetBrowser2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12166
diff
changeset
|
385 |
"Created: / 30-03-2012 / 12:29:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
63694f12baba
Improvements in ChangeSetBrowser2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12166
diff
changeset
|
386 |
! |
63694f12baba
Improvements in ChangeSetBrowser2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12166
diff
changeset
|
387 |
|
12125 | 388 |
selectionIndices |
389 |
|sel| |
|
390 |
||
391 |
(sel := self selectionHolder value) isEmptyOrNil ifTrue:[^ #()]. |
|
392 |
^ sel collect:[:each | self list identityIndexOf:each]. |
|
393 |
||
394 |
"Created: / 05-12-2009 / 14:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
395 |
"Created: / 27-12-2011 / 10:56:20 / cg" |
|
396 |
! |
|
397 |
||
10009 | 398 |
showRemoved |
399 |
||
400 |
^self showRemovedHolder value ? true |
|
401 |
||
402 |
"Created: / 05-12-2009 / 14:28:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
403 |
! ! |
|
404 |
||
405 |
!ChangeList methodsFor:'actions'! |
|
406 |
||
407 |
selectionDoubleclicked |
|
408 |
||
12125 | 409 |
self listMenuBrowse |
410 |
"/ | app | |
|
411 |
"/ |
|
412 |
"/ self selection do: |
|
413 |
"/ [:e|e removed: e removed not]. |
|
414 |
"/ ((app := self masterApplication) respondsTo: #redrawChangeListViews) |
|
415 |
"/ ifTrue:[app redrawChangeListViews]. |
|
10009 | 416 |
|
12125 | 417 |
"Modified: / 24-01-2012 / 22:01:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 418 |
! ! |
419 |
||
420 |
!ChangeList methodsFor:'aspects'! |
|
421 |
||
12125 | 422 |
allowAcceptHolder |
10009 | 423 |
"return/create the valueHolder 'acceptEnabledHolder'" |
424 |
||
12125 | 425 |
allowAcceptHolder isNil ifTrue:[ |
426 |
allowAcceptHolder := ValueHolder with:nil "defaultValue here". |
|
10009 | 427 |
]. |
12125 | 428 |
^ allowAcceptHolder |
429 |
||
430 |
"Created: / 24-01-2012 / 19:53:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
431 |
! |
|
432 |
||
433 |
allowAcceptHolder:something |
|
434 |
"set the 'allowAcceptHolder' value holder (automatically generated)" |
|
435 |
||
436 |
allowAcceptHolder := something. |
|
10009 | 437 |
! |
438 |
||
12125 | 439 |
allowRemoveHolder |
440 |
"return/create the 'allowRemoveHolder' value holder (automatically generated)" |
|
441 |
||
442 |
allowRemoveHolder isNil ifTrue:[ |
|
443 |
allowRemoveHolder := ValueHolder with:true. |
|
444 |
allowRemoveHolder addDependent:self. |
|
445 |
]. |
|
446 |
^ allowRemoveHolder |
|
447 |
||
448 |
"Modified (comment): / 24-01-2012 / 19:44:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
449 |
! |
|
450 |
||
451 |
allowRemoveHolder:something |
|
452 |
"set the 'showRemovedHolder' value holder (automatically generated)" |
|
453 |
||
454 |
|oldValue newValue| |
|
455 |
||
456 |
allowRemoveHolder notNil ifTrue:[ |
|
457 |
oldValue := allowRemoveHolder value. |
|
458 |
allowRemoveHolder removeDependent:self. |
|
459 |
]. |
|
460 |
allowRemoveHolder := something. |
|
461 |
allowRemoveHolder notNil ifTrue:[ |
|
462 |
allowRemoveHolder addDependent:self. |
|
463 |
]. |
|
464 |
newValue := allowRemoveHolder value. |
|
465 |
oldValue ~~ newValue ifTrue:[ |
|
466 |
self |
|
467 |
update:#value |
|
468 |
with:newValue |
|
469 |
from:allowRemoveHolder. |
|
470 |
]. |
|
10009 | 471 |
! |
472 |
||
473 |
listHolder |
|
474 |
listHolder isNil ifTrue:[ |
|
475 |
listHolder := ValueHolder new. |
|
476 |
]. |
|
477 |
^ listHolder |
|
478 |
! |
|
479 |
||
480 |
showRemovedHolder |
|
481 |
"return/create the 'showRemovedHolder' value holder (automatically generated)" |
|
482 |
||
483 |
showRemovedHolder isNil ifTrue:[ |
|
484 |
showRemovedHolder := ValueHolder with: true. |
|
485 |
showRemovedHolder addDependent: self. |
|
486 |
]. |
|
487 |
^ showRemovedHolder |
|
488 |
! |
|
489 |
||
10449 | 490 |
showRemovedHolder:something |
10009 | 491 |
"set the 'showRemovedHolder' value holder (automatically generated)" |
492 |
||
10449 | 493 |
|oldValue newValue| |
494 |
||
495 |
showRemovedHolder notNil ifTrue:[ |
|
496 |
oldValue := showRemovedHolder value. |
|
497 |
showRemovedHolder removeDependent:self. |
|
498 |
]. |
|
499 |
showRemovedHolder := something. |
|
500 |
showRemovedHolder notNil ifTrue:[ |
|
501 |
showRemovedHolder addDependent:self. |
|
502 |
]. |
|
503 |
newValue := showRemovedHolder value. |
|
504 |
oldValue ~~ newValue ifTrue:[ |
|
505 |
self update:#value with:newValue from:showRemovedHolder. |
|
506 |
]. |
|
507 |
! |
|
508 |
||
509 |
showSameHolder |
|
510 |
"return/create the 'showSameHolder' value holder (automatically generated)" |
|
511 |
||
512 |
showSameHolder isNil ifTrue:[ |
|
513 |
showSameHolder := ValueHolder with: true. |
|
514 |
showSameHolder addDependent:self. |
|
515 |
]. |
|
516 |
^ showSameHolder |
|
517 |
||
518 |
"Modified: / 04-08-2011 / 18:39:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
519 |
! |
|
520 |
||
521 |
showSameHolder:something |
|
522 |
"set the 'showSameHolder' value holder (automatically generated)" |
|
523 |
||
524 |
|oldValue newValue| |
|
525 |
||
526 |
showSameHolder notNil ifTrue:[ |
|
527 |
oldValue := showSameHolder value. |
|
528 |
showSameHolder removeDependent:self. |
|
529 |
]. |
|
530 |
showSameHolder := something. |
|
531 |
showSameHolder notNil ifTrue:[ |
|
532 |
showSameHolder addDependent:self. |
|
533 |
]. |
|
534 |
newValue := showSameHolder value. |
|
535 |
oldValue ~~ newValue ifTrue:[ |
|
536 |
self update:#value with:newValue from:showSameHolder. |
|
537 |
]. |
|
10009 | 538 |
! ! |
539 |
||
540 |
!ChangeList methodsFor:'change & update'! |
|
541 |
||
542 |
update: aspect with: param from: sender |
|
543 |
||
10449 | 544 |
sender == selectionHolder ifTrue:[ |
545 |
self selectionChanged. |
|
546 |
^self |
|
547 |
]. |
|
548 |
sender == showSameHolder ifTrue:[ |
|
549 |
self updateList |
|
550 |
]. |
|
551 |
sender == showRemovedHolder ifTrue:[ |
|
552 |
self updateList |
|
553 |
]. |
|
554 |
||
10009 | 555 |
^super update: aspect with: param from: sender |
556 |
||
557 |
"Created: / 24-10-2009 / 19:47:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12125 | 558 |
"Modified (format): / 27-12-2011 / 14:20:30 / cg" |
10009 | 559 |
! ! |
560 |
||
561 |
!ChangeList methodsFor:'event processing'! |
|
562 |
||
563 |
buttonPress:button x:x y:y view:aView |
|
564 |
||
565 |
| itemIndex item | |
|
566 |
||
567 |
button ~= 1 ifTrue:[^aView buttonPress:button x:x y:y]. |
|
568 |
||
569 |
itemIndex := aView yVisibleToLineNr:y. |
|
12125 | 570 |
itemIndex isNil ifTrue:[^self]. |
10009 | 571 |
itemIndex == 0 ifTrue:[^self]. |
572 |
itemIndex > aView list size ifTrue:[^self]. |
|
573 |
item := aView list at: itemIndex. |
|
574 |
||
12166 | 575 |
((aView left + x) between: (item x) and: ((item x ? 0) + 16)) |
10009 | 576 |
ifFalse:[^aView buttonPress:button x:x y:y]. |
577 |
||
578 |
item removed: item removed not. |
|
579 |
aView invalidate |
|
580 |
||
581 |
"Created: / 08-12-2009 / 14:12:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12125 | 582 |
"Modified: / 18-11-2011 / 14:55:41 / cg" |
12166 | 583 |
"Modified: / 15-02-2012 / 18:17:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 584 |
! |
585 |
||
586 |
handlesButtonPress:button inView:aView |
|
587 |
||
12125 | 588 |
^listView scrolledView == aView |
10009 | 589 |
|
590 |
"Created: / 08-12-2009 / 14:08:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12158 | 591 |
! |
592 |
||
593 |
handlesKeyPress:key inView:aView |
|
594 |
^(key == #Accept or:[ key == #Ctrls]) |
|
595 |
and:[ listView scrolledView == aView ] |
|
596 |
||
597 |
"Created: / 08-02-2012 / 14:43:11 / cg" |
|
598 |
! |
|
599 |
||
600 |
keyPress:key x:x y:y view:aView |
|
601 |
(key == #Accept or:[ key == #Ctrls]) ifTrue:[ |
|
602 |
self listMenuApply. |
|
603 |
^ self |
|
604 |
]. |
|
605 |
||
606 |
"Created: / 08-02-2012 / 14:42:18 / cg" |
|
10009 | 607 |
! ! |
608 |
||
609 |
!ChangeList methodsFor:'generators'! |
|
610 |
||
611 |
makeGenerator |
|
612 |
"Superclass Tools::BrowserList says that I am responsible to implement this method" |
|
613 |
||
614 |
^Iterator on: |
|
615 |
[:whatToDo| |
|
616 |
selectionHolder value do: |
|
617 |
[:changeListItem| | change | |
|
618 |
change := changeListItem change. |
|
619 |
change isCompositeChange ifTrue: |
|
620 |
[change changes do: whatToDo]]]. |
|
621 |
||
622 |
"Modified: / 24-07-2009 / 23:00:41 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
623 |
"Modified: / 24-10-2009 / 20:00:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
624 |
! ! |
|
625 |
||
626 |
!ChangeList methodsFor:'hooks'! |
|
627 |
||
12125 | 628 |
postBuildListView: aView |
10009 | 629 |
|
12125 | 630 |
super postBuildListView: aView. |
631 |
listView scrolledView delegate: self. |
|
10009 | 632 |
|
12125 | 633 |
"Created: / 29-11-2011 / 14:56:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 634 |
! ! |
635 |
||
636 |
!ChangeList methodsFor:'initialization'! |
|
637 |
||
638 |
initialize |
|
639 |
||
640 |
super initialize. |
|
641 |
menuHolder := [self menuFor: #listMenu]. |
|
12214
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
642 |
scrollToBottom := false. |
10009 | 643 |
|
644 |
"Created: / 29-10-2010 / 12:50:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
645 |
! ! |
|
646 |
||
647 |
!ChangeList methodsFor:'menu actions'! |
|
648 |
||
649 |
listMenuApply |
|
12158 | 650 |
|sel list idx| |
10009 | 651 |
|
652 |
self acceptEnabled ifFalse:[^self]. |
|
653 |
||
12158 | 654 |
(sel := self selectionHolder value) do:[:e|e change apply]. |
655 |
sel size == 1 ifTrue:[ |
|
656 |
list := self listHolder value. |
|
657 |
idx := list indexOf:(sel first). |
|
658 |
idx < list size ifTrue:[ |
|
659 |
self selectionHolder value:(Array with:(list at:idx+1)) |
|
660 |
] ifFalse:[ |
|
661 |
self selectionHolder value:#() |
|
662 |
]. |
|
663 |
]. |
|
10009 | 664 |
|
665 |
"Modified: / 24-10-2009 / 22:02:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12158 | 666 |
"Modified: / 08-02-2012 / 14:53:25 / cg" |
10009 | 667 |
! |
668 |
||
669 |
listMenuApplyAll |
|
670 |
||
671 |
self acceptEnabled ifFalse:[^self]. |
|
672 |
||
673 |
self selection value do: |
|
674 |
[:e|e removed ifFalse:[e change apply]]. |
|
675 |
||
676 |
"Created: / 05-12-2009 / 14:53:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
677 |
! |
|
678 |
||
679 |
listMenuBrowse |
|
680 |
||
12125 | 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. |
|
12125 | 693 |
changes do: |
10009 | 694 |
[:each| |
12125 | 695 |
each isClassChange ifTrue: |
696 |
[each changeClass ifNotNil: |
|
697 |
[classes add: each changeClass. |
|
698 |
each isMethodCodeChange |
|
10009 | 699 |
ifTrue: |
12125 | 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>" |
|
12125 | 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 |
|
12125 | 860 |
|inGenerator changeset newList | |
10009 | 861 |
|
862 |
inGenerator := self inGeneratorHolder value. |
|
863 |
changeset := inGenerator ifNil:[ #() ] ifNotNil:[ inGenerator ]. |
|
12125 | 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 ~~ #=]] |
12125 | 869 |
]. |
870 |
newList := self filterList: newList. |
|
871 |
newList := newList collect:[:chg | self listEntryFor:chg ]. |
|
872 |
self listHolder value ~= newList ifTrue:[ |
|
873 |
self listHolder value: newList. |
|
12214
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
874 |
((newList size ~~ 0) and:[scrollToBottom]) ifTrue:[ |
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
875 |
self selection: { newList last } |
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
876 |
]. |
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
877 |
scrollToBottom := false. |
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
878 |
|
12125 | 879 |
] |
10449 | 880 |
|
12125 | 881 |
"Modified: / 28-12-2011 / 15:46:15 / cg" |
12214
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
882 |
"Modified: / 30-03-2012 / 17:04:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 883 |
! ! |
884 |
||
885 |
!ChangeList methodsFor:'queries'! |
|
886 |
||
887 |
hasChangeSelected |
|
888 |
||
889 |
^self selectionHolder value size > 0 |
|
890 |
! |
|
891 |
||
892 |
hasChangeSelectedAndNotRemoved |
|
893 |
||
894 |
| selection | |
|
895 |
selection := self selectionHolder value ? #(). |
|
896 |
^selection size > 0 and: |
|
897 |
[selection allSatisfy:[:e|e removed not]]. |
|
898 |
! |
|
899 |
||
900 |
hasSingleChangeSelected |
|
901 |
||
902 |
^self selectionHolder value size = 1 |
|
903 |
! |
|
904 |
||
905 |
hasSingleChangeSelectedAndCanBrowse |
|
906 |
||
907 |
||
908 |
self selectionHolder value ? #() do: |
|
909 |
[:each| |
|
910 |
(each change isClassChange and: |
|
911 |
[each change isMethodChange not |
|
912 |
or:[each change isMethodCodeChange]]) ifFalse:[^false]]. |
|
913 |
^true |
|
914 |
! ! |
|
915 |
||
916 |
!ChangeList::ListEntry class methodsFor:'instance creation'! |
|
917 |
||
918 |
change: aChange |
|
919 |
||
920 |
^self new change: aChange |
|
921 |
||
922 |
"Created: / 24-07-2009 / 22:43:41 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
923 |
! |
|
924 |
||
925 |
change: aChange application: anApplicationModel |
|
926 |
||
927 |
^self new change: aChange; application: anApplicationModel |
|
928 |
||
929 |
"Created: / 05-12-2009 / 14:16:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
930 |
! |
|
931 |
||
932 |
change: aChange parent: aChangeList |
|
933 |
||
934 |
^self new change: aChange; parent: aChangeList |
|
935 |
||
936 |
"Created: / 25-07-2009 / 23:33:00 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
937 |
! ! |
|
938 |
||
939 |
!ChangeList::ListEntry methodsFor:'accessing'! |
|
940 |
||
941 |
application |
|
942 |
^ application ifNil:[super application] |
|
943 |
||
944 |
"Modified: / 05-12-2009 / 14:16:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
945 |
! |
|
946 |
||
947 |
application:anApplicationModel |
|
948 |
application := anApplicationModel. |
|
949 |
||
950 |
"Modified: / 05-12-2009 / 14:15:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
951 |
! |
|
952 |
||
953 |
change |
|
954 |
^ change |
|
955 |
! |
|
956 |
||
957 |
change:aChange |
|
958 |
self assert: ((aChange isKindOf: Change) or:[aChange isKindOf: RefactoryChange]). |
|
959 |
change := aChange. |
|
960 |
||
961 |
"Modified: / 25-07-2009 / 23:40:38 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
12125 | 962 |
"Modified (format): / 04-12-2011 / 14:58:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 963 |
! |
964 |
||
965 |
changeClass |
|
966 |
||
967 |
^change changeClass |
|
968 |
! |
|
969 |
||
10334 | 970 |
changeSource |
971 |
||
972 |
^change changeSource |
|
973 |
||
974 |
"Created: / 19-07-2011 / 12:03:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
975 |
! |
|
976 |
||
10009 | 977 |
children |
978 |
||
12125 | 979 |
children isNil ifTrue:[ |
980 |
change isCompositeChange ifTrue:[ |
|
981 |
children := OrderedCollection new: change changes size. |
|
982 |
change changes do:[:chg| |
|
983 |
((self application showRemovedHolder value or:[ chg removed not ]) |
|
984 |
and:[self application showSameHolder value or:[chg delta ~~ #=]]) |
|
985 |
ifTrue:[ |
|
986 |
children add: ((self application listEntryFor: chg) parent: self) |
|
987 |
] |
|
988 |
]. |
|
989 |
] ifFalse:[ |
|
990 |
children := #() |
|
991 |
] |
|
992 |
]. |
|
10009 | 993 |
^children |
994 |
||
995 |
"Created: / 25-07-2009 / 23:32:39 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
12125 | 996 |
"Modified (format): / 18-11-2011 / 14:56:25 / cg" |
997 |
"Modified: / 04-12-2011 / 15:08:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10009 | 998 |
! |
999 |
||
1000 |
delta |
|
12125 | 1001 |
"/ obsolete: please use deltaDetail |
10009 | 1002 |
|
1003 |
^change delta |
|
1004 |
||
1005 |
"Created: / 29-10-2010 / 14:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12125 | 1006 |
"Modified (comment): / 31-08-2011 / 10:30:02 / cg" |
1007 |
! |
|
1008 |
||
1009 |
deltaDetail |
|
1010 |
||
1011 |
^change deltaDetail |
|
1012 |
||
1013 |
"Created: / 29-10-2010 / 14:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1014 |
"Created: / 31-08-2011 / 10:29:21 / cg" |
|
10009 | 1015 |
! |
1016 |
||
1017 |
iconDelta |
|
1018 |
||
1019 |
| iconSelector | |
|
1020 |
iconSelector := self iconSelector. |
|
12125 | 1021 |
iconSelector isNil ifTrue:[^nil]. |
10009 | 1022 |
self removed ifTrue:[iconSelector := iconSelector , #Grayed]. |
1023 |
^self application class perform: iconSelector asSymbol. |
|
1024 |
||
1025 |
"Created: / 05-12-2009 / 14:11:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12125 | 1026 |
"Modified: / 18-11-2011 / 14:56:33 / cg" |
10009 | 1027 |
! |
1028 |
||
1029 |
iconRemoved |
|
1030 |
||
1031 |
^self removed |
|
1032 |
ifTrue: [self application class uncheckedIcon ] |
|
1033 |
ifFalse:[self application class checkedIcon ] |
|
1034 |
||
1035 |
"Created: / 05-12-2009 / 14:11:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1036 |
! |
|
1037 |
||
10334 | 1038 |
imageSource |
1039 |
||
1040 |
^change imageSource |
|
1041 |
||
1042 |
"Created: / 19-07-2011 / 12:03:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1043 |
! |
|
1044 |
||
10009 | 1045 |
label |
1046 |
||
1047 |
| label | |
|
1048 |
label := change displayString. |
|
1049 |
self removed ifTrue:[label := label asText colorizeAllWith: Color gray]. |
|
1050 |
^label |
|
1051 |
||
1052 |
"Created: / 05-11-2008 / 08:20:02 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1053 |
"Modified: / 25-07-2009 / 23:43:23 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1054 |
"Modified: / 05-12-2009 / 14:46:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
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 |
|
1077 |
||
1078 |
| cx icon | |
|
1079 |
cx := x := newX. |
|
12125 | 1080 |
self application allowRemoveHolder value ifTrue: |
10009 | 1081 |
[(icon := self iconRemoved) ifNotNil: |
1082 |
[icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2) ]. |
|
1083 |
cx := cx + 22."experimental value - this looks good"]. |
|
1084 |
(icon := self iconDelta) ifNotNil: |
|
1085 |
[icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2) ]. |
|
1086 |
cx := cx + 16."12 + 2px gap" |
|
1087 |
||
1088 |
||
1089 |
super displayLabel:aLabel h:lH on:aGC x:cx y:y h:h |
|
1090 |
||
12125 | 1091 |
"Modified: / 24-01-2012 / 21:44:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10009 | 1092 |
! ! |
1093 |
||
1094 |
!ChangeList::ListEntry methodsFor:'private'! |
|
1095 |
||
1096 |
iconSelector |
|
12125 | 1097 |
| delta | |
10657 | 1098 |
|
12125 | 1099 |
delta := change deltaDetail. |
1100 |
delta shortDeltaSymbol = #+ ifTrue:[^#iconPlus]. |
|
1101 |
delta shortDeltaSymbol = #- ifTrue:[^#iconMinus]. |
|
1102 |
delta shortDeltaSymbol = #= ifTrue:[^#iconEqual]. |
|
1103 |
||
1104 |
^ nil. |
|
10957 | 1105 |
|
12125 | 1106 |
"Modified: / 31-08-2011 / 10:39:32 / cg" |
1107 |
! ! |
|
1108 |
||
1109 |
!ChangeList::ListEntry methodsFor:'protocol-queries'! |
|
1110 |
||
1111 |
hasChildren |
|
1112 |
||
1113 |
^ change isCompositeChange and:[change changes notEmptyOrNil ]. |
|
1114 |
||
1115 |
"Created: / 04-12-2011 / 14:45:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10957 | 1116 |
! ! |
1117 |
||
10009 | 1118 |
!ChangeList class methodsFor:'documentation'! |
1119 |
||
10451 | 1120 |
version |
12214
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
1121 |
^ '$Id: Tools__ChangeList.st 7961 2012-03-31 00:16:30Z vranyj1 $' |
10451 | 1122 |
! |
1123 |
||
10009 | 1124 |
version_CVS |
12166 | 1125 |
^ '§Header: /cvs/stx/stx/libtool/Tools__ChangeList.st,v 1.14 2012/02/08 13:55:55 cg Exp §' |
10009 | 1126 |
! |
1127 |
||
1128 |
version_SVN |
|
12214
4b7eedbab2a7
- ChangeSetBrowser2: scroll to bottom after opening a changeset
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12213
diff
changeset
|
1129 |
^ '$Id: Tools__ChangeList.st 7961 2012-03-31 00:16:30Z vranyj1 $' |
12125 | 1130 |
! ! |