5591
|
1 |
"{ Package: 'stx:libtool' }"
|
|
2 |
|
|
3 |
"{ NameSpace: Tools }"
|
|
4 |
|
|
5 |
HierarchicalClassList subclass:#InheritanceClassList
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'Interface-Browsers-New'
|
|
10 |
!
|
|
11 |
|
|
12 |
!InheritanceClassList class methodsFor:'documentation'!
|
|
13 |
|
|
14 |
documentation
|
|
15 |
"
|
|
16 |
Like a HierarchicalClassList, but shows class inheritance.
|
|
17 |
For non-meta classes, this is the same as would be shown in
|
|
18 |
the hierarchy list;
|
|
19 |
For metaclasses, the tree is extented through the class-behavior
|
|
20 |
hierarchy.
|
|
21 |
|
|
22 |
embeddable application displaying the classes as listed by
|
|
23 |
the inputGenerator.
|
|
24 |
Provides an outputGenerator, which enumerates the classes and
|
|
25 |
their protocols (method-categories) in the selected classes.
|
|
26 |
|
|
27 |
[author:]
|
|
28 |
Claus Gittinger (cg@exept.de)
|
|
29 |
"
|
|
30 |
|
|
31 |
|
|
32 |
! !
|
|
33 |
|
|
34 |
!InheritanceClassList methodsFor:'change & update'!
|
|
35 |
|
|
36 |
delayedUpdate:something with:aParameter from:changedObject
|
|
37 |
|top oldSelection newSelection showMeta|
|
|
38 |
|
|
39 |
self inSlaveModeOrInvisible ifTrue:[^ self].
|
|
40 |
"/ (self slaveMode value == true) ifTrue:[^ self].
|
|
41 |
|
|
42 |
changedObject == slaveMode ifTrue:[
|
|
43 |
listValid ~~ true ifTrue:[
|
|
44 |
self enqueueDelayedUpdateList
|
|
45 |
].
|
|
46 |
"/ self invalidateList.
|
|
47 |
^ self
|
|
48 |
].
|
|
49 |
|
|
50 |
changedObject == meta ifTrue:[
|
|
51 |
oldSelection := self selectedClasses value ? #().
|
|
52 |
showMeta := meta value.
|
|
53 |
|
|
54 |
newSelection := oldSelection collect:[:cls | showMeta ifTrue:[cls theMetaclass] ifFalse:[cls theNonMetaclass]].
|
|
55 |
newSelection := newSelection asOrderedCollection.
|
|
56 |
|
|
57 |
top := self topClassHolder value.
|
|
58 |
top notNil ifTrue:[
|
|
59 |
top := showMeta ifTrue:[top theMetaclass] ifFalse:[top theNonMetaclass].
|
|
60 |
self topClassHolder value:top.
|
|
61 |
].
|
|
62 |
self invalidateList.
|
|
63 |
|
|
64 |
(newSelection includes:nil) ifTrue:[self halt:'should not happen'].
|
|
65 |
|
|
66 |
self selectedClasses value:newSelection.
|
|
67 |
^ self.
|
|
68 |
].
|
|
69 |
super delayedUpdate:something with:aParameter from:changedObject
|
|
70 |
|
|
71 |
"Modified: / 24.2.2000 / 15:29:21 / cg"
|
|
72 |
!
|
|
73 |
|
|
74 |
getSelectedClassIndicesFromClasses
|
|
75 |
|classes selectedClasses selectedIndices|
|
|
76 |
|
|
77 |
selectedClasses := self selectedClasses value.
|
|
78 |
selectedClasses size == 0 ifTrue:[^ #() ].
|
|
79 |
|
|
80 |
classes := self classList value.
|
|
81 |
selectedIndices := selectedClasses
|
|
82 |
collect:[:aSelectedClass |
|
|
83 |
classes identityIndexOf:aSelectedClass.
|
|
84 |
].
|
|
85 |
selectedIndices := selectedIndices select:[:idx | idx ~~ 0].
|
|
86 |
selectedIndices size == 0 ifTrue:[
|
|
87 |
"/ meta value == true ifTrue:[
|
|
88 |
"/self halt.
|
|
89 |
"/ ] ifFalse:[
|
|
90 |
"/self halt.
|
|
91 |
"/ ]
|
|
92 |
].
|
|
93 |
|
|
94 |
^ selectedIndices
|
|
95 |
|
|
96 |
"Created: / 24.2.2000 / 19:48:05 / cg"
|
|
97 |
"Modified: / 24.2.2000 / 23:30:22 / cg"
|
|
98 |
!
|
|
99 |
|
|
100 |
getSelectedClassesFromIndices
|
|
101 |
|selected classes allSelected|
|
|
102 |
|
|
103 |
allSelected := false.
|
|
104 |
|
|
105 |
classes := classList value.
|
|
106 |
selected := self selectedClassNameIndices value collect:[:idx |
|
|
107 |
|cls|
|
|
108 |
|
|
109 |
cls := classes at:idx.
|
|
110 |
"/ cls == AllEntry ifTrue:[
|
|
111 |
"/ allSelected := true.
|
|
112 |
"/ cls.
|
|
113 |
"/ ] ifFalse:[
|
|
114 |
"/ cls notNil ifTrue:[
|
|
115 |
"/ meta value ifTrue:[
|
|
116 |
"/ cls := cls theMetaclass
|
|
117 |
"/ ] ifFalse:[
|
|
118 |
"/ cls := cls theNonMetaclass
|
|
119 |
"/ ].
|
|
120 |
"/ ].
|
|
121 |
"/ cls
|
|
122 |
"/ ]
|
|
123 |
].
|
|
124 |
|
|
125 |
"/ allSelected ifTrue:[
|
|
126 |
"/ selected := classList value select:[:cls | cls ~~ AllEntry].
|
|
127 |
"/ ].
|
|
128 |
|
|
129 |
selected := selected select:[:cls | cls notNil].
|
|
130 |
^selected.
|
|
131 |
|
|
132 |
"Created: / 24.2.2000 / 19:45:04 / cg"
|
|
133 |
! !
|
|
134 |
|
|
135 |
!InheritanceClassList methodsFor:'private'!
|
|
136 |
|
|
137 |
defaultSlaveModeValue
|
|
138 |
self organizerMode value == #category ifTrue:[^ true].
|
|
139 |
^ false
|
|
140 |
!
|
|
141 |
|
|
142 |
listOfClasses
|
|
143 |
|top classes|
|
|
144 |
|
|
145 |
(top := self topClassHolder value) isNil ifTrue:[
|
|
146 |
^ super listOfClasses
|
|
147 |
].
|
|
148 |
|
|
149 |
classes := top withAllSuperclasses copy reverse.
|
|
150 |
"/ classes addFirst:InheritedEntry.
|
|
151 |
^ classes
|
|
152 |
|
|
153 |
"Modified: / 26.2.2000 / 00:38:48 / cg"
|
|
154 |
! !
|
|
155 |
|
|
156 |
!InheritanceClassList class methodsFor:'documentation'!
|
|
157 |
|
|
158 |
version
|
|
159 |
^ '$Header: /cvs/stx/stx/libtool/Tools_InheritanceClassList.st,v 1.1 2004-02-26 18:55:29 cg Exp $'
|
|
160 |
! !
|