author | Claus Gittinger <cg@exept.de> |
Mon, 20 Jan 2020 21:02:47 +0100 | |
changeset 19422 | c6ca1c3e0fd7 |
parent 17599 | 66437aed9681 |
permissions | -rw-r--r-- |
17599 | 1 |
"{ Encoding: utf8 }" |
2 |
||
10015 | 3 |
" |
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
|
4 |
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
|
5 |
All Rights Reserved |
10015 | 6 |
|
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
|
7 |
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
|
8 |
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
|
9 |
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
|
10 |
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
|
11 |
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
|
12 |
hereby transferred. |
10015 | 13 |
" |
14 |
"{ Package: 'stx:libtool' }" |
|
15 |
||
16 |
"{ NameSpace: Tools }" |
|
17 |
||
18 |
HierarchicalClassList subclass:#InheritanceClassList |
|
19 |
instanceVariableNames:'' |
|
20 |
classVariableNames:'' |
|
21 |
poolDictionaries:'' |
|
22 |
category:'Interface-Browsers-New' |
|
23 |
! |
|
24 |
||
25 |
!InheritanceClassList class methodsFor:'documentation'! |
|
26 |
||
27 |
copyright |
|
28 |
" |
|
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
|
29 |
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
|
30 |
All Rights Reserved |
10015 | 31 |
|
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
|
32 |
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
|
33 |
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
|
34 |
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
|
35 |
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
|
36 |
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
|
37 |
hereby transferred. |
10015 | 38 |
" |
39 |
! |
|
40 |
||
41 |
documentation |
|
42 |
" |
|
43 |
Like a HierarchicalClassList, but shows class inheritance. |
|
44 |
For non-meta classes, this is the same as would be shown in |
|
45 |
the hierarchy list; |
|
46 |
For metaclasses, the tree is extented through the class-behavior |
|
47 |
hierarchy. |
|
48 |
||
49 |
embeddable application displaying the classes as listed by |
|
50 |
the inputGenerator. |
|
51 |
Provides an outputGenerator, which enumerates the classes and |
|
52 |
their protocols (method-categories) in the selected classes. |
|
53 |
||
54 |
[author:] |
|
55 |
Claus Gittinger (cg@exept.de) |
|
56 |
" |
|
57 |
||
58 |
||
59 |
! ! |
|
60 |
||
61 |
!InheritanceClassList methodsFor:'change & update'! |
|
62 |
||
63 |
delayedUpdate:something with:aParameter from:changedObject |
|
64 |
|top oldSelection newSelection showMeta| |
|
65 |
||
66 |
self inSlaveModeOrInvisible ifTrue:[^ self]. |
|
67 |
"/ (self slaveMode value == true) ifTrue:[^ self]. |
|
68 |
||
69 |
changedObject == slaveMode ifTrue:[ |
|
70 |
listValid ~~ true ifTrue:[ |
|
71 |
self enqueueDelayedUpdateList |
|
72 |
]. |
|
73 |
"/ self invalidateList. |
|
74 |
^ self |
|
75 |
]. |
|
76 |
||
77 |
changedObject == meta ifTrue:[ |
|
78 |
oldSelection := self selectedClasses value ? #(). |
|
79 |
showMeta := meta value. |
|
80 |
||
81 |
newSelection := oldSelection collect:[:cls | showMeta ifTrue:[cls theMetaclass] ifFalse:[cls theNonMetaclass]]. |
|
82 |
newSelection := newSelection asOrderedCollection. |
|
83 |
||
84 |
top := self topClassHolder value. |
|
85 |
top notNil ifTrue:[ |
|
86 |
top := showMeta ifTrue:[top theMetaclass] ifFalse:[top theNonMetaclass]. |
|
87 |
self topClassHolder value:top. |
|
88 |
]. |
|
89 |
self invalidateList. |
|
90 |
||
91 |
(newSelection includes:nil) ifTrue:[self halt:'should not happen']. |
|
92 |
||
93 |
self selectedClasses value:newSelection. |
|
94 |
^ self. |
|
95 |
]. |
|
96 |
super delayedUpdate:something with:aParameter from:changedObject |
|
97 |
||
98 |
"Modified: / 24.2.2000 / 15:29:21 / cg" |
|
99 |
! |
|
100 |
||
101 |
getSelectedClassIndicesFromClasses |
|
102 |
|classes selectedClasses selectedIndices| |
|
103 |
||
104 |
selectedClasses := self selectedClasses value. |
|
105 |
selectedClasses size == 0 ifTrue:[^ #() ]. |
|
106 |
||
107 |
classes := self classList value. |
|
16062 | 108 |
selectedIndices := |
109 |
selectedClasses |
|
110 |
collect:[:aSelectedClass | |
|
111 |
classes identityIndexOf:aSelectedClass] |
|
112 |
thenSelect:[:idx | idx ~~ 0]. |
|
10015 | 113 |
selectedIndices size == 0 ifTrue:[ |
114 |
"/ meta value == true ifTrue:[ |
|
115 |
"/self halt. |
|
116 |
"/ ] ifFalse:[ |
|
117 |
"/self halt. |
|
118 |
"/ ] |
|
119 |
]. |
|
120 |
||
121 |
^ selectedIndices |
|
122 |
||
123 |
"Created: / 24.2.2000 / 19:48:05 / cg" |
|
124 |
"Modified: / 24.2.2000 / 23:30:22 / cg" |
|
125 |
! |
|
126 |
||
127 |
getSelectedClassesFromIndices |
|
128 |
|selected classes allSelected| |
|
129 |
||
130 |
allSelected := false. |
|
131 |
||
132 |
classes := classList value. |
|
133 |
selected := self selectedClassNameIndices value collect:[:idx | |
|
134 |
|cls| |
|
135 |
||
136 |
cls := classes at:idx. |
|
137 |
"/ cls == AllEntry ifTrue:[ |
|
138 |
"/ allSelected := true. |
|
139 |
"/ cls. |
|
140 |
"/ ] ifFalse:[ |
|
141 |
"/ cls notNil ifTrue:[ |
|
142 |
"/ meta value ifTrue:[ |
|
143 |
"/ cls := cls theMetaclass |
|
144 |
"/ ] ifFalse:[ |
|
145 |
"/ cls := cls theNonMetaclass |
|
146 |
"/ ]. |
|
147 |
"/ ]. |
|
148 |
"/ cls |
|
149 |
"/ ] |
|
150 |
]. |
|
151 |
||
152 |
"/ allSelected ifTrue:[ |
|
153 |
"/ selected := classList value select:[:cls | cls ~~ AllEntry]. |
|
154 |
"/ ]. |
|
155 |
||
156 |
selected := selected select:[:cls | cls notNil]. |
|
157 |
^selected. |
|
158 |
||
159 |
"Created: / 24.2.2000 / 19:45:04 / cg" |
|
160 |
! ! |
|
161 |
||
162 |
!InheritanceClassList methodsFor:'private'! |
|
163 |
||
164 |
defaultSlaveModeValue |
|
165 |
|mode| |
|
166 |
||
167 |
mode := self topApplication perform:#initialOrganizerMode ifNotUnderstood:nil. |
|
168 |
mode == OrganizerCanvas organizerModeClassInheritance ifTrue:[^ false]. |
|
169 |
mode isNil ifTrue:[^ false]. |
|
170 |
||
171 |
self organizerMode value == OrganizerCanvas organizerModeCategory ifTrue:[^ true]. |
|
172 |
^ false |
|
173 |
! |
|
174 |
||
175 |
listOfClasses |
|
176 |
|top classes| |
|
177 |
||
178 |
(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
|
179 |
^ super listOfClasses |
10015 | 180 |
]. |
181 |
||
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
|
182 |
"/ 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
|
183 |
"/ 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
|
184 |
"/ 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
|
185 |
"/ 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
|
186 |
"/ 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
|
187 |
"/ in environment? |
17599 | 188 |
classes := top withAllSuperclasses select:[:class | (environment at: class name ifAbsent:[nil]) notNil ]. |
189 |
"/ classes add:InheritedEntry. |
|
190 |
^ classes reversed |
|
10015 | 191 |
|
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
|
192 |
"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
|
193 |
"Modified: / 27-04-2014 / 20:48:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17599 | 194 |
"Modified: / 25-07-2017 / 17:56:04 / stefan" |
10015 | 195 |
! ! |
196 |
||
197 |
!InheritanceClassList class methodsFor:'documentation'! |
|
198 |
||
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 |
version |
16062 | 200 |
^ '$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
|
201 |
! ! |
10015 | 202 |