author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 16 Jul 2013 17:18:09 +0100 | |
branch | jv |
changeset 13182 | bc686a7cc736 |
parent 12459 | 7899fe07efd7 |
parent 13155 | 0230b8afb999 |
child 13390 | ab1969edf59b |
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 |
10974 | 25 |
instanceVariableNames:'label application class name type icon' |
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 |
^ #( |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
118 |
#(#doubleClickChannel #action ) |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
119 |
#classHolder |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
120 |
#forceGeneratorTrigger |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
121 |
#immediateUpdate |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
122 |
#inGeneratorHolder |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
123 |
#menuHolder |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
124 |
#outGeneratorHolder |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
125 |
#packageFilter |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
126 |
#selectedVariables |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
127 |
#selectionChangeCondition |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
128 |
#updateTrigger |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
129 |
#showClassVarsInVariableList |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
130 |
#slaveMode |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
131 |
#sortVariablesByName |
5591 | 132 |
). |
133 |
! ! |
|
134 |
||
135 |
!VariableList methodsFor:'aspects'! |
|
136 |
||
137 |
classHolder |
|
138 |
classHolder isNil ifTrue:[ |
|
139 |
classHolder := #() asValue. |
|
140 |
classHolder addDependent:self |
|
141 |
]. |
|
142 |
^ classHolder |
|
143 |
! |
|
144 |
||
145 |
classHolder:aValueHolder |
|
146 |
classHolder notNil ifTrue:[ |
|
10308 | 147 |
classHolder removeDependent:self |
5591 | 148 |
]. |
149 |
classHolder := aValueHolder. |
|
150 |
classHolder notNil ifTrue:[ |
|
10308 | 151 |
classHolder isBehavior ifTrue:[self error:'should not happen']. |
152 |
classHolder addDependent:self |
|
5591 | 153 |
]. |
10308 | 154 |
|
155 |
"Modified: / 11-07-2011 / 17:04:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5591 | 156 |
! |
157 |
||
158 |
defaultSlaveModeValue |
|
159 |
^ false. |
|
160 |
! |
|
161 |
||
10255 | 162 |
selectedVariableEntries |
163 |
<resource: #uiAspect> |
|
164 |
||
165 |
"automatically generated by UIPainter ..." |
|
166 |
||
167 |
"*** the code below creates a default model when invoked." |
|
168 |
"*** (which may not be the one you wanted)" |
|
169 |
"*** Please change as required and accept it in the browser." |
|
170 |
"*** (and replace this comment by something more useful ;-)" |
|
171 |
||
172 |
selectedVariableEntries isNil ifTrue:[ |
|
173 |
selectedVariableEntries := #() asValue. |
|
174 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
175 |
selectedVariableEntries addDependent:self. |
|
176 |
"/ selectedVariableEntries onChangeSend:#selectedVariableEntriesChanged to:self. |
|
177 |
]. |
|
178 |
^ selectedVariableEntries. |
|
179 |
||
180 |
"Modified: / 12-04-2011 / 15:49:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
181 |
! |
|
182 |
||
5591 | 183 |
selectedVariables |
184 |
^ self selectionHolder |
|
185 |
||
186 |
! |
|
187 |
||
188 |
selectedVariables:aValueHolder |
|
189 |
^ self selectionHolder:aValueHolder |
|
190 |
||
191 |
! |
|
192 |
||
193 |
showClassVarsInVariableList |
|
194 |
showClassVars isNil ifTrue:[ |
|
195 |
showClassVars := false asValue. |
|
196 |
showClassVars addDependent:self |
|
197 |
]. |
|
198 |
^ showClassVars |
|
199 |
! |
|
200 |
||
201 |
showClassVarsInVariableList:aValueHolder |
|
202 |
showClassVars notNil ifTrue:[ |
|
203 |
showClassVars removeDependent:self |
|
204 |
]. |
|
205 |
showClassVars := aValueHolder. |
|
206 |
showClassVars notNil ifTrue:[ |
|
207 |
showClassVars addDependent:self |
|
208 |
]. |
|
209 |
! |
|
210 |
||
211 |
showingInheritedClassVars |
|
212 |
^ false |
|
213 |
"/ ^ true |
|
214 |
! |
|
215 |
||
216 |
sortVariablesByName |
|
217 |
sortVariablesByName isNil ifTrue:[ |
|
218 |
sortVariablesByName := false asValue. |
|
219 |
sortVariablesByName addDependent:self |
|
220 |
]. |
|
221 |
^ sortVariablesByName |
|
222 |
! |
|
223 |
||
224 |
sortVariablesByName:aValueHolder |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
225 |
"/ self assert:(aValueHolder value isBoolean). |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
226 |
|
5591 | 227 |
sortVariablesByName notNil ifTrue:[ |
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
228 |
sortVariablesByName removeDependent:self |
5591 | 229 |
]. |
230 |
sortVariablesByName := aValueHolder. |
|
231 |
sortVariablesByName notNil ifTrue:[ |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
232 |
sortVariablesByName addDependent:self |
5591 | 233 |
]. |
234 |
! |
|
235 |
||
236 |
variableList |
|
237 |
variableList isNil ifTrue:[ |
|
238 |
variableList := ValueHolder new |
|
239 |
]. |
|
240 |
^ variableList |
|
241 |
||
242 |
||
243 |
! ! |
|
244 |
||
245 |
!VariableList methodsFor:'change & update'! |
|
246 |
||
247 |
delayedUpdate:something with:aParameter from:changedObject |
|
248 |
|selectedClasses changedClass anyChange| |
|
249 |
||
250 |
self inSlaveModeOrInvisible ifTrue:[self invalidateList. ^ self]. |
|
251 |
||
252 |
changedObject == slaveMode ifTrue:[ |
|
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
253 |
listValid ~~ true ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
254 |
self enqueueDelayedUpdateList |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
255 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
256 |
"/ self invalidateList. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
257 |
^ self |
5591 | 258 |
]. |
259 |
||
260 |
changedObject == classHolder ifTrue:[ |
|
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
261 |
self invalidateList. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
262 |
^ self |
5591 | 263 |
]. |
264 |
changedObject == showClassVars ifTrue:[ |
|
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
265 |
self invalidateList. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
266 |
^ self. |
5591 | 267 |
]. |
268 |
changedObject == sortVariablesByName ifTrue:[ |
|
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
269 |
self invalidateList. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
270 |
^ self. |
5591 | 271 |
]. |
272 |
changedObject == Smalltalk ifTrue:[ |
|
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
273 |
(something == #projectOrganization) ifTrue:[^ self]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
274 |
(something == #currentChangeSet) ifTrue:[^ self]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
275 |
(something == #aboutToAutoloadClass) ifTrue:[^ self]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
276 |
|
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
277 |
(something == #classDefinition |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
278 |
or:[ (something == #newClass) |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
279 |
or:[ something == #classVariables and:[showClassVars value == true]]]) |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
280 |
ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
281 |
changedClass := aParameter. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
282 |
selectedClasses := classHolder value. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
283 |
selectedClasses notNil ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
284 |
selectedClasses isSequenceable ifFalse:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
285 |
selectedClasses := selectedClasses asOrderedCollection |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
286 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
287 |
selectedClasses keysAndValuesDo:[:idx :cls | |nm| |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
288 |
cls notNil ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
289 |
cls isObsolete ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
290 |
cls isMeta ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
291 |
nm := cls theNonMetaclass name. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
292 |
selectedClasses at:idx put:(Smalltalk at:nm) class. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
293 |
] ifFalse:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
294 |
nm := cls name. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
295 |
selectedClasses at:idx put:(Smalltalk at:nm). |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
296 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
297 |
anyChange := true. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
298 |
] ifFalse:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
299 |
(cls == aParameter |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
300 |
or:[something == #classVariables |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
301 |
and:[showClassVars value == true |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
302 |
and:[cls theNonMetaclass == aParameter theNonMetaclass]]]) ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
303 |
anyChange := true. |
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 |
] |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
306 |
] |
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 |
(selectedClasses includes:nil) ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
309 |
"/ can happen, if a selected class is removed... |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
310 |
"/ self halt:'should this happen ?'. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
311 |
"/ fix it ... |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
312 |
selectedClasses := selectedClasses select:[:each | each notNil]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
313 |
classHolder value:selectedClasses. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
314 |
anyChange := true. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
315 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
316 |
anyChange == true ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
317 |
self invalidateList. |
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 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
320 |
]. |
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 |
]. |
5591 | 323 |
] ifFalse:[ |
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
324 |
changedObject isBehavior ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
325 |
anyChange := false. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
326 |
selectedClasses := classHolder value. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
327 |
selectedClasses notNil ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
328 |
selectedClasses keysAndValuesDo:[:idx :cls | |nm| |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
329 |
cls isObsolete ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
330 |
nm := cls name. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
331 |
selectedClasses at:idx put:(Smalltalk at:nm). |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
332 |
anyChange := true. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
333 |
] |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
334 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
335 |
anyChange == true ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
336 |
self invalidateList. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
337 |
^ self |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
338 |
]. |
5591 | 339 |
|
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
340 |
(selectedClasses includesIdentical:something) ifTrue:[ |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
341 |
self invalidateList. |
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 |
]. |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
344 |
]. |
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 |
]. |
5591 | 347 |
]. |
348 |
super delayedUpdate:something with:aParameter from:changedObject |
|
11296
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
349 |
|
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
350 |
"Modified: / 01-03-2012 / 09:18:11 / cg" |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
351 |
! |
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 |
enqueueDelayedUpdateList |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
354 |
super enqueueDelayedUpdateList |
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
355 |
|
2fec94a88af2
added: #enqueueDelayedUpdateList
Claus Gittinger <cg@exept.de>
parents:
10974
diff
changeset
|
356 |
"Created: / 01-03-2012 / 09:06:42 / cg" |
5591 | 357 |
! |
358 |
||
359 |
makeDependent |
|
360 |
Smalltalk addDependent:self |
|
361 |
||
362 |
! |
|
363 |
||
364 |
makeIndependent |
|
365 |
Smalltalk removeDependent:self |
|
366 |
||
367 |
! |
|
368 |
||
369 |
selectionChangedByClick |
|
370 |
"we are not interested in that - get another notification |
|
371 |
via the changed valueHolder" |
|
372 |
||
373 |
||
374 |
! |
|
375 |
||
376 |
update:something with:aParameter from:changedObject |
|
377 |
"/ ^ self delayedUpdate:something with:aParameter from:changedObject. |
|
378 |
||
379 |
changedObject == Smalltalk ifTrue:[ |
|
10255 | 380 |
something == #methodDictionary ifTrue:[ |
381 |
^ self |
|
382 |
]. |
|
383 |
something == #methodTrap ifTrue:[ |
|
384 |
^ self |
|
385 |
]. |
|
10366 | 386 |
something == #methodCoverageInfo ifTrue:[ |
387 |
^ self |
|
388 |
]. |
|
10255 | 389 |
something == #methodInClass ifTrue:[ |
390 |
^ self |
|
391 |
]. |
|
392 |
something == #methodInClassRemoved ifTrue:[ |
|
393 |
^ self |
|
394 |
]. |
|
395 |
something == #classComment ifTrue:[ |
|
396 |
^ self. |
|
397 |
]. |
|
5591 | 398 |
]. |
399 |
"/ self window sensor isNil ifTrue:[ |
|
400 |
"/ "/ I am not visible ... |
|
401 |
"/ self invalidateList. |
|
402 |
"/ ^ self |
|
403 |
"/ ]. |
|
10255 | 404 |
changedObject == selectedVariableEntries ifTrue:[ |
405 |
self selectedVariables value: |
|
406 |
((selectedVariableEntries value ? #()) |
|
407 |
collect:[:e|e name]). |
|
408 |
^self. |
|
409 |
]. |
|
410 |
||
411 |
||
5591 | 412 |
super update:something with:aParameter from:changedObject |
413 |
||
10255 | 414 |
"Modified: / 12-04-2011 / 15:54:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10366 | 415 |
"Modified: / 20-07-2011 / 18:52:44 / cg" |
5591 | 416 |
! ! |
417 |
||
418 |
!VariableList methodsFor:'generators'! |
|
419 |
||
420 |
makeGenerator |
|
421 |
||
422 |
||
423 |
||
424 |
! ! |
|
425 |
||
426 |
!VariableList methodsFor:'private'! |
|
427 |
||
5909 | 428 |
commonPostBuild |
5591 | 429 |
|list| |
430 |
||
5909 | 431 |
super commonPostBuild. |
5591 | 432 |
|
5909 | 433 |
list := builder componentAt:#List. |
5591 | 434 |
list notNil ifTrue:[ |
5909 | 435 |
list selectConditionBlock:[:item | self selectionChangeAllowed:item]. |
436 |
list ignoreReselect:false. |
|
5591 | 437 |
]. |
438 |
! |
|
439 |
||
440 |
commonSubClassIn:classes |
|
441 |
"return true if there is a common subclass" |
|
442 |
||
443 |
|theCommonSubClass "classesByInheritance"| |
|
444 |
||
445 |
theCommonSubClass := nil. |
|
446 |
classes do:[:eachClass | |
|
447 |
theCommonSubClass isNil ifTrue:[ |
|
448 |
theCommonSubClass := eachClass |
|
449 |
] ifFalse:[ |
|
450 |
(eachClass isSubclassOf:theCommonSubClass) ifTrue:[ |
|
451 |
theCommonSubClass := eachClass |
|
452 |
] ifFalse:[ |
|
453 |
(theCommonSubClass isSubclassOf:eachClass) ifFalse:[ |
|
454 |
^ nil |
|
455 |
] |
|
456 |
] |
|
457 |
] |
|
458 |
]. |
|
459 |
^ theCommonSubClass. |
|
460 |
||
461 |
"/ classesByInheritance := classes topologicalSort:[:a :b | a isSubclassOf:b]. |
|
462 |
"/ classesByInheritance keysAndValuesDo:[:index :eachClass | |
|
463 |
"/ "/ all classes after that one must be superclasses ... |
|
464 |
"/ classesByInheritance from:index+1 to:classesByInheritance size do:[:otherClass | |
|
465 |
"/ (eachClass isSubclassOf:otherClass) ifFalse:[ |
|
466 |
"/ ^ nil. |
|
467 |
"/ ] |
|
468 |
"/ ]. |
|
469 |
"/ ]. |
|
470 |
"/ ^ classesByInheritance first |
|
471 |
! |
|
472 |
||
10324
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
473 |
iconInBrowserForVariable:varName in:aClass |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
474 |
"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
|
475 |
with an <xml>-icon." |
10255 | 476 |
|
10324
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
477 |
(Expecco::ExpeccoXMLDecoder notNil |
11586 | 478 |
and:[aClass canUnderstand: #xmlSpecForObject:]) ifTrue:[ |
10324
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
479 |
Error handle:[:ex | |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
480 |
] do:[ |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
481 |
(Expecco::ExpeccoXMLDecoder xmlSpecForObject:aClass basicNew) |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
482 |
do:[:spec | spec getter = varName ifTrue:[ |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
483 |
^ SystemBrowser instVarOverlayXmlSpec |
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 |
]. |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
487 |
]. |
d68f7aa2e449
I dont like extensions too much.
Claus Gittinger <cg@exept.de>
parents:
10308
diff
changeset
|
488 |
^ nil |
10255 | 489 |
|
490 |
"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
|
491 |
"Modified: / 15-07-2011 / 18:32:47 / cg" |
11586 | 492 |
"Modified: / 22-06-2012 / 13:17:28 / sr" |
10255 | 493 |
! |
494 |
||
495 |
listEntryForClass: cls name:name |
|
496 |
||
497 |
" (showWarningAboutMissingEntryInXmlSpec not |
|
498 |
and:[Expecco::ExpeccoXMLDecoder notNil |
|
499 |
and:[cls canUnderstand: #xmlSpecFor:]]) ifTrue: |
|
500 |
[| hasSpecEntry | |
|
501 |
hasSpecEntry := false. |
|
502 |
(Expecco::ExpeccoXMLDecoder xmlSpecForObject:cls basicNew) |
|
503 |
do:[:spec|spec getter = name ifTrue: |
|
504 |
[ |
|
505 |
hasSpecEntry := true]]. |
|
506 |
showWarningAboutMissingEntryInXmlSpec := hasSpecEntry not]. " |
|
507 |
||
508 |
^VariableEntry application: self class: cls name: name |
|
509 |
||
510 |
"Created: / 12-04-2011 / 15:41:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
511 |
"Modified: / 12-04-2011 / 21:36:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
512 |
! |
|
513 |
||
10974 | 514 |
listEntryForClass: cls name:name info: classInfo |
515 |
||
516 |
| nm entry | |
|
517 |
||
518 |
nm := name. |
|
519 |
entry := Tools::VariableList::VariableEntry application: self class: cls name: nm. |
|
520 |
classInfo notNil ifTrue:[ |
|
521 |
entry type: (classInfo infoForInstvarOrNil: name). |
|
522 |
]. |
|
523 |
^entry |
|
524 |
||
525 |
"Created: / 27-11-2011 / 17:17:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
526 |
! |
|
527 |
||
5591 | 528 |
listOfVariables |
10974 | 529 |
|
13155 | 530 |
|nameList numClasses classes class commonSubclass commonSuperclass showingClassVars |
10974 | 531 |
sortByName classesAlreadyProcessed hasSmallSense smallSenseManager info | |
5591 | 532 |
|
533 |
classHolder isNil ifTrue:[ |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
534 |
"/ testing |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
535 |
^ #() |
5591 | 536 |
]. |
537 |
||
10974 | 538 |
hasSmallSense := ConfigurableFeatures includesFeature:'SmallSenseEnabled'. |
539 |
hasSmallSense ifTrue:[ |
|
540 |
smallSenseManager := (Smalltalk at: #SmallSenseManager) instance. |
|
541 |
]. |
|
542 |
||
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
543 |
showingClassVars := self showClassVarsInVariableList value == true. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
544 |
sortByName := self sortVariablesByName value. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
545 |
"/ self assert:(sortByName isBoolean). |
5591 | 546 |
|
547 |
classes := classHolder value. |
|
548 |
(numClasses := classes size) == 0 ifTrue:[^ #() ]. |
|
549 |
numClasses > 1 ifTrue:[ |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
550 |
"/ 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
|
551 |
commonSubclass := self commonSubClassIn:classes. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
552 |
commonSubclass notNil ifTrue:[ |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
553 |
"/ yes - treat like a single class |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
554 |
classes := Array with:(commonSubclass). |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
555 |
numClasses := 1. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
556 |
]. |
13155 | 557 |
"/ commonSuperclass := Behavior commonSuperclassOf:classes. |
558 |
"/ commonSuperclass notNil ifTrue:[ |
|
559 |
"/ "/ yes - treat like a single class |
|
560 |
"/ classes := Array with:(commonSuperclass). |
|
561 |
"/ numClasses := 1. |
|
562 |
"/ ]. |
|
5591 | 563 |
]. |
564 |
||
565 |
numClasses > 1 ifTrue:[ |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
566 |
"/ multiple classes - sort alphabetically ... |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
567 |
"/ unless there is a common subclass ... |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
568 |
nameList := Set new. |
10550 | 569 |
classesAlreadyProcessed := IdentitySet new. |
13155 | 570 |
classes do:[:eachClass | |
571 |
|class| |
|
572 |
||
573 |
class := eachClass. |
|
574 |
"/ showingClassVars ifTrue:[ |
|
575 |
"/ class := class theNonMetaclass |
|
576 |
"/ ]. |
|
577 |
||
10974 | 578 |
hasSmallSense ifTrue:[ |
579 |
info := smallSenseManager infoForClassOrNil: class. |
|
580 |
]. |
|
581 |
||
10550 | 582 |
(classesAlreadyProcessed includes:class) ifFalse:[ |
583 |
showingClassVars ifTrue:[ |
|
584 |
self showingInheritedClassVars ifTrue:[ |
|
585 |
class theNonMetaclass withAllSuperclassesDo:[:cls| |
|
10974 | 586 |
hasSmallSense ifTrue:[ |
587 |
info := smallSenseManager infoForClassOrNil: cls. |
|
588 |
]. |
|
10550 | 589 |
(classesAlreadyProcessed includes:cls) ifFalse:[ |
590 |
nameList addAll: |
|
10974 | 591 |
(cls classVarNames collect:[:nm|self listEntryForClass: cls name: nm info: info]). |
10550 | 592 |
classesAlreadyProcessed add:cls. |
593 |
] |
|
594 |
] |
|
595 |
] ifFalse:[ |
|
10255 | 596 |
nameList addAll: |
10974 | 597 |
(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
|
598 |
] |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
599 |
] ifFalse:[ |
10550 | 600 |
class withAllSuperclassesDo:[:cls| |
601 |
(classesAlreadyProcessed includes:cls) ifFalse:[ |
|
602 |
nameList addAll: |
|
13155 | 603 |
(cls instVarNames collect:[:nm|self listEntryForClass: cls name: nm info: info ]). |
10550 | 604 |
classesAlreadyProcessed add:cls. |
605 |
] |
|
606 |
] |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
607 |
] |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
608 |
] |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
609 |
]. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
610 |
nameList := nameList asOrderedCollection. |
5591 | 611 |
] ifFalse:[ |
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
612 |
"/ only a single class - sort by inheritance |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
613 |
class := classes first. |
5591 | 614 |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
615 |
nameList := OrderedCollection new. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
616 |
class notNil ifTrue:[ |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
617 |
showingClassVars ifTrue:[ |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
618 |
class := class theNonMetaclass |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
619 |
]. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
620 |
class withAllSuperclassesDo:[:cls| |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
621 |
|varNames| |
5591 | 622 |
|
10974 | 623 |
(hasSmallSense and:[showingClassVars not]) ifTrue:[ |
624 |
info := smallSenseManager infoForClassOrNil: cls. |
|
625 |
]. |
|
6721
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
626 |
varNames := showingClassVars ifTrue:[ cls classVarNames ] ifFalse:[ cls instVarNames ]. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
627 |
varNames copy reverse do:[:varName| |
10974 | 628 |
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
|
629 |
]. |
c49f5a3cbca2
variableList (sort) fixed in hierarchy views
Claus Gittinger <cg@exept.de>
parents:
5909
diff
changeset
|
630 |
sortByName ifFalse:[ |
10255 | 631 |
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
|
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 |
]. |
5591 | 635 |
]. |
636 |
||
637 |
(numClasses > 1 or:[sortByName]) ifTrue:[ |
|
10255 | 638 |
nameList := nameList asSortedCollection:[:a :b|a name < b name]. |
5591 | 639 |
]. |
640 |
^ nameList |
|
641 |
||
10255 | 642 |
"Created: / 05-02-2000 / 13:42:11 / cg" |
10550 | 643 |
"Modified: / 08-08-2011 / 16:20:58 / cg" |
10974 | 644 |
"Modified: / 27-11-2011 / 17:29:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
645 |
"Modified (comment): / 16-12-2011 / 01:27:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5591 | 646 |
! |
647 |
||
648 |
postBuildWith:aBuilder |
|
649 |
|listView| |
|
650 |
||
651 |
(listView := aBuilder componentAt:#List) notNil ifTrue:[ |
|
652 |
listView scrollWhenUpdating:#end |
|
653 |
]. |
|
654 |
super postBuildWith:aBuilder |
|
655 |
||
656 |
! |
|
657 |
||
658 |
release |
|
659 |
super release. |
|
660 |
||
661 |
classHolder removeDependent:self. |
|
662 |
showClassVars removeDependent:self. |
|
663 |
! |
|
664 |
||
665 |
selectionChangeAllowed:index |
|
10255 | 666 |
|
667 |
| entry | |
|
668 |
^((entry := variableList value at:index) isString" and:[entry startsWith:'---']") not. |
|
669 |
||
670 |
"Modified: / 28-04-2011 / 13:18:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5591 | 671 |
! |
672 |
||
673 |
updateList |
|
674 |
| prevSelection newSelection newList oldList selectedVariablesHolder| |
|
675 |
||
676 |
oldList := self variableList value copy. |
|
10255 | 677 |
showWarningAboutMissingEntryInXmlSpec := false. |
5591 | 678 |
newList := self listOfVariables. |
679 |
||
680 |
newList ~= variableList value ifTrue:[ |
|
10495 | 681 |
selectedVariablesHolder := self selectedVariableEntries. |
11360 | 682 |
prevSelection := (self selectedVariables value "selectedVariablesHolder value" copy) ? #(). |
10255 | 683 |
variableList value:newList. |
684 |
||
11360 | 685 |
newSelection := newList select:[:item | prevSelection includes:item string]. |
686 |
"/ newSelection := prevSelection select:[:item | newList includes:item]. |
|
5591 | 687 |
|
10255 | 688 |
newSelection size > 0 ifTrue:[ |
689 |
"/ force change (for dependents) |
|
11360 | 690 |
"/ selectedVariablesHolder value:nil. |
691 |
selectedVariablesHolder |
|
692 |
setValue:newSelection; |
|
11461 | 693 |
removeDependent:self; |
694 |
changed; |
|
695 |
addDependent:self. |
|
10255 | 696 |
] ifFalse:[ |
697 |
prevSelection := selectedVariablesHolder value. |
|
698 |
selectedVariablesHolder value:nil. |
|
699 |
]. |
|
11360 | 700 |
(prevSelection size > 0 or:[newSelection size > 0 |
701 |
"and:[ prevSelection ~= newSelection]"]) ifTrue:[ |
|
10255 | 702 |
self updateOutputGenerator. |
703 |
]. |
|
704 |
]. |
|
705 |
(showWarningAboutMissingEntryInXmlSpec and:[self topApplication respondsTo: #showMessage:]) |
|
706 |
ifTrue: |
|
707 |
[ |
|
708 |
self topApplication showMessage: |
|
709 |
'One or more instance variables are not listed in #xmlSpecFor:'. |
|
710 |
]. |
|
711 |
showWarningAboutMissingEntryInXmlSpec := false. |
|
712 |
listValid := true. |
|
713 |
||
10495 | 714 |
"Modified: / 05-08-2011 / 12:34:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11461 | 715 |
"Modified: / 23-03-2012 / 15:55:47 / cg" |
10255 | 716 |
! ! |
717 |
||
718 |
!VariableList::VariableEntry class methodsFor:'instance creation'! |
|
719 |
||
720 |
application: app class: aClass name: aString |
|
721 |
||
722 |
^self new application: app; class: aClass; name: aString |
|
723 |
||
724 |
"Created: / 12-04-2011 / 19:53:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
725 |
! |
|
726 |
||
727 |
class: aClass name: aString |
|
728 |
||
729 |
^self new class: aClass; name: aString |
|
730 |
||
731 |
"Created: / 12-04-2011 / 15:39:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
732 |
! ! |
|
733 |
||
734 |
!VariableList::VariableEntry methodsFor:'accessing'! |
|
735 |
||
736 |
application: anObject |
|
5591 | 737 |
|
10255 | 738 |
application := anObject |
739 |
||
740 |
"Created: / 12-04-2011 / 19:55:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
741 |
! |
|
742 |
||
10308 | 743 |
asString |
744 |
||
745 |
^self name |
|
746 |
||
747 |
"Created: / 11-07-2011 / 17:03:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
748 |
! |
|
749 |
||
10255 | 750 |
class:aClass |
751 |
class := aClass. |
|
752 |
! |
|
753 |
||
754 |
icon |
|
10871 | 755 |
icon isNil ifTrue:[ |
756 |
icon := application iconInBrowserForVariable: name in: class. |
|
757 |
icon isNil ifTrue:[icon := #NOICON]. |
|
758 |
]. |
|
10255 | 759 |
^icon |
760 |
||
761 |
"Created: / 12-04-2011 / 15:54:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
762 |
"Modified: / 12-04-2011 / 19:58:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10871 | 763 |
"Modified: / 18-11-2011 / 15:05:18 / cg" |
10255 | 764 |
! |
765 |
||
766 |
klass |
|
767 |
^ class |
|
768 |
||
769 |
"Created: / 12-04-2011 / 19:54:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
770 |
! |
|
771 |
||
10974 | 772 |
label |
773 |
||
774 |
label isNil ifTrue:[ |
|
775 |
label := name. |
|
776 |
type notNil ifTrue:[ |
|
777 |
label := (label , ' ' , (type displayString colorizeAllWith: Color brown)) |
|
778 |
] |
|
779 |
]. |
|
780 |
^label |
|
781 |
||
782 |
"Created: / 16-12-2011 / 00:54:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
783 |
! |
|
784 |
||
10255 | 785 |
name |
786 |
^ name |
|
787 |
! |
|
788 |
||
789 |
name:aString |
|
790 |
name := aString. |
|
791 |
! |
|
792 |
||
793 |
string |
|
794 |
||
795 |
^name |
|
796 |
||
797 |
"Created: / 12-04-2011 / 15:45:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10974 | 798 |
! |
799 |
||
800 |
type |
|
801 |
"Return a SmallSense inferred type" |
|
802 |
||
803 |
^ type |
|
804 |
||
805 |
"Modified (format): / 16-12-2011 / 00:41:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
806 |
! |
|
807 |
||
808 |
type:aSmallSenseType |
|
809 |
"Sets a SmallSense inferred type" |
|
810 |
||
811 |
type := aSmallSenseType. |
|
812 |
||
813 |
"Modified (format): / 16-12-2011 / 00:41:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10255 | 814 |
! ! |
815 |
||
816 |
!VariableList::VariableEntry methodsFor:'displaying'! |
|
817 |
||
818 |
displayOn:aGC x:x y:y opaque: opaque |
|
819 |
||
820 |
| icn | |
|
821 |
icn := self icon. |
|
822 |
icn ~~ #NOICON ifTrue:[ |
|
823 |
icn displayOn:aGC x:x + 1 y:y - icn height. |
|
5591 | 824 |
]. |
10974 | 825 |
^self label displayOn:aGC x:x + 20 y:y opaque: opaque |
10255 | 826 |
|
827 |
"Created: / 12-04-2011 / 15:47:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5591 | 828 |
! ! |
829 |
||
10974 | 830 |
!VariableList::VariableEntry methodsFor:'queries'! |
831 |
||
832 |
widthOn:aGC |
|
833 |
||
834 |
^20"space for icon, see displayOn:..." |
|
835 |
+ (self label widthOn:aGC) |
|
836 |
||
837 |
"Created: / 16-12-2011 / 01:04:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
838 |
! ! |
|
839 |
||
5591 | 840 |
!VariableList class methodsFor:'documentation'! |
841 |
||
9461 | 842 |
version_CVS |
13155 | 843 |
^ '$Header: /cvs/stx/stx/libtool/Tools__VariableList.st,v 1.21 2013-07-10 12:04:18 cg Exp $' |
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
844 |
! |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
845 |
|
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
846 |
version_HG |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
847 |
|
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
848 |
^ '$Changeset: <not expanded> $' |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
849 |
! |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
850 |
|
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
851 |
version_SVN |
12314 | 852 |
^ '$Id: Tools__VariableList.st 8083 2013-01-14 11:48:37Z vranyj1 $' |
5591 | 853 |
! ! |
12450 | 854 |