5592
|
1 |
"{ Package: 'stx:libtool' }"
|
5591
|
2 |
|
|
3 |
"{ NameSpace: Tools }"
|
|
4 |
|
|
5 |
MethodList subclass:#ImplementingClassList
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'Interface-Browsers-New'
|
|
10 |
!
|
|
11 |
|
|
12 |
!ImplementingClassList class methodsFor:'documentation'!
|
|
13 |
|
|
14 |
documentation
|
|
15 |
"
|
|
16 |
Like a ClassList, but shows classes hierarchical.
|
|
17 |
|
|
18 |
If topClassHolders value is non-nil, only that classes hierarchy
|
|
19 |
is shown.
|
|
20 |
|
|
21 |
embeddable application displaying the classes as listed by
|
|
22 |
the inputGenerator.
|
|
23 |
Provides an outputGenerator, which enumerates the classes and
|
|
24 |
their protocols (method-categories) in the selected classes.
|
|
25 |
|
|
26 |
[author:]
|
|
27 |
Claus Gittinger (cg@exept.de)
|
|
28 |
"
|
|
29 |
|
|
30 |
|
|
31 |
! !
|
|
32 |
|
|
33 |
!ImplementingClassList methodsFor:'private'!
|
|
34 |
|
|
35 |
listOfMethodNames
|
|
36 |
|methods entries newNameList
|
|
37 |
allCategories classUses allSelectors generator
|
|
38 |
"theMethod"|
|
|
39 |
|
|
40 |
generator := inGeneratorHolder value.
|
|
41 |
generator isNil ifTrue:[^ #() ].
|
|
42 |
|
|
43 |
classUses := Bag identityNew.
|
|
44 |
allSelectors := IdentitySet new.
|
|
45 |
allCategories := Set new.
|
|
46 |
entries := OrderedCollection new.
|
|
47 |
|
|
48 |
"/ generator generates nil-selector entries
|
|
49 |
"/ to pass multiple-class and multiple-protocol info
|
|
50 |
generator do:[:cls :cat :sel :mthd |
|
|
51 |
sel notNil ifTrue:[
|
|
52 |
entries add:(Array with:cls with:sel with:mthd).
|
|
53 |
classUses add:cls.
|
|
54 |
allSelectors add:sel.
|
|
55 |
allCategories add:mthd category.
|
|
56 |
]
|
|
57 |
].
|
|
58 |
|
|
59 |
entries sort:[:a :b | |clsNmA clsNmB|
|
|
60 |
clsNmA := (a at:1) name.
|
|
61 |
clsNmB := (b at:1) name.
|
|
62 |
clsNmA < clsNmB
|
|
63 |
].
|
|
64 |
|
|
65 |
newNameList := entries collect:[:entry |
|
|
66 |
|class nm|
|
|
67 |
|
|
68 |
class := (entry at:1).
|
|
69 |
nm := class name.
|
|
70 |
((allSelectors size > 1)
|
|
71 |
or:[(classUses occurrencesOf:class) > 1]) ifTrue:[
|
|
72 |
nm := nm , ' ' , (entry at:2)
|
|
73 |
].
|
|
74 |
allCategories size > 1 ifTrue:[
|
|
75 |
nm := nm , ' {' , (entry at:3) category , '}'
|
|
76 |
].
|
|
77 |
"/ class name , ' ' , (entry at:2)
|
|
78 |
nm
|
|
79 |
].
|
|
80 |
methods := entries collect:[:entry | (entry at:3)].
|
|
81 |
methodList := methods.
|
|
82 |
"/ methods size == 1 ifTrue:[
|
|
83 |
"/ theMethod := methods first.
|
|
84 |
"/ self methodLabelHolder value:(theMethod mclass name , ' ' , theMethod selector).
|
|
85 |
"/ ].
|
|
86 |
^ newNameList.
|
|
87 |
|
|
88 |
"Created: / 5.2.2000 / 22:43:40 / cg"
|
|
89 |
"Modified: / 1.3.2000 / 21:00:26 / cg"
|
|
90 |
! !
|
|
91 |
|
|
92 |
!ImplementingClassList class methodsFor:'documentation'!
|
|
93 |
|
|
94 |
version
|
5592
|
95 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ImplementingClassList.st,v 1.2 2004-02-26 19:03:55 cg Exp $'
|
5591
|
96 |
! !
|