author | tz |
Tue, 24 Feb 1998 19:44:35 +0100 | |
changeset 672 | 738210a2fa06 |
parent 664 | 6ed67e67d321 |
child 680 | 49c81e9cc6f7 |
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 |
16 |
allClasses' |
|
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 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
81 |
^[:aTreeItem| aTreeItem contents subclasses asSortedCollection: [:i1 :i2| i1 name < i2 name]] |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
82 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
83 |
! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
84 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
85 |
treeViewContents |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
86 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
87 |
^Smalltalk at: #Object |
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 |
|
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 |
! |
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 |
treeViewIcon |
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 |
^[:aTreeItem| |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
97 |
aTreeItem contents subclasses notEmpty |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
98 |
ifTrue: |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
99 |
[ |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
100 |
aTreeItem hide |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
101 |
ifTrue: [self iconHidingSubclasses] |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
102 |
ifFalse: [self iconShowingSubclasses]] |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
103 |
ifFalse: |
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 |
self iconClass |
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 |
] |
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 |
! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
110 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
111 |
treeViewLabel |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
112 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
113 |
^[:aTreeItem|aTreeItem contents name] |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
114 |
! ! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
115 |
|
425 | 116 |
!ResourceSelectionBrowser class methodsFor:'interface specs'! |
117 |
||
118 |
windowSpec |
|
119 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
120 |
||
121 |
"do not manually edit this - the painter/builder may not be able to |
|
122 |
handle the specification if its corrupted." |
|
123 |
||
124 |
" |
|
125 |
UIPainter new openOnClass:ResourceSelectionBrowser andSelector:#windowSpec |
|
126 |
ResourceSelectionBrowser new openInterface:#windowSpec |
|
127 |
" |
|
128 |
"ResourceSelectionBrowser open" |
|
129 |
||
130 |
<resource: #canvas> |
|
131 |
||
132 |
^ |
|
468 | 133 |
|
425 | 134 |
#(#FullSpec |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
135 |
#window: |
425 | 136 |
#(#WindowSpec |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
137 |
#name: 'Resource Selection Browser' |
664 | 138 |
#layout: #(#LayoutFrame 155 0 154 0 754 0 503 0) |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
139 |
#label: 'Resource Selection Browser' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
140 |
#min: #(#Point 400 300) |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
141 |
#max: #(#Point 1152 864) |
664 | 142 |
#bounds: #(#Rectangle 155 154 755 504) |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
143 |
#usePreferredExtent: false |
425 | 144 |
) |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
145 |
#component: |
425 | 146 |
#(#SpecCollection |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
147 |
#collection: |
425 | 148 |
#( |
149 |
#(#VariableHorizontalPanelSpec |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
150 |
#name: 'variableHorizontalPanel' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
151 |
#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
|
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 |
#(#ViewSpec |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
157 |
#name: 'view1' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
158 |
#component: |
425 | 159 |
#(#SpecCollection |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
160 |
#collection: |
425 | 161 |
#( |
162 |
#(#SelectionInTreeViewSpec |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
163 |
#name: 'listOfClassesView' |
664 | 164 |
#layout: #(#LayoutFrame 0 0.0 22 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
|
165 |
#model: #selectionOfClass |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
166 |
#hasHorizontalScrollBar: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
167 |
#hasVerticalScrollBar: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
168 |
#miniScrollerHorizontal: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
169 |
#showDirectoryIndicatorForRoot: false |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
170 |
#showDirectoryIndicator: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
171 |
#valueChangeSelector: #classSelected: |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
172 |
#hierarchicalList: #listOfClasses |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
173 |
#contentsSelector: #treeViewContents |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
174 |
#labelSelector: #treeViewLabel |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
175 |
#childrenSelector: #treeViewChildren |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
176 |
#iconSelector: #treeViewIcon |
425 | 177 |
) |
467 | 178 |
#(#InputFieldSpec |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
179 |
#name: 'classNameInputField' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
180 |
#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
|
181 |
#model: #valueOfClassName |
467 | 182 |
) |
664 | 183 |
#(#LabelSpec |
184 |
#name: 'Label1' |
|
185 |
#layout: #(#LayoutFrame 0 0 0 0 297 0 22 0) |
|
186 |
#label: ' Class Hierarchy' |
|
187 |
#level: 1 |
|
188 |
#adjust: #left |
|
189 |
) |
|
425 | 190 |
) |
191 |
) |
|
192 |
) |
|
193 |
#(#ViewSpec |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
194 |
#name: 'view2' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
195 |
#component: |
425 | 196 |
#(#SpecCollection |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
197 |
#collection: |
425 | 198 |
#( |
199 |
#(#DataSetSpec |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
200 |
#name: 'resourcesDataSetView' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
201 |
#layout: #(#LayoutFrame 2 0.0 0 0.0 -2 1.0 -22 1.0) |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
202 |
#model: #selectionOfResource |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
203 |
#hasHorizontalScrollBar: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
204 |
#hasVerticalScrollBar: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
205 |
#miniScrollerHorizontal: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
206 |
#rowClassName: 'ResourceSelectionBrowser::Row' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
207 |
#dataList: #listOfResources |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
208 |
#useIndex: false |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
209 |
#has3Dsepartors: true |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
210 |
#doubleClickSelector: #resourceDoubleClicked |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
211 |
#columnHolder: #columnsOfDataSetView |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
212 |
#valueChangeSelector: #resourceSelected |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
213 |
#verticalSpacing: 1 |
425 | 214 |
) |
215 |
#(#InputFieldSpec |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
216 |
#name: 'selectorInputField' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
217 |
#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
|
218 |
#model: #valueOfSelector |
425 | 219 |
) |
220 |
) |
|
221 |
) |
|
222 |
) |
|
223 |
) |
|
224 |
) |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
225 |
#handles: #(#Any 0.5 1.0) |
425 | 226 |
) |
436 | 227 |
#(#UISubSpecification |
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
228 |
#name: 'SubSpecification' |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
229 |
#layout: #(#LayoutFrame 2 0.0 -32 1 -2 1.0 -8 1.0) |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
230 |
#majorKey: #ToolApplicationModel |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
231 |
#minorKey: #windowSpecForCommitWithoutChannels |
425 | 232 |
) |
233 |
) |
|
234 |
) |
|
235 |
) |
|
236 |
! ! |
|
237 |
||
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
238 |
!ResourceSelectionBrowser class methodsFor:'list specs'! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
239 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
240 |
columnsOfDataSetView |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
241 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
242 |
^ #(#(#DataSetColumnSpec |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
243 |
#width: 20 |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
244 |
#height: 20 |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
245 |
#printSelector: #iconOn: |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
246 |
#canSelect: false |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
247 |
) |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
248 |
#(#DataSetColumnSpec |
649 | 249 |
#label: ' Selector' |
250 |
#'labelAlignment:' #left |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
251 |
#model: #selector |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
252 |
#canSelect: false |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
253 |
) |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
254 |
(#DataSetColumnSpec |
649 | 255 |
#label: ' Resource Type' |
256 |
#'labelAlignment:' #left |
|
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
257 |
#model: #resourceType |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
258 |
#canSelect: false |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
259 |
)) |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
260 |
! ! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
261 |
|
632 | 262 |
!ResourceSelectionBrowser class methodsFor:'resources'! |
263 |
||
264 |
iconClass |
|
265 |
"Generated by the Image Editor" |
|
266 |
" |
|
267 |
ImageEditor openOnClass:self andSelector:#iconClass |
|
268 |
" |
|
269 |
||
270 |
<resource: #image> |
|
271 |
||
272 |
^Icon |
|
273 |
constantNamed:#'ResourceSelectionBrowser iconClass' |
|
274 |
ifAbsentPut:[(Depth2Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(#[0 0 0 0 0 21 85 85 85 5 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 12 26 170 170 170 5 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 26 170 170 170 0 0 0 0 0 0 0 0 0 0 0]) ; colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color grey:66.9978); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[127 255 128 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 127 255 128]) ; yourself); yourself]! |
|
275 |
||
276 |
iconHidingSubclasses |
|
277 |
"Generated by the Image Editor" |
|
278 |
" |
|
279 |
ImageEditor openOnClass:self andSelector:#iconHidingSubclasses |
|
280 |
" |
|
281 |
||
282 |
<resource: #image> |
|
283 |
||
284 |
^Icon |
|
285 |
constantNamed:#'ResourceSelectionBrowser iconHidingSubclasses' |
|
286 |
ifAbsentPut:[(Depth4Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(#[0 0 0 0 0 0 0 0 0 1 17 17 17 17 17 17 17 48 1 51 51 51 51 51 51 51 32 1 48 0 0 0 51 51 51 32 1 48 68 68 64 51 51 51 32 1 48 0 0 0 51 51 51 32 1 51 50 51 51 51 51 51 32 1 51 50 51 0 0 0 3 32 1 51 50 34 2 34 34 3 32 1 51 50 51 0 0 0 3 32 1 51 50 51 51 51 51 51 32 1 51 50 51 0 0 0 3 32 1 51 50 34 2 34 34 3 32 1 51 51 51 0 0 0 3 32 3 34 34 34 34 34 34 34 32 0 0 0 0 0 0 0 0 0]) ; colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color grey:49.9962); add:(Color grey:66.9978); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9962 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9962); add:(Color red:0.0 green:49.9962 blue:49.9962); add:(Color red:49.9962 green:49.9962 blue:0.0); add:(Color red:49.9962 green:0.0 blue:49.9962); yourself)); mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[127 255 128 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 127 255 128]) ; yourself); yourself]! |
|
287 |
||
288 |
iconShowingSubclasses |
|
289 |
"Generated by the Image Editor" |
|
290 |
" |
|
291 |
ImageEditor openOnClass:self andSelector:#iconShowingSubclasses |
|
292 |
" |
|
293 |
||
294 |
<resource: #image> |
|
295 |
||
296 |
^Icon |
|
297 |
constantNamed:#'ResourceSelectionBrowser iconShowingSubclasses' |
|
298 |
ifAbsentPut:[(Depth4Image new) width: 18; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(#[0 0 0 0 0 0 0 0 0 1 17 17 17 17 17 17 17 48 1 51 51 51 51 51 51 51 32 1 48 0 0 0 51 51 51 32 1 48 68 68 64 51 51 51 32 1 48 0 0 0 51 51 51 32 1 51 50 51 51 51 51 51 32 1 51 50 51 0 0 0 3 32 1 51 50 34 5 85 85 3 32 1 51 50 51 0 0 0 3 32 1 51 50 51 51 51 51 51 32 1 51 50 51 0 0 0 3 32 1 51 50 34 8 136 136 3 32 1 51 51 51 0 0 0 3 32 3 34 34 34 34 34 34 34 32 0 0 0 0 0 0 0 0 0]) ; colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color grey:49.9962); add:(Color grey:66.9978); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9962 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9962); add:(Color red:0.0 green:49.9962 blue:49.9962); add:(Color red:49.9962 green:49.9962 blue:0.0); add:(Color red:49.9962 green:0.0 blue:49.9962); yourself)); mask:((Depth1Image new) width: 18; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[127 255 128 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 255 255 192 127 255 128]) ; yourself); yourself]! ! |
|
299 |
||
425 | 300 |
!ResourceSelectionBrowser methodsFor:'accessing - views'! |
301 |
||
467 | 302 |
classNameInputField |
303 |
||
304 |
^builder componentAt: #classNameInputField |
|
305 |
! |
|
306 |
||
425 | 307 |
listOfClassesView |
308 |
||
309 |
^builder componentAt: #listOfClassesView |
|
310 |
! ! |
|
311 |
||
312 |
!ResourceSelectionBrowser methodsFor:'aspects'! |
|
313 |
||
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
314 |
columnsOfDataSetView |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
315 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
316 |
|holder| |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
317 |
(holder := builder bindingAt:#columnsOfDataSetView) isNil ifTrue:[ |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
318 |
builder aspectAt:#columnsOfDataSetView put:(holder := List new). |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
319 |
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
|
320 |
]. |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
321 |
^ holder |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
322 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
323 |
|
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
324 |
! |
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
325 |
|
425 | 326 |
listOfClasses |
327 |
||
328 |
|holder| |
|
329 |
(holder := builder bindingAt:#listOfClasses) isNil ifTrue:[ |
|
632 | 330 |
builder aspectAt:#listOfClasses put: (holder := TreeItem new) |
425 | 331 |
]. |
332 |
^ holder |
|
333 |
||
334 |
||
335 |
! |
|
336 |
||
337 |
listOfResources |
|
338 |
||
339 |
|holder| |
|
340 |
(holder := builder bindingAt:#listOfResources) isNil ifTrue:[ |
|
341 |
builder aspectAt:#listOfResources put:(holder := List new). |
|
342 |
]. |
|
343 |
^ holder |
|
344 |
! |
|
345 |
||
346 |
selectionOfClass |
|
347 |
||
348 |
|holder| |
|
349 |
(holder := builder bindingAt:#selectionOfClass) isNil ifTrue:[ |
|
350 |
builder aspectAt:#selectionOfClass put:(holder := ValueHolder new). |
|
351 |
]. |
|
352 |
^ holder |
|
353 |
! |
|
354 |
||
355 |
selectionOfResource |
|
356 |
||
357 |
|holder| |
|
358 |
(holder := builder bindingAt:#selectionOfResource) isNil ifTrue:[ |
|
359 |
builder aspectAt:#selectionOfResource put:(holder := '' asValue). |
|
360 |
]. |
|
361 |
^ holder |
|
362 |
! |
|
363 |
||
467 | 364 |
valueOfClassName |
365 |
||
366 |
|holder| |
|
367 |
(holder := builder bindingAt:#valueOfClassName) isNil ifTrue:[ |
|
368 |
builder aspectAt:#valueOfClassName put:(holder := '' asValue). |
|
369 |
]. |
|
370 |
^ holder |
|
371 |
! |
|
372 |
||
425 | 373 |
valueOfSelector |
374 |
||
375 |
|holder| |
|
376 |
(holder := builder bindingAt:#valueOfSelector) isNil ifTrue:[ |
|
377 |
builder aspectAt:#valueOfSelector put:(holder := '' asValue). |
|
378 |
]. |
|
379 |
^ holder |
|
380 |
! ! |
|
381 |
||
632 | 382 |
!ResourceSelectionBrowser methodsFor:'callbacks - tree view'! |
383 |
||
384 |
treeViewContents |
|
385 |
||
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
386 |
^(Smalltalk at: resourceSuperclass) ? self class treeViewContents |
632 | 387 |
|
388 |
||
389 |
! |
|
390 |
||
391 |
treeViewIcon |
|
392 |
||
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
393 |
^self class treeViewIcon |
632 | 394 |
! |
395 |
||
396 |
treeViewLabel |
|
397 |
||
648
d0724edba450
some changes for the lib builder and for its new subclass
tz
parents:
641
diff
changeset
|
398 |
^self class treeViewLabel |
632 | 399 |
|
400 |
! ! |
|
401 |
||
402 |
!ResourceSelectionBrowser methodsFor:'callbacks - user'! |
|
425 | 403 |
|
404 |
classSelected: anIndex |
|
405 |
||
406 |
self selectionOfClass value isNil ifTrue: [^nil]. |
|
407 |
self withWaitCursorDo: |
|
408 |
[ |
|
409 |
|clsName| |
|
517 | 410 |
resourceTypes isNil ifTrue: [resourceTypes := Method resourceTypes]. |
425 | 411 |
clsName := self listOfClassesView list at: anIndex. |
477 | 412 |
self valueOfClassName value: clsName. |
425 | 413 |
self class lastSelection: clsName. |
414 |
self listOfResources contents: |
|
523 | 415 |
((((Smalltalk at: clsName) |
425 | 416 |
class methodDictionary |
417 |
asOrderedCollection select: |
|
523 | 418 |
[:m| m resources notNil and: [resourceTypes includes: m resourceType]])) |
419 |
collect: [:m| Row new method: m]). |
|
425 | 420 |
] |
421 |
! |
|
422 |
||
423 |
resourceDoubleClicked |
|
424 |
||
425 |
resourceMethod := self selectionOfResource value. |
|
426 |
accept value: true. |
|
427 |
self close |
|
428 |
! |
|
429 |
||
430 |
resourceSelected |
|
431 |
||
432 |
resourceMethod := self selectionOfResource value. |
|
649 | 433 |
self selectionOfResource value notNil |
434 |
ifTrue: [self valueOfSelector value: self selectionOfResource value selector] |
|
425 | 435 |
! ! |
436 |
||
437 |
!ResourceSelectionBrowser methodsFor:'instance creation'! |
|
438 |
||
439 |
openOnSuperclass: aSuperclassOrSymbol andClass: aClassOrSymbol andSelector: aSelector withResourceTypes: aResourceTypes |
|
440 |
||
636
b06bea6cbe1b
do return nil if no method was selected even if accepted
tz
parents:
635
diff
changeset
|
441 |
|cls sel| |
517 | 442 |
resourceMethod := aSelector. |
425 | 443 |
resourceTypes := aResourceTypes. |
444 |
resourceSuperclass := aSuperclassOrSymbol isClass ifTrue: [aSuperclassOrSymbol name] ifFalse: [aSuperclassOrSymbol]. |
|
445 |
resourceClass := aClassOrSymbol isClass ifTrue: [aClassOrSymbol name] ifFalse: [aClassOrSymbol]. |
|
481
e2e1ea013229
Take care of nil selectors in #openOnSuperClass:andClass:andSelector:
Stefan Vogel <sv@exept.de>
parents:
477
diff
changeset
|
446 |
self valueOfSelector value:(aSelector ? ''). |
425 | 447 |
|
463 | 448 |
self open. |
449 |
||
632 | 450 |
(self selectionOfClass value notNil and: |
451 |
[(cls := Smalltalk at: self selectionOfClass value name) isClass and: |
|
641 | 452 |
[accept value]]) |
632 | 453 |
ifTrue: |
454 |
[ |
|
641 | 455 |
^cls name, ' ', self valueOfSelector value |
425 | 456 |
]. |
457 |
^nil |
|
458 |
! ! |
|
459 |
||
460 |
!ResourceSelectionBrowser methodsFor:'startup / release'! |
|
461 |
||
462 |
closeCancel |
|
463 |
||
464 |
resourceMethod := nil. |
|
465 |
super closeCancel |
|
466 |
||
467 |
||
468 |
||
623 | 469 |
! |
470 |
||
471 |
postBuildWith:aBuilder |
|
472 |
||
473 |
|classSelection classSelectionBlock| |
|
474 |
allClasses := Object withAllSubclasses. |
|
475 |
classSelection := resourceClass ? self class lastSelection ? #Object. |
|
476 |
classSelectionBlock := |
|
477 |
[:clsPattern| |
|
478 |
|foundClass classes| |
|
479 |
((foundClass := Smalltalk at: clsPattern printString asSymbol) isClass not or: |
|
480 |
[foundClass name ~= clsPattern]) |
|
481 |
ifTrue: |
|
482 |
[ |
|
483 |
classes := allClasses select: [:cls| cls name size >= clsPattern size]. |
|
484 |
1 to: clsPattern size do: |
|
485 |
[:i| |
|
486 |
classes := classes select: [:cls| (cls name at: i) == (clsPattern at: i)]. |
|
487 |
]. |
|
488 |
foundClass := classes at: 1 ifAbsent: [nil] |
|
489 |
]. |
|
490 |
foundClass notNil |
|
491 |
ifTrue: |
|
492 |
[ |
|
493 |
self listOfClassesView |
|
494 |
selectFromListOfNames: (foundClass |
|
495 |
withAllSuperclasses reverse collect: [:cls| cls name asString]); |
|
496 |
selectedNodeExpand: true |
|
497 |
]. |
|
498 |
self valueOfClassName value: clsPattern |
|
499 |
]. |
|
635 | 500 |
self valueOfClassName value: classSelection. |
623 | 501 |
self classNameInputField entryCompletionBlock: |
502 |
[:value| |
|
503 |
|what| |
|
504 |
what := Smalltalk classnameCompletion: value withoutSpaces. |
|
505 |
self classNameInputField contents:what first. |
|
506 |
(what at:2) size ~~ 1 ifTrue:[Display beep]. |
|
507 |
classSelectionBlock value: self classNameInputField contents |
|
508 |
]. |
|
632 | 509 |
self listOfClassesView validateDoubleClickBlock: [:aTreeItem | aTreeItem contents ~~ self treeViewContents]. |
510 |
self listOfClassesView selectedNodeExpand: true. |
|
623 | 511 |
|
635 | 512 |
[[classSelectionBlock value: classSelection] value. |
513 |
self selectionOfResource value: (self listOfResources detect: [:m| m selector == resourceMethod] ifNone: nil)] |
|
514 |
forkAt: 4. |
|
623 | 515 |
|
516 |
^super postBuildWith:aBuilder |
|
517 |
||
425 | 518 |
! ! |
519 |
||
523 | 520 |
!ResourceSelectionBrowser::Row methodsFor:'accessing'! |
521 |
||
522 |
iconOn:aGC |
|
523 |
||
524 |
icon isNil ifTrue: [icon := method iconOn: aGC]. |
|
525 |
^icon |
|
526 |
! |
|
527 |
||
528 |
method: aMethod |
|
529 |
||
530 |
method := aMethod |
|
531 |
! |
|
532 |
||
533 |
resourceType |
|
534 |
||
535 |
resourceType isNil ifTrue: [resourceType := method resourceType]. |
|
536 |
^resourceType |
|
537 |
! |
|
538 |
||
539 |
selector |
|
540 |
||
541 |
selector isNil ifTrue: [selector := method who methodSelector]. |
|
542 |
^selector |
|
543 |
! ! |
|
544 |
||
425 | 545 |
!ResourceSelectionBrowser class methodsFor:'documentation'! |
546 |
||
547 |
version |
|
548 |
^ '$Header$' |
|
549 |
! ! |