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