author | Claus Gittinger <cg@exept.de> |
Mon, 11 Sep 2017 09:07:18 +0200 | |
changeset 17684 | ad637949d97a |
parent 13795 | 79182ccf8472 |
permissions | -rw-r--r-- |
6179 | 1 |
" |
2 |
COPYRIGHT (c) 2004 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 |
" |
|
5591 | 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 |
||
6179 | 25 |
copyright |
26 |
" |
|
27 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
38 |
||
5591 | 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 |
||
13795 | 64 |
self inSlaveModeOrInvisible ifTrue:[^ self]. |
65 |
"/ (self slaveMode value == true) ifTrue:[^ self]. |
|
5591 | 66 |
|
67 |
changedObject == slaveMode ifTrue:[ |
|
13795 | 68 |
listValid ~~ true ifTrue:[ |
69 |
self enqueueDelayedUpdateList |
|
70 |
]. |
|
71 |
"/ self invalidateList. |
|
72 |
^ self |
|
5591 | 73 |
]. |
74 |
||
75 |
changedObject == meta ifTrue:[ |
|
13795 | 76 |
oldSelection := self selectedClasses value ? #(). |
77 |
showMeta := meta value. |
|
5591 | 78 |
|
13795 | 79 |
newSelection := oldSelection collect:[:cls | showMeta ifTrue:[cls theMetaclass] ifFalse:[cls theNonMetaclass]]. |
80 |
newSelection := newSelection asOrderedCollection. |
|
5591 | 81 |
|
13795 | 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. |
|
5591 | 88 |
|
13795 | 89 |
(newSelection includes:nil) ifTrue:[self halt:'should not happen']. |
5591 | 90 |
|
13795 | 91 |
self selectedClasses value:newSelection. |
92 |
^ self. |
|
5591 | 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. |
|
106 |
selectedIndices := selectedClasses |
|
107 |
collect:[:aSelectedClass | |
|
108 |
classes identityIndexOf:aSelectedClass. |
|
109 |
]. |
|
110 |
selectedIndices := selectedIndices select:[:idx | idx ~~ 0]. |
|
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 |
|
6746 | 163 |
|mode| |
164 |
||
165 |
mode := self topApplication perform:#initialOrganizerMode ifNotUnderstood:nil. |
|
166 |
mode == OrganizerCanvas organizerModeClassInheritance ifTrue:[^ false]. |
|
167 |
mode isNil ifTrue:[^ false]. |
|
168 |
||
6741
e45eaa140394
magic constants (organizerMode) removed
Claus Gittinger <cg@exept.de>
parents:
6179
diff
changeset
|
169 |
self organizerMode value == OrganizerCanvas organizerModeCategory ifTrue:[^ true]. |
5591 | 170 |
^ false |
171 |
! |
|
172 |
||
173 |
listOfClasses |
|
174 |
|top classes| |
|
175 |
||
176 |
(top := self topClassHolder value) isNil ifTrue:[ |
|
177 |
^ super listOfClasses |
|
178 |
]. |
|
179 |
||
180 |
classes := top withAllSuperclasses copy reverse. |
|
181 |
"/ classes addFirst:InheritedEntry. |
|
182 |
^ classes |
|
183 |
||
184 |
"Modified: / 26.2.2000 / 00:38:48 / cg" |
|
185 |
! ! |
|
186 |
||
187 |
!InheritanceClassList class methodsFor:'documentation'! |
|
188 |
||
189 |
version |
|
13795 | 190 |
^ '$Header: /cvs/stx/stx/libtool/Tools_InheritanceClassList.st,v 1.6 2014-02-05 18:55:55 cg Exp $' |
5591 | 191 |
! ! |
13795 | 192 |