author | Claus Gittinger <cg@exept.de> |
Tue, 17 Jan 2006 13:18:46 +0100 | |
changeset 6482 | 00207f456339 |
parent 6462 | 44990c9945fc |
child 6632 | ea16a307f70e |
permissions | -rw-r--r-- |
5140 | 1 |
" |
2 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
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 |
||
3892 | 13 |
"{ Package: 'stx:libtool' }" |
14 |
||
15 |
SimpleDialog subclass:#FileDialog |
|
5220
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
16 |
instanceVariableNames:'aspects treeBrowser directory pattern filterHolder initialText |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
17 |
multipleSelect doubleClickAction cancelLabelHolder okLabelHolder |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
18 |
startFilename result filterField filenameField viewFiles |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
19 |
filenameLabelHolder isLoadDialog newDirectoryVisibilityHolder |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
20 |
appendButtonVisibleHolder appendWasPressed |
6065 | 21 |
buttonPanelVisibleHolder appendLabelHolder browseVisibleHolder |
22 |
selectedDeviceDrive listOfDeviceDrives' |
|
5931 | 23 |
classVariableNames:'LastExtent' |
5220
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
24 |
poolDictionaries:'' |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
25 |
category:'Interface-Tools-File' |
3892 | 26 |
! |
27 |
||
28 |
!FileDialog class methodsFor:'documentation'! |
|
29 |
||
5140 | 30 |
copyright |
31 |
" |
|
32 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
33 |
All Rights Reserved |
|
34 |
||
35 |
This software is furnished under a license and may be used |
|
36 |
only in accordance with the terms of that license and with the |
|
37 |
inclusion of the above copyright notice. This software may not |
|
38 |
be provided or otherwise made available to, or used by, any |
|
39 |
other person. No title to or ownership of the software is |
|
40 |
hereby transferred. |
|
41 |
" |
|
42 |
! |
|
43 |
||
3892 | 44 |
documentation |
45 |
" |
|
46 |
documentation to be added. |
|
47 |
||
48 |
[author:] |
|
49 |
Martin Walser (martin@vercingetorix) |
|
50 |
||
51 |
[instance variables:] |
|
52 |
||
53 |
[class variables:] |
|
54 |
||
55 |
[see also:] |
|
56 |
||
57 |
" |
|
58 |
! |
|
59 |
||
60 |
examples |
|
61 |
" |
|
62 |
[exBegin] |
|
63 |
FileDialog open |
|
64 |
[exEnd] |
|
65 |
||
66 |
[exBegin] |
|
5188
283a77f6efe2
care for non-existing initial dir.
Claus Gittinger <cg@exept.de>
parents:
5173
diff
changeset
|
67 |
FileDialog |
4804 | 68 |
requestFileName:'enter a fileName:' |
69 |
default:'' |
|
70 |
version:nil |
|
71 |
ifFail:['none'] |
|
72 |
pattern:'*.conf' |
|
73 |
fromDirectory:'/etc' |
|
74 |
whenBoxCreatedEvaluate:nil. |
|
75 |
[exEnd] |
|
76 |
[exBegin] |
|
77 |
|fd| |
|
78 |
||
79 |
fd := FileDialog new. |
|
80 |
fd multipleSelect:true. |
|
81 |
fd open |
|
3892 | 82 |
[exEnd] |
83 |
" |
|
5062 | 84 |
! |
85 |
||
86 |
todo |
|
87 |
" |
|
88 |
- make the filedialog windows like f |
|
89 |
filename entry field shows only the filename not the whole directory |
|
90 |
the tree allways starts in currrent directory |
|
91 |
the parent tree is shown in a compobox where the perents are selectable |
|
92 |
- do not expand the ~ or relative pathnames to absolute pathnames |
|
93 |
" |
|
3892 | 94 |
! ! |
95 |
||
96 |
!FileDialog class methodsFor:'instance creation'! |
|
97 |
||
98 |
requestDirectoryName:title default:aFileName ifFail:failBlock |
|
99 |
"same as requestFileName, but only show directories" |
|
100 |
||
4795 | 101 |
^ self |
102 |
requestDirectoryName:title |
|
103 |
default:aFileName |
|
104 |
ok:nil |
|
105 |
abort:nil |
|
106 |
version:nil |
|
107 |
pattern:nil |
|
108 |
fromDirectory:nil |
|
109 |
ifFail:failBlock |
|
110 |
whenBoxCreatedEvaluate:nil |
|
111 |
asLoadDialog:nil. |
|
3892 | 112 |
|
113 |
" |
|
3904 | 114 |
FileDialog |
3892 | 115 |
requestDirectoryName:'which directory ?' |
4627 | 116 |
default:Filename currentDirectory pathName |
3892 | 117 |
ifFail:'none' |
118 |
" |
|
119 |
! |
|
120 |
||
5336 | 121 |
requestDirectoryName:title default:aFileName ok:okText abort:abortText ifFail:failBlock |
122 |
"same as requestFileName, but only show directories" |
|
123 |
||
124 |
^ self |
|
125 |
requestDirectoryName:title |
|
126 |
default:aFileName |
|
127 |
ok:okText |
|
128 |
abort:abortText |
|
129 |
version:nil |
|
130 |
pattern:nil |
|
131 |
fromDirectory:nil |
|
132 |
ifFail:failBlock |
|
133 |
whenBoxCreatedEvaluate:nil |
|
134 |
asLoadDialog:nil. |
|
135 |
||
136 |
" |
|
137 |
FileDialog |
|
138 |
requestDirectoryName:'which directory ?' |
|
139 |
default:Filename currentDirectory pathName |
|
140 |
ok:'Yes' |
|
141 |
abort:'No' |
|
142 |
ifFail:'none' |
|
143 |
" |
|
144 |
! |
|
145 |
||
5823 | 146 |
requestDirectoryName:title default:aFileName ok:okText abort:abortText ifFail:failBlock acceptReturnAsOK:aBoolean |
147 |
"same as requestFileName, but only show directories" |
|
148 |
||
149 |
^ self |
|
150 |
requestDirectoryName:title |
|
151 |
default:aFileName |
|
152 |
ok:okText |
|
153 |
abort:abortText |
|
154 |
version:nil |
|
155 |
pattern:nil |
|
156 |
fromDirectory:nil |
|
157 |
ifFail:failBlock |
|
158 |
whenBoxCreatedEvaluate:[:box|box doubleClickAction:[:index|box doAccept]] |
|
159 |
asLoadDialog:nil. |
|
160 |
||
161 |
" |
|
162 |
FileDialog |
|
163 |
requestDirectoryName:'which directory ?' |
|
164 |
default:Filename currentDirectory pathName |
|
165 |
ok:'Yes' |
|
166 |
abort:'No' |
|
167 |
ifFail:'none' |
|
168 |
" |
|
169 |
! |
|
170 |
||
3956 | 171 |
requestDirectoryName:titleString default:aFileName ok:okText abort:abortText version:versionSymbol pattern:pattern fromDirectory:aDirectoryPath ifFail:failBlock whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean |
3892 | 172 |
"same as requestFileName, but only show directories" |
173 |
||
3956 | 174 |
|enteredFileName instance enteredFileNameString| |
3892 | 175 |
|
4795 | 176 |
instance := self |
177 |
startApplicationFor:titleString |
|
178 |
default:aFileName |
|
179 |
ok:okText |
|
180 |
abort:abortText |
|
181 |
ifFail:failBlock |
|
182 |
pattern:pattern |
|
183 |
fromDirectory:aDirectoryPath |
|
184 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
185 |
asLoadDialog:aBoolean |
|
5329 | 186 |
viewFiles:false |
4795 | 187 |
multipleSelect:false. |
3892 | 188 |
|
189 |
enteredFileNameString := instance result. |
|
190 |
enteredFileNameString isNil ifTrue:[ |
|
191 |
^ failBlock value |
|
192 |
]. |
|
193 |
enteredFileName := enteredFileNameString asFilename. |
|
194 |
enteredFileNameString := enteredFileName asString. |
|
195 |
(enteredFileName notNil |
|
196 |
and:[enteredFileNameString notEmpty]) ifTrue:[ |
|
197 |
versionSymbol isNil ifTrue:[ ^ enteredFileNameString]. |
|
198 |
versionSymbol == #mustBeNew ifTrue:[ |
|
199 |
"/ file may not exist |
|
200 |
enteredFileName exists ifTrue:[^ '']. |
|
201 |
]. |
|
202 |
versionSymbol == #new ifTrue:[ |
|
203 |
"/ file may not exist |
|
204 |
enteredFileName exists ifTrue:[ |
|
6356 | 205 |
(Dialog confirm:(self classResources stringWithCRs:'''%1'' exists.\\Continue anyway ?' with:enteredFileNameString)) |
3892 | 206 |
ifFalse:[^ '']. |
207 |
]. |
|
208 |
]. |
|
209 |
versionSymbol == #mustBeOld ifTrue:[ |
|
210 |
enteredFileName exists ifFalse:[^ '']. |
|
211 |
]. |
|
212 |
versionSymbol == #old ifTrue:[ |
|
213 |
"/ file may not exist |
|
214 |
enteredFileName exists ifFalse:[ |
|
6356 | 215 |
(self confirm:(self classResources stringWithCRs:'''%1'' does not exist yet.\\Continue anyway ?' with:enteredFileNameString)) |
3892 | 216 |
ifFalse:[^ '']. |
217 |
]. |
|
218 |
]. |
|
219 |
FileSelectionBox lastFileSelectionDirectory:(enteredFileNameString). |
|
220 |
]. |
|
221 |
^ enteredFileNameString |
|
222 |
||
223 |
" |
|
224 |
FileDialog |
|
225 |
requestDirectoryName:'which directory ?' |
|
4627 | 226 |
default:Filename currentDirectory pathName |
3892 | 227 |
ifFail:nil |
228 |
" |
|
3956 | 229 |
" |
230 |
FileDialog |
|
231 |
requestDirectoryName:'which directory ?' |
|
4627 | 232 |
default:Filename currentDirectory pathName |
3956 | 233 |
ok:nil |
234 |
abort:nil |
|
235 |
version:nil |
|
236 |
pattern:nil |
|
237 |
fromDirectory:nil |
|
238 |
ifFail:nil |
|
239 |
whenBoxCreatedEvaluate:nil |
|
240 |
asLoadDialog:true |
|
241 |
" |
|
3892 | 242 |
! |
243 |
||
5336 | 244 |
requestDirectoryName:title default:aFileName ok:okText ifFail:failBlock |
245 |
"same as requestFileName, but only show directories" |
|
246 |
||
247 |
^ self |
|
248 |
requestDirectoryName:title |
|
249 |
default:aFileName |
|
250 |
ok:okText |
|
251 |
abort:nil |
|
252 |
version:nil |
|
253 |
pattern:nil |
|
254 |
fromDirectory:nil |
|
255 |
ifFail:failBlock |
|
256 |
whenBoxCreatedEvaluate:nil |
|
257 |
asLoadDialog:nil. |
|
258 |
||
259 |
" |
|
260 |
FileDialog |
|
261 |
requestDirectoryName:'which directory ?' |
|
262 |
default:Filename currentDirectory pathName |
|
263 |
ok:'Yes' |
|
264 |
ifFail:'none' |
|
265 |
" |
|
266 |
! |
|
267 |
||
3892 | 268 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil whenBoxCreatedEvaluate:boxCreatedCallback |
269 |
||
4795 | 270 |
^ self |
271 |
requestFileName:titleString |
|
272 |
default:defaultName |
|
273 |
ok:okText |
|
274 |
abort:abortText |
|
275 |
version:nil |
|
276 |
ifFail:nil |
|
277 |
pattern:pattern |
|
278 |
fromDirectory:aDirectoryPathOrNil |
|
279 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
3892 | 280 |
! |
281 |
||
282 |
requestFileName:titleString default:defaultName ok:okText abort:abortText version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback |
|
283 |
"launch a Dialog, which allows user to enter a filename. |
|
284 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
285 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
286 |
The box will show okText in its okButton, abortText in the abortButton. |
|
287 |
The matchPattern is set to pattern initially. |
|
288 |
Return the string, or nil if cancel was pressed |
|
289 |
The version argument allows validation of the files existance; |
|
290 |
it may be any of: |
|
291 |
#mustBeNew - fail (return empty string) if the file exists |
|
292 |
#new - confirm if the file exists |
|
293 |
#mustBeOld - fail if the file does not exist |
|
294 |
#old - confirm if the file does not exist |
|
295 |
#any (other) - no validation |
|
296 |
" |
|
297 |
||
4795 | 298 |
^ self |
299 |
requestFileName:titleString |
|
300 |
default:defaultName |
|
301 |
ok:okText |
|
302 |
abort:abortText |
|
303 |
version:versionSymbol |
|
304 |
ifFail:failBlock |
|
305 |
pattern:pattern |
|
306 |
fromDirectory:aDirectoryPath |
|
307 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
308 |
asLoadDialog:nil |
|
3956 | 309 |
! |
310 |
||
311 |
requestFileName:titleString default:defaultName ok:okText abort:abortText version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean |
|
312 |
"launch a Dialog, which allows user to enter a filename. |
|
313 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
314 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
315 |
The box will show okText in its okButton, abortText in the abortButton. |
|
316 |
The matchPattern is set to pattern initially. |
|
317 |
Return the string, or nil if cancel was pressed |
|
318 |
The version argument allows validation of the files existance; |
|
319 |
it may be any of: |
|
320 |
#mustBeNew - fail (return empty string) if the file exists |
|
321 |
#new - confirm if the file exists |
|
322 |
#mustBeOld - fail if the file does not exist |
|
323 |
#old - confirm if the file does not exist |
|
324 |
#any (other) - no validation |
|
325 |
" |
|
326 |
||
3892 | 327 |
|
3904 | 328 |
| instance enteredFileName enteredFileNameString| |
3892 | 329 |
|
4795 | 330 |
instance := self |
331 |
startApplicationFor:titleString |
|
332 |
default:defaultName |
|
333 |
ok:okText |
|
334 |
abort:abortText |
|
335 |
ifFail:failBlock |
|
336 |
pattern:pattern |
|
337 |
fromDirectory:aDirectoryPath |
|
338 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
339 |
asLoadDialog:aBoolean |
|
5329 | 340 |
viewFiles:true |
4795 | 341 |
multipleSelect:false. |
3892 | 342 |
|
343 |
enteredFileNameString := instance result. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6462
diff
changeset
|
344 |
(enteredFileNameString isEmptyOrNil) ifTrue:[ |
3892 | 345 |
^ failBlock value |
346 |
]. |
|
347 |
enteredFileName := enteredFileNameString asFilename. |
|
5867 | 348 |
enteredFileNameString := enteredFileName asString. |
5858
d5648b365b8d
returns construct with defaultName if directory selected on requestFilename
penk
parents:
5853
diff
changeset
|
349 |
|
3892 | 350 |
(enteredFileName notNil |
351 |
and:[enteredFileNameString notEmpty]) ifTrue:[ |
|
4666 | 352 |
FileSelectionBox lastFileSelectionDirectory:(enteredFileName directoryName). |
3892 | 353 |
versionSymbol isNil ifTrue:[ ^ enteredFileNameString]. |
354 |
versionSymbol == #mustBeNew ifTrue:[ |
|
355 |
"/ file may not exist |
|
356 |
enteredFileName exists ifTrue:[^ '']. |
|
357 |
]. |
|
358 |
versionSymbol == #new ifTrue:[ |
|
359 |
"/ file may not exist |
|
360 |
enteredFileName exists ifTrue:[ |
|
6356 | 361 |
(Dialog confirm:(self classResources stringWithCRs:'''%1'' exists.\\Continue anyway ?' with:enteredFileNameString)) |
3892 | 362 |
ifFalse:[^ '']. |
363 |
]. |
|
364 |
]. |
|
365 |
versionSymbol == #mustBeOld ifTrue:[ |
|
366 |
enteredFileName exists ifFalse:[^ '']. |
|
367 |
]. |
|
368 |
versionSymbol == #old ifTrue:[ |
|
369 |
"/ file may not exist |
|
370 |
enteredFileName exists ifFalse:[ |
|
6356 | 371 |
(self confirm:(self classResources stringWithCRs:'''%1'' does not exist yet.\\Continue anyway ?' with:enteredFileNameString)) |
3892 | 372 |
ifFalse:[^ '']. |
373 |
]. |
|
374 |
]. |
|
375 |
]. |
|
376 |
^ enteredFileNameString |
|
3956 | 377 |
" |
378 |
FileDialog |
|
379 |
requestFileName:'enter a fileName:' |
|
380 |
default:'' |
|
381 |
ok:nil |
|
382 |
abort:nil |
|
383 |
version:nil |
|
384 |
ifFail:['none'] |
|
5858
d5648b365b8d
returns construct with defaultName if directory selected on requestFilename
penk
parents:
5853
diff
changeset
|
385 |
pattern:'*' |
4627 | 386 |
fromDirectory:Filename currentDirectory pathName |
3956 | 387 |
whenBoxCreatedEvaluate:nil |
388 |
asLoadDialog:true |
|
389 |
" |
|
3892 | 390 |
! |
391 |
||
392 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPathOrNil whenBoxCreatedEvaluate:boxCreatedCallback |
|
393 |
||
4795 | 394 |
^ self |
395 |
requestFileName:titleString |
|
396 |
default:defaultName |
|
397 |
ok:nil |
|
398 |
abort:nil |
|
399 |
version:versionSymbol |
|
400 |
ifFail:failBlock |
|
401 |
pattern:pattern |
|
402 |
fromDirectory:aDirectoryPathOrNil |
|
403 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
3892 | 404 |
|
405 |
" |
|
406 |
FileDialog |
|
407 |
requestFileName:'enter a fileName:' |
|
408 |
default:'' |
|
409 |
version:nil |
|
410 |
ifFail:['none'] |
|
411 |
pattern:'*.conf' |
|
4627 | 412 |
fromDirectory:Filename currentDirectory pathName |
3892 | 413 |
whenBoxCreatedEvaluate:nil. |
414 |
Dialog |
|
415 |
requestFileName:'enter a fileName:' |
|
416 |
default:'' |
|
417 |
version:nil |
|
418 |
ifFail:['none'] |
|
419 |
pattern:'*.conf' |
|
4627 | 420 |
fromDirectory:Filename currentDirectory pathName |
3892 | 421 |
whenBoxCreatedEvaluate:nil |
422 |
" |
|
423 |
" |
|
424 |
FileDialog |
|
425 |
requestFileName:'enter a fileName:' |
|
426 |
default:'' |
|
427 |
version:#old |
|
428 |
ifFail:['none'] |
|
429 |
pattern:'*.conf' |
|
4627 | 430 |
fromDirectory:Filename currentDirectory pathName |
3892 | 431 |
whenBoxCreatedEvaluate:nil |
432 |
" |
|
433 |
" |
|
434 |
FileDialog |
|
435 |
requestFileName:'enter a fileName:' |
|
436 |
default:'' |
|
437 |
version:#mustBeNew |
|
438 |
ifFail:['none'] |
|
439 |
pattern:'*.conf' |
|
4627 | 440 |
fromDirectory:Filename currentDirectory pathName |
3892 | 441 |
whenBoxCreatedEvaluate:nil |
442 |
" |
|
3904 | 443 |
! |
444 |
||
445 |
requestFileNames:titleString default:defaultName ok:okText abort:abortText ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback |
|
446 |
"launch a Dialog, which allows user to enter a filename. |
|
447 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
448 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
449 |
The box will show okText in its okButton, abortText in the abortButton. |
|
450 |
The matchPattern is set to pattern initially. |
|
3905 | 451 |
Return all selected Filenames as filenames in a collection, or nil if cancel was pressed |
3904 | 452 |
" |
453 |
||
454 |
||
4795 | 455 |
^ self |
456 |
requestFileNames:titleString |
|
457 |
default:defaultName |
|
458 |
ok:okText |
|
459 |
abort:abortText |
|
460 |
ifFail:failBlock |
|
461 |
pattern:pattern |
|
462 |
fromDirectory:aDirectoryPath |
|
463 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
464 |
asLoadDialog:nil. |
|
3956 | 465 |
|
466 |
||
467 |
" |
|
468 |
FileDialog |
|
469 |
requestFileNames:'enter a fileName:' |
|
470 |
default:'' |
|
471 |
ok:nil |
|
472 |
abort:nil |
|
473 |
ifFail:['none'] |
|
474 |
pattern:'*.conf' |
|
4627 | 475 |
fromDirectory:Filename currentDirectory pathName |
3956 | 476 |
whenBoxCreatedEvaluate:nil. |
477 |
" |
|
478 |
! |
|
479 |
||
480 |
requestFileNames:titleString default:defaultName ok:okText abort:abortText ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:asLoadDialog |
|
481 |
"launch a Dialog, which allows user to enter a filename. |
|
482 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
483 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
484 |
The box will show okText in its okButton, abortText in the abortButton. |
|
485 |
The matchPattern is set to pattern initially. |
|
486 |
Return all selected Filenames as filenames in a collection, or nil if cancel was pressed |
|
487 |
" |
|
488 |
||
489 |
||
3904 | 490 |
| instance enteredFileNames lastDirectory| |
491 |
||
4795 | 492 |
instance := self |
493 |
startApplicationFor:titleString |
|
494 |
default:defaultName |
|
495 |
ok:okText |
|
496 |
abort:abortText |
|
497 |
ifFail:failBlock |
|
498 |
pattern:pattern |
|
499 |
fromDirectory:aDirectoryPath |
|
500 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
501 |
asLoadDialog:asLoadDialog |
|
5329 | 502 |
viewFiles:true |
4795 | 503 |
multipleSelect:true. |
3904 | 504 |
|
3996 | 505 |
enteredFileNames := instance currentSelectedFiles. |
3904 | 506 |
(enteredFileNames isEmpty or:[instance result isNil]) ifTrue:[ |
507 |
^ failBlock value |
|
508 |
]. |
|
509 |
lastDirectory := enteredFileNames first. |
|
510 |
lastDirectory := lastDirectory isFilename ifTrue:[lastDirectory directory] ifFalse:[lastDirectory]. |
|
511 |
FileSelectionBox lastFileSelectionDirectory:(lastDirectory directoryName). |
|
512 |
^ enteredFileNames |
|
513 |
||
514 |
" |
|
515 |
FileDialog |
|
516 |
requestFileNames:'enter a fileName:' |
|
517 |
default:'' |
|
518 |
ok:nil |
|
519 |
abort:nil |
|
520 |
ifFail:['none'] |
|
521 |
pattern:'*.conf' |
|
4627 | 522 |
fromDirectory:Filename currentDirectory pathName |
3956 | 523 |
whenBoxCreatedEvaluate:nil |
524 |
asLoadDialog:true. |
|
3904 | 525 |
" |
526 |
! |
|
527 |
||
5790 | 528 |
startApplicationFor:titleString default:initialDefaultFileNameArg ok:okTextArg abort:abortTextArg ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:asLoadDialog viewFiles:viewFiles multipleSelect:multipleSelect |
3904 | 529 |
"launch a Dialog, which allows user to enter a filename. |
530 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
531 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
532 |
The box will show okText in its okButton, abortText in the abortButton. |
|
533 |
The matchPattern is set to pattern initially. |
|
534 |
Return the string, or nil if cancel was pressed |
|
535 |
The version argument allows validation of the files existance; |
|
536 |
it may be any of: |
|
537 |
#mustBeNew - fail (return empty string) if the file exists |
|
538 |
#new - confirm if the file exists |
|
539 |
#mustBeOld - fail if the file does not exist |
|
540 |
#old - confirm if the file does not exist |
|
541 |
#any (other) - no validation |
|
542 |
" |
|
543 |
||
544 |
||
5790 | 545 |
|defaultDir instance defaultFile okText abortText initialDefaultFileName| |
546 |
||
547 |
initialDefaultFileName := initialDefaultFileNameArg. |
|
548 |
initialDefaultFileName notNil ifTrue:[ |
|
549 |
initialDefaultFileName := initialDefaultFileName asFilename |
|
550 |
]. |
|
5163 | 551 |
|
552 |
okText := okTextArg. |
|
553 |
okText isNil ifTrue:[ okText := self resources string:'OK' ]. |
|
554 |
abortText := abortTextArg. |
|
555 |
abortText isNil ifTrue:[ abortText := self resources string:'Cancel' ]. |
|
3904 | 556 |
|
557 |
defaultDir := aDirectoryPath. |
|
5220
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
558 |
"/ defaultDir isNil ifTrue:[ |
5790 | 559 |
"/ (initialDefaultFileName size > 0 and:[initialDefaultFileName exists]) ifTrue:[ |
560 |
"/ defaultDir := initialDefaultFileName asAbsoluteFilename directory. |
|
5220
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
561 |
"/ ] ifFalse:[ |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
562 |
"/ defaultDir := FileSelectionBox lastFileSelectionDirectory. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
563 |
"/ defaultDir isNil ifTrue:[ |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
564 |
"/ defaultDir := Filename currentDirectory asAbsoluteFilename. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
565 |
"/ ]. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
566 |
"/ defaultDir asFilename exists ifFalse:[ |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
567 |
"/ defaultDir := nil |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
568 |
"/ ]. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
569 |
"/ ] |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
570 |
"/ ]. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
571 |
(initialDefaultFileName notNil |
5790 | 572 |
and:[initialDefaultFileName isAbsolute |
5220
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
573 |
and:[true "initialDefaultFileName asFilename exists"]]) ifTrue:[ |
5790 | 574 |
defaultDir := initialDefaultFileName asAbsoluteFilename. |
5329 | 575 |
viewFiles ifTrue:[ |
5220
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
576 |
defaultDir := defaultDir directory. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
577 |
]. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
578 |
] ifFalse:[ |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
579 |
defaultDir isNil ifTrue:[ |
5193 | 580 |
defaultDir := FileSelectionBox lastFileSelectionDirectory. |
581 |
defaultDir isNil ifTrue:[ |
|
582 |
defaultDir := Filename currentDirectory asAbsoluteFilename. |
|
583 |
]. |
|
5188
283a77f6efe2
care for non-existing initial dir.
Claus Gittinger <cg@exept.de>
parents:
5173
diff
changeset
|
584 |
defaultDir asFilename exists ifFalse:[ |
283a77f6efe2
care for non-existing initial dir.
Claus Gittinger <cg@exept.de>
parents:
5173
diff
changeset
|
585 |
defaultDir := nil |
283a77f6efe2
care for non-existing initial dir.
Claus Gittinger <cg@exept.de>
parents:
5173
diff
changeset
|
586 |
]. |
3956 | 587 |
] |
3904 | 588 |
]. |
4206 | 589 |
defaultDir := defaultDir asFilename asAbsoluteFilename. |
5220
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
590 |
"/ [defaultDir exists] whileFalse:[ |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
591 |
"/ defaultDir := defaultDir directory. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
592 |
"/ ]. |
5066
57de46852214
Do not select '/tmp/tmp' if '/tmp' is given as default directory
Stefan Vogel <sv@exept.de>
parents:
5062
diff
changeset
|
593 |
|
5329 | 594 |
viewFiles ifFalse:[ |
5790 | 595 |
defaultFile := defaultDir asAbsoluteFilename. |
5329 | 596 |
] ifTrue:[ |
5790 | 597 |
(initialDefaultFileName notNil and:[initialDefaultFileName withoutSuffix baseName ~= '*']) ifTrue:[ |
598 |
defaultFile := defaultDir construct:initialDefaultFileName baseName. |
|
3956 | 599 |
]. |
3904 | 600 |
]. |
4562 | 601 |
defaultFile isNil ifTrue:[ |
602 |
defaultFile := defaultDir. |
|
603 |
]. |
|
3956 | 604 |
|
3904 | 605 |
instance := self new. |
5066
57de46852214
Do not select '/tmp/tmp' if '/tmp' is given as default directory
Stefan Vogel <sv@exept.de>
parents:
5062
diff
changeset
|
606 |
defaultDir notNil ifTrue:[instance directory:defaultDir]. |
3958 | 607 |
instance multipleSelect:multipleSelect ? false. |
3904 | 608 |
instance startFilename:defaultFile. |
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6462
diff
changeset
|
609 |
instance pattern:((pattern isEmptyOrNil) ifTrue:['*'] ifFalse:[pattern]). |
3904 | 610 |
instance initialText:titleString. |
611 |
instance okLabelHolder value:okText. |
|
612 |
instance cancelLabelHolder value:abortText. |
|
5571
333ee892a087
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
5375
diff
changeset
|
613 |
|
4804 | 614 |
instance beLoadDialog:asLoadDialog ? false. |
5329 | 615 |
instance viewFiles:viewFiles ? true. |
3953 | 616 |
self setDoubleClickActionFor:instance. |
3904 | 617 |
instance allButOpenInterface:#windowSpec. |
618 |
boxCreatedCallback notNil ifTrue:[boxCreatedCallback value:instance]. |
|
4603
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
619 |
|
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
620 |
Dialog aboutToOpenBoxNotificationSignal raiseRequestWith:instance. |
5853 | 621 |
|
3904 | 622 |
instance openWindowModal. |
623 |
^ instance |
|
3892 | 624 |
! ! |
625 |
||
626 |
!FileDialog class methodsFor:'accessing'! |
|
627 |
||
5931 | 628 |
lastExtent |
629 |
^ LastExtent |
|
630 |
! |
|
631 |
||
632 |
lastExtent:anExtent |
|
633 |
LastExtent := anExtent |
|
634 |
! |
|
635 |
||
3953 | 636 |
setDoubleClickActionFor:instance |
637 |
||
638 |
instance doubleClickAction:[:anIndex| |
|
639 |
| item | |
|
640 |
item := instance treeBrowser fileList at:anIndex ifAbsent:nil. |
|
641 |
item notNil ifTrue:[ |
|
5329 | 642 |
(instance viewFiles and:[item isDirectory not]) ifTrue:[ |
3953 | 643 |
instance doAccept. |
644 |
] |
|
645 |
] |
|
646 |
]. |
|
3892 | 647 |
! ! |
648 |
||
4603
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
649 |
!FileDialog class methodsFor:'active help'! |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
650 |
|
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
651 |
flyByHelpSpec |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
652 |
<resource: #help> |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
653 |
|
5966 | 654 |
|spec| |
4603
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
655 |
|
6098 | 656 |
spec := AbstractFileBrowser flyByHelpSpec addPairsFrom:#( |
4603
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
657 |
|
5966 | 658 |
#fileBrowse |
659 |
'Browse' |
|
660 |
||
4603
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
661 |
). |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
662 |
|
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
663 |
"/ hist := self directoryHistory. |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
664 |
"/ hist notNil ifTrue:[ |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
665 |
"/ hist canForward ifTrue:[ |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
666 |
"/ spec at:#directoryForward put:(self classResources string:'Forward to: %1' with:hist nextForwardItem). |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
667 |
"/ ]. |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
668 |
"/ hist canBackward ifTrue:[ |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
669 |
"/ spec at:#directoryBack put:(self classResources string:'Back to: %1' with:hist nextBackwardItem). |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
670 |
"/ ]. |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
671 |
"/ ]. |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
672 |
^ spec. |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
673 |
|
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
674 |
" |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
675 |
self flyByHelpSpec |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
676 |
" |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
677 |
! ! |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
678 |
|
3892 | 679 |
!FileDialog class methodsFor:'interface specs'! |
680 |
||
681 |
windowSpec |
|
682 |
"This resource specification was automatically generated |
|
683 |
by the UIPainter of ST/X." |
|
684 |
||
685 |
"Do not manually edit this!! If it is corrupted, |
|
686 |
the UIPainter may not be able to read the specification." |
|
687 |
||
688 |
" |
|
689 |
UIPainter new openOnClass:FileDialog andSelector:#windowSpec |
|
690 |
FileDialog new openInterface:#windowSpec |
|
691 |
FileDialog open |
|
692 |
" |
|
693 |
||
694 |
<resource: #canvas> |
|
695 |
||
696 |
^ |
|
5229 | 697 |
#(FullSpec |
698 |
name: windowSpec |
|
699 |
window: |
|
700 |
(WindowSpec |
|
701 |
label: 'FileDialog' |
|
702 |
name: 'FileDialog' |
|
703 |
min: (Point 10 10) |
|
704 |
max: (Point 1024 768) |
|
5873 | 705 |
bounds: (Rectangle 0 0 407 400) |
3892 | 706 |
) |
5229 | 707 |
component: |
708 |
(SpecCollection |
|
709 |
collection: ( |
|
710 |
(ViewSpec |
|
711 |
name: 'FilePart' |
|
712 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -32 1.0) |
|
713 |
component: |
|
714 |
(SpecCollection |
|
715 |
collection: ( |
|
716 |
(MenuPanelSpec |
|
717 |
name: 'ToolBar1' |
|
6087 | 718 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 32 0) |
5229 | 719 |
tabable: true |
720 |
menu: toolBarMenu |
|
721 |
textDefault: true |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
722 |
) |
5229 | 723 |
(SubCanvasSpec |
724 |
name: 'DirectoryTreeBrowser' |
|
6087 | 725 |
layout: (LayoutFrame 0 0.0 57 0 0 1.0 -30 1) |
5229 | 726 |
tabable: true |
727 |
hasHorizontalScrollBar: false |
|
728 |
hasVerticalScrollBar: false |
|
729 |
majorKey: DirectoryTreeBrowser |
|
730 |
createNewApplication: true |
|
731 |
createNewBuilder: true |
|
732 |
postBuildCallback: postBuildTreeBrowser: |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
733 |
) |
5229 | 734 |
(VariableHorizontalPanelSpec |
735 |
name: 'VariableHorizontalPanel1' |
|
6087 | 736 |
layout: (LayoutFrame 0 0 32 0 0 1 57 0) |
5229 | 737 |
level: 1 |
738 |
showHandle: false |
|
739 |
component: |
|
740 |
(SpecCollection |
|
741 |
collection: ( |
|
742 |
(ViewSpec |
|
743 |
name: 'Box1' |
|
6065 | 744 |
component: |
745 |
(SpecCollection |
|
746 |
collection: ( |
|
747 |
(ComboListSpec |
|
748 |
name: 'ComboList1' |
|
749 |
layout: (LayoutFrame 1 0 1 0.0 121 0 -1 1) |
|
750 |
visibilityChannel: driveSelectorVisible |
|
751 |
model: selectedDeviceDrive |
|
752 |
comboList: listOfDeviceDrives |
|
753 |
useIndex: false |
|
754 |
hidePullDownMenuButton: false |
|
755 |
) |
|
756 |
) |
|
757 |
||
758 |
) |
|
4804 | 759 |
) |
5229 | 760 |
(ViewSpec |
761 |
name: 'Box2' |
|
762 |
component: |
|
763 |
(SpecCollection |
|
764 |
collection: ( |
|
765 |
(LabelSpec |
|
766 |
label: 'Filter:' |
|
767 |
name: 'FilterLabel' |
|
768 |
layout: (LayoutFrame 8 0 2 0 59 0 -2 1) |
|
769 |
translateLabel: true |
|
770 |
adjust: right |
|
4804 | 771 |
) |
5229 | 772 |
(InputFieldSpec |
773 |
name: 'FilterEntryField' |
|
774 |
layout: (LayoutFrame 60 0 -22 1 -2 1 -2 1) |
|
775 |
model: filterHolder |
|
776 |
immediateAccept: true |
|
777 |
acceptOnReturn: true |
|
778 |
acceptOnTab: true |
|
779 |
acceptOnLostFocus: true |
|
780 |
acceptOnPointerLeave: false |
|
781 |
postBuildCallback: postBuildFilterField: |
|
4804 | 782 |
) |
783 |
) |
|
784 |
||
785 |
) |
|
786 |
) |
|
787 |
) |
|
788 |
||
789 |
) |
|
6065 | 790 |
handles: (Any 0.5 1.0) |
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
791 |
) |
5230 | 792 |
(LabelSpec |
793 |
label: 'Filename:' |
|
794 |
name: 'FilenameLabel' |
|
795 |
layout: (LayoutFrame 3 0 -21 1 73 0 -1 1) |
|
796 |
translateLabel: true |
|
797 |
labelChannel: filenameLabelHolder |
|
798 |
adjust: left |
|
799 |
) |
|
800 |
(FilenameInputFieldSpec |
|
801 |
name: 'FilenameEntryField' |
|
802 |
layout: (LayoutFrame 70 0 -21 1 -4 1 -1 1) |
|
803 |
tabable: true |
|
804 |
model: filenameHolder |
|
805 |
immediateAccept: false |
|
806 |
acceptOnPointerLeave: false |
|
5853 | 807 |
hasKeyboardFocusInitially: true |
5230 | 808 |
postBuildCallback: postBuildFileNameField: |
809 |
) |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
810 |
) |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
811 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
812 |
) |
3892 | 813 |
) |
5229 | 814 |
(HorizontalPanelViewSpec |
815 |
name: 'ButtonPanel' |
|
816 |
layout: (LayoutFrame 0 0.0 -32 1 0 1 0 1) |
|
817 |
visibilityChannel: buttonPanelVisibleHolder |
|
818 |
horizontalLayout: fitSpace |
|
819 |
verticalLayout: center |
|
820 |
horizontalSpace: 3 |
|
821 |
verticalSpace: 3 |
|
822 |
reverseOrderIfOKAtLeft: true |
|
823 |
component: |
|
824 |
(SpecCollection |
|
825 |
collection: ( |
|
826 |
(ActionButtonSpec |
|
827 |
label: 'Cancel' |
|
828 |
name: 'cancelButton' |
|
829 |
translateLabel: true |
|
830 |
labelChannel: cancelLabelHolder |
|
831 |
tabable: true |
|
832 |
model: doCancel |
|
5873 | 833 |
extent: (Point 131 22) |
4603
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
834 |
) |
5229 | 835 |
(ActionButtonSpec |
836 |
label: 'Append' |
|
837 |
name: 'appendButton' |
|
838 |
visibilityChannel: appendButtonVisibleHolder |
|
839 |
translateLabel: true |
|
840 |
labelChannel: appendLabelHolder |
|
841 |
tabable: true |
|
842 |
model: appendPressed |
|
5873 | 843 |
extent: (Point 132 22) |
3892 | 844 |
) |
5229 | 845 |
(ActionButtonSpec |
846 |
label: 'OK' |
|
847 |
name: 'okButton' |
|
848 |
translateLabel: true |
|
849 |
labelChannel: okLabelHolder |
|
850 |
tabable: true |
|
851 |
model: okPressed |
|
852 |
isDefault: true |
|
5873 | 853 |
extent: (Point 132 22) |
3892 | 854 |
) |
855 |
) |
|
856 |
||
857 |
) |
|
858 |
) |
|
859 |
) |
|
860 |
||
861 |
) |
|
862 |
) |
|
863 |
! ! |
|
864 |
||
865 |
!FileDialog class methodsFor:'menu specs'! |
|
866 |
||
867 |
toolBarMenu |
|
868 |
"This resource specification was automatically generated |
|
869 |
by the MenuEditor of ST/X." |
|
870 |
||
871 |
"Do not manually edit this!! If it is corrupted, |
|
872 |
the MenuEditor may not be able to read the specification." |
|
873 |
||
874 |
" |
|
875 |
MenuEditor new openOnClass:FileDialog andSelector:#toolBarMenu |
|
876 |
(Menu new fromLiteralArrayEncoding:(FileDialog toolBarMenu)) startUp |
|
877 |
" |
|
878 |
||
879 |
<resource: #menu> |
|
880 |
||
881 |
^ |
|
5873 | 882 |
#(Menu |
883 |
( |
|
884 |
(MenuItem |
|
885 |
activeHelpKey: directoryBack |
|
886 |
enabled: enableBack |
|
887 |
label: 'Back' |
|
888 |
itemValue: doBack |
|
889 |
translateLabel: true |
|
890 |
isButton: true |
|
891 |
submenuChannel: menuDirHistoryBack |
|
6087 | 892 |
labelImage: (ResourceRetriever AbstractFileBrowser historyBackIcon) |
5873 | 893 |
keepLinkedMenu: true |
3892 | 894 |
) |
5873 | 895 |
(MenuItem |
896 |
label: '' |
|
3892 | 897 |
) |
5873 | 898 |
(MenuItem |
899 |
activeHelpKey: directoryForward |
|
900 |
enabled: enableForward |
|
901 |
label: 'Forward' |
|
902 |
itemValue: doForward |
|
903 |
translateLabel: true |
|
904 |
isButton: true |
|
905 |
submenuChannel: menuDirHistoryForward |
|
6087 | 906 |
labelImage: (ResourceRetriever AbstractFileBrowser historyForwardIcon) |
5873 | 907 |
keepLinkedMenu: true |
3892 | 908 |
) |
5873 | 909 |
(MenuItem |
6462 | 910 |
label: '-' |
911 |
) |
|
912 |
(MenuItem |
|
913 |
activeHelpKey: directoryUp |
|
914 |
enabled: enableDirectoryUp |
|
915 |
label: 'DirectoryUp' |
|
916 |
itemValue: doGoDirectoryUp |
|
917 |
translateLabel: true |
|
918 |
isButton: true |
|
919 |
labelImage: (ResourceRetriever AbstractFileBrowser directoryUpIcon) |
|
3892 | 920 |
) |
5873 | 921 |
(MenuItem |
922 |
activeHelpKey: fileHome |
|
923 |
enabled: enableHome |
|
924 |
label: 'Home' |
|
925 |
itemValue: doGotoHomeDirectory |
|
926 |
translateLabel: true |
|
927 |
isButton: true |
|
6096 | 928 |
labelImage: (ResourceRetriever ToolbarIconLibrary homeIcon) |
3892 | 929 |
) |
5873 | 930 |
(MenuItem |
6098 | 931 |
activeHelpKey: fileGotoBookmark |
932 |
label: 'Bookmarks' |
|
933 |
translateLabel: true |
|
934 |
isButton: true |
|
935 |
submenuChannel: gotoBookmarksMenuSpec |
|
936 |
labelImage: (ResourceRetriever ToolbarIconLibrary directoryBookmarksIcon) |
|
937 |
) |
|
938 |
(MenuItem |
|
5873 | 939 |
label: '-' |
5966 | 940 |
isVisible: browseVisibleHolder |
941 |
) |
|
942 |
(MenuItem |
|
943 |
activeHelpKey: fileBrowse |
|
944 |
label: 'Browse' |
|
945 |
itemValue: doBrowseDirectory |
|
946 |
translateLabel: true |
|
947 |
isButton: true |
|
948 |
isVisible: browseVisibleHolder |
|
949 |
labelImage: (ResourceRetriever ToolbarIconLibrary fileBrowser24x24Icon) |
|
950 |
) |
|
951 |
(MenuItem |
|
952 |
label: '-' |
|
5873 | 953 |
isVisible: newDirectoryVisibilityHolder |
3923 | 954 |
) |
5873 | 955 |
(MenuItem |
6122 | 956 |
label: 'New Directory...' |
5873 | 957 |
itemValue: newDirectory |
958 |
translateLabel: true |
|
959 |
isButton: true |
|
960 |
isVisible: newDirectoryVisibilityHolder |
|
6088 | 961 |
labelImage: (ResourceRetriever AbstractFileBrowser newDirectoryIcon) |
3923 | 962 |
) |
3892 | 963 |
) |
964 |
nil |
|
965 |
nil |
|
966 |
) |
|
967 |
! ! |
|
968 |
||
969 |
!FileDialog methodsFor:'accessing'! |
|
970 |
||
3996 | 971 |
currentSelectedFiles |
972 |
||
973 |
| selectedFiles| |
|
974 |
||
975 |
selectedFiles := treeBrowser currentFileNameHolder value. |
|
976 |
^ selectedFiles select:[:aFile| aFile isDirectory not]. |
|
977 |
! |
|
978 |
||
3892 | 979 |
directory |
980 |
"return the value of the instance variable 'directory' (automatically generated)" |
|
981 |
||
982 |
^ directory |
|
983 |
! |
|
984 |
||
985 |
directory:something |
|
986 |
"set the value of the instance variable 'directory' (automatically generated)" |
|
987 |
||
988 |
directory := something. |
|
989 |
! |
|
990 |
||
991 |
initialText |
|
992 |
||
5598 | 993 |
initialText isNil ifTrue:[ |
994 |
^ resources string:'File Dialog'. |
|
995 |
]. |
|
996 |
^ resources string:initialText |
|
3892 | 997 |
! |
998 |
||
999 |
initialText:something |
|
1000 |
"set the value of the instance variable 'initialText' (automatically generated)" |
|
1001 |
||
1002 |
initialText := something. |
|
1003 |
! |
|
1004 |
||
1005 |
pattern |
|
1006 |
"return the value of the instance variable 'pattern' (automatically generated)" |
|
1007 |
||
1008 |
^ pattern |
|
1009 |
! |
|
1010 |
||
1011 |
pattern:something |
|
1012 |
"set the value of the instance variable 'pattern' (automatically generated)" |
|
1013 |
||
1014 |
pattern := something. |
|
1015 |
! |
|
1016 |
||
1017 |
result |
|
1018 |
"return the value of the instance variable 'result' (automatically generated)" |
|
1019 |
||
1020 |
^ result |
|
1021 |
! |
|
1022 |
||
1023 |
result:something |
|
1024 |
"set the value of the instance variable 'result' (automatically generated)" |
|
1025 |
||
1026 |
result := something. |
|
1027 |
! |
|
1028 |
||
3904 | 1029 |
selectedDirectories |
1030 |
||
1031 |
| selectedFiles| |
|
1032 |
||
1033 |
selectedFiles := treeBrowser currentFileNameHolder value. |
|
1034 |
^ selectedFiles select:[:aFile| aFile isDirectory]. |
|
1035 |
! |
|
1036 |
||
3892 | 1037 |
startFilename |
1038 |
"return the value of the instance variable 'startFilename' (automatically generated)" |
|
1039 |
||
1040 |
startFilename isNil ifTrue:[ |
|
1041 |
startFilename := Filename currentDirectory asAbsoluteFilename. |
|
1042 |
]. |
|
1043 |
^ startFilename |
|
1044 |
! |
|
1045 |
||
1046 |
startFilename:something |
|
1047 |
"set the value of the instance variable 'startFilename' (automatically generated)" |
|
1048 |
||
1049 |
startFilename := something. |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1050 |
! ! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1051 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1052 |
!FileDialog methodsFor:'accessing-behavior'! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1053 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1054 |
asLoadDialog |
4804 | 1055 |
^ self isLoadDialog |
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1056 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1057 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1058 |
asLoadDialog:aBoolean |
4804 | 1059 |
self beLoadDialog:aBoolean |
1060 |
! |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1061 |
|
4804 | 1062 |
beLoadDialog:aBoolean |
1063 |
||
1064 |
isLoadDialog := aBoolean |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1065 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1066 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1067 |
doubleClickAction |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1068 |
"return the value of the instance variable 'doubleClickAction' (automatically generated)" |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1069 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1070 |
^ doubleClickAction |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1071 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1072 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1073 |
doubleClickAction:something |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1074 |
"set the value of the instance variable 'doubleClickAction' (automatically generated)" |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1075 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1076 |
doubleClickAction := something. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1077 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1078 |
|
4804 | 1079 |
isLoadDialog |
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1080 |
|
4804 | 1081 |
^ isLoadDialog ? true |
1082 |
! |
|
1083 |
||
1084 |
multipleSelect |
|
1085 |
^ multipleSelect ? false |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1086 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1087 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1088 |
multipleSelect:aBoolean |
4804 | 1089 |
multipleSelect := aBoolean. |
1090 |
treeBrowser notNil ifTrue:[ |
|
1091 |
treeBrowser multipleSelect:aBoolean. |
|
1092 |
]. |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1093 |
! ! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1094 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1095 |
!FileDialog methodsFor:'accessing-components'! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1096 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1097 |
addButton:aButton |
6068 | 1098 |
|buttonPanel okButton| |
1099 |
||
1100 |
buttonPanel := self componentAt:#ButtonPanel. |
|
1101 |
okButton := self okButton. |
|
1102 |
||
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1103 |
DialogBox defaultOKButtonAtLeft ifTrue:[ |
6068 | 1104 |
buttonPanel addSubView:aButton before:okButton |
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1105 |
] ifFalse:[ |
6068 | 1106 |
buttonPanel addSubView:aButton after:okButton |
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1107 |
]. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1108 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1109 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1110 |
okButton |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1111 |
^ (self componentAt:#okButton) |
3892 | 1112 |
! |
1113 |
||
3904 | 1114 |
treeBrowser |
1115 |
"return the value of the instance variable 'treeBrowser' (automatically generated)" |
|
1116 |
||
1117 |
^ treeBrowser |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1118 |
! ! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1119 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1120 |
!FileDialog methodsFor:'accessing-look'! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1121 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1122 |
hideButtonPanel |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1123 |
self buttonPanelVisibleHolder value:false |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1124 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1125 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1126 |
newDirectoryVisibilityHolder |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1127 |
newDirectoryVisibilityHolder isNil ifTrue:[ |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1128 |
newDirectoryVisibilityHolder := true asValue. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1129 |
]. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1130 |
^ newDirectoryVisibilityHolder |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1131 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1132 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1133 |
showButtonPanel |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1134 |
self buttonPanelVisibleHolder value:true |
3904 | 1135 |
! |
1136 |
||
3892 | 1137 |
viewFiles |
1138 |
"return the value of the instance variable 'viewFiles' (automatically generated)" |
|
1139 |
||
1140 |
^ viewFiles |
|
1141 |
! |
|
1142 |
||
1143 |
viewFiles:something |
|
1144 |
"set the value of the instance variable 'viewFiles' (automatically generated)" |
|
1145 |
||
1146 |
viewFiles := something. |
|
1147 |
! ! |
|
1148 |
||
1149 |
!FileDialog methodsFor:'aspects'! |
|
1150 |
||
4603
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
1151 |
appendButtonVisibleHolder |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
1152 |
appendButtonVisibleHolder isNil ifTrue:[ |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
1153 |
appendButtonVisibleHolder := false asValue. |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
1154 |
]. |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
1155 |
^ appendButtonVisibleHolder |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
1156 |
! |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
1157 |
|
5193 | 1158 |
appendLabelHolder |
1159 |
appendLabelHolder isNil ifTrue:[ |
|
1160 |
appendLabelHolder := 'Append' asValue. |
|
1161 |
]. |
|
1162 |
^ appendLabelHolder |
|
1163 |
! |
|
1164 |
||
4804 | 1165 |
aspectOrNil:aKey forSubApplication:aSubApp |
1166 |
"this hook provides an aspect for a subApp" |
|
1167 |
||
1168 |
aKey == #currentFileNameHolder ifTrue:[ |
|
1169 |
directory notNil ifTrue:[ |
|
1170 |
^ (OrderedCollection with:directory) asValue |
|
1171 |
] |
|
1172 |
]. |
|
1173 |
^ nil |
|
1174 |
! |
|
1175 |
||
5969 | 1176 |
browseVisibleHolder |
1177 |
browseVisibleHolder isNil ifTrue:[ |
|
1178 |
browseVisibleHolder := false asValue. |
|
1179 |
]. |
|
1180 |
^ browseVisibleHolder. |
|
1181 |
! |
|
1182 |
||
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1183 |
buttonPanelVisibleHolder |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1184 |
buttonPanelVisibleHolder isNil ifTrue:[ |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1185 |
buttonPanelVisibleHolder := true asValue. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1186 |
buttonPanelVisibleHolder onChangeSend:#buttonPanelVisibilityChanged to:self. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1187 |
]. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1188 |
^ buttonPanelVisibleHolder. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1189 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1190 |
|
3892 | 1191 |
cancelLabelHolder |
1192 |
||
1193 |
cancelLabelHolder isNil ifTrue:[ |
|
1194 |
cancelLabelHolder := 'Cancel' asValue. |
|
1195 |
]. |
|
1196 |
^ cancelLabelHolder. |
|
1197 |
! |
|
1198 |
||
1199 |
enableBack |
|
4804 | 1200 |
^ treeBrowser enableBack. |
3892 | 1201 |
! |
1202 |
||
1203 |
enableDirectoryUp |
|
4804 | 1204 |
^ treeBrowser enableDirectoryUp. |
3892 | 1205 |
! |
1206 |
||
1207 |
enableForward |
|
4804 | 1208 |
^ treeBrowser enableForward. |
3892 | 1209 |
! |
1210 |
||
1211 |
enableHome |
|
4804 | 1212 |
^ treeBrowser enableHome. |
3892 | 1213 |
! |
1214 |
||
1215 |
filenameHolder |
|
1216 |
"Return a value holder with the filename. |
|
1217 |
Shown in the filename input-field. |
|
1218 |
Being the selection in the tree. |
|
1219 |
" |
|
1220 |
|holder| |
|
1221 |
holder := builder bindingAt:#filenameHolder. |
|
1222 |
||
1223 |
holder ifNil:[ |
|
1224 |
holder := ValueHolder new. |
|
1225 |
holder addDependent:self. |
|
1226 |
builder aspectAt:#filenameHolder |
|
1227 |
put:holder. |
|
1228 |
]. |
|
1229 |
||
1230 |
^ holder. |
|
1231 |
! |
|
1232 |
||
3904 | 1233 |
filenameLabelHolder |
1234 |
"Return a value holder for the input string. |
|
1235 |
" |
|
1236 |
filenameLabelHolder isNil ifTrue:[ |
|
1237 |
filenameLabelHolder := 'Filename:' asValue. |
|
1238 |
]. |
|
1239 |
^ filenameLabelHolder |
|
1240 |
! |
|
1241 |
||
3892 | 1242 |
filterHolder |
4011 | 1243 |
"Return a value holder for filter |
3892 | 1244 |
" |
1245 |
||
1246 |
filterHolder isNil ifTrue:[ |
|
1247 |
filterHolder := treeBrowser filterModel. |
|
1248 |
self pattern notNil ifTrue:[ |
|
1249 |
filterHolder value:pattern. |
|
1250 |
] |
|
1251 |
]. |
|
1252 |
^ filterHolder |
|
1253 |
! |
|
1254 |
||
6098 | 1255 |
gotoBookmarksMenuSpec |
1256 |
<resource: #programMenu> |
|
1257 |
||
1258 |
|menu bookmarks| |
|
1259 |
||
1260 |
menu := treeBrowser class emptyMenuSpec decodeAsLiteralArray. |
|
1261 |
menu findGuiResourcesIn:self. |
|
1262 |
menu receiver:self. |
|
1263 |
||
1264 |
"/ add the bookmark items ... |
|
1265 |
bookmarks := treeBrowser class directoryBookmarks. |
|
1266 |
bookmarks notEmptyOrNil ifTrue:[ |
|
1267 |
bookmarks do:[:dirName | |
|
1268 |
menu addItem:((MenuItem label:dirName asString value:[ |
|
1269 |
(treeBrowser currentDirectories value includes:dirName) ifFalse:[ |
|
1270 |
treeBrowser setCurrentFileName:dirName. |
|
1271 |
]. |
|
1272 |
])). |
|
1273 |
]. |
|
1274 |
]. |
|
1275 |
^ menu |
|
1276 |
||
1277 |
"Modified: / 17.8.1998 / 10:13:05 / cg" |
|
1278 |
! |
|
1279 |
||
6065 | 1280 |
listOfDeviceDrives |
1281 |
||
1282 |
listOfDeviceDrives isNil ifTrue:[ |
|
1283 |
listOfDeviceDrives := Filename volumes. |
|
1284 |
]. |
|
1285 |
^ listOfDeviceDrives |
|
1286 |
! |
|
1287 |
||
3892 | 1288 |
okLabelHolder |
1289 |
"automatically generated by UIPainter ..." |
|
1290 |
||
1291 |
"*** the code below creates a default model when invoked." |
|
1292 |
"*** (which may not be the one you wanted)" |
|
1293 |
"*** Please change as required and accept it in the browser." |
|
1294 |
"*** (and replace this comment by something more useful ;-)" |
|
1295 |
||
1296 |
okLabelHolder isNil ifTrue:[ |
|
1297 |
okLabelHolder := 'OK' asValue. |
|
1298 |
]. |
|
1299 |
^ okLabelHolder. |
|
6065 | 1300 |
! |
1301 |
||
1302 |
selectedDeviceDrive |
|
1303 |
||
1304 |
selectedDeviceDrive isNil ifTrue:[ |
|
1305 |
selectedDeviceDrive := self listOfDeviceDrives first asValue. |
|
1306 |
selectedDeviceDrive addDependent:self. |
|
1307 |
]. |
|
1308 |
^ selectedDeviceDrive |
|
3892 | 1309 |
! ! |
1310 |
||
1311 |
!FileDialog methodsFor:'change & update'! |
|
1312 |
||
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1313 |
buttonPanelVisibilityChanged |
5598 | 1314 |
|filePart| |
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1315 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1316 |
filePart := builder componentAt:#FilePart. |
5598 | 1317 |
filePart notNil ifTrue:[ |
1318 |
buttonPanelVisibleHolder value ifTrue:[ |
|
1319 |
filePart layout bottomOffset:-40 |
|
1320 |
] ifFalse:[ |
|
1321 |
filePart layout bottomOffset:0 |
|
1322 |
]. |
|
1323 |
filePart containerChangedSize "/ force resize |
|
1324 |
] |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1325 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1326 |
|
6065 | 1327 |
selectedDeviceDriveChanged |
1328 |
||
1329 |
| newDrive curSel newFile| |
|
1330 |
||
1331 |
newDrive := self selectedDeviceDrive value. |
|
1332 |
curSel := treeBrowser currentFileNameHolder value. |
|
1333 |
curSel notEmpty ifTrue:[ |
|
1334 |
curSel first volume = newDrive ifTrue:[ ^self]. |
|
1335 |
]. |
|
1336 |
newDrive notNil ifTrue:[ |
|
1337 |
newFile := newDrive asFilename. |
|
1338 |
||
1339 |
newFile isReadable ifTrue:[ |
|
1340 |
treeBrowser gotoFile:newFile. |
|
1341 |
^self. |
|
1342 |
]. |
|
1343 |
]. |
|
1344 |
curSel notEmpty ifTrue:[ |
|
1345 |
self selectedDeviceDrive value:(curSel first volume). |
|
1346 |
] ifFalse:[ |
|
1347 |
self selectedDeviceDrive value:'C:'. |
|
1348 |
]. |
|
1349 |
! |
|
1350 |
||
3892 | 1351 |
update:something with:aParameter from:changedObject |
5867 | 1352 |
|files newFile newLabel fn entryFieldFilename| |
3892 | 1353 |
|
1354 |
changedObject == treeBrowser currentFileNameHolder ifTrue:[ |
|
4804 | 1355 |
files := changedObject value. |
3892 | 1356 |
|
1357 |
(files isEmpty) ifTrue:[ |
|
4804 | 1358 |
newFile := nil. |
3892 | 1359 |
] ifFalse:[ |
1360 |
files size == 1 ifTrue:[ |
|
4804 | 1361 |
newFile := files first. |
3892 | 1362 |
] ifFalse:[ |
4804 | 1363 |
newFile := ''. |
3892 | 1364 |
]. |
1365 |
]. |
|
5924 | 1366 |
(self filenameHolder value notNil |
1367 |
and:[newFile notNil |
|
1368 |
and:[newFile asFilename isDirectory]]) ifTrue:[ |
|
5867 | 1369 |
entryFieldFilename := self filenameHolder value asFilename. |
1370 |
self startFilename asFilename baseName = entryFieldFilename baseName ifTrue:[ |
|
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6122
diff
changeset
|
1371 |
entryFieldFilename isDirectory ifFalse:[ |
5867 | 1372 |
newFile := newFile asFilename construct:entryFieldFilename baseName. |
1373 |
]. |
|
1374 |
]. |
|
1375 |
]. |
|
4804 | 1376 |
self filenameHolder value:newFile withoutNotifying:self. |
6065 | 1377 |
OperatingSystem supportsVolumes ifTrue:[ |
1378 |
| volume | |
|
1379 |
volume := (files size >= 1) |
|
1380 |
ifTrue:[files first volume] |
|
1381 |
ifFalse:nil. |
|
1382 |
self selectedDeviceDrive value:volume. |
|
1383 |
]. |
|
3892 | 1384 |
]. |
4804 | 1385 |
|
6065 | 1386 |
changedObject == self selectedDeviceDrive ifTrue:[ |
1387 |
self selectedDeviceDriveChanged. |
|
1388 |
^ self. |
|
1389 |
]. |
|
3904 | 1390 |
changedObject == treeBrowser viewFilesInDirectoryTree ifTrue:[ |
1391 |
changedObject value ifTrue:[ |
|
4804 | 1392 |
newLabel := 'Filename:'. |
3904 | 1393 |
] ifFalse:[ |
4804 | 1394 |
newLabel := 'Directory:'. |
1395 |
]. |
|
1396 |
self filenameLabelHolder value:(resources string:newLabel) |
|
3904 | 1397 |
]. |
3892 | 1398 |
changedObject == self filenameHolder ifTrue:[ |
4804 | 1399 |
fn := changedObject value asFilename. |
1400 |
(fn exists) ifFalse:[^ self]. |
|
1401 |
treeBrowser currentFileNameHolder value:(OrderedCollection with:fn) withoutNotifying:self. |
|
5949 | 1402 |
fn isDirectory ifTrue:[ |
1403 |
treeBrowser expandEnforceSelectedItems. |
|
1404 |
]. |
|
3892 | 1405 |
]. |
1406 |
^ super update:something with:aParameter from:changedObject |
|
1407 |
! ! |
|
1408 |
||
1409 |
!FileDialog methodsFor:'event handling'! |
|
1410 |
||
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1411 |
appendWasPressed |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1412 |
"valid after the dialog has been closed: true if append was pressed" |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1413 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1414 |
^ appendWasPressed |
3892 | 1415 |
! ! |
1416 |
||
1417 |
!FileDialog methodsFor:'initialization & release'! |
|
1418 |
||
5932 | 1419 |
closeDownViews |
1420 |
self remarkExtent. |
|
1421 |
super closeDownViews. |
|
1422 |
! |
|
1423 |
||
1424 |
closeWindow |
|
1425 |
self remarkExtent. |
|
1426 |
super closeWindow. |
|
1427 |
! |
|
1428 |
||
5903
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1429 |
commonPostOpen |
6409 | 1430 |
|selection lastExtent| |
3892 | 1431 |
|
1432 |
"/ self windowGroup addPreEventHook:self. |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1433 |
|
5617
2b10cdfc8b38
oops - do not hide button panel too early
Claus Gittinger <cg@exept.de>
parents:
5598
diff
changeset
|
1434 |
"No ok and cancel buttons, when dialog is part of a larger dialog" |
2b10cdfc8b38
oops - do not hide button panel too early
Claus Gittinger <cg@exept.de>
parents:
5598
diff
changeset
|
1435 |
self window topView isModal ifFalse:[ |
2b10cdfc8b38
oops - do not hide button panel too early
Claus Gittinger <cg@exept.de>
parents:
5598
diff
changeset
|
1436 |
self hideButtonPanel |
2b10cdfc8b38
oops - do not hide button panel too early
Claus Gittinger <cg@exept.de>
parents:
5598
diff
changeset
|
1437 |
]. |
5934 | 1438 |
lastExtent := self class lastExtent. |
1439 |
lastExtent notNil ifTrue:[ |
|
1440 |
self window topView extent:lastExtent. |
|
1441 |
]. |
|
3892 | 1442 |
treeBrowser currentFileNameHolder addDependent:self. |
5598 | 1443 |
treeBrowser doubleClickAction:self doubleClickAction. |
3904 | 1444 |
treeBrowser viewFilesInDirectoryTree addDependent:self. |
5863
e31e066a41d9
root is one up (showing containing directory)
Claus Gittinger <cg@exept.de>
parents:
5858
diff
changeset
|
1445 |
|
6409 | 1446 |
treeBrowser rootHolder value:(self initialRootDirectory). |
4804 | 1447 |
treeBrowser viewFilesInDirectoryTree setValue:(self viewFiles ? true). |
4796 | 1448 |
treeBrowser viewFilesInDirectoryTree changed. |
5598 | 1449 |
treeBrowser currentFileNameHolder value:(OrderedCollection with:self startFilename). |
4804 | 1450 |
|
1451 |
self isLoadDialog ifTrue:[ |
|
4796 | 1452 |
treeBrowser newVisibilityHolder value:false. |
1453 |
treeBrowser allowFileOperations value:false. |
|
1454 |
self newDirectoryVisibilityHolder value:false. |
|
1455 |
]. |
|
5598 | 1456 |
self filenameHolder value:self startFilename. |
5927 | 1457 |
treeBrowser expandEnforceSelectedItems. |
5929 | 1458 |
|
1459 |
selection := treeBrowser treeSelectionHolder value. |
|
1460 |
selection notEmptyOrNil ifTrue:[ |
|
5930 | 1461 |
selection := selection asCollection first. |
5929 | 1462 |
selection enforcedExpand. |
1463 |
treeBrowser browser makeItemVisible:selection withMinimumLines:5. |
|
1464 |
]. |
|
5598 | 1465 |
self window label:self initialText. |
4796 | 1466 |
! |
1467 |
||
6409 | 1468 |
initialRootDirectory |
1469 |
"returns the directory the browser is open on |
|
1470 |
" |
|
1471 |
|root| |
|
1472 |
||
1473 |
(root := self directory) notNil ifTrue:[ |
|
1474 |
root := root asFilename. |
|
1475 |
||
1476 |
root isDirectory ifFalse:[ |
|
1477 |
root := root directory. |
|
1478 |
||
1479 |
root isDirectory ifFalse:[ |
|
1480 |
root := nil. |
|
1481 |
] |
|
1482 |
] |
|
1483 |
]. |
|
1484 |
root isNil ifTrue:[ |
|
1485 |
root := Filename currentDirectory. |
|
1486 |
]. |
|
1487 |
^ root asAbsoluteFilename |
|
1488 |
! |
|
1489 |
||
5903
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1490 |
postBuildFileNameField:aWidget |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1491 |
|
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1492 |
filenameField := aWidget. |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1493 |
! |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1494 |
|
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1495 |
postBuildFilterField:aWidget |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1496 |
|
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1497 |
filterField := aWidget. |
4796 | 1498 |
! |
1499 |
||
5903
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1500 |
postBuildTreeBrowser:aSubCanvasView |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1501 |
|
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1502 |
treeBrowser := aSubCanvasView client. |
6409 | 1503 |
treeBrowser rootHolder value:(self initialRootDirectory value). |
5903
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1504 |
! |
4796 | 1505 |
|
5903
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1506 |
postBuildWith:aBuilder |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1507 |
treeBrowser multipleSelect:multipleSelect. |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1508 |
appendWasPressed := false. |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1509 |
|
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1510 |
(aBuilder componentAt:'cancelButton') cursor:(Cursor thumbsDown). |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1511 |
(aBuilder componentAt:'appendButton') cursor:(Cursor thumbsUp). |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1512 |
(aBuilder componentAt:'okButton') cursor:(Cursor thumbsUp). |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1513 |
|
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1514 |
^ super postBuildWith:aBuilder |
5932 | 1515 |
! |
1516 |
||
1517 |
remarkExtent |
|
1518 |
self class lastExtent:self window topView extent. |
|
4796 | 1519 |
! ! |
1520 |
||
1521 |
!FileDialog methodsFor:'private'! |
|
1522 |
||
1523 |
returnWasPressedInFilterField |
|
1524 |
|ev| |
|
1525 |
||
1526 |
ev := self windowGroup lastEvent. |
|
1527 |
(ev notNil |
|
1528 |
and:[ev isKeyEvent |
|
1529 |
and:[ev key == #Return |
|
1530 |
and:[( ev targetView isSameOrComponentOf:filterField) |
|
1531 |
or:[false "ev targetView isSameOrComponentOf:filenameField"]]]]) ifTrue:[ |
|
1532 |
^ true |
|
1533 |
]. |
|
1534 |
^ false |
|
1535 |
! |
|
1536 |
||
1537 |
returnWasPressedInFilterOrFilenameField |
|
1538 |
|ev| |
|
1539 |
||
1540 |
ev := self windowGroup lastEvent. |
|
1541 |
(ev notNil |
|
1542 |
and:[ev isKeyEvent |
|
1543 |
and:[ev key == #Return |
|
1544 |
and:[( ev targetView isSameOrComponentOf:filterField) |
|
1545 |
or:[false "ev targetView isSameOrComponentOf:filenameField"]]]]) ifTrue:[ |
|
1546 |
^ true |
|
1547 |
]. |
|
1548 |
^ false |
|
1549 |
! ! |
|
1550 |
||
6065 | 1551 |
!FileDialog methodsFor:'queries'! |
1552 |
||
1553 |
driveSelectorVisible |
|
1554 |
^ OperatingSystem isMSDOSlike |
|
1555 |
! ! |
|
1556 |
||
4796 | 1557 |
!FileDialog methodsFor:'user actions'! |
1558 |
||
1559 |
appendPressed |
|
1560 |
appendWasPressed := true. |
|
1561 |
self commonAcceptAction. |
|
1562 |
! |
|
1563 |
||
1564 |
commonAcceptAction |
|
1565 |
filenameField accept. |
|
1566 |
self result:(self filenameHolder value asString). |
|
1567 |
||
1568 |
^ super doAccept |
|
1569 |
! |
|
1570 |
||
1571 |
doAccept |
|
1572 |
"force accept - ignore in filterField" |
|
1573 |
||
1574 |
self returnWasPressedInFilterField ifTrue:[ |
|
1575 |
^ self |
|
1576 |
]. |
|
4996
5927cc0508e8
close the editor in treebrowser on rename if ENTER is pressed
penk
parents:
4824
diff
changeset
|
1577 |
treeBrowser hasOpenEditor ifTrue:[ |
5927cc0508e8
close the editor in treebrowser on rename if ENTER is pressed
penk
parents:
4824
diff
changeset
|
1578 |
"/ have to send the event to the TreeView |
5927cc0508e8
close the editor in treebrowser on rename if ENTER is pressed
penk
parents:
4824
diff
changeset
|
1579 |
treeBrowser browser closeEditor. |
5927cc0508e8
close the editor in treebrowser on rename if ENTER is pressed
penk
parents:
4824
diff
changeset
|
1580 |
^ self |
5927cc0508e8
close the editor in treebrowser on rename if ENTER is pressed
penk
parents:
4824
diff
changeset
|
1581 |
]. |
4796 | 1582 |
appendWasPressed := false. |
1583 |
self commonAcceptAction. |
|
1584 |
! |
|
1585 |
||
1586 |
doBack |
|
1587 |
||
1588 |
treeBrowser doBack. |
|
1589 |
! |
|
1590 |
||
5966 | 1591 |
doBrowseDirectory |
1592 |
UserPreferences fileBrowserClass openOn:(treeBrowser currentDirectory ? treeBrowser rootHolder value). |
|
1593 |
||
1594 |
||
1595 |
! |
|
1596 |
||
4796 | 1597 |
doCancel |
1598 |
||
1599 |
self result:nil. |
|
1600 |
^ super doCancel. |
|
1601 |
! |
|
1602 |
||
1603 |
doForward |
|
1604 |
||
1605 |
treeBrowser doForward. |
|
1606 |
! |
|
1607 |
||
1608 |
doGoDirectoryUp |
|
1609 |
||
1610 |
treeBrowser doGoDirectoryUp. |
|
1611 |
! |
|
1612 |
||
1613 |
doGotoHomeDirectory |
|
1614 |
||
1615 |
treeBrowser doGotoHomeDirectory. |
|
1616 |
! |
|
1617 |
||
1618 |
menuDirHistory:backOrForward |
|
1619 |
||
1620 |
^ treeBrowser menuDirHistory:backOrForward. |
|
1621 |
! |
|
1622 |
||
1623 |
menuDirHistoryBack |
|
1624 |
||
1625 |
^ treeBrowser menuDirHistory:#back. |
|
1626 |
! |
|
1627 |
||
1628 |
menuDirHistoryForward |
|
1629 |
||
1630 |
^ treeBrowser menuDirHistory:#forward. |
|
1631 |
! |
|
1632 |
||
1633 |
newDirectory |
|
1634 |
||
1635 |
^ treeBrowser newDirectory |
|
1636 |
! |
|
1637 |
||
1638 |
okPressed |
|
1639 |
self doAccept |
|
1640 |
! ! |
|
1641 |
||
1642 |
!FileDialog class methodsFor:'documentation'! |
|
1643 |
||
1644 |
version |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6462
diff
changeset
|
1645 |
^ '$Header: /cvs/stx/stx/libtool/FileDialog.st,v 1.86 2006-01-17 12:18:26 cg Exp $' |
4796 | 1646 |
! ! |