author | Jan Vrany <jan.vrany@labware.com> |
Mon, 06 Mar 2023 15:22:35 +0000 | |
branch | jv |
changeset 19642 | cba345697a7d |
parent 18226 | 346376844040 |
permissions | -rw-r--r-- |
10008 | 1 |
" |
10063 | 2 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
18226 | 3 |
COPYRIGHT (c) 2015 Jan Vrany |
10063 | 4 |
All Rights Reserved |
10008 | 5 |
|
10063 | 6 |
Permission is hereby granted, free of charge, to any person |
7 |
obtaining a copy of this software and associated documentation |
|
8 |
files (the 'Software'), to deal in the Software without |
|
9 |
restriction, including without limitation the rights to use, |
|
10 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
11 |
copies of the Software, and to permit persons to whom the |
|
12 |
Software is furnished to do so, subject to the following |
|
13 |
conditions: |
|
14 |
||
15 |
The above copyright notice and this permission notice shall be |
|
16 |
included in all copies or substantial portions of the Software. |
|
17 |
||
18 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
19 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
20 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
21 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
22 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
23 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
24 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
25 |
OTHER DEALINGS IN THE SOFTWARE. |
|
10008 | 26 |
" |
27 |
"{ Package: 'stx:libtool' }" |
|
28 |
||
29 |
"{ NameSpace: Tools }" |
|
30 |
||
31 |
ChangeList subclass:#HierarchicalChangeList |
|
32 |
instanceVariableNames:'' |
|
33 |
classVariableNames:'' |
|
34 |
poolDictionaries:'' |
|
35 |
category:'Interface-Browsers-ChangeSet' |
|
36 |
! |
|
37 |
||
38 |
!HierarchicalChangeList class methodsFor:'documentation'! |
|
39 |
||
40 |
copyright |
|
41 |
" |
|
10063 | 42 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
18226 | 43 |
COPYRIGHT (c) 2015 Jan Vrany |
10063 | 44 |
All Rights Reserved |
45 |
||
46 |
Permission is hereby granted, free of charge, to any person |
|
47 |
obtaining a copy of this software and associated documentation |
|
48 |
files (the 'Software'), to deal in the Software without |
|
49 |
restriction, including without limitation the rights to use, |
|
50 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
51 |
copies of the Software, and to permit persons to whom the |
|
52 |
Software is furnished to do so, subject to the following |
|
53 |
conditions: |
|
10008 | 54 |
|
10063 | 55 |
The above copyright notice and this permission notice shall be |
56 |
included in all copies or substantial portions of the Software. |
|
57 |
||
58 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
59 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
60 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
61 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
62 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
63 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
64 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
65 |
OTHER DEALINGS IN THE SOFTWARE. |
|
10008 | 66 |
" |
67 |
! ! |
|
68 |
||
69 |
!HierarchicalChangeList class methodsFor:'interface specs'! |
|
70 |
||
71 |
windowSpec |
|
72 |
"This resource specification was automatically generated |
|
73 |
by the UIPainter of ST/X." |
|
74 |
||
10976 | 75 |
|
10008 | 76 |
"Do not manually edit this!! If it is corrupted, |
77 |
the UIPainter may not be able to read the specification." |
|
78 |
||
79 |
" |
|
80 |
UIPainter new openOnClass:Tools::HierarchicalChangeList andSelector:#windowSpec |
|
81 |
Tools::HierarchicalChangeList new openInterface:#windowSpec |
|
82 |
Tools::HierarchicalChangeList open |
|
83 |
" |
|
84 |
||
85 |
<resource: #canvas> |
|
86 |
||
87 |
^ |
|
88 |
#(FullSpec |
|
89 |
name: windowSpec |
|
90 |
window: |
|
91 |
(WindowSpec |
|
92 |
label: 'ChangeList' |
|
93 |
name: 'ChangeList' |
|
94 |
min: (Point 10 10) |
|
95 |
bounds: (Rectangle 0 0 300 300) |
|
96 |
) |
|
97 |
component: |
|
98 |
(SpecCollection |
|
99 |
collection: ( |
|
100 |
(HierarchicalListViewSpec |
|
10447 | 101 |
name: 'List' |
10008 | 102 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
103 |
model: selectionHolder |
|
10447 | 104 |
menu: menuHolder |
10008 | 105 |
hasHorizontalScrollBar: true |
106 |
hasVerticalScrollBar: true |
|
107 |
listModel: listHolder |
|
108 |
multipleSelectOk: true |
|
109 |
useIndex: false |
|
110 |
highlightMode: line |
|
111 |
showLines: false |
|
112 |
useDefaultIcons: false |
|
10940 | 113 |
postBuildCallback: postBuildListView: |
10008 | 114 |
) |
10976 | 115 |
(InputFieldSpec |
116 |
name: 'Filter' |
|
117 |
layout: (LayoutFrame 0 0 0 0 0 1 26 0) |
|
118 |
initiallyInvisible: true |
|
119 |
model: filterPatternHolder |
|
120 |
immediateAccept: true |
|
121 |
acceptOnLeave: false |
|
122 |
acceptOnReturn: false |
|
123 |
acceptOnTab: false |
|
124 |
acceptOnPointerLeave: false |
|
125 |
emptyFieldReplacementText: 'Search Filter...' |
|
126 |
usePreferredHeight: true |
|
127 |
useDynamicPreferredHeight: true |
|
128 |
postBuildCallback: postBuildFilterView: |
|
129 |
) |
|
10008 | 130 |
) |
131 |
||
132 |
) |
|
133 |
) |
|
10940 | 134 |
|
10976 | 135 |
"Modified: / 20-12-2011 / 10:31:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
136 |
"Modified (format): / 20-12-2011 / 16:20:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10008 | 137 |
! ! |
138 |
||
139 |
!HierarchicalChangeList methodsFor:'aspects'! |
|
140 |
||
141 |
listHolder |
|
142 |
"return/create the 'changeList' value holder (automatically generated)" |
|
143 |
||
144 |
listHolder isNil ifTrue:[ |
|
145 |
listHolder := (HierarchicalList new) |
|
146 |
showRoot:false; |
|
147 |
application: self; |
|
148 |
yourself |
|
149 |
]. |
|
150 |
^ listHolder |
|
151 |
||
152 |
"Created: / 25-07-2009 / 23:34:54 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
153 |
! ! |
|
154 |
||
13868 | 155 |
!HierarchicalChangeList methodsFor:'event processing'! |
156 |
||
157 |
buttonPress:button x:x y:y view:aView |
|
158 |
||
159 |
| itemIndex item | |
|
160 |
||
161 |
button ~= 1 ifTrue:[^aView buttonPress:button x:x y:y]. |
|
162 |
||
163 |
itemIndex := aView yVisibleToLineNr:y. |
|
164 |
itemIndex isNil ifTrue:[^self]. |
|
165 |
itemIndex == 0 ifTrue:[^self]. |
|
166 |
itemIndex > aView list size ifTrue:[^self]. |
|
167 |
item := aView list at: itemIndex. |
|
168 |
||
169 |
((aView left + x) between: (item x) and: ((item x ? 0) + 16)) |
|
170 |
ifFalse:[^aView buttonPress:button x:x y:y]. |
|
171 |
||
172 |
item removed: item removed not. |
|
173 |
aView invalidate |
|
174 |
||
175 |
"Created: / 08-12-2009 / 14:12:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
176 |
"Modified: / 18-11-2011 / 14:55:41 / cg" |
|
177 |
"Modified: / 26-07-2012 / 18:21:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
178 |
! |
|
179 |
||
180 |
handlesButtonPress:button inView:aView |
|
14198
898013d21cc8
Fixed deleting/undeleting items by clicking to check box.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13868
diff
changeset
|
181 |
^ listView scrolledView == aView |
13868 | 182 |
|
183 |
"Created: / 08-12-2009 / 14:08:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
14198
898013d21cc8
Fixed deleting/undeleting items by clicking to check box.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13868
diff
changeset
|
184 |
"Modified (format): / 10-04-2014 / 11:23:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13868 | 185 |
! ! |
186 |
||
10008 | 187 |
!HierarchicalChangeList methodsFor:'private'! |
188 |
||
13868 | 189 |
listColumn: columnId visible: visible |
190 |
"Nothing to do here" |
|
191 |
||
192 |
"Created: / 26-07-2012 / 18:42:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
193 |
! |
|
194 |
||
195 |
listColumnHide: columnId |
|
196 |
"Nothing to do here" |
|
197 |
||
198 |
"Created: / 26-07-2012 / 18:42:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
199 |
! |
|
200 |
||
201 |
listColumnShow: columnId |
|
202 |
"Nothing to do here" |
|
203 |
||
204 |
"Created: / 26-07-2012 / 18:43:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
205 |
! |
|
206 |
||
15806
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
207 |
redrawListItemAt: index |
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
208 |
listView notNil ifTrue:[ |
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
209 |
index ~~ 0 ifTrue:[ |
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
210 |
listView invalidateLineAt:index. |
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
211 |
]. |
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
212 |
] |
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
213 |
|
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
214 |
"Created: / 20-08-2015 / 16:19:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
215 |
! |
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
216 |
|
10008 | 217 |
updateList |
218 |
|inGenerator changeset root| |
|
219 |
||
220 |
inGenerator := self inGeneratorHolder value. |
|
221 |
changeset := inGenerator ifNil:[ #() ] ifNotNil:[ inGenerator ]. |
|
10958 | 222 |
root := self listEntryFor: (CompositeChange name:'Change set' changes:changeset). |
10008 | 223 |
root children do:[:e|e expand]. |
224 |
||
225 |
self listHolder root:root |
|
10958 | 226 |
|
227 |
"Modified: / 04-12-2011 / 15:13:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10008 | 228 |
! ! |
229 |
||
230 |
!HierarchicalChangeList class methodsFor:'documentation'! |
|
231 |
||
232 |
version_CVS |
|
14198
898013d21cc8
Fixed deleting/undeleting items by clicking to check box.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13868
diff
changeset
|
233 |
^ '$Header: /cvs/stx/stx/libtool/Tools__HierarchicalChangeList.st,v 1.9 2014-04-10 09:59:55 vrany Exp $' |
10008 | 234 |
! |
235 |
||
15806
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
236 |
version_HG |
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
237 |
|
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
238 |
^ '$Changeset: <not expanded> $' |
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
239 |
! |
c1236b466d85
Bugfix: fixed DNU when redraw was forced in hierarchical change list.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
240 |
|
10008 | 241 |
version_SVN |
14198
898013d21cc8
Fixed deleting/undeleting items by clicking to check box.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13868
diff
changeset
|
242 |
^ '$Id: Tools__HierarchicalChangeList.st,v 1.9 2014-04-10 09:59:55 vrany Exp $' |
10008 | 243 |
! ! |
13868 | 244 |