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