author | Stefan Vogel <sv@exept.de> |
Thu, 07 May 2009 13:18:25 +0200 | |
changeset 2490 | 4f05f9fb089e |
parent 2441 | a0c5da242681 |
child 2760 | 11963b80d72c |
permissions | -rw-r--r-- |
425 | 1 |
" |
771 | 2 |
COPYRIGHT (c) 1997-1998 by eXept Software AG |
425 | 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 |
" |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
12 |
"{ Package: 'stx:libtool2' }" |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
13 |
|
425 | 14 |
SelectionBrowser subclass:#ResourceSelectionBrowser |
477 | 15 |
instanceVariableNames:'resourceMethod resourceClass resourceSuperclass resourceTypes |
906 | 16 |
allClasses classSelectionBlock' |
17 |
classVariableNames:'ClassPresentation' |
|
425 | 18 |
poolDictionaries:'' |
619 | 19 |
category:'Interface-Dialogs' |
425 | 20 |
! |
21 |
||
771 | 22 |
Object subclass:#ResourceMethod |
523 | 23 |
instanceVariableNames:'method icon resourceType selector' |
24 |
classVariableNames:'' |
|
25 |
poolDictionaries:'' |
|
26 |
privateIn:ResourceSelectionBrowser |
|
27 |
! |
|
28 |
||
425 | 29 |
!ResourceSelectionBrowser class methodsFor:'documentation'! |
30 |
||
31 |
copyright |
|
32 |
" |
|
771 | 33 |
COPYRIGHT (c) 1997-1998 by eXept Software AG |
425 | 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 |
documentation |
|
47 |
" |
|
746 | 48 |
The ResourceSelectionBrowser allows you to browse in class hierarchies |
771 | 49 |
and to select resource methods for loading or to saving resource |
50 |
specifications (#canvas, #menu, etc.). |
|
51 |
||
52 |
[instance variables:] |
|
907 | 53 |
resourceMethod <Symbol> selector of the resource spec |
54 |
resourceClass <Symbol> class of the resource spec |
|
55 |
resourceSuperclass <Symbol> root class of the tree list |
|
56 |
resourceTypes <Array> allowed resource types |
|
57 |
allClasses <Array> list of the subclasses of resourceSuperclass |
|
58 |
classSelectionBlock <Block> by evaluating this block the class selection is done |
|
746 | 59 |
|
504 | 60 |
[start with:] |
907 | 61 |
ResourceSelectionBrowser open |
504 | 62 |
|
63 |
[author:] |
|
907 | 64 |
Thomas Zwick, eXept Software AG |
425 | 65 |
" |
66 |
! ! |
|
67 |
||
68 |
!ResourceSelectionBrowser class methodsFor:'instance creation'! |
|
69 |
||
1978 | 70 |
request:aTitle onSuperclass:aSuperclass andClass:aClassOrClassName andSelector:aSelector withResourceTypes:resourceTypes |
71 |
"opens a ResourceSelectionBrowser; return a Message-object or nil." |
|
72 |
||
73 |
^ (self new |
|
74 |
title: aTitle) |
|
75 |
openOnSuperclass:aSuperclass |
|
76 |
andClass:aClassOrClassName |
|
77 |
andSelector:aSelector |
|
78 |
withResourceTypes:resourceTypes |
|
79 |
||
649 | 80 |
" |
1978 | 81 |
ResourceSelectionBrowser |
906 | 82 |
request: 'Select a Resource Selector' |
83 |
onSuperclass: #ApplicationModel |
|
1978 | 84 |
andClassNamed: #MenuEditor |
906 | 85 |
andSelector: #menuItemImage |
86 |
withResourceTypes: #(image) |
|
425 | 87 |
" |
88 |
! ! |
|
89 |
||
1725 | 90 |
!ResourceSelectionBrowser class methodsFor:'callbacks-default'! |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
91 |
|
906 | 92 |
treeViewClassHierarchyChildren |
771 | 93 |
"returns the children for the contents (class) of aTreeItem as a block" |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
94 |
|
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
95 |
"/ cg: tz's algorithm was very-very slow, |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
96 |
"/ (it enumerated classes hundreds of times, |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
97 |
"/ leading to a square runtime behavior |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
98 |
"/ - i.e. very slow scrolling ) |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
99 |
"/ Speed up things by caching facts while enumerating |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
100 |
"/ classes once only. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
101 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
102 |
|subclassesAndPrivateClassesPerClass| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
103 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
104 |
subclassesAndPrivateClassesPerClass := IdentityDictionary new. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
105 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
106 |
Smalltalk allClassesDo:[:cls | |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
107 |
|owner superclass info| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
108 |
|
1732 | 109 |
"/ (owner := cls owningClass) notNil ifTrue:[ |
110 |
"/ info := subclassesAndPrivateClassesPerClass at:owner ifAbsent:nil. |
|
111 |
"/ info isNil ifTrue:[ |
|
112 |
"/ subclassesAndPrivateClassesPerClass at:owner put:(info := Array with:IdentitySet new |
|
113 |
"/ with:IdentitySet new). |
|
114 |
"/ ]. |
|
115 |
"/ (info at:2) add:cls |
|
116 |
"/ ] ifFalse:[ |
|
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
117 |
superclass := cls superclass. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
118 |
superclass notNil ifTrue:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
119 |
info := subclassesAndPrivateClassesPerClass at:superclass ifAbsent:nil. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
120 |
info isNil ifTrue:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
121 |
subclassesAndPrivateClassesPerClass at:superclass put:(info := Array with:IdentitySet new |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
122 |
with:IdentitySet new). |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
123 |
]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
124 |
(info at:1) add:cls |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
125 |
] |
1732 | 126 |
"/ ] |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
127 |
]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
128 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
129 |
^ [:aTreeItem| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
130 |
|classes itemClass info| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
131 |
|
906 | 132 |
classes := OrderedCollection new. |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
133 |
itemClass := aTreeItem contents. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
134 |
info := subclassesAndPrivateClassesPerClass at:itemClass ifAbsent:nil. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
135 |
info notNil ifTrue:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
136 |
classes addAll:((info at:1) asSortedCollection: [:cls1 :cls2| cls1 name < cls2 name]). |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
137 |
classes addAll:((info at:2) asSortedCollection: [:cls1 :cls2| cls1 name < cls2 name]). |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
138 |
]. |
906 | 139 |
classes |
718 | 140 |
] |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
141 |
! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
142 |
|
906 | 143 |
treeViewClassHierarchyContents |
771 | 144 |
"returns the default contents of the root of the class tree list" |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
145 |
|
802 | 146 |
^ Object |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
147 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
148 |
! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
149 |
|
906 | 150 |
treeViewClassHierarchyIcon |
771 | 151 |
"returns the icon for aTreeItem as a block" |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
152 |
|
718 | 153 |
^[:aTreeItem| |
906 | 154 |
|icon| |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
155 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
156 |
aTreeItem contents isClass ifTrue:[ |
906 | 157 |
icon := self iconClass. |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
158 |
aTreeItem contents isPrivate ifTrue:[ |
906 | 159 |
icon := self iconPrivateClass |
160 |
]. |
|
161 |
icon |
|
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
162 |
] ifFalse:[ |
906 | 163 |
self iconCategory |
164 |
] |
|
771 | 165 |
] |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
166 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
167 |
! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
168 |
|
906 | 169 |
treeViewClassHierarchyLabel |
771 | 170 |
"returns the label for aTreeItem as a block" |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
171 |
|
718 | 172 |
^[:aTreeItem| |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
173 |
|label superCls itemContents| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
174 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
175 |
itemContents := aTreeItem contents. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
176 |
label := itemContents name. |
1732 | 177 |
"/ (itemContents isPrivate |
178 |
"/ and:[aTreeItem parent contents ~~ (superCls := itemContents superclass)]) |
|
179 |
"/ ifTrue: [label := label, ' (', superCls name, ')']. |
|
906 | 180 |
label |
718 | 181 |
] |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
182 |
! ! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
183 |
|
730 | 184 |
!ResourceSelectionBrowser class methodsFor:'image specs'! |
185 |
||
906 | 186 |
iconCategory |
187 |
"This resource specification was automatically generated |
|
188 |
by the ImageEditor of ST/X." |
|
189 |
||
190 |
"Do not manually edit this!! If it is corrupted, |
|
191 |
the ImageEditor may not be able to read the specification." |
|
192 |
||
193 |
" |
|
194 |
self iconCategory inspect |
|
195 |
ImageEditor openOnClass:self andSelector:#iconCategory |
|
196 |
" |
|
197 |
||
198 |
<resource: #image> |
|
199 |
||
200 |
^Icon |
|
2441
a0c5da242681
image resource method fixes (key must be name of method)
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
201 |
constantNamed:#'ResourceSelectionBrowser class iconCategory' |
1493 | 202 |
ifAbsentPut:[(Depth4Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'3L0@@@@@@L3L3L@@@@@@@@3L3@@3L3L3L0CL3@LQDQDQD#CL3@LRH"H"H3CL3@LRH"H"H3CL3@LRH"H"H3CL3@LRH"H"H3CL3@LRH"H"H3CL3@LRH"H"H3CL3@LRH"H"H3CL3@LRH"H"H3CL3@L#L3L3L3CL3@@3L3L3L0CL3L@@@@@@@@3L3L0@@@@@@L3L') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 127 127 127 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127]; mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'<@O@8@G@3?3@7?;@7?;@7?;@7?;@7?;@7?;@7?;@7?;@7?;@7?;@3?3@8@G@<@O@') ; yourself); yourself] |
203 |
! |
|
906 | 204 |
|
730 | 205 |
iconClass |
746 | 206 |
"This resource specification was automatically generated |
207 |
by the ImageEditor of ST/X." |
|
208 |
||
209 |
"Do not manually edit this!! If it is corrupted, |
|
210 |
the ImageEditor may not be able to read the specification." |
|
211 |
||
730 | 212 |
" |
1404 | 213 |
self iconClass inspect |
746 | 214 |
ImageEditor openOnClass:self andSelector:#iconClass |
730 | 215 |
" |
216 |
||
217 |
<resource: #image> |
|
218 |
||
219 |
^Icon |
|
2441
a0c5da242681
image resource method fixes (key must be name of method)
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
220 |
constantNamed:#'ResourceSelectionBrowser class iconClass' |
1493 | 221 |
ifAbsentPut:[(Depth2Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@*****ABUUUUT@IUUUUP@%UUUU@BUUUUT@IUUUUP@%UUUU@BUUUUT@IUUUUP@%UUUU@BUUUUT@IUUUUP@%UUUU@A@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 170 170 170 255 255 255]; mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?>@???@???@???@???@???@???@???@???@???@???@???@???@???@???@_?>@') ; yourself); yourself] |
222 |
! |
|
730 | 223 |
|
224 |
iconPrivateClass |
|
746 | 225 |
"This resource specification was automatically generated |
226 |
by the ImageEditor of ST/X." |
|
227 |
||
228 |
"Do not manually edit this!! If it is corrupted, |
|
229 |
the ImageEditor may not be able to read the specification." |
|
230 |
||
730 | 231 |
" |
746 | 232 |
ImageEditor openOnClass:self andSelector:#iconPrivateClass |
730 | 233 |
" |
234 |
||
235 |
<resource: #image> |
|
236 |
||
237 |
^Icon |
|
2441
a0c5da242681
image resource method fixes (key must be name of method)
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
238 |
constantNamed:#'ResourceSelectionBrowser class iconPrivateClass' |
a0c5da242681
image resource method fixes (key must be name of method)
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
239 |
ifAbsentPut:[(Depth2Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@PUUUUU A****(@F*??* @Z+??*@A*/*>(OF*>+: @Z+??*@A*/?:(DF*>** @Z+:**@A*/**(@F*>** @Z****C2@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 255 0 0]; mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?>@???@???@???@???@???@???@???@???@???@???@???@???@???@???@_?>@') ; yourself); yourself] |
1493 | 240 |
! ! |
730 | 241 |
|
425 | 242 |
!ResourceSelectionBrowser class methodsFor:'interface specs'! |
243 |
||
244 |
windowSpec |
|
746 | 245 |
"This resource specification was automatically generated |
246 |
by the UIPainter of ST/X." |
|
425 | 247 |
|
746 | 248 |
"Do not manually edit this!! If it is corrupted, |
249 |
the UIPainter may not be able to read the specification." |
|
425 | 250 |
|
251 |
" |
|
252 |
UIPainter new openOnClass:ResourceSelectionBrowser andSelector:#windowSpec |
|
253 |
ResourceSelectionBrowser new openInterface:#windowSpec |
|
746 | 254 |
ResourceSelectionBrowser open |
425 | 255 |
" |
256 |
||
257 |
<resource: #canvas> |
|
258 |
||
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
259 |
^ |
1751 | 260 |
#(FullSpec |
261 |
name: windowSpec |
|
262 |
window: |
|
263 |
(WindowSpec |
|
264 |
label: 'Resource Selection Browser' |
|
265 |
name: 'Resource Selection Browser' |
|
266 |
min: (Point 400 300) |
|
267 |
max: (Point 1152 864) |
|
268 |
bounds: (Rectangle 12 22 612 372) |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
269 |
) |
1751 | 270 |
component: |
271 |
(SpecCollection |
|
272 |
collection: ( |
|
273 |
(VariableHorizontalPanelSpec |
|
274 |
name: 'VariableHorizontalPanel' |
|
275 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -36 1.0) |
|
276 |
component: |
|
277 |
(SpecCollection |
|
278 |
collection: ( |
|
279 |
(ViewSpec |
|
280 |
name: 'Box1' |
|
281 |
component: |
|
282 |
(SpecCollection |
|
283 |
collection: ( |
|
284 |
(HorizontalPanelViewSpec |
|
285 |
name: 'HorizontalPanel2' |
|
286 |
layout: (LayoutFrame 0 0 2 0 297 0 23 0) |
|
287 |
horizontalLayout: leftSpace |
|
288 |
verticalLayout: fit |
|
289 |
horizontalSpace: 3 |
|
290 |
verticalSpace: 3 |
|
291 |
component: |
|
292 |
(SpecCollection |
|
293 |
collection: ( |
|
294 |
(RadioButtonSpec |
|
295 |
label: 'Categories' |
|
296 |
name: 'ClassCategoriesRadioButton' |
|
297 |
translateLabel: true |
|
298 |
model: selectionOfClassPresentation |
|
299 |
isTriggerOnDown: true |
|
300 |
lampColor: (Color 0.0 0.0 0.0) |
|
301 |
select: #'Class Categories' |
|
302 |
extent: (Point 124 21) |
|
773 | 303 |
) |
1751 | 304 |
(RadioButtonSpec |
305 |
label: 'Hierarchy' |
|
306 |
name: 'ClassHierarchyRadioButton' |
|
307 |
translateLabel: true |
|
308 |
model: selectionOfClassPresentation |
|
309 |
isTriggerOnDown: true |
|
310 |
lampColor: (Color 0.0 0.0 0.0) |
|
311 |
select: #'Class Hierarchy' |
|
312 |
extent: (Point 145 21) |
|
773 | 313 |
) |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
314 |
) |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
315 |
|
773 | 316 |
) |
317 |
) |
|
1751 | 318 |
(SelectionInTreeViewSpec |
319 |
name: 'listOfClassHierarchyView' |
|
320 |
layout: (LayoutFrame 0 0.0 23 0.0 0 1.0 -24 1.0) |
|
321 |
tabable: true |
|
322 |
model: selectionOfClassHierarchy |
|
323 |
hasHorizontalScrollBar: true |
|
324 |
hasVerticalScrollBar: true |
|
325 |
miniScrollerHorizontal: true |
|
326 |
showDirectoryIndicatorForRoot: false |
|
327 |
showDirectoryIndicator: true |
|
328 |
valueChangeSelector: classSelected |
|
329 |
hierarchicalList: rootOfClassHierarchy |
|
330 |
validateDoubleClickSelector: validateDoubleClick: |
|
331 |
contentsSelector: treeViewClassHierarchyContents |
|
332 |
labelSelector: treeViewClassHierarchyLabel |
|
333 |
childrenSelector: treeViewClassHierarchyChildren |
|
334 |
iconSelector: treeViewClassHierarchyIcon |
|
335 |
highlightMode: line |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
336 |
) |
1751 | 337 |
(SelectionInTreeViewSpec |
338 |
name: 'listOfClassCategoriesView' |
|
339 |
layout: (LayoutFrame 0 0.0 23 0.0 0 1.0 -24 1.0) |
|
340 |
tabable: true |
|
341 |
model: selectionOfClassCategories |
|
342 |
hasHorizontalScrollBar: true |
|
343 |
hasVerticalScrollBar: true |
|
344 |
miniScrollerHorizontal: true |
|
345 |
showRoot: false |
|
346 |
showDirectoryIndicator: true |
|
347 |
valueChangeSelector: classSelected |
|
348 |
hierarchicalList: rootOfClassCategories |
|
349 |
validateDoubleClickSelector: validateDoubleClick: |
|
350 |
childrenSelector: treeViewClassCategoryChildren |
|
351 |
iconSelector: treeViewClassCategoryIcon |
|
352 |
highlightMode: line |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
353 |
) |
1751 | 354 |
(InputFieldSpec |
355 |
name: 'classNameInputField' |
|
356 |
layout: (LayoutFrame 2 0.0 -22 1 -1 1.0 0 1) |
|
357 |
tabable: true |
|
1986 | 358 |
model: classNameHolder |
1751 | 359 |
acceptOnLeave: true |
360 |
acceptOnLostFocus: true |
|
361 |
acceptOnPointerLeave: true |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
362 |
) |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
363 |
) |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
364 |
|
773 | 365 |
) |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
366 |
) |
1751 | 367 |
(ViewSpec |
368 |
name: 'Box2' |
|
369 |
component: |
|
370 |
(SpecCollection |
|
371 |
collection: ( |
|
372 |
(DataSetSpec |
|
373 |
name: 'resourcesDataSetView' |
|
374 |
layout: (LayoutFrame 2 0.0 2 0.0 -2 1.0 -24 1.0) |
|
375 |
model: selectionOfResourceMethod |
|
376 |
hasHorizontalScrollBar: true |
|
377 |
hasVerticalScrollBar: true |
|
378 |
miniScrollerHorizontal: true |
|
379 |
rowClassName: 'ResourceSelectionBrowser::Row' |
|
380 |
dataList: listOfResourceMethods |
|
381 |
useIndex: false |
|
382 |
has3Dsepartors: true |
|
383 |
has3Dseparators: true |
|
384 |
doubleClickSelector: resourceDoubleClicked |
|
385 |
columnHolder: resourceMethodColumns |
|
386 |
valueChangeSelector: resourceSelected |
|
387 |
verticalSpacing: 1 |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
388 |
) |
1751 | 389 |
(InputFieldSpec |
390 |
name: 'selectorInputField' |
|
391 |
layout: (LayoutFrame 2 0.0 -22 1 -2 1.0 0 1) |
|
392 |
tabable: true |
|
1986 | 393 |
model: resourceSelectorHolder |
1751 | 394 |
acceptOnLeave: true |
395 |
acceptOnLostFocus: true |
|
396 |
acceptOnPointerLeave: true |
|
906 | 397 |
) |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
398 |
) |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
399 |
|
906 | 400 |
) |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
401 |
) |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
402 |
) |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
403 |
|
773 | 404 |
) |
1751 | 405 |
handles: (Any 0.5 1.0) |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
406 |
) |
1751 | 407 |
(HorizontalPanelViewSpec |
408 |
name: 'ButtonPanel' |
|
409 |
layout: (LayoutFrame 2 0.0 -30 1 -2 1.0 -4 1.0) |
|
410 |
horizontalLayout: fit |
|
411 |
verticalLayout: fit |
|
412 |
reverseOrderIfOKAtLeft: true |
|
413 |
component: |
|
414 |
(SpecCollection |
|
415 |
collection: ( |
|
416 |
(ActionButtonSpec |
|
417 |
label: 'Help' |
|
418 |
name: 'HelpButton' |
|
419 |
activeHelpKey: dss |
|
420 |
model: openHTMLDocument: |
|
421 |
initiallyDisabled: true |
|
422 |
enableChannel: helpEnabled |
|
423 |
actionValue: 'tools/uipainter/ResourceSelectionBrowser.html' |
|
424 |
extent: (Point 196 26) |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
425 |
) |
1751 | 426 |
(ActionButtonSpec |
427 |
label: 'Cancel' |
|
428 |
name: 'cancelButton' |
|
429 |
activeHelpKey: commitCancel |
|
430 |
tabable: true |
|
431 |
model: cancel |
|
432 |
extent: (Point 197 26) |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
433 |
) |
1751 | 434 |
(ActionButtonSpec |
435 |
label: 'OK' |
|
436 |
name: 'okButton' |
|
437 |
activeHelpKey: commitOK |
|
438 |
tabable: true |
|
439 |
model: accept |
|
440 |
isDefault: true |
|
441 |
extent: (Point 197 26) |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
442 |
) |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
443 |
) |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
444 |
|
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
445 |
) |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
446 |
) |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
447 |
) |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
448 |
|
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
449 |
) |
425 | 450 |
) |
451 |
! ! |
|
452 |
||
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
453 |
!ResourceSelectionBrowser class methodsFor:'list specs'! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
454 |
|
822 | 455 |
tableColumnsForResourceMethodAttributes |
821 | 456 |
"This resource specification was automatically generated |
457 |
by the DataSetBuilder of ST/X." |
|
458 |
||
459 |
"Do not manually edit this!! If it is corrupted, |
|
460 |
the DataSetBuilder may not be able to read the specification." |
|
461 |
||
462 |
" |
|
822 | 463 |
DataSetBuilder new openOnClass:ResourceSelectionBrowser andSelector:#tableColumnsForResourceMethodAttributes |
821 | 464 |
" |
465 |
||
466 |
<resource: #tableColumns> |
|
467 |
||
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
468 |
|
821 | 469 |
^ #( |
470 |
#(#DataSetColumnSpec |
|
471 |
#width: 20 |
|
472 |
#height: 20 |
|
473 |
#printSelector: #iconOn: |
|
474 |
#canSelect: false |
|
475 |
) |
|
476 |
#(#DataSetColumnSpec |
|
477 |
#label: ' Selector' |
|
478 |
#labelAlignment: #left |
|
479 |
#model: #selector |
|
480 |
#canSelect: false |
|
481 |
) |
|
482 |
#(#DataSetColumnSpec |
|
483 |
#label: ' Resource Type' |
|
484 |
#labelAlignment: #left |
|
485 |
#model: #resourceType |
|
486 |
#canSelect: false |
|
487 |
) |
|
488 |
) |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
489 |
! ! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
490 |
|
425 | 491 |
!ResourceSelectionBrowser methodsFor:'aspects'! |
492 |
||
1986 | 493 |
classNameHolder |
494 |
"returns the value holder for the name of the class" |
|
495 |
||
496 |
|holder| |
|
497 |
||
498 |
(holder := builder bindingAt:#valueOfClassName) isNil ifTrue:[ |
|
499 |
builder aspectAt:#valueOfClassName put:(holder := '' asValue). |
|
500 |
holder onChangeEvaluate:[self classSelectionUpdate:holder value]. |
|
501 |
]. |
|
502 |
^ holder |
|
503 |
! |
|
504 |
||
773 | 505 |
helpEnabled |
506 |
"returns whether there is a documentation file" |
|
507 |
||
508 |
^true |
|
509 |
! |
|
510 |
||
771 | 511 |
listOfResourceMethods |
512 |
"returns the value holder for the list of the resource methods" |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
513 |
|
1184 | 514 |
^ builder listAspectFor:#listOfResourceMethods |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
515 |
! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
516 |
|
771 | 517 |
resourceMethodColumns |
518 |
"returns the columns for the table of the resource methods as value holder" |
|
425 | 519 |
|
520 |
|holder| |
|
771 | 521 |
(holder := builder bindingAt:#resourceMethodColumns) isNil ifTrue:[ |
821 | 522 |
builder aspectAt:#resourceMethodColumns put:(holder := List new). |
822 | 523 |
holder addAll: (self class tableColumnsForResourceMethodAttributes collect: [:i| i decodeAsLiteralArray]). |
771 | 524 |
]. |
525 |
^ holder |
|
526 |
! |
|
527 |
||
1986 | 528 |
resourceSelectorHolder |
529 |
"returns the value holder for the name of the selector" |
|
530 |
||
531 |
|holder| |
|
532 |
(holder := builder bindingAt:#valueOfResourceSelector) isNil ifTrue:[ |
|
533 |
builder aspectAt:#valueOfResourceSelector put:(holder := '' asValue). |
|
534 |
]. |
|
535 |
^ holder |
|
536 |
! |
|
537 |
||
906 | 538 |
rootOfClassCategories |
539 |
"returns the value holder for the root of the class tree list" |
|
540 |
||
541 |
|holder| |
|
542 |
||
543 |
(holder := builder bindingAt:#rootOfClassCategories) isNil ifTrue:[ |
|
544 |
ClassPresentation = #'Class Categories' ifTrue: [ |
|
545 |
builder aspectAt:#rootOfClassCategories put: (holder := TreeItem name: 'Categories')]. |
|
546 |
]. |
|
547 |
^ holder |
|
548 |
||
549 |
||
550 |
! |
|
551 |
||
552 |
rootOfClassHierarchy |
|
771 | 553 |
"returns the value holder for the root of the class tree list" |
554 |
||
555 |
|holder| |
|
906 | 556 |
|
557 |
||
558 |
(holder := builder bindingAt:#rootOfClassHierarchy) isNil ifTrue:[ |
|
559 |
ClassPresentation = #'Class Hierarchy' ifTrue: [ |
|
560 |
builder aspectAt:#rootOfClassHierarchy put: (holder := TreeItem new)] |
|
425 | 561 |
]. |
562 |
^ holder |
|
563 |
||
564 |
||
565 |
! |
|
566 |
||
906 | 567 |
selectionOfClassCategories |
568 |
"returns the value holder for the selected class of the class tree list" |
|
569 |
||
570 |
|holder| |
|
571 |
(holder := builder bindingAt:#selectionOfClassCategories) isNil ifTrue:[ |
|
572 |
builder aspectAt:#selectionOfClassCategories put:(holder := ValueHolder new). |
|
573 |
]. |
|
574 |
^ holder |
|
575 |
! |
|
576 |
||
577 |
selectionOfClassHierarchy |
|
771 | 578 |
"returns the value holder for the selected class of the class tree list" |
425 | 579 |
|
906 | 580 |
|holder| |
581 |
(holder := builder bindingAt:#selectionOfClassHierarchy) isNil ifTrue:[ |
|
582 |
builder aspectAt:#selectionOfClassHierarchy put:(holder := ValueHolder new). |
|
583 |
]. |
|
584 |
^ holder |
|
585 |
! |
|
586 |
||
587 |
selectionOfClassPresentation |
|
588 |
"returns the value holder for the selected class presentation" |
|
589 |
||
425 | 590 |
|holder| |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
591 |
|
906 | 592 |
(holder := builder bindingAt:#selectionOfClassPresentation) isNil ifTrue:[ |
593 |
builder aspectAt:#selectionOfClassPresentation put:(holder := RadioButtonGroup with: (ClassPresentation := ClassPresentation ? #'Class Categories')). |
|
1329 | 594 |
holder onChangeEvaluate: |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
595 |
[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
596 |
|hv comp newRoot| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
597 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
598 |
hv := holder value. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
599 |
ClassPresentation := hv. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
600 |
hv = #'Class Hierarchy' ifTrue:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
601 |
comp := builder componentAt: #listOfClassHierarchyView. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
602 |
newRoot := self rootOfClassHierarchy. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
603 |
] ifFalse: [ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
604 |
comp := builder componentAt: #listOfClassCategoriesView. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
605 |
newRoot := self rootOfClassCategories. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
606 |
]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
607 |
comp root:newRoot. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
608 |
comp raise. |
1986 | 609 |
classSelectionBlock value: self classNameHolder value |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
610 |
] |
425 | 611 |
]. |
612 |
^ holder |
|
613 |
! |
|
614 |
||
771 | 615 |
selectionOfResourceMethod |
616 |
"returns the value holder for the selected resource method of the resource method list" |
|
425 | 617 |
|
618 |
|holder| |
|
771 | 619 |
(holder := builder bindingAt:#selectionOfResourceMethod) isNil ifTrue:[ |
620 |
builder aspectAt:#selectionOfResourceMethod put:(holder := '' asValue). |
|
425 | 621 |
]. |
622 |
^ holder |
|
623 |
! |
|
624 |
||
467 | 625 |
valueOfClassName |
2309 | 626 |
<resource: #obsolete> |
771 | 627 |
"returns the value holder for the name of the class" |
467 | 628 |
|
1986 | 629 |
self obsoleteMethodWarning:'stupid name - use #classNameHolder'. |
630 |
^ self classNameHolder |
|
467 | 631 |
! |
632 |
||
771 | 633 |
valueOfResourceSelector |
2309 | 634 |
<resource: #obsolete> |
771 | 635 |
"returns the value holder for the name of the selector" |
425 | 636 |
|
1986 | 637 |
self obsoleteMethodWarning:'stupid name - use #resourceSelectorHolder'. |
638 |
^ self resourceSelectorHolder |
|
425 | 639 |
! ! |
640 |
||
1720 | 641 |
!ResourceSelectionBrowser methodsFor:'callbacks-class list'! |
632 | 642 |
|
906 | 643 |
treeViewClassCategoryChildren |
644 |
"returns the children for the contents (class) of aTreeItem as a block" |
|
645 |
||
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
646 |
"/ cg: tz's algorithm was very-very slow, |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
647 |
"/ (it enumerated classes hundreds of times, |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
648 |
"/ leading to a square runtime behavior |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
649 |
"/ - i.e. very slow scrolling ) |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
650 |
"/ Speed up things by caching facts while enumerating |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
651 |
"/ classes once only. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
652 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
653 |
|allClasses topClass childrenPerCategory privateClasses| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
654 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
655 |
topClass := self treeViewClassHierarchyContents. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
656 |
allClasses := topClass withAllSubclasses. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
657 |
privateClasses := IdentitySet new. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
658 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
659 |
childrenPerCategory := Dictionary new. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
660 |
allClasses do:[:cls | |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
661 |
|cat set| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
662 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
663 |
cls isPrivate ifFalse:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
664 |
cat := cls category. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
665 |
set := childrenPerCategory at:cat ifAbsent:nil. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
666 |
set isNil ifTrue:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
667 |
childrenPerCategory at:cat put:(set := IdentitySet new). |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
668 |
]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
669 |
set add:cls |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
670 |
] ifTrue:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
671 |
privateClasses add:cls |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
672 |
] |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
673 |
]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
674 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
675 |
^ [:aTreeItem| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
676 |
|cont children initialContents setOfCategories itemCategory setOfClasses| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
677 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
678 |
(cont := aTreeItem contents) isBehavior ifTrue:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
679 |
children := privateClasses select:[:cls | cls owningClass == aTreeItem contents]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
680 |
children := children asSortedCollection: [:c1 :c2| c1 name <= c2 name]. |
1732 | 681 |
"/ children := children collect: [:child| TreeItem name: child name , ' (', child superclass name, ')' contents: child] |
682 |
children := children collect: [:child| TreeItem name:(child name) contents: child] |
|
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
683 |
] ifFalse:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
684 |
cont size == 0 ifTrue:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
685 |
setOfCategories := childrenPerCategory keys. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
686 |
children := setOfCategories asSortedCollection. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
687 |
children := children collect: [:nm | TreeItem name:nm contents:#Category] |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
688 |
] ifFalse:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
689 |
cont == #Category ifTrue:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
690 |
itemCategory := aTreeItem name. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
691 |
setOfClasses := childrenPerCategory at:itemCategory ifAbsent:[Set new]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
692 |
children := setOfClasses asOrderedCollection sort:[:c1 :c2 | c1 name <= c2 name]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
693 |
children := children collect:[:child | TreeItem name:child name contents:child]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
694 |
] ifFalse:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
695 |
"/ huh ? |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
696 |
children := OrderedCollection new. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
697 |
] |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
698 |
]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
699 |
]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
700 |
children |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
701 |
] |
906 | 702 |
! |
703 |
||
704 |
treeViewClassCategoryIcon |
|
705 |
"returns the icon for aTreeItem as a block" |
|
706 |
||
707 |
^self class treeViewClassHierarchyIcon |
|
708 |
||
709 |
||
710 |
! |
|
711 |
||
712 |
treeViewClassHierarchyContents |
|
771 | 713 |
"returns the contents of the root of the class tree list" |
632 | 714 |
|
802 | 715 |
|cls| |
632 | 716 |
|
802 | 717 |
resourceSuperclass notNil ifTrue:[ |
1978 | 718 |
cls := Smalltalk classNamed: resourceSuperclass. |
802 | 719 |
]. |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
720 |
cls notNil ifTrue:[^ cls]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
721 |
^ self class treeViewClassHierarchyContents |
771 | 722 |
! |
723 |
||
724 |
validateDoubleClick: aTreeItem |
|
725 |
"returns whether a class may be selected" |
|
726 |
||
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
727 |
|cont| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
728 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
729 |
^ (cont := aTreeItem contents) ~= '' |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
730 |
and: [cont ~~ self treeViewClassHierarchyContents] |
771 | 731 |
|
732 |
||
733 |
||
632 | 734 |
! ! |
735 |
||
1720 | 736 |
!ResourceSelectionBrowser methodsFor:'callbacks-user'! |
425 | 737 |
|
771 | 738 |
classSelected |
739 |
"after a class selection, read the allowed resource methods of the selected class" |
|
730 | 740 |
|
1732 | 741 |
|sel| |
906 | 742 |
|
1919 | 743 |
ClassPresentation = #'Class Hierarchy' |
1732 | 744 |
"/ ifTrue: [sel := self selectionOfClassHierarchy value] |
1919 | 745 |
ifFalse: [sel := self selectionOfClassCategories value]. |
746 |
||
747 |
sel notNil ifTrue:[ |
|
1978 | 748 |
resourceClass := sel. |
1919 | 749 |
]. |
1732 | 750 |
self updateResourceMethodList. |
425 | 751 |
! |
752 |
||
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
753 |
classSelectionUpdate:clsPattern |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
754 |
|foundClass classes| |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
755 |
|
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
756 |
clsPattern notNil ifTrue:[ |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
757 |
foundClass := Smalltalk at:(clsPattern printString asSymbol). |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
758 |
]. |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
759 |
(foundClass isClass not or:[foundClass name ~= clsPattern]) |
1732 | 760 |
ifTrue: [ |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
761 |
classes := allClasses select: [:cls| cls name size >= clsPattern size]. |
1732 | 762 |
1 to: clsPattern size do: [:i| |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
763 |
classes := classes select: [:cls| (cls name at: i) == (clsPattern at: i)]. |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
764 |
]. |
1835 | 765 |
foundClass := classes at: 1 ifAbsent:[]. |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
766 |
]. |
1732 | 767 |
|
768 |
foundClass notNil ifTrue: [ |
|
1835 | 769 |
foundClass := foundClass autoload. |
1978 | 770 |
resourceClass := foundClass. |
1732 | 771 |
|
772 |
ClassPresentation = #'Class Hierarchy' ifTrue: [ |
|
773 |
|searchArgs nonSuperclasses hierItem| |
|
774 |
||
775 |
false "foundClass isPrivate" |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
776 |
ifFalse: [searchArgs := foundClass withAllSuperclasses reverse] |
1978 | 777 |
ifTrue: [searchArgs := foundClass owningClass withAllSuperclasses reverse. |
778 |
searchArgs add: foundClass]. |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
779 |
(nonSuperclasses := self treeViewClassHierarchyContents allSuperclasses) notNil |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
780 |
ifTrue: [searchArgs := searchArgs reject: [:cls| nonSuperclasses includes: cls]]. |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
781 |
|
1732 | 782 |
hierItem := self rootOfClassHierarchy detectChild:[:child :arg| child contents == arg] arguments:searchArgs. |
783 |
hierItem notNil ifTrue:[ |
|
784 |
self selectionOfClassHierarchy value:hierItem. |
|
785 |
]. |
|
1835 | 786 |
] ifFalse: [ |
1732 | 787 |
|searchArgs hierItem| |
788 |
||
789 |
false "foundClass isPrivate" |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
790 |
ifTrue: [searchArgs := Array with: 'Categories' with: foundClass category with: foundClass owningClass name with: foundClass name] |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
791 |
ifFalse: [searchArgs := Array with: 'Categories' with: foundClass category with: foundClass name]. |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
792 |
|
1732 | 793 |
hierItem := self rootOfClassCategories detectChild:[:child :arg| (child name upTo: $ ) = arg] arguments:searchArgs. |
794 |
hierItem notNil ifTrue:[ |
|
795 |
self selectionOfClassCategories value: hierItem. |
|
796 |
]. |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
797 |
]. |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
798 |
]. |
1986 | 799 |
self classNameHolder value: clsPattern. |
1919 | 800 |
self updateResourceMethodList. |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
801 |
! |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
802 |
|
425 | 803 |
resourceDoubleClicked |
771 | 804 |
"after a double click on resource method, accept it and close" |
425 | 805 |
|
806 |
accept value: true. |
|
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
807 |
self closeRequest |
425 | 808 |
! |
809 |
||
810 |
resourceSelected |
|
771 | 811 |
"after a click on a resource method, set its selector into the field" |
425 | 812 |
|
771 | 813 |
self selectionOfResourceMethod value notNil |
1986 | 814 |
ifTrue: [self resourceSelectorHolder value: self selectionOfResourceMethod value selector] |
1732 | 815 |
! |
816 |
||
817 |
updateResourceMethodList |
|
818 |
"read the allowed resource methods of the selected class" |
|
819 |
||
820 |
|class className item| |
|
821 |
||
1978 | 822 |
(class := resourceClass) isNil ifTrue:[ |
1732 | 823 |
ClassPresentation = #'Class Hierarchy' |
824 |
ifTrue: [item := self selectionOfClassHierarchy value ] |
|
825 |
ifFalse: [item := self selectionOfClassCategories value ]. |
|
1978 | 826 |
|
1732 | 827 |
item notNil ifTrue:[ |
828 |
className := item name. |
|
829 |
class := Smalltalk at:className asSymbol |
|
830 |
]. |
|
831 |
]. |
|
832 |
||
833 |
class isNil ifTrue: [^self]. |
|
834 |
||
2038 | 835 |
className := class name."/class theNonMetaclass name |
1732 | 836 |
|
1920 | 837 |
self withWaitCursorDo:[ |
1732 | 838 |
|newContents| |
839 |
||
840 |
resourceTypes isNil ifTrue: [resourceTypes := Method resourceTypes]. |
|
841 |
||
1986 | 842 |
self classNameHolder value: className. |
1732 | 843 |
self class lastSelection: className. |
844 |
||
845 |
newContents := class class methodDictionary asOrderedCollection |
|
846 |
select: [:m | m resources notNil |
|
847 |
and: [resourceTypes includes: m resourceType] |
|
848 |
]. |
|
849 |
newContents := newContents sort:[:m1 :m2 | m1 selector < m2 selector]. |
|
850 |
newContents := newContents collect:[:m| (ResourceMethod new method:m)]. |
|
851 |
||
852 |
self listOfResourceMethods contents:newContents |
|
853 |
. |
|
854 |
] |
|
425 | 855 |
! ! |
856 |
||
857 |
!ResourceSelectionBrowser methodsFor:'instance creation'! |
|
858 |
||
1978 | 859 |
openOnSuperclass: aSuperclassOrSymbol andClass:aClassOrClassName andSelector: aSelector withResourceTypes: aResourceTypes |
860 |
"opens a ResourceSelectionBrowser; return a Message-object or nil" |
|
425 | 861 |
|
1978 | 862 |
|selectedClass enteredClassName className cls| |
771 | 863 |
|
517 | 864 |
resourceMethod := aSelector. |
425 | 865 |
resourceTypes := aResourceTypes. |
866 |
resourceSuperclass := aSuperclassOrSymbol isClass ifTrue: [aSuperclassOrSymbol name] ifFalse: [aSuperclassOrSymbol]. |
|
802 | 867 |
resourceClass := nil. |
868 |
||
1978 | 869 |
aClassOrClassName notNil ifTrue:[ |
870 |
aClassOrClassName isClass ifTrue: [ |
|
871 |
cls := aClassOrClassName. |
|
872 |
resourceClass := aClassOrClassName |
|
873 |
] ifFalse: [ |
|
874 |
cls := Smalltalk classNamed: aClassOrClassName. |
|
875 |
cls notNil ifTrue:[ |
|
876 |
resourceClass := cls |
|
802 | 877 |
] |
1978 | 878 |
] |
879 |
]. |
|
1986 | 880 |
self resourceSelectorHolder value:(aSelector ? ''). |
463 | 881 |
self open. |
882 |
||
1978 | 883 |
(selectedClass := self selectionOfClassHierarchy value) isNil ifTrue:[ |
884 |
(selectedClass := self selectionOfClassCategories value) isNil ifTrue:[ |
|
1986 | 885 |
(enteredClassName := self classNameHolder value) isNil ifTrue:[ |
1086
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
886 |
accept value ifTrue:[ |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
887 |
self warn:'No valid class selected/entered'. |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
888 |
]. |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
889 |
^ nil |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
890 |
] |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
891 |
] |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
892 |
]. |
693 | 893 |
|
1978 | 894 |
className := enteredClassName. |
895 |
className isNil ifTrue:[ |
|
896 |
className := selectedClass name |
|
425 | 897 |
]. |
1978 | 898 |
cls := Smalltalk classNamed:className. |
899 |
(cls isClass and:[accept value]) ifTrue:[ |
|
1986 | 900 |
^ Method::MethodWhoInfo class:cls selector:(self resourceSelectorHolder value) |
1086
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
901 |
]. |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
902 |
|
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
903 |
accept value ifTrue:[ |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
904 |
self warn:'No valid class selected/entered'. |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
905 |
]. |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
906 |
^ nil |
802 | 907 |
|
908 |
"Modified: / 22.4.1998 / 14:51:03 / cg" |
|
425 | 909 |
! ! |
910 |
||
1716 | 911 |
!ResourceSelectionBrowser methodsFor:'startup & release'! |
425 | 912 |
|
623 | 913 |
postBuildWith:aBuilder |
771 | 914 |
"after building and before opening, |
906 | 915 |
create a class selection block, an entry completion block for the class name field" |
623 | 916 |
|
771 | 917 |
|classSelection classNameInputField| |
906 | 918 |
|
919 |
allClasses := self treeViewClassHierarchyContents withAllSubclasses reject: [:cls| cls isPrivate]. |
|
1978 | 920 |
classSelection := resourceClass isNil ifTrue:[nil] ifFalse:[resourceClass name]. |
802 | 921 |
|
1978 | 922 |
(classSelection isNil or:[ (Smalltalk classNamed: classSelection) isNil]) |
689 | 923 |
ifTrue: [classSelection := self class lastSelection]. |
1732 | 924 |
"/ (classSelection isNil or:[Smalltalk at: classSelection]) isNil |
925 |
"/ ifTrue: [classSelection := self treeViewContents]. |
|
802 | 926 |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
927 |
classSelectionBlock := [:clsPattern | self classSelectionUpdate:clsPattern]. |
1986 | 928 |
self classNameHolder value:classSelection. |
771 | 929 |
|
1920 | 930 |
(classNameInputField := builder componentAt: #classNameInputField) |
931 |
entryCompletionBlock: |
|
932 |
[:value| |
|
933 |
|s what m| |
|
934 |
||
935 |
s := classNameInputField contents withoutSpaces. |
|
936 |
what := Smalltalk classnameCompletion:s inEnvironment:Smalltalk. |
|
937 |
classNameInputField contents:what first. |
|
938 |
(what at:2) size ~~ 1 ifTrue:[ |
|
939 |
classNameInputField device beep |
|
940 |
] |
|
941 |
"/ |what oldClassName| |
|
942 |
"/ oldClassName := classNameInputField contents. |
|
943 |
"/ what := Smalltalk classnameCompletion: value withoutSpaces. |
|
944 |
"/ classNameInputField contents:what first. |
|
945 |
"/ oldClassName = classNameInputField contents ifTrue:[classNameInputField flash]. |
|
946 |
"/ classSelectionBlock value: classNameInputField contents |
|
947 |
]. |
|
771 | 948 |
|
1986 | 949 |
classSelectionBlock value: self classNameHolder value. |
1732 | 950 |
self updateResourceMethodList. |
906 | 951 |
self selectionOfResourceMethod value: (self listOfResourceMethods detect: [:m| m selector == resourceMethod] ifNone: nil). |
909 | 952 |
|
953 |
^super postBuildWith:aBuilder |
|
910 | 954 |
! |
955 |
||
956 |
postOpenWith:aBuilder |
|
957 |
"after opening and if turned on make hierarchy view visible" |
|
958 |
||
959 |
ClassPresentation = #'Class Hierarchy' |
|
960 |
ifTrue: [(builder componentAt: #listOfClassHierarchyView) raise]. |
|
961 |
||
2026 | 962 |
super postOpenWith:aBuilder |
425 | 963 |
! ! |
964 |
||
771 | 965 |
!ResourceSelectionBrowser::ResourceMethod methodsFor:'accessing'! |
523 | 966 |
|
967 |
iconOn:aGC |
|
771 | 968 |
"registers and returns an icon indicating the resource type" |
523 | 969 |
|
1524
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
970 |
|cls sel image imageKey| |
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
971 |
|
730 | 972 |
self resourceType isNil ifTrue: [^nil]. |
1524
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
973 |
|
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
974 |
icon isNil ifTrue:[ |
1412 | 975 |
((self resourceType = #image) or: [resourceType = #fileImage]) |
1524
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
976 |
ifTrue:[ |
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
977 |
cls := method mclass theNonMetaclass. |
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
978 |
sel := method selector. |
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
979 |
] ifFalse: [ |
1412 | 980 |
cls := SystemBrowser. |
981 |
sel := (resourceType, 'Icon') asSymbol. |
|
982 |
]. |
|
983 |
imageKey := (cls name, sel) asSymbol. |
|
984 |
(icon := aGC registeredImageAt: imageKey) isNil |
|
1524
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
985 |
ifTrue: [ |
1412 | 986 |
image := cls perform: sel. |
1524
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
987 |
(image extent y > 18) ifTrue: [ |
1412 | 988 |
image := image magnifiedBy: 18/image extent y |
989 |
]. |
|
990 |
aGC registerImage: image key: imageKey. |
|
991 |
icon := aGC registeredImageAt: imageKey. |
|
992 |
]. |
|
730 | 993 |
]. |
523 | 994 |
^icon |
1524
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
995 |
|
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
996 |
"Modified: / 5.11.2001 / 16:48:35 / cg" |
523 | 997 |
! |
998 |
||
999 |
method: aMethod |
|
771 | 1000 |
"sets aMethod" |
523 | 1001 |
|
1002 |
method := aMethod |
|
1003 |
! |
|
1004 |
||
1005 |
resourceType |
|
771 | 1006 |
"returns resourceType" |
523 | 1007 |
|
1008 |
resourceType isNil ifTrue: [resourceType := method resourceType]. |
|
1009 |
^resourceType |
|
1010 |
! |
|
1011 |
||
1012 |
selector |
|
771 | 1013 |
"returns selector" |
523 | 1014 |
|
1015 |
selector isNil ifTrue: [selector := method who methodSelector]. |
|
1016 |
^selector |
|
1017 |
! ! |
|
1018 |
||
425 | 1019 |
!ResourceSelectionBrowser class methodsFor:'documentation'! |
1020 |
||
1021 |
version |
|
1022 |
^ '$Header$' |
|
1023 |
! ! |