author | tz |
Mon, 09 Mar 1998 21:41:42 +0100 | |
changeset 712 | bf8aa59e82b6 |
parent 693 | bb247cc428c3 |
child 718 | c2e814032029 |
permissions | -rw-r--r-- |
425 | 1 |
" |
504 | 2 |
COPYRIGHT (c) 1997 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 |
" |
|
12 |
||
13 |
||
14 |
SelectionBrowser subclass:#ResourceSelectionBrowser |
|
477 | 15 |
instanceVariableNames:'resourceMethod resourceClass resourceSuperclass resourceTypes |
680 | 16 |
allClasses classSelectionBlock' |
425 | 17 |
classVariableNames:'' |
18 |
poolDictionaries:'' |
|
619 | 19 |
category:'Interface-Dialogs' |
425 | 20 |
! |
21 |
||
523 | 22 |
Object subclass:#Row |
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 |
" |
|
504 | 33 |
COPYRIGHT (c) 1997 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 |
" |
|
504 | 48 |
[start with:] |
49 |
ResourceSelectionBrowser open |
|
50 |
||
51 |
[author:] |
|
52 |
Thomas Zwick |
|
425 | 53 |
" |
54 |
! ! |
|
55 |
||
56 |
!ResourceSelectionBrowser class methodsFor:'instance creation'! |
|
57 |
||
649 | 58 |
request: aTitle onSuperclass: aSuperclass andClass: aClass andSelector: aSelector withResourceTypes: resourceTypes |
425 | 59 |
|
649 | 60 |
" |
61 |
ResourceSelectionBrowser |
|
62 |
request: 'Select a Resource Selector' |
|
425 | 63 |
onSuperclass: #ApplicationModel |
64 |
andClass: #ToolApplicationModel |
|
65 |
andSelector: #saveIcon |
|
517 | 66 |
withResourceTypes: #(image) |
425 | 67 |
" |
68 |
||
69 |
^self new |
|
70 |
title: aTitle; |
|
71 |
openOnSuperclass: aSuperclass |
|
72 |
andClass: aClass |
|
73 |
andSelector: aSelector |
|
649 | 74 |
withResourceTypes: resourceTypes |
425 | 75 |
! ! |
76 |
||
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
77 |
!ResourceSelectionBrowser class methodsFor:'callbacks - default'! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
78 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
79 |
treeViewChildren |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
80 |
|
680 | 81 |
^[:aTreeItem| |
82 |
|classes| |
|
83 |
classes := OrderedCollection new. |
|
84 |
classes |
|
85 |
addAll: (aTreeItem contents subclasses asSortedCollection: [:i1 :i2| i1 name < i2 name]); |
|
86 |
yourself] |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
87 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
88 |
! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
89 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
90 |
treeViewContents |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
91 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
92 |
^Smalltalk at: #Object |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
93 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
94 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
95 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
96 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
97 |
! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
98 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
99 |
treeViewIcon |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
100 |
|
680 | 101 |
^[self iconClass] |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
102 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
103 |
! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
104 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
105 |
treeViewLabel |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
106 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
107 |
^[:aTreeItem|aTreeItem contents name] |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
108 |
! ! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
109 |
|
425 | 110 |
!ResourceSelectionBrowser class methodsFor:'interface specs'! |
111 |
||
112 |
windowSpec |
|
113 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
114 |
||
115 |
"do not manually edit this - the painter/builder may not be able to |
|
116 |
handle the specification if its corrupted." |
|
117 |
||
118 |
" |
|
119 |
UIPainter new openOnClass:ResourceSelectionBrowser andSelector:#windowSpec |
|
120 |
ResourceSelectionBrowser new openInterface:#windowSpec |
|
121 |
" |
|
122 |
"ResourceSelectionBrowser open" |
|
123 |
||
124 |
<resource: #canvas> |
|
125 |
||
126 |
^ |
|
468 | 127 |
|
425 | 128 |
#(#FullSpec |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
129 |
#window: |
425 | 130 |
#(#WindowSpec |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
131 |
#name: 'Resource Selection Browser' |
680 | 132 |
#layout: #(#LayoutFrame 197 0 172 0 796 0 521 0) |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
133 |
#label: 'Resource Selection Browser' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
134 |
#min: #(#Point 400 300) |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
135 |
#max: #(#Point 1152 864) |
680 | 136 |
#bounds: #(#Rectangle 197 172 797 522) |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
137 |
#usePreferredExtent: false |
425 | 138 |
) |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
139 |
#component: |
425 | 140 |
#(#SpecCollection |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
141 |
#collection: |
425 | 142 |
#( |
143 |
#(#VariableHorizontalPanelSpec |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
144 |
#name: 'variableHorizontalPanel' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
145 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -40 1.0) |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
146 |
#component: |
425 | 147 |
#(#SpecCollection |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
148 |
#collection: |
425 | 149 |
#( |
150 |
#(#ViewSpec |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
151 |
#name: 'view1' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
152 |
#component: |
425 | 153 |
#(#SpecCollection |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
154 |
#collection: |
425 | 155 |
#( |
156 |
#(#SelectionInTreeViewSpec |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
157 |
#name: 'listOfClassesView' |
680 | 158 |
#layout: #(#LayoutFrame 0 0.0 23 0.0 0 1.0 -22 1.0) |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
159 |
#model: #selectionOfClass |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
160 |
#hasHorizontalScrollBar: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
161 |
#hasVerticalScrollBar: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
162 |
#miniScrollerHorizontal: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
163 |
#showDirectoryIndicatorForRoot: false |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
164 |
#showDirectoryIndicator: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
165 |
#valueChangeSelector: #classSelected: |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
166 |
#hierarchicalList: #listOfClasses |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
167 |
#contentsSelector: #treeViewContents |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
168 |
#labelSelector: #treeViewLabel |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
169 |
#childrenSelector: #treeViewChildren |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
170 |
#iconSelector: #treeViewIcon |
425 | 171 |
) |
467 | 172 |
#(#InputFieldSpec |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
173 |
#name: 'classNameInputField' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
174 |
#layout: #(#LayoutFrame 2 0.0 -22 1 -1 1.0 0 1) |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
175 |
#model: #valueOfClassName |
467 | 176 |
) |
664 | 177 |
#(#LabelSpec |
680 | 178 |
#name: 'ClassHierarchyLabel' |
179 |
#layout: #(#LayoutFrame 0 0 2 0 297 0 23 0) |
|
664 | 180 |
#label: ' Class Hierarchy' |
181 |
#level: 1 |
|
182 |
#adjust: #left |
|
183 |
) |
|
425 | 184 |
) |
185 |
) |
|
186 |
) |
|
187 |
#(#ViewSpec |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
188 |
#name: 'view2' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
189 |
#component: |
425 | 190 |
#(#SpecCollection |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
191 |
#collection: |
425 | 192 |
#( |
193 |
#(#DataSetSpec |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
194 |
#name: 'resourcesDataSetView' |
680 | 195 |
#layout: #(#LayoutFrame 2 0.0 2 0.0 -2 1.0 -22 1.0) |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
196 |
#model: #selectionOfResource |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
197 |
#hasHorizontalScrollBar: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
198 |
#hasVerticalScrollBar: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
199 |
#miniScrollerHorizontal: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
200 |
#rowClassName: 'ResourceSelectionBrowser::Row' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
201 |
#dataList: #listOfResources |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
202 |
#useIndex: false |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
203 |
#has3Dsepartors: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
204 |
#doubleClickSelector: #resourceDoubleClicked |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
205 |
#columnHolder: #columnsOfDataSetView |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
206 |
#valueChangeSelector: #resourceSelected |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
207 |
#verticalSpacing: 1 |
425 | 208 |
) |
209 |
#(#InputFieldSpec |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
210 |
#name: 'selectorInputField' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
211 |
#layout: #(#LayoutFrame 2 0.0 -22 1 -2 1.0 0 1) |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
212 |
#model: #valueOfSelector |
425 | 213 |
) |
214 |
) |
|
215 |
) |
|
216 |
) |
|
217 |
) |
|
218 |
) |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
219 |
#handles: #(#Any 0.5 1.0) |
425 | 220 |
) |
436 | 221 |
#(#UISubSpecification |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
222 |
#name: 'SubSpecification' |
680 | 223 |
#layout: #(#LayoutFrame 301 0.0 -32 1 -2 1.0 -8 1.0) |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
224 |
#majorKey: #ToolApplicationModel |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
225 |
#minorKey: #windowSpecForCommitWithoutChannels |
425 | 226 |
) |
680 | 227 |
#(#HorizontalPanelViewSpec |
228 |
#name: 'HorizontalPanelView1' |
|
229 |
#layout: #(#LayoutFrame 3 0 76 0.691429 300 0 0 0.977143) |
|
230 |
#component: |
|
231 |
#(#SpecCollection |
|
232 |
#collection: |
|
233 |
#( |
|
234 |
#(#LabelSpec |
|
235 |
#name: 'Label2' |
|
236 |
#label: 'Create: ' |
|
237 |
#adjust: #right |
|
238 |
#extent: #(#Point 67 24) |
|
239 |
) |
|
240 |
#(#ActionButtonSpec |
|
241 |
#name: 'CreateClassButton' |
|
242 |
#activeHelpKey: #dss |
|
243 |
#label: 'Class' |
|
244 |
#model: #createClass: |
|
245 |
#actionValue: 'class' |
|
246 |
#extent: #(#Point 72 24) |
|
247 |
) |
|
248 |
#(#ActionButtonSpec |
|
249 |
#name: 'CreateSubclassButton' |
|
250 |
#activeHelpKey: #dss |
|
251 |
#label: 'Subclass' |
|
252 |
#model: #createClass: |
|
253 |
#actionValue: 'subclass' |
|
254 |
#extent: #(#Point 72 24) |
|
255 |
) |
|
256 |
#(#ActionButtonSpec |
|
257 |
#name: 'CreatePrivateClassButton' |
|
258 |
#activeHelpKey: #dss |
|
259 |
#label: 'Private' |
|
260 |
#model: #createClass: |
|
261 |
#actionValue: 'private' |
|
262 |
#extent: #(#Point 72 24) |
|
263 |
) |
|
264 |
) |
|
265 |
) |
|
266 |
#horizontalLayout: #fit |
|
267 |
#verticalLayout: #fit |
|
268 |
) |
|
425 | 269 |
) |
270 |
) |
|
271 |
) |
|
272 |
! ! |
|
273 |
||
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
274 |
!ResourceSelectionBrowser class methodsFor:'list specs'! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
275 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
276 |
columnsOfDataSetView |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
277 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
278 |
^ #(#(#DataSetColumnSpec |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
279 |
#width: 20 |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
280 |
#height: 20 |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
281 |
#printSelector: #iconOn: |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
282 |
#canSelect: false |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
283 |
) |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
284 |
#(#DataSetColumnSpec |
649 | 285 |
#label: ' Selector' |
286 |
#'labelAlignment:' #left |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
287 |
#model: #selector |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
288 |
#canSelect: false |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
289 |
) |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
290 |
(#DataSetColumnSpec |
649 | 291 |
#label: ' Resource Type' |
292 |
#'labelAlignment:' #left |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
293 |
#model: #resourceType |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
294 |
#canSelect: false |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
295 |
)) |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
296 |
! ! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
297 |
|
632 | 298 |
!ResourceSelectionBrowser class methodsFor:'resources'! |
299 |
||
300 |
iconClass |
|
301 |
"Generated by the Image Editor" |
|
302 |
" |
|
303 |
ImageEditor openOnClass:self andSelector:#iconClass |
|
304 |
" |
|
305 |
||
306 |
<resource: #image> |
|
307 |
||
308 |
^Icon |
|
309 |
constantNamed:#'ResourceSelectionBrowser iconClass' |
|
680 | 310 |
ifAbsentPut:[(Depth2Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@UUUUUAQ****(@F**** @Z****@A****(@F**** @Z****@A****(LF**** TZ****@A****(@F**** @Z****@@@@@@@@@@@@@@@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] |
311 |
! |
|
632 | 312 |
|
680 | 313 |
iconPrivateClass |
632 | 314 |
"Generated by the Image Editor" |
315 |
" |
|
680 | 316 |
ImageEditor openOnClass:self andSelector:#iconPrivateClass |
632 | 317 |
" |
318 |
||
319 |
<resource: #image> |
|
320 |
||
321 |
^Icon |
|
680 | 322 |
constantNamed:#'ResourceSelectionBrowser iconPrivateClass' |
323 |
ifAbsentPut:[(Depth2Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@PUUUUU@A****(@F*??* @Z/??*@A+???(MF/??> @Z5UU:@A+UUW(DF/??> @Z???:@A*??>(@F*??* @Z****C@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 127 0 0]; mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'_?>@???@???@???@???@???@???@???@???@???@???@???@???@???@???@_?>@') ; yourself); yourself] |
|
324 |
! |
|
632 | 325 |
|
680 | 326 |
iconRealPrivateClass |
632 | 327 |
"Generated by the Image Editor" |
328 |
" |
|
680 | 329 |
ImageEditor openOnClass:self andSelector:#iconRealPrivateClass |
632 | 330 |
" |
331 |
||
332 |
<resource: #image> |
|
333 |
||
334 |
^Icon |
|
680 | 335 |
constantNamed:#'ResourceSelectionBrowser iconRealPrivateClass' |
336 |
ifAbsentPut:[(Depth2Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@PUUUUU@A****(@F*??* @Z/??*@A+???(OF/??> @Z5UU:@A+UUW(DF/??> @Z???:@A*??>(@F*??* @Z****C0@@@@@@@@@@@@@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] |
|
337 |
! ! |
|
632 | 338 |
|
425 | 339 |
!ResourceSelectionBrowser methodsFor:'accessing - views'! |
340 |
||
467 | 341 |
classNameInputField |
342 |
||
343 |
^builder componentAt: #classNameInputField |
|
344 |
! |
|
345 |
||
425 | 346 |
listOfClassesView |
347 |
||
348 |
^builder componentAt: #listOfClassesView |
|
349 |
! ! |
|
350 |
||
351 |
!ResourceSelectionBrowser methodsFor:'aspects'! |
|
352 |
||
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
353 |
columnsOfDataSetView |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
354 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
355 |
|holder| |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
356 |
(holder := builder bindingAt:#columnsOfDataSetView) isNil ifTrue:[ |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
357 |
builder aspectAt:#columnsOfDataSetView put:(holder := List new). |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
358 |
holder addAll: (self class columnsOfDataSetView collect: [:i| i decodeAsLiteralArray]). |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
359 |
]. |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
360 |
^ holder |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
361 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
362 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
363 |
! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
364 |
|
425 | 365 |
listOfClasses |
366 |
||
367 |
|holder| |
|
368 |
(holder := builder bindingAt:#listOfClasses) isNil ifTrue:[ |
|
632 | 369 |
builder aspectAt:#listOfClasses put: (holder := TreeItem new) |
425 | 370 |
]. |
371 |
^ holder |
|
372 |
||
373 |
||
374 |
! |
|
375 |
||
376 |
listOfResources |
|
377 |
||
378 |
|holder| |
|
379 |
(holder := builder bindingAt:#listOfResources) isNil ifTrue:[ |
|
380 |
builder aspectAt:#listOfResources put:(holder := List new). |
|
381 |
]. |
|
382 |
^ holder |
|
383 |
! |
|
384 |
||
385 |
selectionOfClass |
|
386 |
||
387 |
|holder| |
|
388 |
(holder := builder bindingAt:#selectionOfClass) isNil ifTrue:[ |
|
389 |
builder aspectAt:#selectionOfClass put:(holder := ValueHolder new). |
|
390 |
]. |
|
391 |
^ holder |
|
392 |
! |
|
393 |
||
394 |
selectionOfResource |
|
395 |
||
396 |
|holder| |
|
397 |
(holder := builder bindingAt:#selectionOfResource) isNil ifTrue:[ |
|
398 |
builder aspectAt:#selectionOfResource put:(holder := '' asValue). |
|
399 |
]. |
|
400 |
^ holder |
|
401 |
! |
|
402 |
||
467 | 403 |
valueOfClassName |
404 |
||
405 |
|holder| |
|
406 |
(holder := builder bindingAt:#valueOfClassName) isNil ifTrue:[ |
|
407 |
builder aspectAt:#valueOfClassName put:(holder := '' asValue). |
|
408 |
]. |
|
409 |
^ holder |
|
410 |
! |
|
411 |
||
425 | 412 |
valueOfSelector |
413 |
||
414 |
|holder| |
|
415 |
(holder := builder bindingAt:#valueOfSelector) isNil ifTrue:[ |
|
416 |
builder aspectAt:#valueOfSelector put:(holder := '' asValue). |
|
417 |
]. |
|
418 |
^ holder |
|
419 |
! ! |
|
420 |
||
632 | 421 |
!ResourceSelectionBrowser methodsFor:'callbacks - tree view'! |
422 |
||
680 | 423 |
treeViewChildren |
424 |
||
425 |
^[:aTreeItem| |
|
426 |
|classes| |
|
427 |
classes := self class treeViewChildren value: aTreeItem. |
|
428 |
classes addAll: (aTreeItem contents privateClasses asSortedCollection: [:i1 :i2| i1 name < i2 name]); |
|
429 |
yourself] |
|
430 |
! |
|
431 |
||
632 | 432 |
treeViewContents |
433 |
||
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
434 |
^(Smalltalk at: resourceSuperclass) ? self class treeViewContents |
632 | 435 |
|
436 |
||
437 |
! |
|
438 |
||
439 |
treeViewIcon |
|
440 |
||
680 | 441 |
^[:aTreeItem| |
442 |
|icon| |
|
443 |
icon := self class treeViewIcon value. |
|
444 |
aTreeItem contents isPrivate |
|
445 |
ifTrue: |
|
446 |
[ |
|
447 |
aTreeItem parent contents ~~ aTreeItem contents superclass |
|
448 |
ifTrue: [icon := self class iconRealPrivateClass] |
|
449 |
ifFalse: [icon := self class iconPrivateClass] |
|
450 |
]. |
|
451 |
icon] |
|
632 | 452 |
! |
453 |
||
454 |
treeViewLabel |
|
455 |
||
680 | 456 |
^[:aTreeItem| |
457 |
|label superCls| |
|
458 |
label := self class treeViewLabel value: aTreeItem. |
|
459 |
(aTreeItem contents isPrivate and: [aTreeItem parent contents ~~ (superCls := aTreeItem contents superclass)]) |
|
460 |
ifTrue: [label := label, ' (', superCls name, ')']. |
|
461 |
label] |
|
632 | 462 |
! ! |
463 |
||
464 |
!ResourceSelectionBrowser methodsFor:'callbacks - user'! |
|
425 | 465 |
|
466 |
classSelected: anIndex |
|
467 |
||
468 |
self selectionOfClass value isNil ifTrue: [^nil]. |
|
469 |
self withWaitCursorDo: |
|
470 |
[ |
|
471 |
|clsName| |
|
517 | 472 |
resourceTypes isNil ifTrue: [resourceTypes := Method resourceTypes]. |
680 | 473 |
clsName := ((self listOfClassesView list at: anIndex) upTo: $ ) asSymbol. |
477 | 474 |
self valueOfClassName value: clsName. |
425 | 475 |
self class lastSelection: clsName. |
476 |
self listOfResources contents: |
|
523 | 477 |
((((Smalltalk at: clsName) |
425 | 478 |
class methodDictionary |
479 |
asOrderedCollection select: |
|
523 | 480 |
[:m| m resources notNil and: [resourceTypes includes: m resourceType]])) |
481 |
collect: [:m| Row new method: m]). |
|
425 | 482 |
] |
483 |
! |
|
484 |
||
680 | 485 |
createClass: what |
486 |
||
487 |
|clsCandidat cls| |
|
488 |
clsCandidat := self valueOfClassName value asSymbol. |
|
489 |
||
490 |
(Smalltalk at: clsCandidat) notNil |
|
491 |
ifTrue: [^self warn: 'Cannot create class ', clsCandidat asBoldText, |
|
492 |
'!!\Key with that name in dictionary ' withCRs, 'Smalltalk' asBoldText, ' detected.']. |
|
493 |
||
494 |
cls := self selectionOfClass value contents. |
|
495 |
what = 'class' ifTrue: [cls := cls superclass]. |
|
496 |
||
497 |
cls isNil ifTrue: [^self warn: 'May not create class with superclass ', 'nil' asBoldText, '!!']. |
|
498 |
||
499 |
what = 'private' |
|
693 | 500 |
ifFalse: |
501 |
[ |
|
502 |
cls subclass: clsCandidat |
|
503 |
instanceVariableNames:'' |
|
504 |
classVariableNames:'' |
|
505 |
poolDictionaries:'' |
|
506 |
category: cls category |
|
507 |
] |
|
680 | 508 |
ifTrue: |
509 |
[ |
|
510 |
|superClsCandidate| |
|
511 |
superClsCandidate := (Dialog |
|
512 |
request: 'Enter name of superclass of private class.' |
|
513 |
initialAnswer: 'Object') asSymbol. |
|
514 |
(superClsCandidate := Smalltalk at: superClsCandidate) isNil ifTrue: [^nil]. |
|
515 |
||
516 |
(superClsCandidate isClass and: [superClsCandidate isPrivate not]) |
|
517 |
ifFalse: [^self warn: 'May not create private class with superclass ', superClsCandidate asBoldText, '!!']. |
|
518 |
superClsCandidate subclass: clsCandidat |
|
519 |
instanceVariableNames:'' |
|
520 |
classVariableNames:'' |
|
521 |
poolDictionaries:'' |
|
522 |
privateIn: cls |
|
523 |
]. |
|
524 |
||
525 |
allClasses := Object withAllSubclasses. |
|
526 |
||
527 |
what = 'class' |
|
528 |
ifTrue: [self selectionOfClass value parent changed: #children] |
|
529 |
ifFalse: [self selectionOfClass value changed: #children]. |
|
530 |
||
693 | 531 |
classSelectionBlock value: self valueOfClassName value |
680 | 532 |
! |
533 |
||
425 | 534 |
resourceDoubleClicked |
535 |
||
536 |
resourceMethod := self selectionOfResource value. |
|
537 |
accept value: true. |
|
538 |
self close |
|
539 |
! |
|
540 |
||
541 |
resourceSelected |
|
542 |
||
543 |
resourceMethod := self selectionOfResource value. |
|
649 | 544 |
self selectionOfResource value notNil |
545 |
ifTrue: [self valueOfSelector value: self selectionOfResource value selector] |
|
425 | 546 |
! ! |
547 |
||
548 |
!ResourceSelectionBrowser methodsFor:'instance creation'! |
|
549 |
||
550 |
openOnSuperclass: aSuperclassOrSymbol andClass: aClassOrSymbol andSelector: aSelector withResourceTypes: aResourceTypes |
|
551 |
||
693 | 552 |
|cls clsName| |
517 | 553 |
resourceMethod := aSelector. |
425 | 554 |
resourceTypes := aResourceTypes. |
555 |
resourceSuperclass := aSuperclassOrSymbol isClass ifTrue: [aSuperclassOrSymbol name] ifFalse: [aSuperclassOrSymbol]. |
|
689 | 556 |
resourceClass := aClassOrSymbol isClass |
557 |
ifTrue: [aClassOrSymbol name] |
|
558 |
ifFalse: [(Smalltalk at: aClassOrSymbol) |
|
559 |
ifTrue: [aClassOrSymbol] |
|
560 |
ifFalse: [nil]]. |
|
481
e2e1ea013229
Take care of nil selectors in #openOnSuperClass:andClass:andSelector:
Stefan Vogel <sv@exept.de>
parents:
477
diff
changeset
|
561 |
self valueOfSelector value:(aSelector ? ''). |
425 | 562 |
|
463 | 563 |
self open. |
564 |
||
693 | 565 |
clsName := (self selectionOfClass value name upTo: $ ) asSymbol. |
566 |
||
632 | 567 |
(self selectionOfClass value notNil and: |
693 | 568 |
[(cls := Smalltalk at: clsName) isClass and: |
641 | 569 |
[accept value]]) |
632 | 570 |
ifTrue: |
693 | 571 |
[ |
572 |
^clsName, ' ', self valueOfSelector value |
|
425 | 573 |
]. |
574 |
^nil |
|
575 |
! ! |
|
576 |
||
577 |
!ResourceSelectionBrowser methodsFor:'startup / release'! |
|
578 |
||
579 |
closeCancel |
|
580 |
||
581 |
resourceMethod := nil. |
|
582 |
super closeCancel |
|
583 |
||
584 |
||
585 |
||
623 | 586 |
! |
587 |
||
588 |
postBuildWith:aBuilder |
|
589 |
||
680 | 590 |
|classSelection| |
623 | 591 |
allClasses := Object withAllSubclasses. |
689 | 592 |
classSelection := resourceClass. |
593 |
(Smalltalk at: classSelection) isNil |
|
594 |
ifTrue: [classSelection := self class lastSelection]. |
|
595 |
(Smalltalk at: classSelection) isNil |
|
596 |
ifTrue: [classSelection := #Object]. |
|
623 | 597 |
classSelectionBlock := |
598 |
[:clsPattern| |
|
599 |
|foundClass classes| |
|
600 |
((foundClass := Smalltalk at: clsPattern printString asSymbol) isClass not or: |
|
601 |
[foundClass name ~= clsPattern]) |
|
602 |
ifTrue: |
|
603 |
[ |
|
604 |
classes := allClasses select: [:cls| cls name size >= clsPattern size]. |
|
605 |
1 to: clsPattern size do: |
|
606 |
[:i| |
|
607 |
classes := classes select: [:cls| (cls name at: i) == (clsPattern at: i)]. |
|
608 |
]. |
|
609 |
foundClass := classes at: 1 ifAbsent: [nil] |
|
610 |
]. |
|
611 |
foundClass notNil |
|
612 |
ifTrue: |
|
613 |
[ |
|
614 |
self listOfClassesView |
|
615 |
selectFromListOfNames: (foundClass |
|
616 |
withAllSuperclasses reverse collect: [:cls| cls name asString]); |
|
617 |
selectedNodeExpand: true |
|
618 |
]. |
|
619 |
self valueOfClassName value: clsPattern |
|
620 |
]. |
|
635 | 621 |
self valueOfClassName value: classSelection. |
623 | 622 |
self classNameInputField entryCompletionBlock: |
623 |
[:value| |
|
624 |
|what| |
|
625 |
what := Smalltalk classnameCompletion: value withoutSpaces. |
|
626 |
self classNameInputField contents:what first. |
|
627 |
(what at:2) size ~~ 1 ifTrue:[Display beep]. |
|
628 |
classSelectionBlock value: self classNameInputField contents |
|
629 |
]. |
|
632 | 630 |
self listOfClassesView validateDoubleClickBlock: [:aTreeItem | aTreeItem contents ~~ self treeViewContents]. |
631 |
self listOfClassesView selectedNodeExpand: true. |
|
623 | 632 |
|
680 | 633 |
[ |
634 |
[classSelectionBlock value: classSelection] value. |
|
635 |
self selectionOfResource value: (self listOfResources detect: [:m| m selector == resourceMethod] ifNone: nil) |
|
636 |
] |
|
635 | 637 |
forkAt: 4. |
623 | 638 |
|
639 |
^super postBuildWith:aBuilder |
|
640 |
||
425 | 641 |
! ! |
642 |
||
523 | 643 |
!ResourceSelectionBrowser::Row methodsFor:'accessing'! |
644 |
||
645 |
iconOn:aGC |
|
646 |
||
647 |
icon isNil ifTrue: [icon := method iconOn: aGC]. |
|
648 |
^icon |
|
680 | 649 |
|
523 | 650 |
! |
651 |
||
652 |
method: aMethod |
|
653 |
||
654 |
method := aMethod |
|
655 |
! |
|
656 |
||
657 |
resourceType |
|
658 |
||
659 |
resourceType isNil ifTrue: [resourceType := method resourceType]. |
|
660 |
^resourceType |
|
661 |
! |
|
662 |
||
663 |
selector |
|
664 |
||
665 |
selector isNil ifTrue: [selector := method who methodSelector]. |
|
666 |
^selector |
|
667 |
! ! |
|
668 |
||
425 | 669 |
!ResourceSelectionBrowser class methodsFor:'documentation'! |
670 |
||
671 |
version |
|
672 |
^ '$Header$' |
|
673 |
! ! |