author | tz |
Mon, 30 Mar 1998 14:09:01 +0200 | |
changeset 745 | d3995881fa13 |
parent 680 | 49c81e9cc6f7 |
child 771 | 905c3b4ba565 |
permissions | -rw-r--r-- |
646 | 1 |
" |
2 |
COPYRIGHT (c) 1997 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 |
||
13 |
||
14 |
||
15 |
ResourceSelectionBrowser subclass:#MethodSelectionBrowser |
|
16 |
instanceVariableNames:'' |
|
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Interface-Dialogs' |
|
20 |
! |
|
21 |
||
22 |
Object subclass:#Row |
|
665 | 23 |
instanceVariableNames:'selector protocol' |
646 | 24 |
classVariableNames:'' |
25 |
poolDictionaries:'' |
|
26 |
privateIn:MethodSelectionBrowser |
|
27 |
! |
|
28 |
||
29 |
!MethodSelectionBrowser class methodsFor:'documentation'! |
|
30 |
||
31 |
copyright |
|
32 |
" |
|
33 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
34 |
All Rights Reserved |
|
35 |
||
36 |
This software is furnished under a license and may be used |
|
37 |
only in accordance with the terms of that license and with the |
|
38 |
inclusion of the above copyright notice. This software may not |
|
39 |
be provided or otherwise made available to, or used by, any |
|
40 |
other person. No title to or ownership of the software is |
|
41 |
hereby transferred. |
|
42 |
" |
|
43 |
||
44 |
||
45 |
! |
|
46 |
||
47 |
documentation |
|
48 |
" |
|
49 |
[start with:] |
|
50 |
MethodSelectionBrowser open |
|
51 |
||
52 |
[author:] |
|
53 |
Thomas Zwick |
|
54 |
" |
|
55 |
||
56 |
! ! |
|
57 |
||
58 |
!MethodSelectionBrowser class methodsFor:'instance creation'! |
|
59 |
||
60 |
request: aTitle onSuperclass: aSuperclass andClass: aClass andSelector: aSelector withTypes: aResourceTypes |
|
61 |
||
650
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
62 |
" |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
63 |
MethodSelectionBrowser |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
64 |
request: 'Select a Method' |
646 | 65 |
onSuperclass: #ApplicationModel |
66 |
andClass: #ToolApplicationModel |
|
67 |
andSelector: #saveIcon |
|
650
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
68 |
withTypes: #(class) |
646 | 69 |
" |
70 |
||
71 |
^self new |
|
72 |
title: aTitle; |
|
73 |
openOnSuperclass: aSuperclass |
|
74 |
andClass: aClass |
|
75 |
andSelector: aSelector |
|
76 |
withTypes: aResourceTypes |
|
77 |
||
78 |
||
79 |
! ! |
|
80 |
||
81 |
!MethodSelectionBrowser class methodsFor:'list specs'! |
|
82 |
||
83 |
columnsOfDataSetView |
|
84 |
||
85 |
^ #( |
|
86 |
#(#DataSetColumnSpec |
|
650
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
87 |
#label: ' Selector' |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
88 |
#'labelAlignment:' #left |
646 | 89 |
#model: #selector |
90 |
#canSelect: false |
|
91 |
) |
|
92 |
(#DataSetColumnSpec |
|
665 | 93 |
#label: ' Protocol' |
650
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
94 |
#'labelAlignment:' #left |
665 | 95 |
#model: #protocol |
646 | 96 |
#canSelect: false |
97 |
)) |
|
98 |
||
99 |
||
100 |
||
101 |
||
102 |
! ! |
|
103 |
||
104 |
!MethodSelectionBrowser methodsFor:'callbacks - user'! |
|
105 |
||
106 |
classSelected: anIndex |
|
107 |
||
108 |
self selectionOfClass value isNil ifTrue: [^nil]. |
|
109 |
self withWaitCursorDo: |
|
110 |
[ |
|
111 |
|clsName| |
|
112 |
resourceTypes isNil ifTrue: [resourceTypes := #(instance class)]. |
|
680 | 113 |
clsName := ((self listOfClassesView list at: anIndex) upTo: $ ) asSymbol. |
646 | 114 |
self valueOfClassName value: clsName. |
115 |
self class lastSelection: clsName. |
|
116 |
(resourceTypes includes: #instance) ifTrue: [ |
|
117 |
self listOfResources contents: |
|
118 |
(((Smalltalk at: clsName) |
|
119 |
selectors |
|
120 |
asOrderedCollection) |
|
665 | 121 |
collect: [:sel| Row new selector: sel; protocol: 'instance'])]. |
646 | 122 |
(resourceTypes includes: #class) ifTrue: [ |
123 |
self listOfResources addAll: |
|
124 |
(((Smalltalk at: clsName) |
|
125 |
class selectors |
|
126 |
asOrderedCollection) |
|
665 | 127 |
collect: [:sel| Row new selector: sel; protocol: 'class'])]. |
646 | 128 |
] |
129 |
||
130 |
||
131 |
! ! |
|
132 |
||
133 |
!MethodSelectionBrowser methodsFor:'instance creation'! |
|
134 |
||
135 |
openOnSuperclass: aSuperclassOrSymbol andClass: aClassOrSymbol andSelector: aSelector withTypes: aResourceTypes |
|
136 |
||
650
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
137 |
|message type row| |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
138 |
message := super openOnSuperclass: aSuperclassOrSymbol |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
139 |
andClass: aClassOrSymbol |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
140 |
andSelector: aSelector |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
141 |
withResourceTypes: aResourceTypes. |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
142 |
|
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
143 |
(message notNil and: |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
144 |
[((row := self selectionOfResource value) notNil and: |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
145 |
[(type := row type) = 'class'])]) |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
146 |
ifTrue: |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
147 |
[ |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
148 |
message := message replChar:$ withString: ' class ' |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
149 |
]. |
495b35593c09
the returning message should contain some info about the method protocol type
tz
parents:
646
diff
changeset
|
150 |
^message |
646 | 151 |
|
152 |
||
153 |
||
154 |
! ! |
|
155 |
||
156 |
!MethodSelectionBrowser methodsFor:'startup / release'! |
|
157 |
||
158 |
postBuildWith:aBuilder |
|
159 |
||
160 |
title := 'Method Selection Browser'. |
|
161 |
||
162 |
^super postBuildWith:aBuilder |
|
163 |
||
164 |
! ! |
|
165 |
||
166 |
!MethodSelectionBrowser::Row methodsFor:'accessing'! |
|
167 |
||
665 | 168 |
protocol |
169 |
||
170 |
^protocol |
|
171 |
||
172 |
||
173 |
! |
|
174 |
||
175 |
protocol: aString |
|
176 |
||
177 |
protocol := aString |
|
178 |
||
179 |
||
180 |
! |
|
181 |
||
646 | 182 |
selector |
183 |
||
184 |
^selector |
|
185 |
||
186 |
! |
|
187 |
||
188 |
selector: aSymbol |
|
189 |
||
190 |
selector := aSymbol |
|
191 |
||
192 |
! ! |
|
193 |
||
194 |
!MethodSelectionBrowser class methodsFor:'documentation'! |
|
195 |
||
196 |
version |
|
197 |
^ '$Header$' |
|
198 |
! ! |