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