5592
|
1 |
"{ Package: 'stx:libtool' }"
|
5591
|
2 |
|
|
3 |
"{ NameSpace: Tools }"
|
|
4 |
|
|
5 |
MethodCategoryList subclass:#FullMethodCategoryList
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'Interface-Browsers-New'
|
|
10 |
!
|
|
11 |
|
|
12 |
!FullMethodCategoryList class methodsFor:'documentation'!
|
|
13 |
|
|
14 |
documentation
|
|
15 |
"
|
|
16 |
embeddable application displaying the classes as listed by
|
|
17 |
the inputGenerator.
|
|
18 |
Provides an outputGenerator, which enumerates the classes and
|
|
19 |
their protocols (method-categories) in the selected classes.
|
|
20 |
|
|
21 |
[author:]
|
|
22 |
Claus Gittinger (cg@exept.de)
|
|
23 |
"
|
|
24 |
|
|
25 |
|
|
26 |
! !
|
|
27 |
|
|
28 |
!FullMethodCategoryList methodsFor:'generators'!
|
|
29 |
|
|
30 |
makeGenerator
|
|
31 |
"return a generator which enumerates the methods from the selected protocol;
|
|
32 |
that generator generates 4-element elements (includes the class and protocol),
|
|
33 |
in order to make the consumers only depend on one input
|
|
34 |
(i.e. to pass multiple-class and multiple-protocol info
|
|
35 |
without a need for another classHolder/protocolHolder in the methodList)."
|
|
36 |
|
|
37 |
^ Iterator on:[:whatToDo |
|
|
38 |
|protocols all packages theProtocol|
|
|
39 |
|
|
40 |
protocols := self selectedProtocols value ? #().
|
|
41 |
|
|
42 |
all := protocols includes:(self class nameListEntryForALL).
|
|
43 |
packages := packageFilter value value.
|
|
44 |
|
|
45 |
protocols size > 0 ifTrue:[
|
|
46 |
protocols size == 1 ifTrue:[
|
|
47 |
theProtocol := protocols first.
|
|
48 |
Smalltalk allClassesDo:[:eachClass |
|
|
49 |
eachClass instAndClassSelectorsAndMethodsDo:[:sel :eachMethod |
|
|
50 |
|cat|
|
|
51 |
|
|
52 |
cat := eachMethod category.
|
|
53 |
(all
|
|
54 |
or:[theProtocol = cat]) ifTrue:[
|
|
55 |
(packages isNil
|
|
56 |
or:[packages includes:eachMethod package])
|
|
57 |
ifTrue:[
|
|
58 |
whatToDo value:eachMethod mclass value:cat value:sel value:eachMethod.
|
|
59 |
].
|
|
60 |
].
|
|
61 |
].
|
|
62 |
]
|
|
63 |
] ifFalse:[
|
|
64 |
Smalltalk allClassesDo:[:eachClass |
|
|
65 |
eachClass instAndClassSelectorsAndMethodsDo:[:sel :eachMethod |
|
|
66 |
|cat|
|
|
67 |
|
|
68 |
cat := eachMethod category.
|
|
69 |
(all
|
|
70 |
or:[protocols includes:cat]) ifTrue:[
|
|
71 |
(packages isNil
|
|
72 |
or:[packages includes:eachMethod package])
|
|
73 |
ifTrue:[
|
|
74 |
whatToDo value:eachMethod mclass value:cat value:sel value:eachMethod.
|
|
75 |
].
|
|
76 |
].
|
|
77 |
].
|
|
78 |
]
|
|
79 |
]
|
|
80 |
]
|
|
81 |
]
|
|
82 |
! !
|
|
83 |
|
|
84 |
!FullMethodCategoryList methodsFor:'private'!
|
|
85 |
|
|
86 |
listOfMethodCategories
|
|
87 |
|categories|
|
|
88 |
|
|
89 |
categories := Set new.
|
|
90 |
|
|
91 |
"return all existing categories"
|
|
92 |
Method allInstancesDo:[:eachMethod |
|
|
93 |
categories add:eachMethod category
|
|
94 |
].
|
|
95 |
categories := categories asOrderedCollection sort.
|
|
96 |
categories addFirst:(self class nameListEntryForALL).
|
|
97 |
^ categories
|
|
98 |
|
|
99 |
|
|
100 |
! !
|
|
101 |
|
|
102 |
!FullMethodCategoryList class methodsFor:'documentation'!
|
|
103 |
|
|
104 |
version
|
5592
|
105 |
^ '$Header: /cvs/stx/stx/libtool/Tools_FullMethodCategoryList.st,v 1.2 2004-02-26 19:03:55 cg Exp $'
|
5591
|
106 |
! !
|