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