10003
|
1 |
"
|
10040
|
2 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
|
|
3 |
Copyright (c) 2009-2010 eXept Software AG
|
10003
|
4 |
|
10040
|
5 |
Permission is hereby granted, free of charge, to any person
|
|
6 |
obtaining a copy of this software and associated documentation
|
|
7 |
files (the 'Software'), to deal in the Software without
|
|
8 |
restriction, including without limitation the rights to use,
|
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10 |
copies of the Software, and to permit persons to whom the
|
|
11 |
Software is furnished to do so, subject to the following
|
|
12 |
conditions:
|
|
13 |
|
|
14 |
The above copyright notice and this permission notice shall be
|
|
15 |
included in all copies or substantial portions of the Software.
|
|
16 |
|
|
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
24 |
OTHER DEALINGS IN THE SOFTWARE.
|
10003
|
25 |
"
|
|
26 |
"{ Package: 'stx:libtool' }"
|
|
27 |
|
|
28 |
"{ NameSpace: Tools }"
|
|
29 |
|
|
30 |
MethodList subclass:#ImplementingClassList
|
|
31 |
instanceVariableNames:''
|
|
32 |
classVariableNames:''
|
|
33 |
poolDictionaries:''
|
|
34 |
category:'Interface-Browsers-New'
|
|
35 |
!
|
|
36 |
|
|
37 |
!ImplementingClassList class methodsFor:'documentation'!
|
|
38 |
|
|
39 |
copyright
|
|
40 |
"
|
10040
|
41 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
|
|
42 |
Copyright (c) 2009-2010 eXept Software AG
|
|
43 |
|
|
44 |
Permission is hereby granted, free of charge, to any person
|
|
45 |
obtaining a copy of this software and associated documentation
|
|
46 |
files (the 'Software'), to deal in the Software without
|
|
47 |
restriction, including without limitation the rights to use,
|
|
48 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
49 |
copies of the Software, and to permit persons to whom the
|
|
50 |
Software is furnished to do so, subject to the following
|
|
51 |
conditions:
|
10003
|
52 |
|
10040
|
53 |
The above copyright notice and this permission notice shall be
|
|
54 |
included in all copies or substantial portions of the Software.
|
|
55 |
|
|
56 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
57 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
58 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
59 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
60 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
61 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
62 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
63 |
OTHER DEALINGS IN THE SOFTWARE.
|
10003
|
64 |
"
|
|
65 |
!
|
|
66 |
|
|
67 |
documentation
|
|
68 |
"
|
|
69 |
Like a ClassList, but shows classes hierarchical.
|
|
70 |
|
|
71 |
If topClassHolders value is non-nil, only that classes hierarchy
|
|
72 |
is shown.
|
|
73 |
|
|
74 |
embeddable application displaying the classes as listed by
|
|
75 |
the inputGenerator.
|
|
76 |
Provides an outputGenerator, which enumerates the classes and
|
|
77 |
their protocols (method-categories) in the selected classes.
|
|
78 |
|
|
79 |
[author:]
|
|
80 |
Claus Gittinger (cg@exept.de)
|
|
81 |
"
|
|
82 |
|
|
83 |
|
|
84 |
! !
|
|
85 |
|
|
86 |
!ImplementingClassList methodsFor:'private'!
|
|
87 |
|
|
88 |
listOfMethodNames
|
|
89 |
|methods entries newNameList
|
|
90 |
allCategories classUses allSelectors generator
|
|
91 |
"theMethod"|
|
|
92 |
|
|
93 |
generator := inGeneratorHolder value.
|
|
94 |
generator isNil ifTrue:[^ #() ].
|
|
95 |
|
|
96 |
classUses := Bag identityNew.
|
|
97 |
allSelectors := IdentitySet new.
|
|
98 |
allCategories := Set new.
|
|
99 |
entries := OrderedCollection new.
|
|
100 |
|
|
101 |
"/ generator generates nil-selector entries
|
|
102 |
"/ to pass multiple-class and multiple-protocol info
|
|
103 |
generator do:[:cls :cat :sel :mthd |
|
|
104 |
sel notNil ifTrue:[
|
|
105 |
entries add:(Array with:cls with:sel with:mthd).
|
|
106 |
classUses add:cls.
|
|
107 |
allSelectors add:sel.
|
|
108 |
allCategories add:mthd category.
|
|
109 |
]
|
|
110 |
].
|
|
111 |
|
|
112 |
entries sort:[:a :b | |clsNmA clsNmB|
|
|
113 |
clsNmA := (a at:1) name.
|
|
114 |
clsNmB := (b at:1) name.
|
|
115 |
clsNmA < clsNmB
|
|
116 |
].
|
|
117 |
|
|
118 |
newNameList := entries collect:[:entry |
|
|
119 |
|class nm|
|
|
120 |
|
|
121 |
class := (entry at:1).
|
|
122 |
nm := class name.
|
|
123 |
((allSelectors size > 1)
|
|
124 |
or:[(classUses occurrencesOf:class) > 1]) ifTrue:[
|
|
125 |
nm := nm , ' ' , (entry at:2)
|
|
126 |
].
|
|
127 |
allCategories size > 1 ifTrue:[
|
|
128 |
nm := nm , ' {' , (entry at:3) category , '}'
|
|
129 |
].
|
|
130 |
"/ class name , ' ' , (entry at:2)
|
|
131 |
nm
|
|
132 |
].
|
|
133 |
methods := entries collect:[:entry | (entry at:3)].
|
|
134 |
methodList := methods.
|
|
135 |
"/ methods size == 1 ifTrue:[
|
|
136 |
"/ theMethod := methods first.
|
|
137 |
"/ self methodLabelHolder value:(theMethod mclass name , ' ' , theMethod selector).
|
|
138 |
"/ ].
|
|
139 |
^ newNameList.
|
|
140 |
|
|
141 |
"Created: / 5.2.2000 / 22:43:40 / cg"
|
|
142 |
"Modified: / 1.3.2000 / 21:00:26 / cg"
|
|
143 |
! !
|
|
144 |
|
|
145 |
!ImplementingClassList class methodsFor:'documentation'!
|
|
146 |
|
|
147 |
version_CVS
|
10040
|
148 |
^ '$Header: /cvs/stx/stx/libtool/Tools__ImplementingClassList.st,v 1.2 2011-07-03 13:37:11 cg Exp $'
|
10003
|
149 |
!
|
|
150 |
|
|
151 |
version_SVN
|
|
152 |
^ '§Id: Tools__ImplementingClassList.st 7796 2011-06-23 16:01:32Z vranyj1 §'
|
|
153 |
! !
|