author | Claus Gittinger <cg@exept.de> |
Tue, 28 Mar 2006 17:27:25 +0200 | |
changeset 6746 | f849bfaae74e |
parent 6741 | e45eaa140394 |
child 12045 | b8f7983d1bc2 |
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 |
" |
|
12 |
||
5591 | 13 |
"{ Package: 'stx:libtool' }" |
14 |
||
15 |
"{ NameSpace: Tools }" |
|
16 |
||
17 |
HierarchicalClassList subclass:#InheritanceClassList |
|
18 |
instanceVariableNames:'' |
|
19 |
classVariableNames:'' |
|
20 |
poolDictionaries:'' |
|
21 |
category:'Interface-Browsers-New' |
|
22 |
! |
|
23 |
||
24 |
!InheritanceClassList class methodsFor:'documentation'! |
|
25 |
||
6179 | 26 |
copyright |
27 |
" |
|
28 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
29 |
All Rights Reserved |
|
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
! |
|
39 |
||
5591 | 40 |
documentation |
41 |
" |
|
42 |
Like a HierarchicalClassList, but shows class inheritance. |
|
43 |
For non-meta classes, this is the same as would be shown in |
|
44 |
the hierarchy list; |
|
45 |
For metaclasses, the tree is extented through the class-behavior |
|
46 |
hierarchy. |
|
47 |
||
48 |
embeddable application displaying the classes as listed by |
|
49 |
the inputGenerator. |
|
50 |
Provides an outputGenerator, which enumerates the classes and |
|
51 |
their protocols (method-categories) in the selected classes. |
|
52 |
||
53 |
[author:] |
|
54 |
Claus Gittinger (cg@exept.de) |
|
55 |
" |
|
56 |
||
57 |
||
58 |
! ! |
|
59 |
||
60 |
!InheritanceClassList methodsFor:'change & update'! |
|
61 |
||
62 |
delayedUpdate:something with:aParameter from:changedObject |
|
63 |
|top oldSelection newSelection showMeta| |
|
64 |
||
65 |
self inSlaveModeOrInvisible ifTrue:[^ self]. |
|
66 |
"/ (self slaveMode value == true) ifTrue:[^ self]. |
|
67 |
||
68 |
changedObject == slaveMode ifTrue:[ |
|
69 |
listValid ~~ true ifTrue:[ |
|
70 |
self enqueueDelayedUpdateList |
|
71 |
]. |
|
72 |
"/ self invalidateList. |
|
73 |
^ self |
|
74 |
]. |
|
75 |
||
76 |
changedObject == meta ifTrue:[ |
|
77 |
oldSelection := self selectedClasses value ? #(). |
|
78 |
showMeta := meta value. |
|
79 |
||
80 |
newSelection := oldSelection collect:[:cls | showMeta ifTrue:[cls theMetaclass] ifFalse:[cls theNonMetaclass]]. |
|
81 |
newSelection := newSelection asOrderedCollection. |
|
82 |
||
83 |
top := self topClassHolder value. |
|
84 |
top notNil ifTrue:[ |
|
85 |
top := showMeta ifTrue:[top theMetaclass] ifFalse:[top theNonMetaclass]. |
|
86 |
self topClassHolder value:top. |
|
87 |
]. |
|
88 |
self invalidateList. |
|
89 |
||
90 |
(newSelection includes:nil) ifTrue:[self halt:'should not happen']. |
|
91 |
||
92 |
self selectedClasses value:newSelection. |
|
93 |
^ self. |
|
94 |
]. |
|
95 |
super delayedUpdate:something with:aParameter from:changedObject |
|
96 |
||
97 |
"Modified: / 24.2.2000 / 15:29:21 / cg" |
|
98 |
! |
|
99 |
||
100 |
getSelectedClassIndicesFromClasses |
|
101 |
|classes selectedClasses selectedIndices| |
|
102 |
||
103 |
selectedClasses := self selectedClasses value. |
|
104 |
selectedClasses size == 0 ifTrue:[^ #() ]. |
|
105 |
||
106 |
classes := self classList value. |
|
107 |
selectedIndices := selectedClasses |
|
108 |
collect:[:aSelectedClass | |
|
109 |
classes identityIndexOf:aSelectedClass. |
|
110 |
]. |
|
111 |
selectedIndices := selectedIndices select:[:idx | idx ~~ 0]. |
|
112 |
selectedIndices size == 0 ifTrue:[ |
|
113 |
"/ meta value == true ifTrue:[ |
|
114 |
"/self halt. |
|
115 |
"/ ] ifFalse:[ |
|
116 |
"/self halt. |
|
117 |
"/ ] |
|
118 |
]. |
|
119 |
||
120 |
^ selectedIndices |
|
121 |
||
122 |
"Created: / 24.2.2000 / 19:48:05 / cg" |
|
123 |
"Modified: / 24.2.2000 / 23:30:22 / cg" |
|
124 |
! |
|
125 |
||
126 |
getSelectedClassesFromIndices |
|
127 |
|selected classes allSelected| |
|
128 |
||
129 |
allSelected := false. |
|
130 |
||
131 |
classes := classList value. |
|
132 |
selected := self selectedClassNameIndices value collect:[:idx | |
|
133 |
|cls| |
|
134 |
||
135 |
cls := classes at:idx. |
|
136 |
"/ cls == AllEntry ifTrue:[ |
|
137 |
"/ allSelected := true. |
|
138 |
"/ cls. |
|
139 |
"/ ] ifFalse:[ |
|
140 |
"/ cls notNil ifTrue:[ |
|
141 |
"/ meta value ifTrue:[ |
|
142 |
"/ cls := cls theMetaclass |
|
143 |
"/ ] ifFalse:[ |
|
144 |
"/ cls := cls theNonMetaclass |
|
145 |
"/ ]. |
|
146 |
"/ ]. |
|
147 |
"/ cls |
|
148 |
"/ ] |
|
149 |
]. |
|
150 |
||
151 |
"/ allSelected ifTrue:[ |
|
152 |
"/ selected := classList value select:[:cls | cls ~~ AllEntry]. |
|
153 |
"/ ]. |
|
154 |
||
155 |
selected := selected select:[:cls | cls notNil]. |
|
156 |
^selected. |
|
157 |
||
158 |
"Created: / 24.2.2000 / 19:45:04 / cg" |
|
159 |
! ! |
|
160 |
||
161 |
!InheritanceClassList methodsFor:'private'! |
|
162 |
||
163 |
defaultSlaveModeValue |
|
6746 | 164 |
|mode| |
165 |
||
166 |
mode := self topApplication perform:#initialOrganizerMode ifNotUnderstood:nil. |
|
167 |
mode == OrganizerCanvas organizerModeClassInheritance ifTrue:[^ false]. |
|
168 |
mode isNil ifTrue:[^ false]. |
|
169 |
||
6741
e45eaa140394
magic constants (organizerMode) removed
Claus Gittinger <cg@exept.de>
parents:
6179
diff
changeset
|
170 |
self organizerMode value == OrganizerCanvas organizerModeCategory ifTrue:[^ true]. |
5591 | 171 |
^ false |
172 |
! |
|
173 |
||
174 |
listOfClasses |
|
175 |
|top classes| |
|
176 |
||
177 |
(top := self topClassHolder value) isNil ifTrue:[ |
|
178 |
^ super listOfClasses |
|
179 |
]. |
|
180 |
||
181 |
classes := top withAllSuperclasses copy reverse. |
|
182 |
"/ classes addFirst:InheritedEntry. |
|
183 |
^ classes |
|
184 |
||
185 |
"Modified: / 26.2.2000 / 00:38:48 / cg" |
|
186 |
! ! |
|
187 |
||
188 |
!InheritanceClassList class methodsFor:'documentation'! |
|
189 |
||
190 |
version |
|
6746 | 191 |
^ '$Header: /cvs/stx/stx/libtool/Tools_InheritanceClassList.st,v 1.4 2006-03-28 15:27:25 cg Exp $' |
5591 | 192 |
! ! |