10015
|
1 |
"
|
10036
|
2 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
|
|
3 |
Copyright (c) 2009-2010 eXept Software AG
|
10015
|
4 |
|
10036
|
5 |
Permission is hereby granted, free of charge, to any person
|
|
6 |
obtaining a copy of this software and associated documentation
|
|
7 |
files (the 'Software'), to deal in the Software without
|
|
8 |
restriction, including without limitation the rights to use,
|
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10 |
copies of the Software, and to permit persons to whom the
|
|
11 |
Software is furnished to do so, subject to the following
|
|
12 |
conditions:
|
|
13 |
|
|
14 |
The above copyright notice and this permission notice shall be
|
|
15 |
included in all copies or substantial portions of the Software.
|
|
16 |
|
|
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
24 |
OTHER DEALINGS IN THE SOFTWARE.
|
10015
|
25 |
"
|
|
26 |
"{ Package: 'stx:libtool' }"
|
|
27 |
|
|
28 |
"{ NameSpace: Tools }"
|
|
29 |
|
|
30 |
HierarchicalClassList subclass:#InheritanceClassList
|
|
31 |
instanceVariableNames:''
|
|
32 |
classVariableNames:''
|
|
33 |
poolDictionaries:''
|
|
34 |
category:'Interface-Browsers-New'
|
|
35 |
!
|
|
36 |
|
|
37 |
!InheritanceClassList class methodsFor:'documentation'!
|
|
38 |
|
|
39 |
copyright
|
|
40 |
"
|
10036
|
41 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
|
|
42 |
Copyright (c) 2009-2010 eXept Software AG
|
|
43 |
|
|
44 |
Permission is hereby granted, free of charge, to any person
|
|
45 |
obtaining a copy of this software and associated documentation
|
|
46 |
files (the 'Software'), to deal in the Software without
|
|
47 |
restriction, including without limitation the rights to use,
|
|
48 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
49 |
copies of the Software, and to permit persons to whom the
|
|
50 |
Software is furnished to do so, subject to the following
|
|
51 |
conditions:
|
10015
|
52 |
|
10036
|
53 |
The above copyright notice and this permission notice shall be
|
|
54 |
included in all copies or substantial portions of the Software.
|
|
55 |
|
|
56 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
57 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
58 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
59 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
60 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
61 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
62 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
63 |
OTHER DEALINGS IN THE SOFTWARE.
|
10015
|
64 |
"
|
|
65 |
!
|
|
66 |
|
|
67 |
documentation
|
|
68 |
"
|
|
69 |
Like a HierarchicalClassList, but shows class inheritance.
|
|
70 |
For non-meta classes, this is the same as would be shown in
|
|
71 |
the hierarchy list;
|
|
72 |
For metaclasses, the tree is extented through the class-behavior
|
|
73 |
hierarchy.
|
|
74 |
|
|
75 |
embeddable application displaying the classes as listed by
|
|
76 |
the inputGenerator.
|
|
77 |
Provides an outputGenerator, which enumerates the classes and
|
|
78 |
their protocols (method-categories) in the selected classes.
|
|
79 |
|
|
80 |
[author:]
|
|
81 |
Claus Gittinger (cg@exept.de)
|
|
82 |
"
|
|
83 |
|
|
84 |
|
|
85 |
! !
|
|
86 |
|
|
87 |
!InheritanceClassList methodsFor:'change & update'!
|
|
88 |
|
|
89 |
delayedUpdate:something with:aParameter from:changedObject
|
|
90 |
|top oldSelection newSelection showMeta|
|
|
91 |
|
|
92 |
self inSlaveModeOrInvisible ifTrue:[^ self].
|
|
93 |
"/ (self slaveMode value == true) ifTrue:[^ self].
|
|
94 |
|
|
95 |
changedObject == slaveMode ifTrue:[
|
|
96 |
listValid ~~ true ifTrue:[
|
|
97 |
self enqueueDelayedUpdateList
|
|
98 |
].
|
|
99 |
"/ self invalidateList.
|
|
100 |
^ self
|
|
101 |
].
|
|
102 |
|
|
103 |
changedObject == meta ifTrue:[
|
|
104 |
oldSelection := self selectedClasses value ? #().
|
|
105 |
showMeta := meta value.
|
|
106 |
|
|
107 |
newSelection := oldSelection collect:[:cls | showMeta ifTrue:[cls theMetaclass] ifFalse:[cls theNonMetaclass]].
|
|
108 |
newSelection := newSelection asOrderedCollection.
|
|
109 |
|
|
110 |
top := self topClassHolder value.
|
|
111 |
top notNil ifTrue:[
|
|
112 |
top := showMeta ifTrue:[top theMetaclass] ifFalse:[top theNonMetaclass].
|
|
113 |
self topClassHolder value:top.
|
|
114 |
].
|
|
115 |
self invalidateList.
|
|
116 |
|
|
117 |
(newSelection includes:nil) ifTrue:[self halt:'should not happen'].
|
|
118 |
|
|
119 |
self selectedClasses value:newSelection.
|
|
120 |
^ self.
|
|
121 |
].
|
|
122 |
super delayedUpdate:something with:aParameter from:changedObject
|
|
123 |
|
|
124 |
"Modified: / 24.2.2000 / 15:29:21 / cg"
|
|
125 |
!
|
|
126 |
|
|
127 |
getSelectedClassIndicesFromClasses
|
|
128 |
|classes selectedClasses selectedIndices|
|
|
129 |
|
|
130 |
selectedClasses := self selectedClasses value.
|
|
131 |
selectedClasses size == 0 ifTrue:[^ #() ].
|
|
132 |
|
|
133 |
classes := self classList value.
|
|
134 |
selectedIndices := selectedClasses
|
|
135 |
collect:[:aSelectedClass |
|
|
136 |
classes identityIndexOf:aSelectedClass.
|
|
137 |
].
|
|
138 |
selectedIndices := selectedIndices select:[:idx | idx ~~ 0].
|
|
139 |
selectedIndices size == 0 ifTrue:[
|
|
140 |
"/ meta value == true ifTrue:[
|
|
141 |
"/self halt.
|
|
142 |
"/ ] ifFalse:[
|
|
143 |
"/self halt.
|
|
144 |
"/ ]
|
|
145 |
].
|
|
146 |
|
|
147 |
^ selectedIndices
|
|
148 |
|
|
149 |
"Created: / 24.2.2000 / 19:48:05 / cg"
|
|
150 |
"Modified: / 24.2.2000 / 23:30:22 / cg"
|
|
151 |
!
|
|
152 |
|
|
153 |
getSelectedClassesFromIndices
|
|
154 |
|selected classes allSelected|
|
|
155 |
|
|
156 |
allSelected := false.
|
|
157 |
|
|
158 |
classes := classList value.
|
|
159 |
selected := self selectedClassNameIndices value collect:[:idx |
|
|
160 |
|cls|
|
|
161 |
|
|
162 |
cls := classes at:idx.
|
|
163 |
"/ cls == AllEntry ifTrue:[
|
|
164 |
"/ allSelected := true.
|
|
165 |
"/ cls.
|
|
166 |
"/ ] ifFalse:[
|
|
167 |
"/ cls notNil ifTrue:[
|
|
168 |
"/ meta value ifTrue:[
|
|
169 |
"/ cls := cls theMetaclass
|
|
170 |
"/ ] ifFalse:[
|
|
171 |
"/ cls := cls theNonMetaclass
|
|
172 |
"/ ].
|
|
173 |
"/ ].
|
|
174 |
"/ cls
|
|
175 |
"/ ]
|
|
176 |
].
|
|
177 |
|
|
178 |
"/ allSelected ifTrue:[
|
|
179 |
"/ selected := classList value select:[:cls | cls ~~ AllEntry].
|
|
180 |
"/ ].
|
|
181 |
|
|
182 |
selected := selected select:[:cls | cls notNil].
|
|
183 |
^selected.
|
|
184 |
|
|
185 |
"Created: / 24.2.2000 / 19:45:04 / cg"
|
|
186 |
! !
|
|
187 |
|
|
188 |
!InheritanceClassList methodsFor:'private'!
|
|
189 |
|
|
190 |
defaultSlaveModeValue
|
|
191 |
|mode|
|
|
192 |
|
|
193 |
mode := self topApplication perform:#initialOrganizerMode ifNotUnderstood:nil.
|
|
194 |
mode == OrganizerCanvas organizerModeClassInheritance ifTrue:[^ false].
|
|
195 |
mode isNil ifTrue:[^ false].
|
|
196 |
|
|
197 |
self organizerMode value == OrganizerCanvas organizerModeCategory ifTrue:[^ true].
|
|
198 |
^ false
|
|
199 |
!
|
|
200 |
|
|
201 |
listOfClasses
|
|
202 |
|top classes|
|
|
203 |
|
|
204 |
(top := self topClassHolder value) isNil ifTrue:[
|
|
205 |
^ super listOfClasses
|
|
206 |
].
|
|
207 |
|
|
208 |
classes := top withAllSuperclasses copy reverse.
|
|
209 |
"/ classes addFirst:InheritedEntry.
|
|
210 |
^ classes
|
|
211 |
|
|
212 |
"Modified: / 26.2.2000 / 00:38:48 / cg"
|
|
213 |
! !
|
|
214 |
|
|
215 |
!InheritanceClassList class methodsFor:'documentation'!
|
|
216 |
|
|
217 |
version_CVS
|
10036
|
218 |
^ '$Header: /cvs/stx/stx/libtool/Tools__InheritanceClassList.st,v 1.3 2011-07-03 13:34:57 cg Exp $'
|
10015
|
219 |
!
|
|
220 |
|
|
221 |
version_SVN
|
|
222 |
^ '§Id: Tools__InheritanceClassList.st 7796 2011-06-23 16:01:32Z vranyj1 §'
|
|
223 |
! !
|