author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 05 Mar 2014 19:29:36 +0100 | |
changeset 14114 | 105a8c3f4e69 |
parent 14021 | ff0b42e2c251 |
child 14144 | 9bcb9fef21b6 |
permissions | -rw-r--r-- |
5591 | 1 |
" |
2 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
5592 | 12 |
"{ Package: 'stx:libtool' }" |
5591 | 13 |
|
14 |
"{ NameSpace: Tools }" |
|
15 |
||
16 |
BrowserList subclass:#VariableList |
|
10255 | 17 |
instanceVariableNames:'variableList classHolder showClassVars sortVariablesByName |
18 |
selectedVariableEntries showWarningAboutMissingEntryInXmlSpec' |
|
5591 | 19 |
classVariableNames:'' |
20 |
poolDictionaries:'' |
|
21 |
category:'Interface-Browsers-New' |
|
22 |
! |
|
23 |
||
10255 | 24 |
Object subclass:#VariableEntry |
13382 | 25 |
instanceVariableNames:'label application class name type icon sortingByNameHolder' |
10255 | 26 |
classVariableNames:'' |
27 |
poolDictionaries:'' |
|
28 |
privateIn:VariableList |
|
29 |
! |
|
30 |
||
5591 | 31 |
!VariableList class methodsFor:'documentation'! |
32 |
||
33 |
copyright |
|
34 |
" |
|
35 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
36 |
All Rights Reserved |
|
37 |
||
38 |
This software is furnished under a license and may be used |
|
39 |
only in accordance with the terms of that license and with the |
|
40 |
inclusion of the above copyright notice. This software may not |
|
41 |
be provided or otherwise made available to, or used by, any |
|
42 |
other person. No title to or ownership of the software is |
|
43 |
hereby transferred. |
|
44 |
" |
|
11878 | 45 |
! |
46 |
||
47 |
documentation |
|
48 |
" |
|
49 |
I implement the variable list (below class list) in the new system browser |
|
50 |
" |
|
5591 | 51 |
! ! |
52 |
||
53 |
!VariableList class methodsFor:'interface specs'! |
|
54 |
||
55 |
windowSpec |
|
56 |
"This resource specification was automatically generated |
|
57 |
by the UIPainter of ST/X." |
|
58 |
||
59 |
"Do not manually edit this!! If it is corrupted, |
|
60 |
the UIPainter may not be able to read the specification." |
|
61 |
||
62 |
" |
|
10287 | 63 |
UIPainter new openOnClass:Tools::VariableList andSelector:#windowSpec |
64 |
Tools::VariableList new openInterface:#windowSpec |
|
65 |
Tools::VariableList open |
|
5591 | 66 |
" |
67 |
||
68 |
<resource: #canvas> |
|
69 |
||
70 |
^ |
|
10287 | 71 |
#(FullSpec |
72 |
name: windowSpec |
|
73 |
window: |
|
74 |
(WindowSpec |
|
75 |
label: 'VariableList' |
|
76 |
name: 'VariableList' |
|
77 |
min: (Point 0 0) |
|
78 |
bounds: (Rectangle 0 0 300 300) |
|
9461 | 79 |
) |
10287 | 80 |
component: |
81 |
(SpecCollection |
|
82 |
collection: ( |
|
83 |
(SequenceViewSpec |
|
84 |
name: 'List' |
|
85 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
86 |
tabable: true |
|
87 |
model: selectedVariableEntries |
|
88 |
menu: menuHolder |
|
89 |
hasHorizontalScrollBar: true |
|
90 |
hasVerticalScrollBar: true |
|
91 |
miniScrollerHorizontal: true |
|
92 |
isMultiSelect: true |
|
93 |
valueChangeSelector: selectionChangedByClick |
|
94 |
useIndex: false |
|
95 |
sequenceList: variableList |
|
96 |
doubleClickChannel: doubleClickChannel |
|
9461 | 97 |
) |
98 |
) |
|
5591 | 99 |
|
9461 | 100 |
) |
5591 | 101 |
) |
102 |
! ! |
|
103 |
||
104 |
!VariableList class methodsFor:'plugIn spec'! |
|
105 |
||
106 |
aspectSelectors |
|
107 |
"This resource specification was automatically generated |
|
108 |
by the UIPainter of ST/X." |
|
109 |
||
110 |
"Do not manually edit this. If it is corrupted, |
|
111 |
the UIPainter may not be able to read the specification." |
|
112 |
||
113 |
"Return a description of exported aspects; |
|
114 |
these can be connected to aspects of an embedding application |
|
115 |
(if this app is embedded in a subCanvas)." |
|
116 |
||
117 |
^ #( |
|
14021
ff0b42e2c251
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13827
diff
changeset
|
118 |
environmentHolder |
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
119 |
#(#doubleClickChannel #action ) |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
120 |
#classHolder |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
121 |
#forceGeneratorTrigger |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
122 |
#immediateUpdate |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
123 |
#inGeneratorHolder |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
124 |
#menuHolder |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
125 |
#outGeneratorHolder |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
126 |
#packageFilter |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
127 |
#selectedVariables |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
128 |
#selectionChangeCondition |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
129 |
#updateTrigger |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
130 |
#showClassVarsInVariableList |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
131 |
#slaveMode |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
132 |
#sortVariablesByName |
5591 | 133 |
). |
14021
ff0b42e2c251
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13827
diff
changeset
|
134 |
|
ff0b42e2c251
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13827
diff
changeset
|
135 |
"Modified: / 24-02-2014 / 10:37:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5591 | 136 |
! ! |
137 |
||
138 |
!VariableList methodsFor:'aspects'! |
|
139 |
||
140 |
classHolder |
|
141 |
classHolder isNil ifTrue:[ |
|
142 |
classHolder := #() asValue. |
|
143 |
classHolder addDependent:self |
|
144 |
]. |
|
145 |
^ classHolder |
|
146 |
! |
|
147 |
||
148 |
classHolder:aValueHolder |
|
149 |
classHolder notNil ifTrue:[ |
|
10308 | 150 |
classHolder removeDependent:self |
5591 | 151 |
]. |
152 |
classHolder := aValueHolder. |
|
153 |
classHolder notNil ifTrue:[ |
|
10308 | 154 |
classHolder isBehavior ifTrue:[self error:'should not happen']. |
155 |
classHolder addDependent:self |
|
5591 | 156 |
]. |
10308 | 157 |
|
158 |
"Modified: / 11-07-2011 / 17:04:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5591 | 159 |
! |
160 |
||
161 |
defaultSlaveModeValue |
|
162 |
^ false. |
|
163 |
! |
|
164 |
||
10255 | 165 |
selectedVariableEntries |
166 |
<resource: #uiAspect> |
|
167 |
||
168 |
"automatically generated by UIPainter ..." |
|
169 |
||
170 |
"*** the code below creates a default model when invoked." |
|
171 |
"*** (which may not be the one you wanted)" |
|
172 |
"*** Please change as required and accept it in the browser." |
|
173 |
"*** (and replace this comment by something more useful ;-)" |
|
174 |
||
175 |
selectedVariableEntries isNil ifTrue:[ |
|
176 |
selectedVariableEntries := #() asValue. |
|
177 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
178 |
selectedVariableEntries addDependent:self. |
|
179 |
"/ selectedVariableEntries onChangeSend:#selectedVariableEntriesChanged to:self. |
|
180 |
]. |
|
181 |
^ selectedVariableEntries. |
|
182 |
||
183 |
"Modified: / 12-04-2011 / 15:49:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
184 |
! |
|
185 |
||
5591 | 186 |
selectedVariables |
187 |
^ self selectionHolder |
|
188 |
||
189 |
! |
|
190 |
||
191 |
selectedVariables:aValueHolder |
|
192 |
^ self selectionHolder:aValueHolder |
|
193 |
||
194 |
! |
|
195 |
||
196 |
showClassVarsInVariableList |
|
197 |
showClassVars isNil ifTrue:[ |
|
198 |
showClassVars := false asValue. |
|
199 |
showClassVars addDependent:self |
|
200 |
]. |
|
201 |
^ showClassVars |
|
202 |
! |
|
203 |
||
204 |
showClassVarsInVariableList:aValueHolder |
|
205 |
showClassVars notNil ifTrue:[ |
|
206 |
showClassVars removeDependent:self |
|
207 |
]. |
|
208 |
showClassVars := aValueHolder. |
|
209 |
showClassVars notNil ifTrue:[ |
|
210 |
showClassVars addDependent:self |
|
211 |
]. |
|
212 |
! |
|
213 |
||
214 |
showingInheritedClassVars |
|
215 |
^ false |
|
216 |
"/ ^ true |
|
217 |
! |
|
218 |
||
219 |
sortVariablesByName |
|
220 |
sortVariablesByName isNil ifTrue:[ |
|
221 |
sortVariablesByName := false asValue. |
|
222 |
sortVariablesByName addDependent:self |
|
223 |
]. |
|
224 |
^ sortVariablesByName |
|
225 |
! |
|
226 |
||
227 |
sortVariablesByName:aValueHolder |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
228 |
"/ self assert:(aValueHolder value isBoolean). |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
229 |
|
5591 | 230 |
sortVariablesByName notNil ifTrue:[ |
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
231 |
sortVariablesByName removeDependent:self |
5591 | 232 |
]. |
233 |
sortVariablesByName := aValueHolder. |
|
234 |
sortVariablesByName notNil ifTrue:[ |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
235 |
sortVariablesByName addDependent:self |
5591 | 236 |
]. |
237 |
! |
|
238 |
||
239 |
variableList |
|
240 |
variableList isNil ifTrue:[ |
|
241 |
variableList := ValueHolder new |
|
242 |
]. |
|
243 |
^ variableList |
|
244 |
||
245 |
||
246 |
! ! |
|
247 |
||
248 |
!VariableList methodsFor:'change & update'! |
|
249 |
||
250 |
delayedUpdate:something with:aParameter from:changedObject |
|
251 |
|selectedClasses changedClass anyChange| |
|
252 |
||
253 |
self inSlaveModeOrInvisible ifTrue:[self invalidateList. ^ self]. |
|
254 |
||
255 |
changedObject == slaveMode ifTrue:[ |
|
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
256 |
listValid ~~ true ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
257 |
self enqueueDelayedUpdateList |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
258 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
259 |
"/ self invalidateList. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
260 |
^ self |
5591 | 261 |
]. |
262 |
||
263 |
changedObject == classHolder ifTrue:[ |
|
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
264 |
self invalidateList. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
265 |
^ self |
5591 | 266 |
]. |
267 |
changedObject == showClassVars ifTrue:[ |
|
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
268 |
self invalidateList. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
269 |
^ self. |
5591 | 270 |
]. |
271 |
changedObject == sortVariablesByName ifTrue:[ |
|
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
272 |
self invalidateList. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
273 |
^ self. |
5591 | 274 |
]. |
13498
b8d845e42988
Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13458
diff
changeset
|
275 |
changedObject == environment ifTrue:[ |
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
276 |
(something == #projectOrganization) ifTrue:[^ self]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
277 |
(something == #currentChangeSet) ifTrue:[^ self]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
278 |
(something == #aboutToAutoloadClass) ifTrue:[^ self]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
279 |
|
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
280 |
(something == #classDefinition |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
281 |
or:[ (something == #newClass) |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
282 |
or:[ something == #classVariables and:[showClassVars value == true]]]) |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
283 |
ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
284 |
changedClass := aParameter. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
285 |
selectedClasses := classHolder value. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
286 |
selectedClasses notNil ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
287 |
selectedClasses isSequenceable ifFalse:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
288 |
selectedClasses := selectedClasses asOrderedCollection |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
289 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
290 |
selectedClasses keysAndValuesDo:[:idx :cls | |nm| |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
291 |
cls notNil ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
292 |
cls isObsolete ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
293 |
cls isMeta ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
294 |
nm := cls theNonMetaclass name. |
13498
b8d845e42988
Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13458
diff
changeset
|
295 |
selectedClasses at:idx put:(environment at:nm) class. |
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
296 |
] ifFalse:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
297 |
nm := cls name. |
13498
b8d845e42988
Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13458
diff
changeset
|
298 |
selectedClasses at:idx put:(environment at:nm). |
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
299 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
300 |
anyChange := true. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
301 |
] ifFalse:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
302 |
(cls == aParameter |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
303 |
or:[something == #classVariables |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
304 |
and:[showClassVars value == true |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
305 |
and:[cls theNonMetaclass == aParameter theNonMetaclass]]]) ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
306 |
anyChange := true. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
307 |
] |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
308 |
] |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
309 |
] |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
310 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
311 |
(selectedClasses includes:nil) ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
312 |
"/ can happen, if a selected class is removed... |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
313 |
"/ self halt:'should this happen ?'. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
314 |
"/ fix it ... |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
315 |
selectedClasses := selectedClasses select:[:each | each notNil]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
316 |
classHolder value:selectedClasses. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
317 |
anyChange := true. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
318 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
319 |
anyChange == true ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
320 |
self invalidateList. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
321 |
^ self |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
322 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
323 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
324 |
^ self |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
325 |
]. |
5591 | 326 |
] ifFalse:[ |
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
327 |
changedObject isBehavior ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
328 |
anyChange := false. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
329 |
selectedClasses := classHolder value. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
330 |
selectedClasses notNil ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
331 |
selectedClasses keysAndValuesDo:[:idx :cls | |nm| |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
332 |
cls isObsolete ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
333 |
nm := cls name. |
13498
b8d845e42988
Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13458
diff
changeset
|
334 |
selectedClasses at:idx put:(environment at:nm). |
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
335 |
anyChange := true. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
336 |
] |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
337 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
338 |
anyChange == true ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
339 |
self invalidateList. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
340 |
^ self |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
341 |
]. |
5591 | 342 |
|
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
343 |
(selectedClasses includesIdentical:something) ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
344 |
self invalidateList. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
345 |
^ self |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
346 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
347 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
348 |
^ self |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
349 |
]. |
5591 | 350 |
]. |
351 |
super delayedUpdate:something with:aParameter from:changedObject |
|
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
352 |
|
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
353 |
"Modified: / 01-03-2012 / 09:18:11 / cg" |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
354 |
! |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
355 |
|
5591 | 356 |
makeDependent |
13498
b8d845e42988
Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13458
diff
changeset
|
357 |
environment addDependent:self |
5591 | 358 |
|
359 |
! |
|
360 |
||
361 |
makeIndependent |
|
13498
b8d845e42988
Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13458
diff
changeset
|
362 |
environment removeDependent:self |
5591 | 363 |
|
364 |
! |
|
365 |
||
366 |
selectionChangedByClick |
|
367 |
"we are not interested in that - get another notification |
|
368 |
via the changed valueHolder" |
|
369 |
||
370 |
||
371 |
! |
|
372 |
||
373 |
update:something with:aParameter from:changedObject |
|
374 |
"/ ^ self delayedUpdate:something with:aParameter from:changedObject. |
|
375 |
||
13498
b8d845e42988
Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13458
diff
changeset
|
376 |
changedObject == environment ifTrue:[ |
10255 | 377 |
something == #methodDictionary ifTrue:[ |
378 |
^ self |
|
379 |
]. |
|
380 |
something == #methodTrap ifTrue:[ |
|
381 |
^ self |
|
382 |
]. |
|
10366 | 383 |
something == #methodCoverageInfo ifTrue:[ |
384 |
^ self |
|
385 |
]. |
|
10255 | 386 |
something == #methodInClass ifTrue:[ |
387 |
^ self |
|
388 |
]. |
|
389 |
something == #methodInClassRemoved ifTrue:[ |
|
390 |
^ self |
|
391 |
]. |
|
392 |
something == #classComment ifTrue:[ |
|
393 |
^ self. |
|
394 |
]. |
|
5591 | 395 |
]. |
396 |
"/ self window sensor isNil ifTrue:[ |
|
397 |
"/ "/ I am not visible ... |
|
398 |
"/ self invalidateList. |
|
399 |
"/ ^ self |
|
400 |
"/ ]. |
|
10255 | 401 |
changedObject == selectedVariableEntries ifTrue:[ |
402 |
self selectedVariables value: |
|
403 |
((selectedVariableEntries value ? #()) |
|
404 |
collect:[:e|e name]). |
|
405 |
^self. |
|
406 |
]. |
|
407 |
||
408 |
||
5591 | 409 |
super update:something with:aParameter from:changedObject |
410 |
||
10255 | 411 |
"Modified: / 12-04-2011 / 15:54:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10366 | 412 |
"Modified: / 20-07-2011 / 18:52:44 / cg" |
5591 | 413 |
! ! |
414 |
||
415 |
!VariableList methodsFor:'generators'! |
|
416 |
||
417 |
makeGenerator |
|
418 |
||
419 |
||
420 |
||
421 |
! ! |
|
422 |
||
423 |
!VariableList methodsFor:'private'! |
|
424 |
||
5909 | 425 |
commonPostBuild |
5591 | 426 |
|list| |
427 |
||
5909 | 428 |
super commonPostBuild. |
5591 | 429 |
|
5909 | 430 |
list := builder componentAt:#List. |
5591 | 431 |
list notNil ifTrue:[ |
5909 | 432 |
list selectConditionBlock:[:item | self selectionChangeAllowed:item]. |
433 |
list ignoreReselect:false. |
|
5591 | 434 |
]. |
435 |
! |
|
436 |
||
437 |
commonSubClassIn:classes |
|
438 |
"return true if there is a common subclass" |
|
439 |
||
440 |
|theCommonSubClass "classesByInheritance"| |
|
441 |
||
442 |
theCommonSubClass := nil. |
|
443 |
classes do:[:eachClass | |
|
444 |
theCommonSubClass isNil ifTrue:[ |
|
445 |
theCommonSubClass := eachClass |
|
446 |
] ifFalse:[ |
|
447 |
(eachClass isSubclassOf:theCommonSubClass) ifTrue:[ |
|
448 |
theCommonSubClass := eachClass |
|
449 |
] ifFalse:[ |
|
450 |
(theCommonSubClass isSubclassOf:eachClass) ifFalse:[ |
|
451 |
^ nil |
|
452 |
] |
|
453 |
] |
|
454 |
] |
|
455 |
]. |
|
456 |
^ theCommonSubClass. |
|
457 |
||
458 |
"/ classesByInheritance := classes topologicalSort:[:a :b | a isSubclassOf:b]. |
|
459 |
"/ classesByInheritance keysAndValuesDo:[:index :eachClass | |
|
460 |
"/ "/ all classes after that one must be superclasses ... |
|
461 |
"/ classesByInheritance from:index+1 to:classesByInheritance size do:[:otherClass | |
|
462 |
"/ (eachClass isSubclassOf:otherClass) ifFalse:[ |
|
463 |
"/ ^ nil. |
|
464 |
"/ ] |
|
465 |
"/ ]. |
|
466 |
"/ ]. |
|
467 |
"/ ^ classesByInheritance first |
|
468 |
! |
|
469 |
||
10324
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
470 |
iconInBrowserForVariable:varName in:aClass |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
471 |
"variables for which an entry is found in the xml-spec (if any) are marked |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
472 |
with an <xml>-icon." |
10255 | 473 |
|
10324
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
474 |
(Expecco::ExpeccoXMLDecoder notNil |
11586 | 475 |
and:[aClass canUnderstand: #xmlSpecForObject:]) ifTrue:[ |
10324
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
476 |
Error handle:[:ex | |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
477 |
] do:[ |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
478 |
(Expecco::ExpeccoXMLDecoder xmlSpecForObject:aClass basicNew) |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
479 |
do:[:spec | spec getter = varName ifTrue:[ |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
480 |
^ SystemBrowser instVarOverlayXmlSpec |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
481 |
] |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
482 |
]. |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
483 |
]. |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
484 |
]. |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
485 |
^ nil |
10255 | 486 |
|
487 |
"Created: / 12-04-2011 / 19:58:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10324
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
488 |
"Modified: / 15-07-2011 / 18:32:47 / cg" |
11586 | 489 |
"Modified: / 22-06-2012 / 13:17:28 / sr" |
10255 | 490 |
! |
491 |
||
492 |
listEntryForClass: cls name:name |
|
493 |
||
494 |
" (showWarningAboutMissingEntryInXmlSpec not |
|
495 |
and:[Expecco::ExpeccoXMLDecoder notNil |
|
496 |
and:[cls canUnderstand: #xmlSpecFor:]]) ifTrue: |
|
497 |
[| hasSpecEntry | |
|
498 |
hasSpecEntry := false. |
|
499 |
(Expecco::ExpeccoXMLDecoder xmlSpecForObject:cls basicNew) |
|
500 |
do:[:spec|spec getter = name ifTrue: |
|
501 |
[ |
|
502 |
hasSpecEntry := true]]. |
|
503 |
showWarningAboutMissingEntryInXmlSpec := hasSpecEntry not]. " |
|
504 |
||
13382 | 505 |
|entry| |
506 |
||
507 |
entry := VariableEntry application: self class: cls name: name. |
|
508 |
entry sortingByNameHolder:sortVariablesByName. |
|
509 |
^ entry |
|
10255 | 510 |
|
511 |
"Created: / 12-04-2011 / 15:41:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
512 |
"Modified: / 12-04-2011 / 21:36:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
513 |
! |
|
514 |
||
10974 | 515 |
listEntryForClass: cls name:name info: classInfo |
516 |
||
517 |
| nm entry | |
|
518 |
||
519 |
nm := name. |
|
520 |
entry := Tools::VariableList::VariableEntry application: self class: cls name: nm. |
|
13382 | 521 |
entry sortingByNameHolder:sortVariablesByName. |
10974 | 522 |
classInfo notNil ifTrue:[ |
523 |
entry type: (classInfo infoForInstvarOrNil: name). |
|
524 |
]. |
|
525 |
^entry |
|
526 |
||
527 |
"Created: / 27-11-2011 / 17:17:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13827 | 528 |
"Modified: / 07-10-2013 / 08:28:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10974 | 529 |
! |
530 |
||
5591 | 531 |
listOfVariables |
10974 | 532 |
|
13155 | 533 |
|nameList numClasses classes class commonSubclass commonSuperclass showingClassVars |
10974 | 534 |
sortByName classesAlreadyProcessed hasSmallSense smallSenseManager info | |
5591 | 535 |
|
536 |
classHolder isNil ifTrue:[ |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
537 |
"/ testing |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
538 |
^ #() |
5591 | 539 |
]. |
540 |
||
13458
842c7f563bd5
class: Tools::VariableList
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13457
diff
changeset
|
541 |
hasSmallSense := (ConfigurableFeatures includesFeature:'SmallSenseEnabled') |
842c7f563bd5
class: Tools::VariableList
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13457
diff
changeset
|
542 |
and:[(Smalltalk at: #'SmallSense::Manager') notNil]. |
10974 | 543 |
hasSmallSense ifTrue:[ |
13457
630e14513fec
Fix for recent SmallSense (moved to its own namespace)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13382
diff
changeset
|
544 |
smallSenseManager := (Smalltalk at: #'SmallSense::Manager') instance. |
10974 | 545 |
]. |
546 |
||
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
547 |
showingClassVars := self showClassVarsInVariableList value == true. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
548 |
sortByName := self sortVariablesByName value. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
549 |
"/ self assert:(sortByName isBoolean). |
5591 | 550 |
|
551 |
classes := classHolder value. |
|
552 |
(numClasses := classes size) == 0 ifTrue:[^ #() ]. |
|
553 |
numClasses > 1 ifTrue:[ |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
554 |
"/ multiple classes - see if there is a common subclass ... |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
555 |
commonSubclass := self commonSubClassIn:classes. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
556 |
commonSubclass notNil ifTrue:[ |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
557 |
"/ yes - treat like a single class |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
558 |
classes := Array with:(commonSubclass). |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
559 |
numClasses := 1. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
560 |
]. |
13155 | 561 |
"/ commonSuperclass := Behavior commonSuperclassOf:classes. |
562 |
"/ commonSuperclass notNil ifTrue:[ |
|
563 |
"/ "/ yes - treat like a single class |
|
564 |
"/ classes := Array with:(commonSuperclass). |
|
565 |
"/ numClasses := 1. |
|
566 |
"/ ]. |
|
5591 | 567 |
]. |
568 |
||
569 |
numClasses > 1 ifTrue:[ |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
570 |
"/ multiple classes - sort alphabetically ... |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
571 |
"/ unless there is a common subclass ... |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
572 |
nameList := Set new. |
10550 | 573 |
classesAlreadyProcessed := IdentitySet new. |
13155 | 574 |
classes do:[:eachClass | |
575 |
|class| |
|
576 |
||
577 |
class := eachClass. |
|
578 |
"/ showingClassVars ifTrue:[ |
|
579 |
"/ class := class theNonMetaclass |
|
580 |
"/ ]. |
|
581 |
||
10974 | 582 |
hasSmallSense ifTrue:[ |
583 |
info := smallSenseManager infoForClassOrNil: class. |
|
584 |
]. |
|
585 |
||
10550 | 586 |
(classesAlreadyProcessed includes:class) ifFalse:[ |
587 |
showingClassVars ifTrue:[ |
|
588 |
self showingInheritedClassVars ifTrue:[ |
|
589 |
class theNonMetaclass withAllSuperclassesDo:[:cls| |
|
10974 | 590 |
hasSmallSense ifTrue:[ |
591 |
info := smallSenseManager infoForClassOrNil: cls. |
|
592 |
]. |
|
10550 | 593 |
(classesAlreadyProcessed includes:cls) ifFalse:[ |
594 |
nameList addAll: |
|
10974 | 595 |
(cls classVarNames collect:[:nm|self listEntryForClass: cls name: nm info: info]). |
10550 | 596 |
classesAlreadyProcessed add:cls. |
597 |
] |
|
598 |
] |
|
599 |
] ifFalse:[ |
|
10255 | 600 |
nameList addAll: |
10974 | 601 |
(class classVarNames collect:[:nm|self listEntryForClass: class name: nm info: info ]) |
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
602 |
] |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
603 |
] ifFalse:[ |
10550 | 604 |
class withAllSuperclassesDo:[:cls| |
605 |
(classesAlreadyProcessed includes:cls) ifFalse:[ |
|
606 |
nameList addAll: |
|
13155 | 607 |
(cls instVarNames collect:[:nm|self listEntryForClass: cls name: nm info: info ]). |
10550 | 608 |
classesAlreadyProcessed add:cls. |
609 |
] |
|
610 |
] |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
611 |
] |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
612 |
] |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
613 |
]. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
614 |
nameList := nameList asOrderedCollection. |
5591 | 615 |
] ifFalse:[ |
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
616 |
"/ only a single class - sort by inheritance |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
617 |
class := classes first. |
5591 | 618 |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
619 |
nameList := OrderedCollection new. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
620 |
class notNil ifTrue:[ |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
621 |
showingClassVars ifTrue:[ |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
622 |
class := class theNonMetaclass |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
623 |
]. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
624 |
class withAllSuperclassesDo:[:cls| |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
625 |
|varNames| |
5591 | 626 |
|
10974 | 627 |
(hasSmallSense and:[showingClassVars not]) ifTrue:[ |
628 |
info := smallSenseManager infoForClassOrNil: cls. |
|
629 |
]. |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
630 |
varNames := showingClassVars ifTrue:[ cls classVarNames ] ifFalse:[ cls instVarNames ]. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
631 |
varNames copy reverse do:[:varName| |
10974 | 632 |
nameList addFirst: (self listEntryForClass: cls name: varName info: info). |
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
633 |
]. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
634 |
sortByName ifFalse:[ |
10255 | 635 |
nameList addFirst:(("'----- ' , "cls nameInBrowser" , ' -----'") asText colorizeAllWith: Color gray). |
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
636 |
] |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
637 |
]. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
638 |
]. |
5591 | 639 |
]. |
640 |
||
641 |
(numClasses > 1 or:[sortByName]) ifTrue:[ |
|
10255 | 642 |
nameList := nameList asSortedCollection:[:a :b|a name < b name]. |
5591 | 643 |
]. |
644 |
^ nameList |
|
645 |
||
10255 | 646 |
"Created: / 05-02-2000 / 13:42:11 / cg" |
10550 | 647 |
"Modified: / 08-08-2011 / 16:20:58 / cg" |
13458
842c7f563bd5
class: Tools::VariableList
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13457
diff
changeset
|
648 |
"Modified: / 02-09-2013 / 13:13:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5591 | 649 |
! |
650 |
||
651 |
postBuildWith:aBuilder |
|
652 |
|listView| |
|
653 |
||
654 |
(listView := aBuilder componentAt:#List) notNil ifTrue:[ |
|
655 |
listView scrollWhenUpdating:#end |
|
656 |
]. |
|
657 |
super postBuildWith:aBuilder |
|
658 |
||
659 |
! |
|
660 |
||
661 |
release |
|
662 |
super release. |
|
663 |
||
664 |
classHolder removeDependent:self. |
|
665 |
showClassVars removeDependent:self. |
|
666 |
! |
|
667 |
||
668 |
selectionChangeAllowed:index |
|
10255 | 669 |
|
670 |
| entry | |
|
671 |
^((entry := variableList value at:index) isString" and:[entry startsWith:'---']") not. |
|
672 |
||
673 |
"Modified: / 28-04-2011 / 13:18:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5591 | 674 |
! |
675 |
||
676 |
updateList |
|
677 |
| prevSelection newSelection newList oldList selectedVariablesHolder| |
|
678 |
||
679 |
oldList := self variableList value copy. |
|
10255 | 680 |
showWarningAboutMissingEntryInXmlSpec := false. |
5591 | 681 |
newList := self listOfVariables. |
682 |
||
683 |
newList ~= variableList value ifTrue:[ |
|
10495 | 684 |
selectedVariablesHolder := self selectedVariableEntries. |
11360 | 685 |
prevSelection := (self selectedVariables value "selectedVariablesHolder value" copy) ? #(). |
10255 | 686 |
variableList value:newList. |
687 |
||
11360 | 688 |
newSelection := newList select:[:item | prevSelection includes:item string]. |
689 |
"/ newSelection := prevSelection select:[:item | newList includes:item]. |
|
5591 | 690 |
|
10255 | 691 |
newSelection size > 0 ifTrue:[ |
692 |
"/ force change (for dependents) |
|
11360 | 693 |
"/ selectedVariablesHolder value:nil. |
694 |
selectedVariablesHolder |
|
695 |
setValue:newSelection; |
|
11461 | 696 |
removeDependent:self; |
697 |
changed; |
|
698 |
addDependent:self. |
|
10255 | 699 |
] ifFalse:[ |
700 |
prevSelection := selectedVariablesHolder value. |
|
701 |
selectedVariablesHolder value:nil. |
|
702 |
]. |
|
11360 | 703 |
(prevSelection size > 0 or:[newSelection size > 0 |
704 |
"and:[ prevSelection ~= newSelection]"]) ifTrue:[ |
|
10255 | 705 |
self updateOutputGenerator. |
706 |
]. |
|
707 |
]. |
|
708 |
(showWarningAboutMissingEntryInXmlSpec and:[self topApplication respondsTo: #showMessage:]) |
|
709 |
ifTrue: |
|
710 |
[ |
|
711 |
self topApplication showMessage: |
|
712 |
'One or more instance variables are not listed in #xmlSpecFor:'. |
|
713 |
]. |
|
714 |
showWarningAboutMissingEntryInXmlSpec := false. |
|
715 |
listValid := true. |
|
716 |
||
10495 | 717 |
"Modified: / 05-08-2011 / 12:34:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11461 | 718 |
"Modified: / 23-03-2012 / 15:55:47 / cg" |
10255 | 719 |
! ! |
720 |
||
721 |
!VariableList::VariableEntry class methodsFor:'instance creation'! |
|
722 |
||
723 |
application: app class: aClass name: aString |
|
724 |
||
725 |
^self new application: app; class: aClass; name: aString |
|
726 |
||
727 |
"Created: / 12-04-2011 / 19:53:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
728 |
! |
|
729 |
||
730 |
class: aClass name: aString |
|
731 |
||
732 |
^self new class: aClass; name: aString |
|
733 |
||
734 |
"Created: / 12-04-2011 / 15:39:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
735 |
! ! |
|
736 |
||
737 |
!VariableList::VariableEntry methodsFor:'accessing'! |
|
738 |
||
739 |
application: anObject |
|
5591 | 740 |
|
10255 | 741 |
application := anObject |
742 |
||
743 |
"Created: / 12-04-2011 / 19:55:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
744 |
! |
|
745 |
||
10308 | 746 |
asString |
747 |
||
748 |
^self name |
|
749 |
||
750 |
"Created: / 11-07-2011 / 17:03:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
751 |
! |
|
752 |
||
10255 | 753 |
class:aClass |
754 |
class := aClass. |
|
755 |
! |
|
756 |
||
757 |
icon |
|
10871 | 758 |
icon isNil ifTrue:[ |
759 |
icon := application iconInBrowserForVariable: name in: class. |
|
760 |
icon isNil ifTrue:[icon := #NOICON]. |
|
761 |
]. |
|
10255 | 762 |
^icon |
763 |
||
764 |
"Created: / 12-04-2011 / 15:54:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
765 |
"Modified: / 12-04-2011 / 19:58:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10871 | 766 |
"Modified: / 18-11-2011 / 15:05:18 / cg" |
10255 | 767 |
! |
768 |
||
769 |
klass |
|
770 |
^ class |
|
771 |
||
772 |
"Created: / 12-04-2011 / 19:54:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
773 |
! |
|
774 |
||
10974 | 775 |
label |
776 |
||
777 |
label isNil ifTrue:[ |
|
778 |
label := name. |
|
779 |
type notNil ifTrue:[ |
|
13827 | 780 |
label := (label , ' ' , (type displayString colorizeAllWith: Color brown)) |
781 |
] ifFalse:[ |
|
782 |
"/ Hack for Java classes to display field type |
|
783 |
class theNonMetaclass isJavaClass ifTrue:[ |
|
784 |
| field | |
|
785 |
field := class theNonMetaclass lookupFieldFor:name static: (class isMetaclass) onlyPublic: false. |
|
786 |
field notNil ifTrue:[ |
|
787 |
label := label asText , |
|
788 |
' ' , |
|
789 |
(('< ' , (JavaMethod fieldTypeFromStream: (field descriptor readStream) in: class theNonMetaclass javaPackage) , ' >') |
|
790 |
asText colorizeAllWith: Color brown). |
|
791 |
]. |
|
792 |
]. |
|
13382 | 793 |
]. |
10974 | 794 |
]. |
795 |
^label |
|
796 |
||
797 |
"Created: / 16-12-2011 / 00:54:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13827 | 798 |
"Modified: / 07-10-2013 / 08:29:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10974 | 799 |
! |
800 |
||
13382 | 801 |
labelWithClass |
802 |
|l| |
|
803 |
||
804 |
l := self label. |
|
805 |
class notNil ifTrue:[ |
|
806 |
^ label,' (' ,(class nameWithoutPrefix colorizeAllWith: Color grey),')' |
|
807 |
]. |
|
808 |
^label |
|
809 |
! |
|
810 |
||
10255 | 811 |
name |
812 |
^ name |
|
813 |
! |
|
814 |
||
815 |
name:aString |
|
816 |
name := aString. |
|
817 |
! |
|
818 |
||
13382 | 819 |
sortingByNameHolder:something |
820 |
sortingByNameHolder := something. |
|
821 |
! |
|
822 |
||
10255 | 823 |
string |
824 |
||
825 |
^name |
|
826 |
||
827 |
"Created: / 12-04-2011 / 15:45:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10974 | 828 |
! |
829 |
||
830 |
type |
|
831 |
"Return a SmallSense inferred type" |
|
832 |
||
833 |
^ type |
|
834 |
||
835 |
"Modified (format): / 16-12-2011 / 00:41:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
836 |
! |
|
837 |
||
838 |
type:aSmallSenseType |
|
839 |
"Sets a SmallSense inferred type" |
|
840 |
||
841 |
type := aSmallSenseType. |
|
842 |
||
843 |
"Modified (format): / 16-12-2011 / 00:41:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10255 | 844 |
! ! |
845 |
||
846 |
!VariableList::VariableEntry methodsFor:'displaying'! |
|
847 |
||
848 |
displayOn:aGC x:x y:y opaque: opaque |
|
13382 | 849 |
| icn shownLabel | |
10255 | 850 |
|
851 |
icn := self icon. |
|
852 |
icn ~~ #NOICON ifTrue:[ |
|
853 |
icn displayOn:aGC x:x + 1 y:y - icn height. |
|
5591 | 854 |
]. |
13382 | 855 |
|
856 |
shownLabel := sortingByNameHolder value |
|
857 |
ifTrue:[ self labelWithClass ] |
|
858 |
ifFalse: [ self label ]. |
|
859 |
||
860 |
shownLabel displayOn:aGC x:x + 20 y:y opaque: opaque |
|
10255 | 861 |
|
862 |
"Created: / 12-04-2011 / 15:47:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5591 | 863 |
! ! |
864 |
||
10974 | 865 |
!VariableList::VariableEntry methodsFor:'queries'! |
866 |
||
867 |
widthOn:aGC |
|
868 |
||
869 |
^20"space for icon, see displayOn:..." |
|
870 |
+ (self label widthOn:aGC) |
|
871 |
||
872 |
"Created: / 16-12-2011 / 01:04:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
873 |
! ! |
|
874 |
||
5591 | 875 |
!VariableList class methodsFor:'documentation'! |
876 |
||
9461 | 877 |
version_CVS |
14114
105a8c3f4e69
Removed: #enqueueDelayedUpdateList - just called super enqueueDelayedUpdateList
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14021
diff
changeset
|
878 |
^ '$Header: /cvs/stx/stx/libtool/Tools__VariableList.st,v 1.28 2014-03-05 18:29:36 vrany Exp $' |
5591 | 879 |
! ! |
12450 | 880 |