author | Claus Gittinger <cg@exept.de> |
Wed, 05 Sep 2012 11:22:06 +0200 | |
changeset 2916 | 59c84eca29fd |
parent 2908 | 178288821f0a |
child 3117 | ee3f64a07e16 |
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 |
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
|
268 |
) |
1751 | 269 |
component: |
270 |
(SpecCollection |
|
271 |
collection: ( |
|
272 |
(VariableHorizontalPanelSpec |
|
273 |
name: 'VariableHorizontalPanel' |
|
274 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -36 1.0) |
|
275 |
component: |
|
276 |
(SpecCollection |
|
277 |
collection: ( |
|
278 |
(ViewSpec |
|
279 |
name: 'Box1' |
|
280 |
component: |
|
281 |
(SpecCollection |
|
282 |
collection: ( |
|
283 |
(HorizontalPanelViewSpec |
|
284 |
name: 'HorizontalPanel2' |
|
285 |
layout: (LayoutFrame 0 0 2 0 297 0 23 0) |
|
286 |
horizontalLayout: leftSpace |
|
287 |
verticalLayout: fit |
|
288 |
horizontalSpace: 3 |
|
289 |
verticalSpace: 3 |
|
290 |
component: |
|
291 |
(SpecCollection |
|
292 |
collection: ( |
|
293 |
(RadioButtonSpec |
|
294 |
label: 'Categories' |
|
295 |
name: 'ClassCategoriesRadioButton' |
|
296 |
translateLabel: true |
|
297 |
model: selectionOfClassPresentation |
|
298 |
isTriggerOnDown: true |
|
299 |
lampColor: (Color 0.0 0.0 0.0) |
|
300 |
select: #'Class Categories' |
|
301 |
extent: (Point 124 21) |
|
773 | 302 |
) |
1751 | 303 |
(RadioButtonSpec |
304 |
label: 'Hierarchy' |
|
305 |
name: 'ClassHierarchyRadioButton' |
|
306 |
translateLabel: true |
|
307 |
model: selectionOfClassPresentation |
|
308 |
isTriggerOnDown: true |
|
309 |
lampColor: (Color 0.0 0.0 0.0) |
|
310 |
select: #'Class Hierarchy' |
|
311 |
extent: (Point 145 21) |
|
773 | 312 |
) |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
313 |
) |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
314 |
|
773 | 315 |
) |
316 |
) |
|
1751 | 317 |
(SelectionInTreeViewSpec |
318 |
name: 'listOfClassHierarchyView' |
|
319 |
layout: (LayoutFrame 0 0.0 23 0.0 0 1.0 -24 1.0) |
|
320 |
tabable: true |
|
321 |
model: selectionOfClassHierarchy |
|
322 |
hasHorizontalScrollBar: true |
|
323 |
hasVerticalScrollBar: true |
|
324 |
miniScrollerHorizontal: true |
|
325 |
showDirectoryIndicatorForRoot: false |
|
326 |
showDirectoryIndicator: true |
|
327 |
valueChangeSelector: classSelected |
|
328 |
hierarchicalList: rootOfClassHierarchy |
|
329 |
validateDoubleClickSelector: validateDoubleClick: |
|
330 |
contentsSelector: treeViewClassHierarchyContents |
|
331 |
labelSelector: treeViewClassHierarchyLabel |
|
332 |
childrenSelector: treeViewClassHierarchyChildren |
|
333 |
iconSelector: treeViewClassHierarchyIcon |
|
334 |
highlightMode: line |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
335 |
) |
1751 | 336 |
(SelectionInTreeViewSpec |
337 |
name: 'listOfClassCategoriesView' |
|
338 |
layout: (LayoutFrame 0 0.0 23 0.0 0 1.0 -24 1.0) |
|
339 |
tabable: true |
|
340 |
model: selectionOfClassCategories |
|
341 |
hasHorizontalScrollBar: true |
|
342 |
hasVerticalScrollBar: true |
|
343 |
miniScrollerHorizontal: true |
|
344 |
showRoot: false |
|
345 |
showDirectoryIndicator: true |
|
346 |
valueChangeSelector: classSelected |
|
347 |
hierarchicalList: rootOfClassCategories |
|
348 |
validateDoubleClickSelector: validateDoubleClick: |
|
349 |
childrenSelector: treeViewClassCategoryChildren |
|
350 |
iconSelector: treeViewClassCategoryIcon |
|
351 |
highlightMode: line |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
352 |
) |
1751 | 353 |
(InputFieldSpec |
354 |
name: 'classNameInputField' |
|
355 |
layout: (LayoutFrame 2 0.0 -22 1 -1 1.0 0 1) |
|
356 |
tabable: true |
|
1986 | 357 |
model: classNameHolder |
1751 | 358 |
acceptOnLeave: true |
359 |
acceptOnLostFocus: true |
|
360 |
acceptOnPointerLeave: true |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
361 |
) |
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 |
|
773 | 364 |
) |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
365 |
) |
1751 | 366 |
(ViewSpec |
367 |
name: 'Box2' |
|
368 |
component: |
|
369 |
(SpecCollection |
|
370 |
collection: ( |
|
371 |
(DataSetSpec |
|
372 |
name: 'resourcesDataSetView' |
|
373 |
layout: (LayoutFrame 2 0.0 2 0.0 -2 1.0 -24 1.0) |
|
374 |
model: selectionOfResourceMethod |
|
375 |
hasHorizontalScrollBar: true |
|
376 |
hasVerticalScrollBar: true |
|
377 |
miniScrollerHorizontal: true |
|
378 |
rowClassName: 'ResourceSelectionBrowser::Row' |
|
379 |
dataList: listOfResourceMethods |
|
380 |
useIndex: false |
|
381 |
has3Dsepartors: true |
|
382 |
has3Dseparators: true |
|
383 |
doubleClickSelector: resourceDoubleClicked |
|
384 |
columnHolder: resourceMethodColumns |
|
385 |
valueChangeSelector: resourceSelected |
|
386 |
verticalSpacing: 1 |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
387 |
) |
1751 | 388 |
(InputFieldSpec |
389 |
name: 'selectorInputField' |
|
390 |
layout: (LayoutFrame 2 0.0 -22 1 -2 1.0 0 1) |
|
391 |
tabable: true |
|
1986 | 392 |
model: resourceSelectorHolder |
1751 | 393 |
acceptOnLeave: true |
394 |
acceptOnLostFocus: true |
|
395 |
acceptOnPointerLeave: true |
|
906 | 396 |
) |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
397 |
) |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
398 |
|
906 | 399 |
) |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
400 |
) |
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 |
|
773 | 403 |
) |
1751 | 404 |
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
|
405 |
) |
1751 | 406 |
(HorizontalPanelViewSpec |
407 |
name: 'ButtonPanel' |
|
408 |
layout: (LayoutFrame 2 0.0 -30 1 -2 1.0 -4 1.0) |
|
409 |
horizontalLayout: fit |
|
410 |
verticalLayout: fit |
|
411 |
reverseOrderIfOKAtLeft: true |
|
412 |
component: |
|
413 |
(SpecCollection |
|
414 |
collection: ( |
|
415 |
(ActionButtonSpec |
|
416 |
label: 'Help' |
|
417 |
name: 'HelpButton' |
|
418 |
activeHelpKey: dss |
|
419 |
model: openHTMLDocument: |
|
420 |
initiallyDisabled: true |
|
421 |
enableChannel: helpEnabled |
|
422 |
actionValue: 'tools/uipainter/ResourceSelectionBrowser.html' |
|
423 |
extent: (Point 196 26) |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
424 |
) |
1751 | 425 |
(ActionButtonSpec |
426 |
label: 'Cancel' |
|
427 |
name: 'cancelButton' |
|
428 |
activeHelpKey: commitCancel |
|
429 |
tabable: true |
|
430 |
model: cancel |
|
431 |
extent: (Point 197 26) |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
432 |
) |
1751 | 433 |
(ActionButtonSpec |
434 |
label: 'OK' |
|
435 |
name: 'okButton' |
|
436 |
activeHelpKey: commitOK |
|
437 |
tabable: true |
|
438 |
model: accept |
|
439 |
isDefault: true |
|
440 |
extent: (Point 197 26) |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
441 |
) |
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 |
) |
425 | 449 |
) |
450 |
! ! |
|
451 |
||
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
452 |
!ResourceSelectionBrowser class methodsFor:'list specs'! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
453 |
|
822 | 454 |
tableColumnsForResourceMethodAttributes |
821 | 455 |
"This resource specification was automatically generated |
456 |
by the DataSetBuilder of ST/X." |
|
457 |
||
458 |
"Do not manually edit this!! If it is corrupted, |
|
459 |
the DataSetBuilder may not be able to read the specification." |
|
460 |
||
461 |
" |
|
822 | 462 |
DataSetBuilder new openOnClass:ResourceSelectionBrowser andSelector:#tableColumnsForResourceMethodAttributes |
821 | 463 |
" |
464 |
||
465 |
<resource: #tableColumns> |
|
466 |
||
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
467 |
|
821 | 468 |
^ #( |
469 |
#(#DataSetColumnSpec |
|
470 |
#width: 20 |
|
471 |
#height: 20 |
|
472 |
#printSelector: #iconOn: |
|
473 |
#canSelect: false |
|
474 |
) |
|
475 |
#(#DataSetColumnSpec |
|
476 |
#label: ' Selector' |
|
477 |
#labelAlignment: #left |
|
478 |
#model: #selector |
|
479 |
#canSelect: false |
|
480 |
) |
|
481 |
#(#DataSetColumnSpec |
|
482 |
#label: ' Resource Type' |
|
483 |
#labelAlignment: #left |
|
484 |
#model: #resourceType |
|
485 |
#canSelect: false |
|
486 |
) |
|
487 |
) |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
488 |
! ! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
489 |
|
425 | 490 |
!ResourceSelectionBrowser methodsFor:'aspects'! |
491 |
||
1986 | 492 |
classNameHolder |
493 |
"returns the value holder for the name of the class" |
|
494 |
||
495 |
|holder| |
|
496 |
||
497 |
(holder := builder bindingAt:#valueOfClassName) isNil ifTrue:[ |
|
498 |
builder aspectAt:#valueOfClassName put:(holder := '' asValue). |
|
499 |
holder onChangeEvaluate:[self classSelectionUpdate:holder value]. |
|
500 |
]. |
|
501 |
^ holder |
|
502 |
! |
|
503 |
||
773 | 504 |
helpEnabled |
505 |
"returns whether there is a documentation file" |
|
506 |
||
507 |
^true |
|
508 |
! |
|
509 |
||
771 | 510 |
listOfResourceMethods |
511 |
"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
|
512 |
|
1184 | 513 |
^ builder listAspectFor:#listOfResourceMethods |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
514 |
! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
515 |
|
771 | 516 |
resourceMethodColumns |
517 |
"returns the columns for the table of the resource methods as value holder" |
|
425 | 518 |
|
519 |
|holder| |
|
771 | 520 |
(holder := builder bindingAt:#resourceMethodColumns) isNil ifTrue:[ |
821 | 521 |
builder aspectAt:#resourceMethodColumns put:(holder := List new). |
822 | 522 |
holder addAll: (self class tableColumnsForResourceMethodAttributes collect: [:i| i decodeAsLiteralArray]). |
771 | 523 |
]. |
524 |
^ holder |
|
525 |
! |
|
526 |
||
1986 | 527 |
resourceSelectorHolder |
528 |
"returns the value holder for the name of the selector" |
|
529 |
||
530 |
|holder| |
|
531 |
(holder := builder bindingAt:#valueOfResourceSelector) isNil ifTrue:[ |
|
532 |
builder aspectAt:#valueOfResourceSelector put:(holder := '' asValue). |
|
533 |
]. |
|
534 |
^ holder |
|
535 |
! |
|
536 |
||
906 | 537 |
rootOfClassCategories |
538 |
"returns the value holder for the root of the class tree list" |
|
539 |
||
540 |
|holder| |
|
541 |
||
542 |
(holder := builder bindingAt:#rootOfClassCategories) isNil ifTrue:[ |
|
543 |
ClassPresentation = #'Class Categories' ifTrue: [ |
|
544 |
builder aspectAt:#rootOfClassCategories put: (holder := TreeItem name: 'Categories')]. |
|
545 |
]. |
|
546 |
^ holder |
|
547 |
||
548 |
||
549 |
! |
|
550 |
||
551 |
rootOfClassHierarchy |
|
771 | 552 |
"returns the value holder for the root of the class tree list" |
553 |
||
554 |
|holder| |
|
906 | 555 |
|
556 |
||
557 |
(holder := builder bindingAt:#rootOfClassHierarchy) isNil ifTrue:[ |
|
558 |
ClassPresentation = #'Class Hierarchy' ifTrue: [ |
|
559 |
builder aspectAt:#rootOfClassHierarchy put: (holder := TreeItem new)] |
|
425 | 560 |
]. |
561 |
^ holder |
|
562 |
||
563 |
||
564 |
! |
|
565 |
||
906 | 566 |
selectionOfClassCategories |
567 |
"returns the value holder for the selected class of the class tree list" |
|
568 |
||
569 |
|holder| |
|
570 |
(holder := builder bindingAt:#selectionOfClassCategories) isNil ifTrue:[ |
|
571 |
builder aspectAt:#selectionOfClassCategories put:(holder := ValueHolder new). |
|
572 |
]. |
|
573 |
^ holder |
|
574 |
! |
|
575 |
||
576 |
selectionOfClassHierarchy |
|
771 | 577 |
"returns the value holder for the selected class of the class tree list" |
425 | 578 |
|
906 | 579 |
|holder| |
580 |
(holder := builder bindingAt:#selectionOfClassHierarchy) isNil ifTrue:[ |
|
581 |
builder aspectAt:#selectionOfClassHierarchy put:(holder := ValueHolder new). |
|
582 |
]. |
|
583 |
^ holder |
|
584 |
! |
|
585 |
||
586 |
selectionOfClassPresentation |
|
587 |
"returns the value holder for the selected class presentation" |
|
588 |
||
425 | 589 |
|holder| |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
590 |
|
906 | 591 |
(holder := builder bindingAt:#selectionOfClassPresentation) isNil ifTrue:[ |
592 |
builder aspectAt:#selectionOfClassPresentation put:(holder := RadioButtonGroup with: (ClassPresentation := ClassPresentation ? #'Class Categories')). |
|
1329 | 593 |
holder onChangeEvaluate: |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
594 |
[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
595 |
|hv comp newRoot| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
596 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
597 |
hv := holder value. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
598 |
ClassPresentation := hv. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
599 |
hv = #'Class Hierarchy' ifTrue:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
600 |
comp := builder componentAt: #listOfClassHierarchyView. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
601 |
newRoot := self rootOfClassHierarchy. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
602 |
] ifFalse: [ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
603 |
comp := builder componentAt: #listOfClassCategoriesView. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
604 |
newRoot := self rootOfClassCategories. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
605 |
]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
606 |
comp root:newRoot. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
607 |
comp raise. |
1986 | 608 |
classSelectionBlock value: self classNameHolder value |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
609 |
] |
425 | 610 |
]. |
611 |
^ holder |
|
612 |
! |
|
613 |
||
771 | 614 |
selectionOfResourceMethod |
615 |
"returns the value holder for the selected resource method of the resource method list" |
|
425 | 616 |
|
617 |
|holder| |
|
771 | 618 |
(holder := builder bindingAt:#selectionOfResourceMethod) isNil ifTrue:[ |
619 |
builder aspectAt:#selectionOfResourceMethod put:(holder := '' asValue). |
|
425 | 620 |
]. |
621 |
^ holder |
|
622 |
! |
|
623 |
||
467 | 624 |
valueOfClassName |
2309 | 625 |
<resource: #obsolete> |
771 | 626 |
"returns the value holder for the name of the class" |
467 | 627 |
|
1986 | 628 |
self obsoleteMethodWarning:'stupid name - use #classNameHolder'. |
629 |
^ self classNameHolder |
|
467 | 630 |
! |
631 |
||
771 | 632 |
valueOfResourceSelector |
2309 | 633 |
<resource: #obsolete> |
771 | 634 |
"returns the value holder for the name of the selector" |
425 | 635 |
|
1986 | 636 |
self obsoleteMethodWarning:'stupid name - use #resourceSelectorHolder'. |
637 |
^ self resourceSelectorHolder |
|
425 | 638 |
! ! |
639 |
||
1720 | 640 |
!ResourceSelectionBrowser methodsFor:'callbacks-class list'! |
632 | 641 |
|
906 | 642 |
treeViewClassCategoryChildren |
643 |
"returns the children for the contents (class) of aTreeItem as a block" |
|
644 |
||
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
645 |
"/ cg: tz's algorithm was very-very slow, |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
646 |
"/ (it enumerated classes hundreds of times, |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
647 |
"/ leading to a square runtime behavior |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
648 |
"/ - i.e. very slow scrolling ) |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
649 |
"/ Speed up things by caching facts while enumerating |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
650 |
"/ classes once only. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
651 |
|
2760
11963b80d72c
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
652 |
|topClass childrenPerCategory privateClasses| |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
653 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
654 |
topClass := self treeViewClassHierarchyContents. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
655 |
privateClasses := IdentitySet new. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
656 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
657 |
childrenPerCategory := Dictionary new. |
2760
11963b80d72c
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
658 |
|
11963b80d72c
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
659 |
topClass withAllSubclassesDo:[:cls | |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
660 |
|cat set| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
661 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
662 |
cls isPrivate ifFalse:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
663 |
cat := cls category. |
2908
178288821f0a
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2774
diff
changeset
|
664 |
cat notNil ifTrue:[ |
178288821f0a
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2774
diff
changeset
|
665 |
set := childrenPerCategory at:cat ifAbsent:nil. |
178288821f0a
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2774
diff
changeset
|
666 |
set isNil ifTrue:[ |
178288821f0a
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2774
diff
changeset
|
667 |
childrenPerCategory at:cat put:(set := IdentitySet new). |
178288821f0a
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2774
diff
changeset
|
668 |
]. |
178288821f0a
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2774
diff
changeset
|
669 |
set add:cls |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
670 |
]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
671 |
] ifTrue:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
672 |
privateClasses add:cls |
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 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
676 |
^ [:aTreeItem| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
677 |
|cont children initialContents setOfCategories itemCategory setOfClasses| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
678 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
679 |
(cont := aTreeItem contents) isBehavior ifTrue:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
680 |
children := privateClasses select:[:cls | cls owningClass == aTreeItem contents]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
681 |
children := children asSortedCollection: [:c1 :c2| c1 name <= c2 name]. |
1732 | 682 |
"/ children := children collect: [:child| TreeItem name: child name , ' (', child superclass name, ')' contents: child] |
683 |
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
|
684 |
] ifFalse:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
685 |
cont size == 0 ifTrue:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
686 |
setOfCategories := childrenPerCategory keys. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
687 |
children := setOfCategories asSortedCollection. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
688 |
children := children collect: [:nm | TreeItem name:nm contents:#Category] |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
689 |
] ifFalse:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
690 |
cont == #Category ifTrue:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
691 |
itemCategory := aTreeItem name. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
692 |
setOfClasses := childrenPerCategory at:itemCategory ifAbsent:[Set new]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
693 |
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
|
694 |
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
|
695 |
] ifFalse:[ |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
696 |
"/ huh ? |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
697 |
children := OrderedCollection new. |
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 |
]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
701 |
children |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
702 |
] |
2908
178288821f0a
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2774
diff
changeset
|
703 |
|
178288821f0a
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2774
diff
changeset
|
704 |
"Modified: / 22-08-2012 / 19:44:59 / cg" |
906 | 705 |
! |
706 |
||
707 |
treeViewClassCategoryIcon |
|
708 |
"returns the icon for aTreeItem as a block" |
|
709 |
||
710 |
^self class treeViewClassHierarchyIcon |
|
711 |
||
712 |
||
713 |
! |
|
714 |
||
715 |
treeViewClassHierarchyContents |
|
771 | 716 |
"returns the contents of the root of the class tree list" |
632 | 717 |
|
802 | 718 |
|cls| |
632 | 719 |
|
802 | 720 |
resourceSuperclass notNil ifTrue:[ |
1978 | 721 |
cls := Smalltalk classNamed: resourceSuperclass. |
802 | 722 |
]. |
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
723 |
cls notNil ifTrue:[^ cls]. |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
724 |
^ self class treeViewClassHierarchyContents |
771 | 725 |
! |
726 |
||
727 |
validateDoubleClick: aTreeItem |
|
728 |
"returns whether a class may be selected" |
|
729 |
||
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
730 |
|cont| |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
731 |
|
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
732 |
^ (cont := aTreeItem contents) ~= '' |
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
733 |
and: [cont ~~ self treeViewClassHierarchyContents] |
771 | 734 |
|
735 |
||
736 |
||
632 | 737 |
! ! |
738 |
||
1720 | 739 |
!ResourceSelectionBrowser methodsFor:'callbacks-user'! |
425 | 740 |
|
771 | 741 |
classSelected |
742 |
"after a class selection, read the allowed resource methods of the selected class" |
|
730 | 743 |
|
1732 | 744 |
|sel| |
906 | 745 |
|
1919 | 746 |
ClassPresentation = #'Class Hierarchy' |
1732 | 747 |
"/ ifTrue: [sel := self selectionOfClassHierarchy value] |
1919 | 748 |
ifFalse: [sel := self selectionOfClassCategories value]. |
749 |
||
750 |
sel notNil ifTrue:[ |
|
1978 | 751 |
resourceClass := sel. |
1919 | 752 |
]. |
1732 | 753 |
self updateResourceMethodList. |
425 | 754 |
! |
755 |
||
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
756 |
classSelectionUpdate:clsPattern |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
757 |
|foundClass classes| |
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 |
clsPattern notNil ifTrue:[ |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
760 |
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
|
761 |
]. |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
762 |
(foundClass isClass not or:[foundClass name ~= clsPattern]) |
1732 | 763 |
ifTrue: [ |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
764 |
classes := allClasses select: [:cls| cls name size >= clsPattern size]. |
1732 | 765 |
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
|
766 |
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
|
767 |
]. |
1835 | 768 |
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
|
769 |
]. |
1732 | 770 |
|
771 |
foundClass notNil ifTrue: [ |
|
1835 | 772 |
foundClass := foundClass autoload. |
1978 | 773 |
resourceClass := foundClass. |
1732 | 774 |
|
775 |
ClassPresentation = #'Class Hierarchy' ifTrue: [ |
|
776 |
|searchArgs nonSuperclasses hierItem| |
|
777 |
||
778 |
false "foundClass isPrivate" |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
779 |
ifFalse: [searchArgs := foundClass withAllSuperclasses reverse] |
1978 | 780 |
ifTrue: [searchArgs := foundClass owningClass withAllSuperclasses reverse. |
781 |
searchArgs add: foundClass]. |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
782 |
(nonSuperclasses := self treeViewClassHierarchyContents allSuperclasses) notNil |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
783 |
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
|
784 |
|
1732 | 785 |
hierItem := self rootOfClassHierarchy detectChild:[:child :arg| child contents == arg] arguments:searchArgs. |
786 |
hierItem notNil ifTrue:[ |
|
787 |
self selectionOfClassHierarchy value:hierItem. |
|
788 |
]. |
|
1835 | 789 |
] ifFalse: [ |
1732 | 790 |
|searchArgs hierItem| |
791 |
||
792 |
false "foundClass isPrivate" |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
793 |
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
|
794 |
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
|
795 |
|
1732 | 796 |
hierItem := self rootOfClassCategories detectChild:[:child :arg| (child name upTo: $ ) = arg] arguments:searchArgs. |
797 |
hierItem notNil ifTrue:[ |
|
798 |
self selectionOfClassCategories value: hierItem. |
|
799 |
]. |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
800 |
]. |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
801 |
]. |
1986 | 802 |
self classNameHolder value: clsPattern. |
1919 | 803 |
self updateResourceMethodList. |
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
804 |
! |
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
805 |
|
425 | 806 |
resourceDoubleClicked |
771 | 807 |
"after a double click on resource method, accept it and close" |
425 | 808 |
|
809 |
accept value: true. |
|
1034
3cb196044804
fixed stupid class-enumeration code.
Claus Gittinger <cg@exept.de>
parents:
918
diff
changeset
|
810 |
self closeRequest |
425 | 811 |
! |
812 |
||
813 |
resourceSelected |
|
771 | 814 |
"after a click on a resource method, set its selector into the field" |
425 | 815 |
|
771 | 816 |
self selectionOfResourceMethod value notNil |
1986 | 817 |
ifTrue: [self resourceSelectorHolder value: self selectionOfResourceMethod value selector] |
1732 | 818 |
! |
819 |
||
820 |
updateResourceMethodList |
|
821 |
"read the allowed resource methods of the selected class" |
|
822 |
||
823 |
|class className item| |
|
824 |
||
1978 | 825 |
(class := resourceClass) isNil ifTrue:[ |
1732 | 826 |
ClassPresentation = #'Class Hierarchy' |
827 |
ifTrue: [item := self selectionOfClassHierarchy value ] |
|
828 |
ifFalse: [item := self selectionOfClassCategories value ]. |
|
1978 | 829 |
|
1732 | 830 |
item notNil ifTrue:[ |
831 |
className := item name. |
|
832 |
class := Smalltalk at:className asSymbol |
|
833 |
]. |
|
834 |
]. |
|
835 |
||
836 |
class isNil ifTrue: [^self]. |
|
837 |
||
2038 | 838 |
className := class name."/class theNonMetaclass name |
1732 | 839 |
|
1920 | 840 |
self withWaitCursorDo:[ |
1732 | 841 |
|newContents| |
842 |
||
843 |
resourceTypes isNil ifTrue: [resourceTypes := Method resourceTypes]. |
|
844 |
||
1986 | 845 |
self classNameHolder value: className. |
1732 | 846 |
self class lastSelection: className. |
847 |
||
848 |
newContents := class class methodDictionary asOrderedCollection |
|
849 |
select: [:m | m resources notNil |
|
850 |
and: [resourceTypes includes: m resourceType] |
|
851 |
]. |
|
852 |
newContents := newContents sort:[:m1 :m2 | m1 selector < m2 selector]. |
|
853 |
newContents := newContents collect:[:m| (ResourceMethod new method:m)]. |
|
854 |
||
855 |
self listOfResourceMethods contents:newContents |
|
856 |
. |
|
857 |
] |
|
425 | 858 |
! ! |
859 |
||
860 |
!ResourceSelectionBrowser methodsFor:'instance creation'! |
|
861 |
||
1978 | 862 |
openOnSuperclass: aSuperclassOrSymbol andClass:aClassOrClassName andSelector: aSelector withResourceTypes: aResourceTypes |
863 |
"opens a ResourceSelectionBrowser; return a Message-object or nil" |
|
425 | 864 |
|
1978 | 865 |
|selectedClass enteredClassName className cls| |
771 | 866 |
|
517 | 867 |
resourceMethod := aSelector. |
425 | 868 |
resourceTypes := aResourceTypes. |
869 |
resourceSuperclass := aSuperclassOrSymbol isClass ifTrue: [aSuperclassOrSymbol name] ifFalse: [aSuperclassOrSymbol]. |
|
802 | 870 |
resourceClass := nil. |
871 |
||
1978 | 872 |
aClassOrClassName notNil ifTrue:[ |
873 |
aClassOrClassName isClass ifTrue: [ |
|
874 |
cls := aClassOrClassName. |
|
875 |
resourceClass := aClassOrClassName |
|
876 |
] ifFalse: [ |
|
877 |
cls := Smalltalk classNamed: aClassOrClassName. |
|
878 |
cls notNil ifTrue:[ |
|
879 |
resourceClass := cls |
|
802 | 880 |
] |
1978 | 881 |
] |
882 |
]. |
|
1986 | 883 |
self resourceSelectorHolder value:(aSelector ? ''). |
463 | 884 |
self open. |
885 |
||
1978 | 886 |
(selectedClass := self selectionOfClassHierarchy value) isNil ifTrue:[ |
887 |
(selectedClass := self selectionOfClassCategories value) isNil ifTrue:[ |
|
1986 | 888 |
(enteredClassName := self classNameHolder value) isNil ifTrue:[ |
1086
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
889 |
accept value ifTrue:[ |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
890 |
self warn:'No valid class selected/entered'. |
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 |
^ nil |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
893 |
] |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
894 |
] |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
895 |
]. |
693 | 896 |
|
1978 | 897 |
className := enteredClassName. |
898 |
className isNil ifTrue:[ |
|
899 |
className := selectedClass name |
|
425 | 900 |
]. |
1978 | 901 |
cls := Smalltalk classNamed:className. |
902 |
(cls isClass and:[accept value]) ifTrue:[ |
|
1986 | 903 |
^ 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
|
904 |
]. |
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 |
accept value ifTrue:[ |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
907 |
self warn:'No valid class selected/entered'. |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
908 |
]. |
592f0177687e
did not look at className in enterField
Claus Gittinger <cg@exept.de>
parents:
1034
diff
changeset
|
909 |
^ nil |
802 | 910 |
|
911 |
"Modified: / 22.4.1998 / 14:51:03 / cg" |
|
425 | 912 |
! ! |
913 |
||
1716 | 914 |
!ResourceSelectionBrowser methodsFor:'startup & release'! |
425 | 915 |
|
623 | 916 |
postBuildWith:aBuilder |
771 | 917 |
"after building and before opening, |
906 | 918 |
create a class selection block, an entry completion block for the class name field" |
623 | 919 |
|
771 | 920 |
|classSelection classNameInputField| |
906 | 921 |
|
922 |
allClasses := self treeViewClassHierarchyContents withAllSubclasses reject: [:cls| cls isPrivate]. |
|
1978 | 923 |
classSelection := resourceClass isNil ifTrue:[nil] ifFalse:[resourceClass name]. |
802 | 924 |
|
1978 | 925 |
(classSelection isNil or:[ (Smalltalk classNamed: classSelection) isNil]) |
689 | 926 |
ifTrue: [classSelection := self class lastSelection]. |
1732 | 927 |
"/ (classSelection isNil or:[Smalltalk at: classSelection]) isNil |
928 |
"/ ifTrue: [classSelection := self treeViewContents]. |
|
802 | 929 |
|
1384
ff417bf5f8d8
bug fix - update tree-selection when entering a className
Claus Gittinger <cg@exept.de>
parents:
1329
diff
changeset
|
930 |
classSelectionBlock := [:clsPattern | self classSelectionUpdate:clsPattern]. |
1986 | 931 |
self classNameHolder value:classSelection. |
771 | 932 |
|
1920 | 933 |
(classNameInputField := builder componentAt: #classNameInputField) |
934 |
entryCompletionBlock: |
|
935 |
[:value| |
|
936 |
|s what m| |
|
937 |
||
938 |
s := classNameInputField contents withoutSpaces. |
|
939 |
what := Smalltalk classnameCompletion:s inEnvironment:Smalltalk. |
|
940 |
classNameInputField contents:what first. |
|
941 |
(what at:2) size ~~ 1 ifTrue:[ |
|
942 |
classNameInputField device beep |
|
943 |
] |
|
944 |
"/ |what oldClassName| |
|
945 |
"/ oldClassName := classNameInputField contents. |
|
946 |
"/ what := Smalltalk classnameCompletion: value withoutSpaces. |
|
947 |
"/ classNameInputField contents:what first. |
|
948 |
"/ oldClassName = classNameInputField contents ifTrue:[classNameInputField flash]. |
|
949 |
"/ classSelectionBlock value: classNameInputField contents |
|
950 |
]. |
|
771 | 951 |
|
1986 | 952 |
classSelectionBlock value: self classNameHolder value. |
1732 | 953 |
self updateResourceMethodList. |
906 | 954 |
self selectionOfResourceMethod value: (self listOfResourceMethods detect: [:m| m selector == resourceMethod] ifNone: nil). |
909 | 955 |
|
956 |
^super postBuildWith:aBuilder |
|
910 | 957 |
! |
958 |
||
959 |
postOpenWith:aBuilder |
|
960 |
"after opening and if turned on make hierarchy view visible" |
|
961 |
||
962 |
ClassPresentation = #'Class Hierarchy' |
|
963 |
ifTrue: [(builder componentAt: #listOfClassHierarchyView) raise]. |
|
964 |
||
2026 | 965 |
super postOpenWith:aBuilder |
425 | 966 |
! ! |
967 |
||
771 | 968 |
!ResourceSelectionBrowser::ResourceMethod methodsFor:'accessing'! |
523 | 969 |
|
970 |
iconOn:aGC |
|
771 | 971 |
"registers and returns an icon indicating the resource type" |
523 | 972 |
|
1524
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
973 |
|cls sel image imageKey| |
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
974 |
|
730 | 975 |
self resourceType isNil ifTrue: [^nil]. |
1524
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
976 |
|
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
977 |
icon isNil ifTrue:[ |
1412 | 978 |
((self resourceType = #image) or: [resourceType = #fileImage]) |
1524
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
979 |
ifTrue:[ |
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
980 |
cls := method mclass theNonMetaclass. |
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
981 |
sel := method selector. |
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
982 |
] ifFalse: [ |
1412 | 983 |
cls := SystemBrowser. |
984 |
sel := (resourceType, 'Icon') asSymbol. |
|
985 |
]. |
|
986 |
imageKey := (cls name, sel) asSymbol. |
|
987 |
(icon := aGC registeredImageAt: imageKey) isNil |
|
1524
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
988 |
ifTrue: [ |
1412 | 989 |
image := cls perform: sel. |
1524
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
990 |
(image extent y > 18) ifTrue: [ |
1412 | 991 |
image := image magnifiedBy: 18/image extent y |
992 |
]. |
|
993 |
aGC registerImage: image key: imageKey. |
|
994 |
icon := aGC registeredImageAt: imageKey. |
|
995 |
]. |
|
730 | 996 |
]. |
523 | 997 |
^icon |
1524
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
998 |
|
4efbd088b787
isMeta/soleInstance -> theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
1493
diff
changeset
|
999 |
"Modified: / 5.11.2001 / 16:48:35 / cg" |
523 | 1000 |
! |
1001 |
||
1002 |
method: aMethod |
|
771 | 1003 |
"sets aMethod" |
523 | 1004 |
|
1005 |
method := aMethod |
|
1006 |
! |
|
1007 |
||
1008 |
resourceType |
|
771 | 1009 |
"returns resourceType" |
523 | 1010 |
|
1011 |
resourceType isNil ifTrue: [resourceType := method resourceType]. |
|
1012 |
^resourceType |
|
1013 |
! |
|
1014 |
||
1015 |
selector |
|
771 | 1016 |
"returns selector" |
523 | 1017 |
|
1018 |
selector isNil ifTrue: [selector := method who methodSelector]. |
|
1019 |
^selector |
|
1020 |
! ! |
|
1021 |
||
425 | 1022 |
!ResourceSelectionBrowser class methodsFor:'documentation'! |
1023 |
||
1024 |
version |
|
1025 |
^ '$Header$' |
|
2760
11963b80d72c
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
1026 |
! |
11963b80d72c
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
1027 |
|
11963b80d72c
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
1028 |
version_CVS |
11963b80d72c
changed: #treeViewClassCategoryChildren
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
1029 |
^ '$Header$' |
425 | 1030 |
! ! |