author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 19 Jul 2017 09:42:32 +0200 | |
branch | jv |
changeset 17619 | edb119820fcb |
parent 16066 | 471853fc1521 |
permissions | -rw-r--r-- |
10015 | 1 |
" |
14287
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
2 |
COPYRIGHT (c) 2004 by eXept Software AG |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
3 |
All Rights Reserved |
10015 | 4 |
|
14287
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
5 |
This software is furnished under a license and may be used |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
10 |
hereby transferred. |
10015 | 11 |
" |
12 |
"{ Package: 'stx:libtool' }" |
|
13 |
||
14 |
"{ NameSpace: Tools }" |
|
15 |
||
16 |
HierarchicalClassList subclass:#InheritanceClassList |
|
17 |
instanceVariableNames:'' |
|
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-Browsers-New' |
|
21 |
! |
|
22 |
||
23 |
!InheritanceClassList class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
14287
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
27 |
COPYRIGHT (c) 2004 by eXept Software AG |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
28 |
All Rights Reserved |
10015 | 29 |
|
14287
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
30 |
This software is furnished under a license and may be used |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
31 |
only in accordance with the terms of that license and with the |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
32 |
inclusion of the above copyright notice. This software may not |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
33 |
be provided or otherwise made available to, or used by, any |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
34 |
other person. No title to or ownership of the software is |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
35 |
hereby transferred. |
10015 | 36 |
" |
37 |
! |
|
38 |
||
39 |
documentation |
|
40 |
" |
|
41 |
Like a HierarchicalClassList, but shows class inheritance. |
|
42 |
For non-meta classes, this is the same as would be shown in |
|
43 |
the hierarchy list; |
|
44 |
For metaclasses, the tree is extented through the class-behavior |
|
45 |
hierarchy. |
|
46 |
||
47 |
embeddable application displaying the classes as listed by |
|
48 |
the inputGenerator. |
|
49 |
Provides an outputGenerator, which enumerates the classes and |
|
50 |
their protocols (method-categories) in the selected classes. |
|
51 |
||
52 |
[author:] |
|
53 |
Claus Gittinger (cg@exept.de) |
|
54 |
" |
|
55 |
||
56 |
||
57 |
! ! |
|
58 |
||
59 |
!InheritanceClassList methodsFor:'change & update'! |
|
60 |
||
61 |
delayedUpdate:something with:aParameter from:changedObject |
|
62 |
|top oldSelection newSelection showMeta| |
|
63 |
||
64 |
self inSlaveModeOrInvisible ifTrue:[^ self]. |
|
65 |
"/ (self slaveMode value == true) ifTrue:[^ self]. |
|
66 |
||
67 |
changedObject == slaveMode ifTrue:[ |
|
68 |
listValid ~~ true ifTrue:[ |
|
69 |
self enqueueDelayedUpdateList |
|
70 |
]. |
|
71 |
"/ self invalidateList. |
|
72 |
^ self |
|
73 |
]. |
|
74 |
||
75 |
changedObject == meta ifTrue:[ |
|
76 |
oldSelection := self selectedClasses value ? #(). |
|
77 |
showMeta := meta value. |
|
78 |
||
79 |
newSelection := oldSelection collect:[:cls | showMeta ifTrue:[cls theMetaclass] ifFalse:[cls theNonMetaclass]]. |
|
80 |
newSelection := newSelection asOrderedCollection. |
|
81 |
||
82 |
top := self topClassHolder value. |
|
83 |
top notNil ifTrue:[ |
|
84 |
top := showMeta ifTrue:[top theMetaclass] ifFalse:[top theNonMetaclass]. |
|
85 |
self topClassHolder value:top. |
|
86 |
]. |
|
87 |
self invalidateList. |
|
88 |
||
89 |
(newSelection includes:nil) ifTrue:[self halt:'should not happen']. |
|
90 |
||
91 |
self selectedClasses value:newSelection. |
|
92 |
^ self. |
|
93 |
]. |
|
94 |
super delayedUpdate:something with:aParameter from:changedObject |
|
95 |
||
96 |
"Modified: / 24.2.2000 / 15:29:21 / cg" |
|
97 |
! |
|
98 |
||
99 |
getSelectedClassIndicesFromClasses |
|
100 |
|classes selectedClasses selectedIndices| |
|
101 |
||
102 |
selectedClasses := self selectedClasses value. |
|
103 |
selectedClasses size == 0 ifTrue:[^ #() ]. |
|
104 |
||
105 |
classes := self classList value. |
|
16062 | 106 |
selectedIndices := |
107 |
selectedClasses |
|
108 |
collect:[:aSelectedClass | |
|
109 |
classes identityIndexOf:aSelectedClass] |
|
110 |
thenSelect:[:idx | idx ~~ 0]. |
|
10015 | 111 |
selectedIndices size == 0 ifTrue:[ |
112 |
"/ meta value == true ifTrue:[ |
|
113 |
"/self halt. |
|
114 |
"/ ] ifFalse:[ |
|
115 |
"/self halt. |
|
116 |
"/ ] |
|
117 |
]. |
|
118 |
||
119 |
^ selectedIndices |
|
120 |
||
121 |
"Created: / 24.2.2000 / 19:48:05 / cg" |
|
122 |
"Modified: / 24.2.2000 / 23:30:22 / cg" |
|
123 |
! |
|
124 |
||
125 |
getSelectedClassesFromIndices |
|
126 |
|selected classes allSelected| |
|
127 |
||
128 |
allSelected := false. |
|
129 |
||
130 |
classes := classList value. |
|
131 |
selected := self selectedClassNameIndices value collect:[:idx | |
|
132 |
|cls| |
|
133 |
||
134 |
cls := classes at:idx. |
|
135 |
"/ cls == AllEntry ifTrue:[ |
|
136 |
"/ allSelected := true. |
|
137 |
"/ cls. |
|
138 |
"/ ] ifFalse:[ |
|
139 |
"/ cls notNil ifTrue:[ |
|
140 |
"/ meta value ifTrue:[ |
|
141 |
"/ cls := cls theMetaclass |
|
142 |
"/ ] ifFalse:[ |
|
143 |
"/ cls := cls theNonMetaclass |
|
144 |
"/ ]. |
|
145 |
"/ ]. |
|
146 |
"/ cls |
|
147 |
"/ ] |
|
148 |
]. |
|
149 |
||
150 |
"/ allSelected ifTrue:[ |
|
151 |
"/ selected := classList value select:[:cls | cls ~~ AllEntry]. |
|
152 |
"/ ]. |
|
153 |
||
154 |
selected := selected select:[:cls | cls notNil]. |
|
155 |
^selected. |
|
156 |
||
157 |
"Created: / 24.2.2000 / 19:45:04 / cg" |
|
158 |
! ! |
|
159 |
||
160 |
!InheritanceClassList methodsFor:'private'! |
|
161 |
||
162 |
defaultSlaveModeValue |
|
163 |
|mode| |
|
164 |
||
165 |
mode := self topApplication perform:#initialOrganizerMode ifNotUnderstood:nil. |
|
166 |
mode == OrganizerCanvas organizerModeClassInheritance ifTrue:[^ false]. |
|
167 |
mode isNil ifTrue:[^ false]. |
|
168 |
||
169 |
self organizerMode value == OrganizerCanvas organizerModeCategory ifTrue:[^ true]. |
|
170 |
^ false |
|
171 |
! |
|
172 |
||
173 |
listOfClasses |
|
174 |
|top classes| |
|
175 |
||
176 |
(top := self topClassHolder value) isNil ifTrue:[ |
|
14287
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
177 |
^ super listOfClasses |
10015 | 178 |
]. |
179 |
||
15535
f34d6683163b
class: Tools::InheritanceClassList
Claus Gittinger <cg@exept.de>
parents:
14287
diff
changeset
|
180 |
classes := top withAllSuperclasses reversed. |
14287
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
181 |
"/ Must check whether environment contains the class and filter it out, |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
182 |
"/ if not. Think of limited environment to Java classes which should not |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
183 |
"/ show Object & JavaObject even if they are real superclasses of any Java |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
184 |
"/ class. |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
185 |
"/ Q: Should we rather ignore all superclasses after first class which is not |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
186 |
"/ in environment? |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
187 |
classes := classes select:[:class | (environment at: class name ifAbsent:[nil]) notNil ]. |
10015 | 188 |
"/ classes addFirst:InheritedEntry. |
189 |
^ classes |
|
190 |
||
14287
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
191 |
"Modified: / 26-02-2000 / 00:38:48 / cg" |
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
192 |
"Modified: / 27-04-2014 / 20:48:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10015 | 193 |
! ! |
194 |
||
195 |
!InheritanceClassList class methodsFor:'documentation'! |
|
196 |
||
14287
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
197 |
version |
16062 | 198 |
^ '$Header$' |
14287
25e0e7fd7c49
Fix in #listOfClasses - must check whether all superclasses are actually in environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10036
diff
changeset
|
199 |
! ! |
10015 | 200 |