author | Stefan Vogel <sv@exept.de> |
Fri, 21 Mar 2014 20:33:09 +0100 | |
changeset 14151 | 649b6d53e148 |
parent 13741 | 65519eaa7ae3 |
child 15366 | a8c4945ee67a |
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 |
" |
|
8250 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
3892 | 14 |
SimpleDialog subclass:#FileDialog |
5220
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
15 |
instanceVariableNames:'aspects treeBrowser directory pattern filterHolder initialText |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
16 |
multipleSelect doubleClickAction cancelLabelHolder okLabelHolder |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
17 |
startFilename result filterField filenameField viewFiles |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
18 |
filenameLabelHolder isLoadDialog newDirectoryVisibilityHolder |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
19 |
appendButtonVisibleHolder appendWasPressed |
6065 | 20 |
buttonPanelVisibleHolder appendLabelHolder browseVisibleHolder |
9678 | 21 |
selectedDeviceDrive listOfDeviceDrives rootDirectoryHolder |
12875 | 22 |
initialRoot verticalPanelView' |
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 |
" |
|
9767 | 46 |
A slightly better file dialog |
3892 | 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] |
12816 | 83 |
|
84 |
Adding custom components: |
|
85 |
[exBegin] |
|
86 |
DialogBox aboutToOpenBoxNotificationSignal handle:[:ex | |
|
87 |
| fmtBox | |
|
88 |
||
89 |
fmtBox := ComboListView new. |
|
90 |
fmtBox list: #('Comma Separated Values (.csv)' |
|
91 |
'Microsoft Excel (.xls)' |
|
92 |
'Microsoft Excel XML (.xlsx)') . |
|
93 |
fmtBox model:'Select...' asValue. |
|
94 |
ex application addComponent: fmtBox. |
|
95 |
ex proceed. |
|
96 |
] do:[ |
|
97 |
Dialog requestFileName: 'Save file as...' |
|
98 |
] |
|
99 |
[exEnd] |
|
100 |
||
3892 | 101 |
" |
5062 | 102 |
! |
103 |
||
104 |
todo |
|
105 |
" |
|
9769 | 106 |
- make the filedialog windows like |
5062 | 107 |
filename entry field shows only the filename not the whole directory |
108 |
the tree allways starts in currrent directory |
|
109 |
the parent tree is shown in a compobox where the perents are selectable |
|
9769 | 110 |
|
5062 | 111 |
- do not expand the ~ or relative pathnames to absolute pathnames |
112 |
" |
|
3892 | 113 |
! ! |
114 |
||
115 |
!FileDialog class methodsFor:'instance creation'! |
|
116 |
||
117 |
requestDirectoryName:title default:aFileName ifFail:failBlock |
|
118 |
"same as requestFileName, but only show directories" |
|
119 |
||
4795 | 120 |
^ self |
121 |
requestDirectoryName:title |
|
122 |
default:aFileName |
|
123 |
ok:nil |
|
124 |
abort:nil |
|
125 |
version:nil |
|
126 |
pattern:nil |
|
127 |
fromDirectory:nil |
|
128 |
ifFail:failBlock |
|
129 |
whenBoxCreatedEvaluate:nil |
|
130 |
asLoadDialog:nil. |
|
3892 | 131 |
|
132 |
" |
|
3904 | 133 |
FileDialog |
3892 | 134 |
requestDirectoryName:'which directory ?' |
4627 | 135 |
default:Filename currentDirectory pathName |
3892 | 136 |
ifFail:'none' |
137 |
" |
|
138 |
! |
|
139 |
||
5336 | 140 |
requestDirectoryName:title default:aFileName ok:okText abort:abortText ifFail:failBlock |
141 |
"same as requestFileName, but only show directories" |
|
142 |
||
143 |
^ self |
|
144 |
requestDirectoryName:title |
|
145 |
default:aFileName |
|
146 |
ok:okText |
|
147 |
abort:abortText |
|
148 |
version:nil |
|
149 |
pattern:nil |
|
150 |
fromDirectory:nil |
|
151 |
ifFail:failBlock |
|
152 |
whenBoxCreatedEvaluate:nil |
|
153 |
asLoadDialog:nil. |
|
154 |
||
155 |
" |
|
156 |
FileDialog |
|
157 |
requestDirectoryName:'which directory ?' |
|
158 |
default:Filename currentDirectory pathName |
|
159 |
ok:'Yes' |
|
160 |
abort:'No' |
|
161 |
ifFail:'none' |
|
162 |
" |
|
163 |
! |
|
164 |
||
5823 | 165 |
requestDirectoryName:title default:aFileName ok:okText abort:abortText ifFail:failBlock acceptReturnAsOK:aBoolean |
166 |
"same as requestFileName, but only show directories" |
|
167 |
||
168 |
^ self |
|
169 |
requestDirectoryName:title |
|
170 |
default:aFileName |
|
171 |
ok:okText |
|
172 |
abort:abortText |
|
173 |
version:nil |
|
174 |
pattern:nil |
|
175 |
fromDirectory:nil |
|
176 |
ifFail:failBlock |
|
177 |
whenBoxCreatedEvaluate:[:box|box doubleClickAction:[:index|box doAccept]] |
|
178 |
asLoadDialog:nil. |
|
179 |
||
180 |
" |
|
181 |
FileDialog |
|
182 |
requestDirectoryName:'which directory ?' |
|
183 |
default:Filename currentDirectory pathName |
|
184 |
ok:'Yes' |
|
185 |
abort:'No' |
|
186 |
ifFail:'none' |
|
187 |
" |
|
188 |
! |
|
189 |
||
3956 | 190 |
requestDirectoryName:titleString default:aFileName ok:okText abort:abortText version:versionSymbol pattern:pattern fromDirectory:aDirectoryPath ifFail:failBlock whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean |
3892 | 191 |
"same as requestFileName, but only show directories" |
192 |
||
3956 | 193 |
|enteredFileName instance enteredFileNameString| |
3892 | 194 |
|
4795 | 195 |
instance := self |
196 |
startApplicationFor:titleString |
|
197 |
default:aFileName |
|
198 |
ok:okText |
|
199 |
abort:abortText |
|
200 |
ifFail:failBlock |
|
201 |
pattern:pattern |
|
202 |
fromDirectory:aDirectoryPath |
|
203 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
204 |
asLoadDialog:aBoolean |
|
5329 | 205 |
viewFiles:false |
4795 | 206 |
multipleSelect:false. |
3892 | 207 |
|
208 |
enteredFileNameString := instance result. |
|
209 |
enteredFileNameString isNil ifTrue:[ |
|
210 |
^ failBlock value |
|
211 |
]. |
|
212 |
enteredFileName := enteredFileNameString asFilename. |
|
12896 | 213 |
enteredFileName isRelative ifTrue:[ |
214 |
enteredFileName := instance directory construct:enteredFileNameString |
|
215 |
]. |
|
216 |
||
3892 | 217 |
enteredFileNameString := enteredFileName asString. |
218 |
(enteredFileName notNil |
|
219 |
and:[enteredFileNameString notEmpty]) ifTrue:[ |
|
220 |
versionSymbol isNil ifTrue:[ ^ enteredFileNameString]. |
|
221 |
versionSymbol == #mustBeNew ifTrue:[ |
|
222 |
"/ file may not exist |
|
223 |
enteredFileName exists ifTrue:[^ '']. |
|
224 |
]. |
|
225 |
versionSymbol == #new ifTrue:[ |
|
226 |
"/ file may not exist |
|
227 |
enteredFileName exists ifTrue:[ |
|
6356 | 228 |
(Dialog confirm:(self classResources stringWithCRs:'''%1'' exists.\\Continue anyway ?' with:enteredFileNameString)) |
3892 | 229 |
ifFalse:[^ '']. |
230 |
]. |
|
231 |
]. |
|
232 |
versionSymbol == #mustBeOld ifTrue:[ |
|
233 |
enteredFileName exists ifFalse:[^ '']. |
|
234 |
]. |
|
235 |
versionSymbol == #old ifTrue:[ |
|
236 |
"/ file may not exist |
|
237 |
enteredFileName exists ifFalse:[ |
|
6356 | 238 |
(self confirm:(self classResources stringWithCRs:'''%1'' does not exist yet.\\Continue anyway ?' with:enteredFileNameString)) |
3892 | 239 |
ifFalse:[^ '']. |
240 |
]. |
|
241 |
]. |
|
242 |
FileSelectionBox lastFileSelectionDirectory:(enteredFileNameString). |
|
243 |
]. |
|
244 |
^ enteredFileNameString |
|
245 |
||
246 |
" |
|
247 |
FileDialog |
|
248 |
requestDirectoryName:'which directory ?' |
|
4627 | 249 |
default:Filename currentDirectory pathName |
3892 | 250 |
ifFail:nil |
251 |
" |
|
3956 | 252 |
" |
253 |
FileDialog |
|
254 |
requestDirectoryName:'which directory ?' |
|
4627 | 255 |
default:Filename currentDirectory pathName |
3956 | 256 |
ok:nil |
257 |
abort:nil |
|
258 |
version:nil |
|
259 |
pattern:nil |
|
260 |
fromDirectory:nil |
|
261 |
ifFail:nil |
|
262 |
whenBoxCreatedEvaluate:nil |
|
263 |
asLoadDialog:true |
|
264 |
" |
|
3892 | 265 |
! |
266 |
||
5336 | 267 |
requestDirectoryName:title default:aFileName ok:okText ifFail:failBlock |
268 |
"same as requestFileName, but only show directories" |
|
269 |
||
270 |
^ self |
|
271 |
requestDirectoryName:title |
|
272 |
default:aFileName |
|
273 |
ok:okText |
|
274 |
abort:nil |
|
275 |
version:nil |
|
276 |
pattern:nil |
|
277 |
fromDirectory:nil |
|
278 |
ifFail:failBlock |
|
279 |
whenBoxCreatedEvaluate:nil |
|
280 |
asLoadDialog:nil. |
|
281 |
||
282 |
" |
|
283 |
FileDialog |
|
284 |
requestDirectoryName:'which directory ?' |
|
285 |
default:Filename currentDirectory pathName |
|
286 |
ok:'Yes' |
|
287 |
ifFail:'none' |
|
288 |
" |
|
289 |
! |
|
290 |
||
9765 | 291 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil |
292 |
"launch a Dialog, which allows user to enter a filename. |
|
293 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
294 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
295 |
The box will show okText in its okButton, abortText in the abortButton. |
|
296 |
The matchPattern is set to pattern initially. |
|
297 |
Return the string, or nil if cancel was pressed." |
|
298 |
||
299 |
^ self |
|
300 |
requestFileName:titleString |
|
301 |
default:defaultName |
|
302 |
ok:okText |
|
303 |
abort:abortText |
|
304 |
pattern:pattern |
|
305 |
fromDirectory:aDirectoryPathOrNil |
|
306 |
whenBoxCreatedEvaluate:nil |
|
307 |
||
308 |
"Created: / 14-02-2011 / 17:59:21 / cg" |
|
309 |
! |
|
310 |
||
3892 | 311 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil whenBoxCreatedEvaluate:boxCreatedCallback |
312 |
||
4795 | 313 |
^ self |
314 |
requestFileName:titleString |
|
315 |
default:defaultName |
|
316 |
ok:okText |
|
317 |
abort:abortText |
|
318 |
version:nil |
|
319 |
ifFail:nil |
|
320 |
pattern:pattern |
|
321 |
fromDirectory:aDirectoryPathOrNil |
|
322 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
3892 | 323 |
! |
324 |
||
325 |
requestFileName:titleString default:defaultName ok:okText abort:abortText version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback |
|
326 |
"launch a Dialog, which allows user to enter a filename. |
|
327 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
328 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
329 |
The box will show okText in its okButton, abortText in the abortButton. |
|
330 |
The matchPattern is set to pattern initially. |
|
331 |
Return the string, or nil if cancel was pressed |
|
332 |
The version argument allows validation of the files existance; |
|
333 |
it may be any of: |
|
334 |
#mustBeNew - fail (return empty string) if the file exists |
|
335 |
#new - confirm if the file exists |
|
336 |
#mustBeOld - fail if the file does not exist |
|
337 |
#old - confirm if the file does not exist |
|
338 |
#any (other) - no validation |
|
339 |
" |
|
340 |
||
4795 | 341 |
^ self |
342 |
requestFileName:titleString |
|
343 |
default:defaultName |
|
344 |
ok:okText |
|
345 |
abort:abortText |
|
346 |
version:versionSymbol |
|
347 |
ifFail:failBlock |
|
348 |
pattern:pattern |
|
349 |
fromDirectory:aDirectoryPath |
|
350 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
351 |
asLoadDialog:nil |
|
3956 | 352 |
! |
353 |
||
354 |
requestFileName:titleString default:defaultName ok:okText abort:abortText version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean |
|
355 |
"launch a Dialog, which allows user to enter a filename. |
|
356 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
357 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
358 |
The box will show okText in its okButton, abortText in the abortButton. |
|
359 |
The matchPattern is set to pattern initially. |
|
360 |
Return the string, or nil if cancel was pressed |
|
361 |
The version argument allows validation of the files existance; |
|
362 |
it may be any of: |
|
363 |
#mustBeNew - fail (return empty string) if the file exists |
|
364 |
#new - confirm if the file exists |
|
365 |
#mustBeOld - fail if the file does not exist |
|
366 |
#old - confirm if the file does not exist |
|
367 |
#any (other) - no validation |
|
368 |
" |
|
369 |
||
3892 | 370 |
|
3904 | 371 |
| instance enteredFileName enteredFileNameString| |
3892 | 372 |
|
4795 | 373 |
instance := self |
374 |
startApplicationFor:titleString |
|
375 |
default:defaultName |
|
376 |
ok:okText |
|
377 |
abort:abortText |
|
378 |
ifFail:failBlock |
|
379 |
pattern:pattern |
|
380 |
fromDirectory:aDirectoryPath |
|
381 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
382 |
asLoadDialog:aBoolean |
|
5329 | 383 |
viewFiles:true |
4795 | 384 |
multipleSelect:false. |
3892 | 385 |
|
386 |
enteredFileNameString := instance result. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6462
diff
changeset
|
387 |
(enteredFileNameString isEmptyOrNil) ifTrue:[ |
3892 | 388 |
^ failBlock value |
389 |
]. |
|
390 |
enteredFileName := enteredFileNameString asFilename. |
|
12896 | 391 |
enteredFileName isRelative ifTrue:[ |
392 |
enteredFileName := instance directory construct:enteredFileNameString |
|
393 |
]. |
|
5867 | 394 |
enteredFileNameString := enteredFileName asString. |
5858
d5648b365b8d
returns construct with defaultName if directory selected on requestFilename
penk
parents:
5853
diff
changeset
|
395 |
|
3892 | 396 |
(enteredFileName notNil |
397 |
and:[enteredFileNameString notEmpty]) ifTrue:[ |
|
4666 | 398 |
FileSelectionBox lastFileSelectionDirectory:(enteredFileName directoryName). |
3892 | 399 |
versionSymbol isNil ifTrue:[ ^ enteredFileNameString]. |
400 |
versionSymbol == #mustBeNew ifTrue:[ |
|
401 |
"/ file may not exist |
|
402 |
enteredFileName exists ifTrue:[^ '']. |
|
403 |
]. |
|
404 |
versionSymbol == #new ifTrue:[ |
|
405 |
"/ file may not exist |
|
406 |
enteredFileName exists ifTrue:[ |
|
6356 | 407 |
(Dialog confirm:(self classResources stringWithCRs:'''%1'' exists.\\Continue anyway ?' with:enteredFileNameString)) |
3892 | 408 |
ifFalse:[^ '']. |
409 |
]. |
|
410 |
]. |
|
411 |
versionSymbol == #mustBeOld ifTrue:[ |
|
412 |
enteredFileName exists ifFalse:[^ '']. |
|
413 |
]. |
|
414 |
versionSymbol == #old ifTrue:[ |
|
415 |
"/ file may not exist |
|
416 |
enteredFileName exists ifFalse:[ |
|
6356 | 417 |
(self confirm:(self classResources stringWithCRs:'''%1'' does not exist yet.\\Continue anyway ?' with:enteredFileNameString)) |
3892 | 418 |
ifFalse:[^ '']. |
419 |
]. |
|
420 |
]. |
|
421 |
]. |
|
422 |
^ enteredFileNameString |
|
3956 | 423 |
" |
424 |
FileDialog |
|
425 |
requestFileName:'enter a fileName:' |
|
426 |
default:'' |
|
427 |
ok:nil |
|
428 |
abort:nil |
|
429 |
version:nil |
|
430 |
ifFail:['none'] |
|
5858
d5648b365b8d
returns construct with defaultName if directory selected on requestFilename
penk
parents:
5853
diff
changeset
|
431 |
pattern:'*' |
4627 | 432 |
fromDirectory:Filename currentDirectory pathName |
3956 | 433 |
whenBoxCreatedEvaluate:nil |
434 |
asLoadDialog:true |
|
435 |
" |
|
3892 | 436 |
! |
437 |
||
9765 | 438 |
requestFileName:titleString default:defaultName pattern:pattern fromDirectory:aDirectory |
439 |
"launch a Dialog, which allows user to enter a filename. |
|
440 |
The files presented initially are those from the current directory. |
|
441 |
The box will show ok/cancel in its buttons. |
|
442 |
The matchPattern is set to pattern initially. |
|
443 |
Return the string or nil if cancel was pressed." |
|
444 |
||
445 |
|resources| |
|
446 |
||
447 |
resources := self classResources. |
|
448 |
^ self |
|
449 |
requestFileName:titleString |
|
450 |
default:defaultName |
|
451 |
ok:(resources string:'OK') |
|
452 |
abort:(resources string:'Cancel') |
|
453 |
pattern:pattern |
|
454 |
fromDirectory:aDirectory |
|
455 |
||
456 |
"Created: / 14-02-2011 / 17:59:14 / cg" |
|
457 |
! |
|
458 |
||
3892 | 459 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPathOrNil whenBoxCreatedEvaluate:boxCreatedCallback |
460 |
||
4795 | 461 |
^ self |
462 |
requestFileName:titleString |
|
463 |
default:defaultName |
|
464 |
ok:nil |
|
465 |
abort:nil |
|
466 |
version:versionSymbol |
|
467 |
ifFail:failBlock |
|
468 |
pattern:pattern |
|
469 |
fromDirectory:aDirectoryPathOrNil |
|
470 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
3892 | 471 |
|
472 |
" |
|
473 |
FileDialog |
|
474 |
requestFileName:'enter a fileName:' |
|
475 |
default:'' |
|
476 |
version:nil |
|
477 |
ifFail:['none'] |
|
478 |
pattern:'*.conf' |
|
4627 | 479 |
fromDirectory:Filename currentDirectory pathName |
3892 | 480 |
whenBoxCreatedEvaluate:nil. |
481 |
Dialog |
|
482 |
requestFileName:'enter a fileName:' |
|
483 |
default:'' |
|
484 |
version:nil |
|
485 |
ifFail:['none'] |
|
486 |
pattern:'*.conf' |
|
4627 | 487 |
fromDirectory:Filename currentDirectory pathName |
3892 | 488 |
whenBoxCreatedEvaluate:nil |
489 |
" |
|
490 |
" |
|
491 |
FileDialog |
|
492 |
requestFileName:'enter a fileName:' |
|
493 |
default:'' |
|
494 |
version:#old |
|
495 |
ifFail:['none'] |
|
496 |
pattern:'*.conf' |
|
4627 | 497 |
fromDirectory:Filename currentDirectory pathName |
3892 | 498 |
whenBoxCreatedEvaluate:nil |
499 |
" |
|
500 |
" |
|
501 |
FileDialog |
|
502 |
requestFileName:'enter a fileName:' |
|
503 |
default:'' |
|
504 |
version:#mustBeNew |
|
505 |
ifFail:['none'] |
|
506 |
pattern:'*.conf' |
|
4627 | 507 |
fromDirectory:Filename currentDirectory pathName |
3892 | 508 |
whenBoxCreatedEvaluate:nil |
509 |
" |
|
3904 | 510 |
! |
511 |
||
512 |
requestFileNames:titleString default:defaultName ok:okText abort:abortText ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback |
|
513 |
"launch a Dialog, which allows user to enter a filename. |
|
514 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
515 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
516 |
The box will show okText in its okButton, abortText in the abortButton. |
|
517 |
The matchPattern is set to pattern initially. |
|
3905 | 518 |
Return all selected Filenames as filenames in a collection, or nil if cancel was pressed |
3904 | 519 |
" |
520 |
||
521 |
||
4795 | 522 |
^ self |
523 |
requestFileNames:titleString |
|
524 |
default:defaultName |
|
525 |
ok:okText |
|
526 |
abort:abortText |
|
527 |
ifFail:failBlock |
|
528 |
pattern:pattern |
|
529 |
fromDirectory:aDirectoryPath |
|
530 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
531 |
asLoadDialog:nil. |
|
3956 | 532 |
|
533 |
||
534 |
" |
|
535 |
FileDialog |
|
536 |
requestFileNames:'enter a fileName:' |
|
537 |
default:'' |
|
538 |
ok:nil |
|
539 |
abort:nil |
|
540 |
ifFail:['none'] |
|
541 |
pattern:'*.conf' |
|
4627 | 542 |
fromDirectory:Filename currentDirectory pathName |
3956 | 543 |
whenBoxCreatedEvaluate:nil. |
544 |
" |
|
545 |
! |
|
546 |
||
547 |
requestFileNames:titleString default:defaultName ok:okText abort:abortText ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:asLoadDialog |
|
548 |
"launch a Dialog, which allows user to enter a filename. |
|
549 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
550 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
551 |
The box will show okText in its okButton, abortText in the abortButton. |
|
552 |
The matchPattern is set to pattern initially. |
|
553 |
Return all selected Filenames as filenames in a collection, or nil if cancel was pressed |
|
554 |
" |
|
555 |
||
556 |
||
3904 | 557 |
| instance enteredFileNames lastDirectory| |
558 |
||
4795 | 559 |
instance := self |
560 |
startApplicationFor:titleString |
|
561 |
default:defaultName |
|
562 |
ok:okText |
|
563 |
abort:abortText |
|
564 |
ifFail:failBlock |
|
565 |
pattern:pattern |
|
566 |
fromDirectory:aDirectoryPath |
|
567 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
568 |
asLoadDialog:asLoadDialog |
|
5329 | 569 |
viewFiles:true |
4795 | 570 |
multipleSelect:true. |
3904 | 571 |
|
3996 | 572 |
enteredFileNames := instance currentSelectedFiles. |
3904 | 573 |
(enteredFileNames isEmpty or:[instance result isNil]) ifTrue:[ |
574 |
^ failBlock value |
|
575 |
]. |
|
576 |
lastDirectory := enteredFileNames first. |
|
577 |
lastDirectory := lastDirectory isFilename ifTrue:[lastDirectory directory] ifFalse:[lastDirectory]. |
|
578 |
FileSelectionBox lastFileSelectionDirectory:(lastDirectory directoryName). |
|
579 |
^ enteredFileNames |
|
580 |
||
581 |
" |
|
582 |
FileDialog |
|
583 |
requestFileNames:'enter a fileName:' |
|
584 |
default:'' |
|
585 |
ok:nil |
|
586 |
abort:nil |
|
587 |
ifFail:['none'] |
|
588 |
pattern:'*.conf' |
|
4627 | 589 |
fromDirectory:Filename currentDirectory pathName |
3956 | 590 |
whenBoxCreatedEvaluate:nil |
591 |
asLoadDialog:true. |
|
3904 | 592 |
" |
593 |
! |
|
594 |
||
5790 | 595 |
startApplicationFor:titleString default:initialDefaultFileNameArg ok:okTextArg abort:abortTextArg ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:asLoadDialog viewFiles:viewFiles multipleSelect:multipleSelect |
3904 | 596 |
"launch a Dialog, which allows user to enter a filename. |
597 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
598 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
599 |
The box will show okText in its okButton, abortText in the abortButton. |
|
600 |
The matchPattern is set to pattern initially. |
|
601 |
Return the string, or nil if cancel was pressed |
|
602 |
The version argument allows validation of the files existance; |
|
603 |
it may be any of: |
|
604 |
#mustBeNew - fail (return empty string) if the file exists |
|
605 |
#new - confirm if the file exists |
|
606 |
#mustBeOld - fail if the file does not exist |
|
607 |
#old - confirm if the file does not exist |
|
608 |
#any (other) - no validation |
|
609 |
" |
|
610 |
||
611 |
||
5790 | 612 |
|defaultDir instance defaultFile okText abortText initialDefaultFileName| |
613 |
||
614 |
initialDefaultFileName := initialDefaultFileNameArg. |
|
615 |
initialDefaultFileName notNil ifTrue:[ |
|
13001 | 616 |
initialDefaultFileName := initialDefaultFileName asFilename. |
5790 | 617 |
]. |
5163 | 618 |
|
619 |
okText := okTextArg. |
|
620 |
okText isNil ifTrue:[ okText := self resources string:'OK' ]. |
|
621 |
abortText := abortTextArg. |
|
622 |
abortText isNil ifTrue:[ abortText := self resources string:'Cancel' ]. |
|
3904 | 623 |
|
624 |
defaultDir := aDirectoryPath. |
|
5220
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
625 |
"/ defaultDir isNil ifTrue:[ |
5790 | 626 |
"/ (initialDefaultFileName size > 0 and:[initialDefaultFileName exists]) ifTrue:[ |
627 |
"/ defaultDir := initialDefaultFileName asAbsoluteFilename directory. |
|
5220
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
628 |
"/ ] ifFalse:[ |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
629 |
"/ defaultDir := FileSelectionBox lastFileSelectionDirectory. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
630 |
"/ defaultDir isNil ifTrue:[ |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
631 |
"/ defaultDir := Filename currentDirectory asAbsoluteFilename. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
632 |
"/ ]. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
633 |
"/ defaultDir asFilename exists ifFalse:[ |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
634 |
"/ defaultDir := nil |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
635 |
"/ ]. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
636 |
"/ ] |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
637 |
"/ ]. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
638 |
(initialDefaultFileName notNil |
5790 | 639 |
and:[initialDefaultFileName isAbsolute |
5220
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
640 |
and:[true "initialDefaultFileName asFilename exists"]]) ifTrue:[ |
5790 | 641 |
defaultDir := initialDefaultFileName asAbsoluteFilename. |
6953
651025031ea2
initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents:
6728
diff
changeset
|
642 |
true "viewFiles" ifTrue:[ |
651025031ea2
initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents:
6728
diff
changeset
|
643 |
defaultFile := defaultDir asAbsoluteFilename. |
5220
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
644 |
defaultDir := defaultDir directory. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
645 |
]. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
646 |
] ifFalse:[ |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
647 |
defaultDir isNil ifTrue:[ |
5193 | 648 |
defaultDir := FileSelectionBox lastFileSelectionDirectory. |
649 |
defaultDir isNil ifTrue:[ |
|
650 |
defaultDir := Filename currentDirectory asAbsoluteFilename. |
|
651 |
]. |
|
5188
283a77f6efe2
care for non-existing initial dir.
Claus Gittinger <cg@exept.de>
parents:
5173
diff
changeset
|
652 |
defaultDir asFilename exists ifFalse:[ |
283a77f6efe2
care for non-existing initial dir.
Claus Gittinger <cg@exept.de>
parents:
5173
diff
changeset
|
653 |
defaultDir := nil |
283a77f6efe2
care for non-existing initial dir.
Claus Gittinger <cg@exept.de>
parents:
5173
diff
changeset
|
654 |
]. |
3956 | 655 |
] |
3904 | 656 |
]. |
4206 | 657 |
defaultDir := defaultDir asFilename asAbsoluteFilename. |
5220
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
658 |
"/ [defaultDir exists] whileFalse:[ |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
659 |
"/ defaultDir := defaultDir directory. |
1de409e5ea52
initial text overwrites given directoryPath
Claus Gittinger <cg@exept.de>
parents:
5193
diff
changeset
|
660 |
"/ ]. |
5066
57de46852214
Do not select '/tmp/tmp' if '/tmp' is given as default directory
Stefan Vogel <sv@exept.de>
parents:
5062
diff
changeset
|
661 |
|
6953
651025031ea2
initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents:
6728
diff
changeset
|
662 |
defaultFile isNil ifTrue:[ |
651025031ea2
initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents:
6728
diff
changeset
|
663 |
viewFiles ifFalse:[ |
651025031ea2
initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents:
6728
diff
changeset
|
664 |
defaultFile := defaultDir asAbsoluteFilename. |
651025031ea2
initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents:
6728
diff
changeset
|
665 |
] ifTrue:[ |
651025031ea2
initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents:
6728
diff
changeset
|
666 |
(initialDefaultFileName notNil and:[initialDefaultFileName withoutSuffix baseName ~= '*']) ifTrue:[ |
651025031ea2
initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents:
6728
diff
changeset
|
667 |
defaultFile := defaultDir construct:initialDefaultFileName baseName. |
651025031ea2
initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents:
6728
diff
changeset
|
668 |
] ifFalse:[ |
651025031ea2
initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents:
6728
diff
changeset
|
669 |
defaultFile := defaultDir. |
651025031ea2
initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents:
6728
diff
changeset
|
670 |
]. |
3956 | 671 |
]. |
3904 | 672 |
]. |
3956 | 673 |
|
3904 | 674 |
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
|
675 |
defaultDir notNil ifTrue:[instance directory:defaultDir]. |
3958 | 676 |
instance multipleSelect:multipleSelect ? false. |
3904 | 677 |
instance startFilename:defaultFile. |
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6462
diff
changeset
|
678 |
instance pattern:((pattern isEmptyOrNil) ifTrue:['*'] ifFalse:[pattern]). |
3904 | 679 |
instance initialText:titleString. |
680 |
instance okLabelHolder value:okText. |
|
681 |
instance cancelLabelHolder value:abortText. |
|
5571
333ee892a087
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
5375
diff
changeset
|
682 |
|
4804 | 683 |
instance beLoadDialog:asLoadDialog ? false. |
5329 | 684 |
instance viewFiles:viewFiles ? true. |
3953 | 685 |
self setDoubleClickActionFor:instance. |
3904 | 686 |
instance allButOpenInterface:#windowSpec. |
687 |
boxCreatedCallback notNil ifTrue:[boxCreatedCallback value:instance]. |
|
4603
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
688 |
|
8661
086147f751d0
AboutToOpenBoxNotificationSignal moved to SimpleView and now raised
Claus Gittinger <cg@exept.de>
parents:
8586
diff
changeset
|
689 |
"/ Dialog aboutToOpenBoxNotificationSignal raiseRequestWith:instance. |
7571 | 690 |
instance treeBrowser sortCaselessInTreeBrowser value: (Filename isCaseSensitive not). |
3904 | 691 |
instance openWindowModal. |
692 |
^ instance |
|
6953
651025031ea2
initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents:
6728
diff
changeset
|
693 |
|
651025031ea2
initial tree-selection when selecting a directory changed.
Claus Gittinger <cg@exept.de>
parents:
6728
diff
changeset
|
694 |
"Modified: / 23-08-2006 / 12:24:54 / cg" |
7571 | 695 |
"Modified: / 13-12-2006 / 16:25:42 / User" |
3892 | 696 |
! ! |
697 |
||
698 |
!FileDialog class methodsFor:'accessing'! |
|
699 |
||
6650 | 700 |
classResources |
9110 | 701 |
^ (FileBrowserV2 ? AbstractFileBrowser) classResources |
6650 | 702 |
! |
703 |
||
5931 | 704 |
lastExtent |
705 |
^ LastExtent |
|
706 |
! |
|
707 |
||
708 |
lastExtent:anExtent |
|
709 |
LastExtent := anExtent |
|
710 |
! |
|
711 |
||
3953 | 712 |
setDoubleClickActionFor:instance |
713 |
||
714 |
instance doubleClickAction:[:anIndex| |
|
715 |
| item | |
|
716 |
item := instance treeBrowser fileList at:anIndex ifAbsent:nil. |
|
717 |
item notNil ifTrue:[ |
|
5329 | 718 |
(instance viewFiles and:[item isDirectory not]) ifTrue:[ |
3953 | 719 |
instance doAccept. |
720 |
] |
|
721 |
] |
|
722 |
]. |
|
3892 | 723 |
! ! |
724 |
||
8585 | 725 |
!FileDialog class methodsFor:'help specs'! |
4603
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
726 |
|
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
727 |
flyByHelpSpec |
8585 | 728 |
"This resource specification was automatically generated |
729 |
by the UIHelpTool of ST/X." |
|
730 |
||
731 |
"Do not manually edit this!! If it is corrupted, |
|
732 |
the UIHelpTool may not be able to read the specification." |
|
733 |
||
734 |
" |
|
735 |
UIHelpTool openOnClass:FileDialog |
|
736 |
" |
|
737 |
||
4603
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
738 |
<resource: #help> |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
739 |
|
8585 | 740 |
^ FileBrowserV2 flyByHelpSpec addPairsFrom:#( |
4603
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
741 |
|
8585 | 742 |
#openFileBrowser |
13003 | 743 |
'Open a FileBrowser on the selected directory' |
4603
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
744 |
|
8585 | 745 |
) |
4603
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
746 |
! ! |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
747 |
|
3892 | 748 |
!FileDialog class methodsFor:'interface specs'! |
749 |
||
750 |
windowSpec |
|
751 |
"This resource specification was automatically generated |
|
752 |
by the UIPainter of ST/X." |
|
753 |
||
754 |
"Do not manually edit this!! If it is corrupted, |
|
755 |
the UIPainter may not be able to read the specification." |
|
756 |
||
757 |
" |
|
758 |
UIPainter new openOnClass:FileDialog andSelector:#windowSpec |
|
759 |
FileDialog new openInterface:#windowSpec |
|
760 |
FileDialog open |
|
761 |
" |
|
762 |
||
763 |
<resource: #canvas> |
|
764 |
||
765 |
^ |
|
13741 | 766 |
#(FullSpec |
767 |
name: windowSpec |
|
768 |
window: |
|
769 |
(WindowSpec |
|
770 |
label: 'FileDialog' |
|
771 |
name: 'FileDialog' |
|
772 |
min: (Point 10 10) |
|
773 |
bounds: (Rectangle 0 0 400 400) |
|
774 |
menu: mainMenu |
|
775 |
performer: treeBrowser |
|
776 |
) |
|
777 |
component: |
|
778 |
(SpecCollection |
|
779 |
collection: ( |
|
780 |
(VerticalPanelViewSpec |
|
781 |
name: 'FilePanel' |
|
782 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1) |
|
783 |
horizontalLayout: fit |
|
784 |
verticalLayout: bottomFit |
|
785 |
horizontalSpace: 0 |
|
786 |
verticalSpace: 3 |
|
787 |
elementsChangeSize: true |
|
788 |
component: |
|
789 |
(SpecCollection |
|
790 |
collection: ( |
|
791 |
(ViewSpec |
|
792 |
name: 'FilePart' |
|
793 |
component: |
|
794 |
(SpecCollection |
|
795 |
collection: ( |
|
796 |
(MenuPanelSpec |
|
797 |
name: 'ToolBar1' |
|
798 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 40 0) |
|
799 |
tabable: true |
|
800 |
menu: toolBarMenu |
|
801 |
textDefault: true |
|
802 |
) |
|
803 |
(VariableHorizontalPanelSpec |
|
804 |
name: 'DeviceAndFilterPanel' |
|
805 |
layout: (LayoutFrame 0 0 40 0 0 1 70 0) |
|
806 |
level: 1 |
|
807 |
showHandle: true |
|
808 |
component: |
|
809 |
(SpecCollection |
|
810 |
collection: ( |
|
811 |
(ViewSpec |
|
812 |
name: 'Box1' |
|
813 |
component: |
|
814 |
(SpecCollection |
|
815 |
collection: ( |
|
816 |
(ComboListSpec |
|
817 |
name: 'ComboList1' |
|
818 |
layout: (LayoutFrame 1 0 1 0.0 -1 1 -1 1) |
|
819 |
visibilityChannel: driveSelectorVisible |
|
820 |
model: selectedDeviceDrive |
|
821 |
comboList: listOfDeviceDrives |
|
822 |
useIndex: false |
|
823 |
hidePullDownMenuButton: false |
|
12816 | 824 |
) |
13741 | 825 |
) |
826 |
||
827 |
) |
|
828 |
) |
|
829 |
(ViewSpec |
|
830 |
name: 'Box2' |
|
831 |
component: |
|
832 |
(SpecCollection |
|
833 |
collection: ( |
|
834 |
(LabelSpec |
|
835 |
label: 'Filter:' |
|
836 |
name: 'FilterLabel' |
|
837 |
layout: (LayoutFrame 1 0 2 0 59 0 -2 1) |
|
838 |
translateLabel: true |
|
839 |
adjust: right |
|
12816 | 840 |
) |
13741 | 841 |
(InputFieldSpec |
842 |
name: 'FilterEntryField' |
|
843 |
layout: (LayoutFrame 60 0 -27 1 -2 1 -2 1) |
|
844 |
model: filterHolder |
|
845 |
immediateAccept: true |
|
846 |
acceptOnReturn: true |
|
847 |
acceptOnTab: true |
|
848 |
acceptOnLostFocus: true |
|
849 |
acceptOnPointerLeave: false |
|
850 |
postBuildCallback: postBuildFilterField: |
|
851 |
) |
|
852 |
) |
|
853 |
||
854 |
) |
|
6065 | 855 |
) |
13741 | 856 |
) |
857 |
||
858 |
) |
|
859 |
handles: (Any 0.2972972972973 1.0) |
|
860 |
) |
|
861 |
(SubCanvasSpec |
|
862 |
name: 'DirectoryTreeBrowser' |
|
863 |
layout: (LayoutFrame 0 0.0 70 0 0 1.0 -30 1) |
|
864 |
tabable: true |
|
865 |
hasHorizontalScrollBar: false |
|
866 |
hasVerticalScrollBar: false |
|
867 |
majorKey: DirectoryTreeBrowser |
|
868 |
subAspectHolders: |
|
869 |
(Array |
|
6065 | 870 |
|
13741 | 871 |
(SubChannelInfoSpec |
872 |
subAspect: filterModel |
|
873 |
aspect: filterHolder |
|
874 |
) |
|
875 |
(SubChannelInfoSpec |
|
876 |
subAspect: rootHolder |
|
877 |
aspect: rootDirectoryHolder |
|
878 |
) |
|
879 |
||
880 |
(SubChannelInfoSpec |
|
881 |
subAspect: showHiddenFiles |
|
882 |
aspect: showHiddenFiles |
|
883 |
) |
|
884 |
) |
|
885 |
createNewApplication: true |
|
886 |
createNewBuilder: true |
|
887 |
postBuildCallback: postBuildTreeBrowser: |
|
4804 | 888 |
) |
13741 | 889 |
(LabelSpec |
890 |
label: 'Filename:' |
|
891 |
name: 'FilenameLabel' |
|
892 |
layout: (LayoutFrame 3 0 -25 1 90 0 -1 1) |
|
893 |
translateLabel: true |
|
894 |
labelChannel: filenameLabelHolder |
|
895 |
adjust: left |
|
896 |
) |
|
897 |
(FilenameInputFieldSpec |
|
898 |
name: 'FilenameEntryField' |
|
899 |
layout: (LayoutFrame 90 0 -25 1 -2 1 -1 1) |
|
900 |
tabable: true |
|
901 |
model: filenameHolder |
|
902 |
immediateAccept: false |
|
903 |
acceptOnPointerLeave: true |
|
904 |
hasKeyboardFocusInitially: true |
|
905 |
postBuildCallback: postBuildFileNameField: |
|
906 |
) |
|
907 |
) |
|
908 |
||
909 |
) |
|
910 |
extent: (Point 400 370) |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
911 |
) |
13741 | 912 |
) |
913 |
||
914 |
) |
|
915 |
postBuildCallback: postBuildVerticalPanelView: |
|
916 |
) |
|
917 |
(HorizontalPanelViewSpec |
|
918 |
name: 'ButtonPanel' |
|
919 |
layout: (LayoutFrame 0 0.0 -30 1 0 1 0 1) |
|
920 |
visibilityChannel: buttonPanelVisibleHolder |
|
921 |
horizontalLayout: fitSpace |
|
922 |
verticalLayout: center |
|
923 |
horizontalSpace: 3 |
|
924 |
verticalSpace: 3 |
|
925 |
reverseOrderIfOKAtLeft: true |
|
926 |
component: |
|
927 |
(SpecCollection |
|
928 |
collection: ( |
|
929 |
(ActionButtonSpec |
|
930 |
label: 'Cancel' |
|
931 |
name: 'cancelButton' |
|
932 |
translateLabel: true |
|
933 |
labelChannel: cancelLabelHolder |
|
934 |
tabable: true |
|
935 |
model: doCancel |
|
936 |
extent: (Point 129 25) |
|
3892 | 937 |
) |
13741 | 938 |
(ActionButtonSpec |
939 |
label: 'Append' |
|
940 |
name: 'appendButton' |
|
941 |
visibilityChannel: appendButtonVisibleHolder |
|
942 |
translateLabel: true |
|
943 |
labelChannel: appendLabelHolder |
|
944 |
tabable: true |
|
945 |
model: appendPressed |
|
946 |
extent: (Point 129 25) |
|
947 |
) |
|
948 |
(ActionButtonSpec |
|
949 |
label: 'OK' |
|
950 |
name: 'okButton' |
|
951 |
translateLabel: true |
|
952 |
labelChannel: okLabelHolder |
|
953 |
tabable: true |
|
954 |
model: okPressed |
|
955 |
isDefault: true |
|
956 |
extent: (Point 130 25) |
|
957 |
) |
|
958 |
) |
|
959 |
||
960 |
) |
|
961 |
keepSpaceForOSXResizeHandleH: true |
|
3892 | 962 |
) |
13741 | 963 |
) |
964 |
||
965 |
) |
|
966 |
) |
|
3892 | 967 |
! ! |
968 |
||
969 |
!FileDialog class methodsFor:'menu specs'! |
|
970 |
||
9113 | 971 |
mainMenu |
972 |
"This resource specification was automatically generated |
|
973 |
by the MenuEditor of ST/X." |
|
974 |
||
975 |
"Do not manually edit this!! If it is corrupted, |
|
976 |
the MenuEditor may not be able to read the specification." |
|
977 |
||
978 |
" |
|
979 |
MenuEditor new openOnClass:FileDialog andSelector:#mainMenu |
|
980 |
(Menu new fromLiteralArrayEncoding:(FileDialog mainMenu)) startUp |
|
981 |
" |
|
982 |
||
983 |
<resource: #menu> |
|
984 |
||
985 |
^ |
|
986 |
#(Menu |
|
987 |
( |
|
988 |
(MenuItem |
|
989 |
label: 'Directory' |
|
990 |
translateLabel: true |
|
991 |
submenu: |
|
992 |
(Menu |
|
993 |
( |
|
994 |
(MenuItem |
|
995 |
label: 'Up' |
|
996 |
itemValue: doGoDirectoryUp |
|
997 |
translateLabel: true |
|
998 |
) |
|
999 |
(MenuItem |
|
1000 |
label: '-' |
|
1001 |
) |
|
1002 |
(MenuItem |
|
1003 |
activeHelpKey: directoryBack |
|
1004 |
enabled: enableBack |
|
1005 |
label: 'Back' |
|
1006 |
itemValue: doBack |
|
1007 |
translateLabel: true |
|
1008 |
) |
|
1009 |
(MenuItem |
|
1010 |
activeHelpKey: directoryBack |
|
1011 |
enabled: enableForward |
|
1012 |
label: 'Forward' |
|
1013 |
itemValue: doForward |
|
1014 |
translateLabel: true |
|
1015 |
) |
|
1016 |
(MenuItem |
|
1017 |
label: '-' |
|
1018 |
) |
|
1019 |
(MenuItem |
|
1020 |
enabled: enableHome |
|
1021 |
label: 'Home Directory' |
|
1022 |
itemValue: doGotoHomeDirectory |
|
1023 |
translateLabel: true |
|
1024 |
) |
|
1025 |
(MenuItem |
|
1026 |
label: 'Bookmarks' |
|
1027 |
translateLabel: true |
|
1028 |
submenuChannel: bookmarksMenu |
|
1029 |
) |
|
1030 |
(MenuItem |
|
1031 |
label: 'Visited Directories' |
|
1032 |
translateLabel: true |
|
1033 |
submenuChannel: visitedDirectoriesMenu |
|
1034 |
) |
|
1035 |
) |
|
1036 |
nil |
|
1037 |
nil |
|
1038 |
) |
|
1039 |
) |
|
1040 |
(MenuItem |
|
1041 |
label: 'View' |
|
1042 |
translateLabel: true |
|
1043 |
submenu: |
|
1044 |
(Menu |
|
1045 |
( |
|
1046 |
(MenuItem |
|
1047 |
label: 'Sort' |
|
1048 |
translateLabel: true |
|
1049 |
submenuChannel: sortMenu |
|
1050 |
) |
|
1051 |
(MenuItem |
|
1052 |
label: 'Show' |
|
1053 |
translateLabel: true |
|
1054 |
submenuChannel: showMenuSpecForDialog |
|
1055 |
) |
|
1056 |
(MenuItem |
|
1057 |
label: '-' |
|
1058 |
) |
|
1059 |
(MenuItem |
|
1060 |
label: 'Update' |
|
1061 |
itemValue: updateCurrentDirectory |
|
1062 |
translateLabel: true |
|
1063 |
) |
|
1064 |
) |
|
1065 |
nil |
|
1066 |
nil |
|
1067 |
) |
|
1068 |
) |
|
1069 |
) |
|
1070 |
nil |
|
1071 |
nil |
|
1072 |
) |
|
1073 |
! |
|
1074 |
||
3892 | 1075 |
toolBarMenu |
1076 |
"This resource specification was automatically generated |
|
1077 |
by the MenuEditor of ST/X." |
|
1078 |
||
1079 |
"Do not manually edit this!! If it is corrupted, |
|
1080 |
the MenuEditor may not be able to read the specification." |
|
1081 |
||
1082 |
" |
|
1083 |
MenuEditor new openOnClass:FileDialog andSelector:#toolBarMenu |
|
1084 |
(Menu new fromLiteralArrayEncoding:(FileDialog toolBarMenu)) startUp |
|
1085 |
" |
|
1086 |
||
1087 |
<resource: #menu> |
|
1088 |
||
1089 |
^ |
|
5873 | 1090 |
#(Menu |
1091 |
( |
|
1092 |
(MenuItem |
|
1093 |
activeHelpKey: directoryBack |
|
1094 |
enabled: enableBack |
|
1095 |
label: 'Back' |
|
1096 |
itemValue: doBack |
|
1097 |
translateLabel: true |
|
1098 |
isButton: true |
|
1099 |
submenuChannel: menuDirHistoryBack |
|
6087 | 1100 |
labelImage: (ResourceRetriever AbstractFileBrowser historyBackIcon) |
5873 | 1101 |
keepLinkedMenu: true |
3892 | 1102 |
) |
5873 | 1103 |
(MenuItem |
1104 |
label: '' |
|
3892 | 1105 |
) |
5873 | 1106 |
(MenuItem |
1107 |
activeHelpKey: directoryForward |
|
1108 |
enabled: enableForward |
|
1109 |
label: 'Forward' |
|
1110 |
itemValue: doForward |
|
1111 |
translateLabel: true |
|
1112 |
isButton: true |
|
1113 |
submenuChannel: menuDirHistoryForward |
|
6087 | 1114 |
labelImage: (ResourceRetriever AbstractFileBrowser historyForwardIcon) |
5873 | 1115 |
keepLinkedMenu: true |
3892 | 1116 |
) |
5873 | 1117 |
(MenuItem |
6462 | 1118 |
label: '-' |
1119 |
) |
|
1120 |
(MenuItem |
|
1121 |
activeHelpKey: directoryUp |
|
1122 |
enabled: enableDirectoryUp |
|
1123 |
label: 'DirectoryUp' |
|
1124 |
itemValue: doGoDirectoryUp |
|
1125 |
translateLabel: true |
|
1126 |
isButton: true |
|
1127 |
labelImage: (ResourceRetriever AbstractFileBrowser directoryUpIcon) |
|
3892 | 1128 |
) |
5873 | 1129 |
(MenuItem |
1130 |
activeHelpKey: fileHome |
|
1131 |
enabled: enableHome |
|
1132 |
label: 'Home' |
|
1133 |
itemValue: doGotoHomeDirectory |
|
1134 |
translateLabel: true |
|
1135 |
isButton: true |
|
6096 | 1136 |
labelImage: (ResourceRetriever ToolbarIconLibrary homeIcon) |
3892 | 1137 |
) |
5873 | 1138 |
(MenuItem |
8092 | 1139 |
activeHelpKey: fileDesktop |
8586 | 1140 |
enabled: enableGotoDesktop |
8092 | 1141 |
label: 'Desktop' |
1142 |
itemValue: doGotoDesktopDirectory |
|
1143 |
translateLabel: true |
|
1144 |
isButton: true |
|
1145 |
labelImage: (ResourceRetriever ToolbarIconLibrary desktopIcon) |
|
1146 |
) |
|
1147 |
(MenuItem |
|
6098 | 1148 |
activeHelpKey: fileGotoBookmark |
1149 |
label: 'Bookmarks' |
|
1150 |
translateLabel: true |
|
1151 |
isButton: true |
|
9113 | 1152 |
submenuChannel: gotoBookmarksMenu |
6098 | 1153 |
labelImage: (ResourceRetriever ToolbarIconLibrary directoryBookmarksIcon) |
1154 |
) |
|
1155 |
(MenuItem |
|
5873 | 1156 |
label: '-' |
1157 |
isVisible: newDirectoryVisibilityHolder |
|
3923 | 1158 |
) |
5873 | 1159 |
(MenuItem |
6122 | 1160 |
label: 'New Directory...' |
5873 | 1161 |
itemValue: newDirectory |
1162 |
translateLabel: true |
|
1163 |
isButton: true |
|
1164 |
isVisible: newDirectoryVisibilityHolder |
|
6088 | 1165 |
labelImage: (ResourceRetriever AbstractFileBrowser newDirectoryIcon) |
3923 | 1166 |
) |
8585 | 1167 |
(MenuItem |
1168 |
label: '-' |
|
1169 |
isVisible: browseVisibleHolder |
|
1170 |
) |
|
1171 |
(MenuItem |
|
1172 |
activeHelpKey: openFileBrowser |
|
1173 |
label: 'Browse' |
|
1174 |
itemValue: doBrowseDirectory |
|
1175 |
translateLabel: true |
|
1176 |
isButton: true |
|
1177 |
isVisible: browseVisibleHolder |
|
1178 |
labelImage: (ResourceRetriever ToolbarIconLibrary startFileBrowserIcon) |
|
1179 |
) |
|
3892 | 1180 |
) |
1181 |
nil |
|
1182 |
nil |
|
1183 |
) |
|
9113 | 1184 |
! |
1185 |
||
1186 |
viewInContentsBrowserMenu |
|
1187 |
^ DirectoryContentsBrowser showMenuSpec |
|
3892 | 1188 |
! ! |
1189 |
||
8182 | 1190 |
!FileDialog class methodsFor:'plugIn spec'! |
1191 |
||
1192 |
aspectSelectors |
|
1193 |
"This resource specification was automatically generated |
|
1194 |
by the UIPainter of ST/X." |
|
1195 |
||
1196 |
"Do not manually edit this. If it is corrupted, |
|
1197 |
the UIPainter may not be able to read the specification." |
|
1198 |
||
1199 |
"Return a description of exported aspects; |
|
1200 |
these can be connected to aspects of an embedding application |
|
1201 |
(if this app is embedded in a subCanvas)." |
|
1202 |
||
1203 |
^ #( |
|
1204 |
#filenameHolder |
|
1205 |
#filterHolder |
|
8191
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1206 |
#rootDirectoryHolder |
8182 | 1207 |
). |
1208 |
||
1209 |
! ! |
|
1210 |
||
3892 | 1211 |
!FileDialog methodsFor:'accessing'! |
1212 |
||
3996 | 1213 |
currentSelectedFiles |
1214 |
||
1215 |
| selectedFiles| |
|
1216 |
||
1217 |
selectedFiles := treeBrowser currentFileNameHolder value. |
|
12828 | 1218 |
^ selectedFiles reject:[:aFile| aFile isDirectory ]. |
3996 | 1219 |
! |
1220 |
||
3892 | 1221 |
directory |
1222 |
"return the value of the instance variable 'directory' (automatically generated)" |
|
1223 |
||
1224 |
^ directory |
|
1225 |
! |
|
1226 |
||
1227 |
directory:something |
|
1228 |
"set the value of the instance variable 'directory' (automatically generated)" |
|
1229 |
||
1230 |
directory := something. |
|
1231 |
! |
|
1232 |
||
1233 |
initialText |
|
13090 | 1234 |
^ resources string:(initialText ? 'File Dialog') |
3892 | 1235 |
! |
1236 |
||
1237 |
initialText:something |
|
1238 |
initialText := something. |
|
1239 |
! |
|
1240 |
||
1241 |
pattern |
|
1242 |
"return the value of the instance variable 'pattern' (automatically generated)" |
|
1243 |
||
1244 |
^ pattern |
|
1245 |
! |
|
1246 |
||
1247 |
pattern:something |
|
1248 |
"set the value of the instance variable 'pattern' (automatically generated)" |
|
1249 |
||
1250 |
pattern := something. |
|
1251 |
! |
|
1252 |
||
1253 |
result |
|
1254 |
"return the value of the instance variable 'result' (automatically generated)" |
|
1255 |
||
1256 |
^ result |
|
1257 |
! |
|
1258 |
||
1259 |
result:something |
|
1260 |
"set the value of the instance variable 'result' (automatically generated)" |
|
1261 |
||
1262 |
result := something. |
|
1263 |
! |
|
1264 |
||
3904 | 1265 |
selectedDirectories |
1266 |
||
1267 |
| selectedFiles| |
|
1268 |
||
1269 |
selectedFiles := treeBrowser currentFileNameHolder value. |
|
1270 |
^ selectedFiles select:[:aFile| aFile isDirectory]. |
|
1271 |
! |
|
1272 |
||
3892 | 1273 |
startFilename |
1274 |
startFilename isNil ifTrue:[ |
|
1275 |
startFilename := Filename currentDirectory asAbsoluteFilename. |
|
1276 |
]. |
|
1277 |
^ startFilename |
|
1278 |
! |
|
1279 |
||
1280 |
startFilename:something |
|
1281 |
startFilename := something. |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1282 |
! ! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1283 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1284 |
!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
|
1285 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1286 |
asLoadDialog |
4804 | 1287 |
^ self isLoadDialog |
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1288 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1289 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1290 |
asLoadDialog:aBoolean |
4804 | 1291 |
self beLoadDialog:aBoolean |
1292 |
! |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1293 |
|
4804 | 1294 |
beLoadDialog:aBoolean |
1295 |
||
1296 |
isLoadDialog := aBoolean |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1297 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1298 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1299 |
doubleClickAction |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1300 |
"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
|
1301 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1302 |
^ doubleClickAction |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1303 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1304 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1305 |
doubleClickAction:something |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1306 |
"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
|
1307 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1308 |
doubleClickAction := something. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1309 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1310 |
|
4804 | 1311 |
isLoadDialog |
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1312 |
|
4804 | 1313 |
^ isLoadDialog ? true |
1314 |
! |
|
1315 |
||
1316 |
multipleSelect |
|
1317 |
^ multipleSelect ? false |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1318 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1319 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1320 |
multipleSelect:aBoolean |
4804 | 1321 |
multipleSelect := aBoolean. |
1322 |
treeBrowser notNil ifTrue:[ |
|
1323 |
treeBrowser multipleSelect:aBoolean. |
|
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 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1327 |
!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
|
1328 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1329 |
addButton:aButton |
6068 | 1330 |
|buttonPanel okButton| |
1331 |
||
1332 |
buttonPanel := self componentAt:#ButtonPanel. |
|
1333 |
okButton := self okButton. |
|
1334 |
||
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1335 |
DialogBox defaultOKButtonAtLeft ifTrue:[ |
6068 | 1336 |
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
|
1337 |
] ifFalse:[ |
6068 | 1338 |
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
|
1339 |
]. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1340 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1341 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1342 |
okButton |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1343 |
^ (self componentAt:#okButton) |
3892 | 1344 |
! |
1345 |
||
3904 | 1346 |
treeBrowser |
1347 |
"return the value of the instance variable 'treeBrowser' (automatically generated)" |
|
1348 |
||
1349 |
^ treeBrowser |
|
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1350 |
! ! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1351 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1352 |
!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
|
1353 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1354 |
hideButtonPanel |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1355 |
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
|
1356 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1357 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1358 |
newDirectoryVisibilityHolder |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1359 |
newDirectoryVisibilityHolder isNil ifTrue:[ |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1360 |
newDirectoryVisibilityHolder := true asValue. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1361 |
]. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1362 |
^ newDirectoryVisibilityHolder |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1363 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1364 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1365 |
showButtonPanel |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1366 |
self buttonPanelVisibleHolder value:true |
3904 | 1367 |
! |
1368 |
||
3892 | 1369 |
viewFiles |
1370 |
"return the value of the instance variable 'viewFiles' (automatically generated)" |
|
1371 |
||
1372 |
^ viewFiles |
|
1373 |
! |
|
1374 |
||
1375 |
viewFiles:something |
|
1376 |
"set the value of the instance variable 'viewFiles' (automatically generated)" |
|
1377 |
||
1378 |
viewFiles := something. |
|
1379 |
! ! |
|
1380 |
||
1381 |
!FileDialog methodsFor:'aspects'! |
|
1382 |
||
4603
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
1383 |
appendButtonVisibleHolder |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
1384 |
appendButtonVisibleHolder isNil ifTrue:[ |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
1385 |
appendButtonVisibleHolder := false asValue. |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
1386 |
]. |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
1387 |
^ appendButtonVisibleHolder |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
1388 |
! |
49cca8deebde
support an additional "append" button
Claus Gittinger <cg@exept.de>
parents:
4562
diff
changeset
|
1389 |
|
5193 | 1390 |
appendLabelHolder |
1391 |
appendLabelHolder isNil ifTrue:[ |
|
1392 |
appendLabelHolder := 'Append' asValue. |
|
1393 |
]. |
|
1394 |
^ appendLabelHolder |
|
1395 |
! |
|
1396 |
||
4804 | 1397 |
aspectOrNil:aKey forSubApplication:aSubApp |
1398 |
"this hook provides an aspect for a subApp" |
|
1399 |
||
1400 |
aKey == #currentFileNameHolder ifTrue:[ |
|
1401 |
directory notNil ifTrue:[ |
|
1402 |
^ (OrderedCollection with:directory) asValue |
|
1403 |
] |
|
1404 |
]. |
|
1405 |
^ nil |
|
1406 |
! |
|
1407 |
||
5969 | 1408 |
browseVisibleHolder |
1409 |
browseVisibleHolder isNil ifTrue:[ |
|
8585 | 1410 |
browseVisibleHolder := true "false" asValue. |
5969 | 1411 |
]. |
1412 |
^ browseVisibleHolder. |
|
1413 |
! |
|
1414 |
||
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1415 |
buttonPanelVisibleHolder |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1416 |
buttonPanelVisibleHolder isNil ifTrue:[ |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1417 |
buttonPanelVisibleHolder := true asValue. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1418 |
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
|
1419 |
]. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1420 |
^ buttonPanelVisibleHolder. |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1421 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1422 |
|
3892 | 1423 |
cancelLabelHolder |
1424 |
||
1425 |
cancelLabelHolder isNil ifTrue:[ |
|
1426 |
cancelLabelHolder := 'Cancel' asValue. |
|
1427 |
]. |
|
1428 |
^ cancelLabelHolder. |
|
1429 |
! |
|
1430 |
||
1431 |
enableBack |
|
4804 | 1432 |
^ treeBrowser enableBack. |
3892 | 1433 |
! |
1434 |
||
1435 |
enableDirectoryUp |
|
4804 | 1436 |
^ treeBrowser enableDirectoryUp. |
3892 | 1437 |
! |
1438 |
||
1439 |
enableForward |
|
4804 | 1440 |
^ treeBrowser enableForward. |
3892 | 1441 |
! |
1442 |
||
8169 | 1443 |
enableGotoDesktop |
1444 |
^ treeBrowser enableGotoDesktop. |
|
1445 |
! |
|
1446 |
||
3892 | 1447 |
enableHome |
4804 | 1448 |
^ treeBrowser enableHome. |
3892 | 1449 |
! |
1450 |
||
9269
4d09efee3752
added: #fileEntryFieldHolder
Claus Gittinger <cg@exept.de>
parents:
9113
diff
changeset
|
1451 |
fileEntryFieldHolder |
4d09efee3752
added: #fileEntryFieldHolder
Claus Gittinger <cg@exept.de>
parents:
9113
diff
changeset
|
1452 |
"for directoryTreeBrowser" |
4d09efee3752
added: #fileEntryFieldHolder
Claus Gittinger <cg@exept.de>
parents:
9113
diff
changeset
|
1453 |
|
4d09efee3752
added: #fileEntryFieldHolder
Claus Gittinger <cg@exept.de>
parents:
9113
diff
changeset
|
1454 |
^ self filenameHolder |
4d09efee3752
added: #fileEntryFieldHolder
Claus Gittinger <cg@exept.de>
parents:
9113
diff
changeset
|
1455 |
! |
4d09efee3752
added: #fileEntryFieldHolder
Claus Gittinger <cg@exept.de>
parents:
9113
diff
changeset
|
1456 |
|
3892 | 1457 |
filenameHolder |
1458 |
"Return a value holder with the filename. |
|
1459 |
Shown in the filename input-field. |
|
9514
c818ca8969f7
comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents:
9476
diff
changeset
|
1460 |
Being the selection in the tree." |
c818ca8969f7
comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents:
9476
diff
changeset
|
1461 |
|
3892 | 1462 |
|holder| |
7581 | 1463 |
|
3892 | 1464 |
holder := builder bindingAt:#filenameHolder. |
1465 |
||
7581 | 1466 |
holder isNil ifTrue:[ |
13001 | 1467 |
holder := startFilename asValue. |
3892 | 1468 |
holder addDependent:self. |
9514
c818ca8969f7
comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents:
9476
diff
changeset
|
1469 |
builder aspectAt:#filenameHolder put:holder. |
3892 | 1470 |
]. |
1471 |
||
1472 |
^ holder. |
|
9514
c818ca8969f7
comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents:
9476
diff
changeset
|
1473 |
|
c818ca8969f7
comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents:
9476
diff
changeset
|
1474 |
"Modified: / 09-07-2010 / 19:25:15 / cg" |
3892 | 1475 |
! |
1476 |
||
8183 | 1477 |
filenameHolder:aHolder |
8182 | 1478 |
"needed when used as subcanvas" |
8183 | 1479 |
|
1480 |
|holder| |
|
8182 | 1481 |
|
8183 | 1482 |
holder := builder aspectAt:#filenameHolder. |
1483 |
holder notNil ifTrue:[ |
|
1484 |
holder removeDependent:self |
|
1485 |
]. |
|
8182 | 1486 |
builder aspectAt:#filenameHolder put:aHolder. |
8183 | 1487 |
aHolder addDependent:self |
8182 | 1488 |
! |
1489 |
||
3904 | 1490 |
filenameLabelHolder |
1491 |
"Return a value holder for the input string. |
|
1492 |
" |
|
1493 |
filenameLabelHolder isNil ifTrue:[ |
|
1494 |
filenameLabelHolder := 'Filename:' asValue. |
|
1495 |
]. |
|
1496 |
^ filenameLabelHolder |
|
1497 |
! |
|
1498 |
||
3892 | 1499 |
filterHolder |
8183 | 1500 |
"Return a value holder for filter" |
3892 | 1501 |
|
1502 |
filterHolder isNil ifTrue:[ |
|
8191
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1503 |
filterHolder := (self pattern ? '*') asValue. |
3892 | 1504 |
]. |
1505 |
^ filterHolder |
|
1506 |
! |
|
1507 |
||
8183 | 1508 |
filterHolder:aHolder |
1509 |
"needed when used as subcanvas" |
|
1510 |
||
1511 |
filterHolder := aHolder. |
|
1512 |
! |
|
1513 |
||
9113 | 1514 |
gotoBookmarksMenu |
6098 | 1515 |
<resource: #programMenu> |
1516 |
||
9113 | 1517 |
^ treeBrowser gotoBookmarksMenu |
7567
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1518 |
"/ |menu bookmarks| |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1519 |
"/ |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1520 |
"/ menu := treeBrowser class emptyMenuSpec decodeAsLiteralArray. |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1521 |
"/ menu findGuiResourcesIn:self. |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1522 |
"/ menu receiver:self. |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1523 |
"/ |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1524 |
"/ "/ add the bookmark items ... |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1525 |
"/ bookmarks := treeBrowser class directoryBookmarks. |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1526 |
"/ bookmarks notEmptyOrNil ifTrue:[ |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1527 |
"/ bookmarks do:[:dirName | |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1528 |
"/ menu addItem:((MenuItem label:dirName asString value:[ |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1529 |
"/ (treeBrowser currentSelectedDirectories includes:dirName) ifFalse:[ |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1530 |
"/ treeBrowser setCurrentFileName:dirName. |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1531 |
"/ ]. |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1532 |
"/ ])). |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1533 |
"/ ]. |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1534 |
"/ ]. |
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1535 |
"/ ^ menu |
6098 | 1536 |
|
7567
9896e794a220
share the bookmarks-menu with the fileBrowser.
Claus Gittinger <cg@exept.de>
parents:
6953
diff
changeset
|
1537 |
"Modified: / 06-12-2006 / 12:05:06 / cg" |
6098 | 1538 |
! |
1539 |
||
6065 | 1540 |
listOfDeviceDrives |
1541 |
||
1542 |
listOfDeviceDrives isNil ifTrue:[ |
|
1543 |
listOfDeviceDrives := Filename volumes. |
|
1544 |
]. |
|
1545 |
^ listOfDeviceDrives |
|
1546 |
! |
|
1547 |
||
3892 | 1548 |
okLabelHolder |
1549 |
"automatically generated by UIPainter ..." |
|
1550 |
||
1551 |
"*** the code below creates a default model when invoked." |
|
1552 |
"*** (which may not be the one you wanted)" |
|
1553 |
"*** Please change as required and accept it in the browser." |
|
1554 |
"*** (and replace this comment by something more useful ;-)" |
|
1555 |
||
1556 |
okLabelHolder isNil ifTrue:[ |
|
1557 |
okLabelHolder := 'OK' asValue. |
|
1558 |
]. |
|
1559 |
^ okLabelHolder. |
|
6065 | 1560 |
! |
1561 |
||
8191
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1562 |
rootDirectoryHolder |
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1563 |
"Return a value holder for filter" |
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1564 |
|
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1565 |
rootDirectoryHolder isNil ifTrue:[ |
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1566 |
rootDirectoryHolder := self initialRootDirectory asValue. |
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1567 |
]. |
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1568 |
^ rootDirectoryHolder |
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1569 |
! |
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1570 |
|
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1571 |
rootDirectoryHolder:aHolder |
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1572 |
"Return a value holder for filter" |
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1573 |
|
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1574 |
rootDirectoryHolder := aHolder. |
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1575 |
! |
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1576 |
|
6065 | 1577 |
selectedDeviceDrive |
1578 |
||
1579 |
selectedDeviceDrive isNil ifTrue:[ |
|
1580 |
selectedDeviceDrive := self listOfDeviceDrives first asValue. |
|
1581 |
selectedDeviceDrive addDependent:self. |
|
1582 |
]. |
|
1583 |
^ selectedDeviceDrive |
|
9110 | 1584 |
! |
1585 |
||
9113 | 1586 |
showDirectoryTree |
1587 |
^ false |
|
1588 |
! |
|
1589 |
||
1590 |
showDiskUsageHolder |
|
1591 |
^ treeBrowser showDiskUsageHolder |
|
1592 |
! |
|
1593 |
||
9110 | 1594 |
showHiddenFiles |
9113 | 1595 |
^ treeBrowser showHiddenFiles |
1596 |
! |
|
1597 |
||
1598 |
shownFiles |
|
1599 |
^ treeBrowser shownFiles |
|
1600 |
! |
|
1601 |
||
1602 |
sortCaselessInTreeBrowser |
|
1603 |
^ treeBrowser sortCaselessInTreeBrowser |
|
1604 |
! |
|
1605 |
||
1606 |
sortInTreeVisibilityHolder |
|
1607 |
^ true |
|
1608 |
! |
|
1609 |
||
1610 |
sortPropertyInTree |
|
1611 |
^ treeBrowser sortBlockProperty |
|
1612 |
! |
|
1613 |
||
1614 |
viewDirsInContentsBrowser |
|
1615 |
^ false |
|
1616 |
! |
|
1617 |
||
1618 |
viewFilesInDirectoryTree |
|
1619 |
^ false |
|
1620 |
! |
|
1621 |
||
1622 |
viewNoteBookApplicationHolder |
|
9110 | 1623 |
^ false |
3892 | 1624 |
! ! |
1625 |
||
1626 |
!FileDialog methodsFor:'change & update'! |
|
1627 |
||
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1628 |
buttonPanelVisibilityChanged |
12848
90fde21c7de4
class: Expecco::ExpeccoDebugView
Claus Gittinger <cg@exept.de>
parents:
12828
diff
changeset
|
1629 |
|panel filePart partAbove| |
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1630 |
|
12848
90fde21c7de4
class: Expecco::ExpeccoDebugView
Claus Gittinger <cg@exept.de>
parents:
12828
diff
changeset
|
1631 |
panel := builder componentAt:#FilePanel. |
90fde21c7de4
class: Expecco::ExpeccoDebugView
Claus Gittinger <cg@exept.de>
parents:
12828
diff
changeset
|
1632 |
panel isNil ifTrue:[ |
90fde21c7de4
class: Expecco::ExpeccoDebugView
Claus Gittinger <cg@exept.de>
parents:
12828
diff
changeset
|
1633 |
filePart := builder componentAt:#FilePart. |
90fde21c7de4
class: Expecco::ExpeccoDebugView
Claus Gittinger <cg@exept.de>
parents:
12828
diff
changeset
|
1634 |
]. |
90fde21c7de4
class: Expecco::ExpeccoDebugView
Claus Gittinger <cg@exept.de>
parents:
12828
diff
changeset
|
1635 |
partAbove := panel ? filePart. |
90fde21c7de4
class: Expecco::ExpeccoDebugView
Claus Gittinger <cg@exept.de>
parents:
12828
diff
changeset
|
1636 |
partAbove notNil ifTrue:[ |
5598 | 1637 |
buttonPanelVisibleHolder value ifTrue:[ |
12848
90fde21c7de4
class: Expecco::ExpeccoDebugView
Claus Gittinger <cg@exept.de>
parents:
12828
diff
changeset
|
1638 |
partAbove layout bottomOffset:-40 |
5598 | 1639 |
] ifFalse:[ |
12848
90fde21c7de4
class: Expecco::ExpeccoDebugView
Claus Gittinger <cg@exept.de>
parents:
12828
diff
changeset
|
1640 |
partAbove layout bottomOffset:0 |
5598 | 1641 |
]. |
12848
90fde21c7de4
class: Expecco::ExpeccoDebugView
Claus Gittinger <cg@exept.de>
parents:
12828
diff
changeset
|
1642 |
partAbove containerChangedSize "/ force resize |
5598 | 1643 |
] |
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1644 |
! |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1645 |
|
9765 | 1646 |
fileSelectionChanged |
1647 |
|files newFile entryFieldFilename filenameHolder| |
|
1648 |
||
1649 |
filenameHolder := self filenameHolder. |
|
1650 |
||
1651 |
files := treeBrowser currentFileNameHolder value. |
|
1652 |
||
1653 |
(files isEmpty) ifTrue:[ |
|
1654 |
newFile := nil. |
|
1655 |
] ifFalse:[ |
|
1656 |
files size == 1 ifTrue:[ |
|
1657 |
newFile := files first. |
|
1658 |
] ifFalse:[ |
|
1659 |
newFile := ''. |
|
1660 |
]. |
|
1661 |
]. |
|
1662 |
(filenameHolder value notNil |
|
1663 |
and:[newFile notNil |
|
1664 |
and:[newFile asFilename isDirectory]]) ifTrue:[ |
|
1665 |
entryFieldFilename := filenameHolder value asFilename. |
|
1666 |
self startFilename asFilename baseName = entryFieldFilename baseName ifTrue:[ |
|
1667 |
entryFieldFilename isDirectory ifFalse:[ |
|
1668 |
newFile := newFile asFilename construct:entryFieldFilename baseName. |
|
1669 |
]. |
|
1670 |
]. |
|
1671 |
]. |
|
1672 |
filenameHolder value:newFile withoutNotifying:self. |
|
1673 |
OperatingSystem supportsVolumes ifTrue:[ |
|
1674 |
| volume | |
|
1675 |
volume := (files size >= 1) |
|
1676 |
ifTrue:[files first volume] |
|
1677 |
ifFalse:nil. |
|
1678 |
self selectedDeviceDrive value:volume. |
|
1679 |
]. |
|
1680 |
||
1681 |
"Created: / 14-02-2011 / 17:54:08 / cg" |
|
1682 |
! |
|
1683 |
||
6065 | 1684 |
selectedDeviceDriveChanged |
9683
83fb945b7a5a
changed: #selectedDeviceDriveChanged
Claus Gittinger <cg@exept.de>
parents:
9678
diff
changeset
|
1685 |
|newDrive curSel newFile| |
6065 | 1686 |
|
1687 |
newDrive := self selectedDeviceDrive value. |
|
1688 |
curSel := treeBrowser currentFileNameHolder value. |
|
1689 |
curSel notEmpty ifTrue:[ |
|
1690 |
curSel first volume = newDrive ifTrue:[ ^self]. |
|
1691 |
]. |
|
9683
83fb945b7a5a
changed: #selectedDeviceDriveChanged
Claus Gittinger <cg@exept.de>
parents:
9678
diff
changeset
|
1692 |
|
6065 | 1693 |
newDrive notNil ifTrue:[ |
1694 |
newFile := newDrive asFilename. |
|
1695 |
newFile isReadable ifTrue:[ |
|
1696 |
treeBrowser gotoFile:newFile. |
|
1697 |
^self. |
|
1698 |
]. |
|
9683
83fb945b7a5a
changed: #selectedDeviceDriveChanged
Claus Gittinger <cg@exept.de>
parents:
9678
diff
changeset
|
1699 |
self warn:'Cannot open drive %1' with:newFile asFilename volume. |
6065 | 1700 |
]. |
9683
83fb945b7a5a
changed: #selectedDeviceDriveChanged
Claus Gittinger <cg@exept.de>
parents:
9678
diff
changeset
|
1701 |
|
83fb945b7a5a
changed: #selectedDeviceDriveChanged
Claus Gittinger <cg@exept.de>
parents:
9678
diff
changeset
|
1702 |
newDrive := curSel notEmpty ifTrue:[ curSel first volume ] ifFalse:[ 'C:' ]. |
83fb945b7a5a
changed: #selectedDeviceDriveChanged
Claus Gittinger <cg@exept.de>
parents:
9678
diff
changeset
|
1703 |
self selectedDeviceDrive value:newDrive. |
6065 | 1704 |
! |
1705 |
||
3892 | 1706 |
update:something with:aParameter from:changedObject |
9765 | 1707 |
|newLabel fn| |
3892 | 1708 |
|
1709 |
changedObject == treeBrowser currentFileNameHolder ifTrue:[ |
|
9765 | 1710 |
self fileSelectionChanged. |
1711 |
^ self. |
|
3892 | 1712 |
]. |
4804 | 1713 |
|
6065 | 1714 |
changedObject == self selectedDeviceDrive ifTrue:[ |
1715 |
self selectedDeviceDriveChanged. |
|
1716 |
^ self. |
|
1717 |
]. |
|
3904 | 1718 |
changedObject == treeBrowser viewFilesInDirectoryTree ifTrue:[ |
1719 |
changedObject value ifTrue:[ |
|
4804 | 1720 |
newLabel := 'Filename:'. |
3904 | 1721 |
] ifFalse:[ |
4804 | 1722 |
newLabel := 'Directory:'. |
1723 |
]. |
|
1724 |
self filenameLabelHolder value:(resources string:newLabel) |
|
3904 | 1725 |
]. |
9765 | 1726 |
changedObject == self filenameHolder ifTrue:[ |
4804 | 1727 |
fn := changedObject value asFilename. |
1728 |
(fn exists) ifFalse:[^ self]. |
|
9514
c818ca8969f7
comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents:
9476
diff
changeset
|
1729 |
treeBrowser currentFileNameHolder |
c818ca8969f7
comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents:
9476
diff
changeset
|
1730 |
value:(OrderedCollection with:fn) withoutNotifying:self. |
5949 | 1731 |
fn isDirectory ifTrue:[ |
1732 |
treeBrowser expandEnforceSelectedItems. |
|
1733 |
]. |
|
3892 | 1734 |
]. |
1735 |
^ super update:something with:aParameter from:changedObject |
|
9514
c818ca8969f7
comment/format in: #filenameHolder
Claus Gittinger <cg@exept.de>
parents:
9476
diff
changeset
|
1736 |
|
9765 | 1737 |
"Modified: / 14-02-2011 / 17:54:35 / cg" |
3892 | 1738 |
! ! |
1739 |
||
12816 | 1740 |
!FileDialog methodsFor:'construction-adding'! |
1741 |
||
1742 |
addComponent: aView |
|
12875 | 1743 |
verticalPanelView addComponent: aView |
12816 | 1744 |
|
1745 |
"Created: / 03-06-2013 / 17:47:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1746 |
! ! |
|
1747 |
||
3892 | 1748 |
!FileDialog methodsFor:'event handling'! |
1749 |
||
4728
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1750 |
appendWasPressed |
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1751 |
"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
|
1752 |
|
545cd2c65dfa
hooks to allow use as component in a non-modal subcanvas
Claus Gittinger <cg@exept.de>
parents:
4666
diff
changeset
|
1753 |
^ appendWasPressed |
3892 | 1754 |
! ! |
1755 |
||
1756 |
!FileDialog methodsFor:'initialization & release'! |
|
1757 |
||
5932 | 1758 |
closeDownViews |
9765 | 1759 |
self rememberExtent. |
5932 | 1760 |
super closeDownViews. |
9765 | 1761 |
|
1762 |
"Modified: / 14-02-2011 / 17:55:14 / cg" |
|
5932 | 1763 |
! |
1764 |
||
1765 |
closeWindow |
|
9765 | 1766 |
self rememberExtent. |
5932 | 1767 |
super closeWindow. |
9765 | 1768 |
|
1769 |
"Modified: / 14-02-2011 / 17:55:55 / cg" |
|
5932 | 1770 |
! |
1771 |
||
5903
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1772 |
commonPostOpen |
8182 | 1773 |
|selection| |
3892 | 1774 |
|
1775 |
"/ 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
|
1776 |
|
3892 | 1777 |
treeBrowser currentFileNameHolder addDependent:self. |
5598 | 1778 |
treeBrowser doubleClickAction:self doubleClickAction. |
3904 | 1779 |
treeBrowser viewFilesInDirectoryTree addDependent:self. |
5863
e31e066a41d9
root is one up (showing containing directory)
Claus Gittinger <cg@exept.de>
parents:
5858
diff
changeset
|
1780 |
|
6409 | 1781 |
treeBrowser rootHolder value:(self initialRootDirectory). |
4804 | 1782 |
treeBrowser viewFilesInDirectoryTree setValue:(self viewFiles ? true). |
4796 | 1783 |
treeBrowser viewFilesInDirectoryTree changed. |
4804 | 1784 |
|
1785 |
self isLoadDialog ifTrue:[ |
|
4796 | 1786 |
treeBrowser newVisibilityHolder value:false. |
1787 |
treeBrowser allowFileOperations value:false. |
|
1788 |
self newDirectoryVisibilityHolder value:false. |
|
1789 |
]. |
|
5927 | 1790 |
treeBrowser expandEnforceSelectedItems. |
5929 | 1791 |
|
1792 |
selection := treeBrowser treeSelectionHolder value. |
|
1793 |
selection notEmptyOrNil ifTrue:[ |
|
5930 | 1794 |
selection := selection asCollection first. |
5929 | 1795 |
selection enforcedExpand. |
1796 |
treeBrowser browser makeItemVisible:selection withMinimumLines:5. |
|
1797 |
]. |
|
4796 | 1798 |
! |
1799 |
||
6409 | 1800 |
initialRootDirectory |
1801 |
"returns the directory the browser is open on |
|
1802 |
" |
|
1803 |
|root| |
|
1804 |
||
9678 | 1805 |
initialRoot isNil ifTrue:[ |
6409 | 1806 |
|
9678 | 1807 |
(root := self directory) notNil ifTrue:[ |
1808 |
root := root asFilename. |
|
6409 | 1809 |
|
1810 |
root isDirectory ifFalse:[ |
|
9678 | 1811 |
root := root directory. |
1812 |
root isDirectory ifFalse:[ |
|
1813 |
root := nil. |
|
1814 |
] |
|
6409 | 1815 |
] |
9678 | 1816 |
]. |
1817 |
root isNil ifTrue:[ |
|
1818 |
root := Filename currentDirectory. |
|
1819 |
]. |
|
1820 |
initialRoot := root asAbsoluteFilename. |
|
6409 | 1821 |
]. |
9678 | 1822 |
^ initialRoot |
1823 |
||
1824 |
"Modified: / 27-12-2010 / 09:56:30 / cg" |
|
6409 | 1825 |
! |
1826 |
||
5903
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1827 |
postBuildFileNameField:aWidget |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1828 |
|
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1829 |
filenameField := aWidget. |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1830 |
! |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1831 |
|
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1832 |
postBuildFilterField:aWidget |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1833 |
|
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1834 |
filterField := aWidget. |
4796 | 1835 |
! |
1836 |
||
5903
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1837 |
postBuildTreeBrowser:aSubCanvasView |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1838 |
treeBrowser := aSubCanvasView client. |
6409 | 1839 |
treeBrowser rootHolder value:(self initialRootDirectory value). |
9113 | 1840 |
treeBrowser sortPropertyInTree:(treeBrowser sortBlockProperty). |
9553 | 1841 |
treeBrowser showHiddenFiles value:true. |
1842 |
||
1843 |
"Modified: / 24-08-2010 / 16:07:16 / sr" |
|
5903
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1844 |
! |
4796 | 1845 |
|
12875 | 1846 |
postBuildVerticalPanelView:aView |
1847 |
verticalPanelView := aView. |
|
12816 | 1848 |
|
1849 |
"Created: / 03-06-2013 / 17:41:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1850 |
! |
|
1851 |
||
13004 | 1852 |
postBuildWith:aBuilder |
1853 |
|win hMin| |
|
1854 |
||
5903
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1855 |
treeBrowser multipleSelect:multipleSelect. |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1856 |
appendWasPressed := false. |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1857 |
|
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1858 |
(aBuilder componentAt:'cancelButton') cursor:(Cursor thumbsDown). |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1859 |
(aBuilder componentAt:'appendButton') cursor:(Cursor thumbsUp). |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1860 |
(aBuilder componentAt:'okButton') cursor:(Cursor thumbsUp). |
0c2fdcd6babf
make use of commonPostOpen in AppModel
Claus Gittinger <cg@exept.de>
parents:
5873
diff
changeset
|
1861 |
|
13004 | 1862 |
win := aBuilder window . |
13187 | 1863 |
win minExtent notNil ifTrue:[ |
1864 |
"minExtent is nil if window is not a TopView" |
|
1865 |
hMin := (win margin * 2) |
|
1866 |
+ (aBuilder menuBar isNil ifTrue:[0] ifFalse:[aBuilder menuBar preferredHeight]) |
|
1867 |
+ (aBuilder componentAt:#FilenameEntryField) height |
|
1868 |
+ (aBuilder componentAt:#ToolBar1) preferredHeight |
|
1869 |
+ (aBuilder componentAt:#ButtonPanel) preferredHeight. |
|
13004 | 1870 |
|
13187 | 1871 |
win minExtent:(win minExtent x @ hMin). |
1872 |
]. |
|
13090 | 1873 |
win topView label:self initialText. |
13004 | 1874 |
|
6632 | 1875 |
super postBuildWith:aBuilder |
5932 | 1876 |
! |
1877 |
||
8182 | 1878 |
postOpenAsSubcanvasWith:aBuilder |
1879 |
super postOpenAsSubcanvasWith:aBuilder. |
|
1880 |
||
1881 |
"No ok and cancel buttons, when dialog is part of a larger dialog" |
|
8191
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1882 |
self hideButtonPanel. |
8183 | 1883 |
|
9809
fa5280b1259f
changed: #postOpenAsSubcanvasWith:
Stefan Vogel <sv@exept.de>
parents:
9769
diff
changeset
|
1884 |
"filenameHolder contains the initial file name, or nil" |
8191
1779a8c3730d
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8183
diff
changeset
|
1885 |
self startFilename:self filenameHolder value. |
9809
fa5280b1259f
changed: #postOpenAsSubcanvasWith:
Stefan Vogel <sv@exept.de>
parents:
9769
diff
changeset
|
1886 |
treeBrowser currentFileNameHolder value:(Array with:self startFilename). |
8182 | 1887 |
! |
1888 |
||
12816 | 1889 |
preOpenWith:aBuilder |
12883 | 1890 |
"called right before being opened" |
1891 |
||
13025 | 1892 |
|delta| |
8182 | 1893 |
|
12816 | 1894 |
"Increase height of the window so height of the file part |
12875 | 1895 |
remain the same. This cares for any components added by a hook" |
1896 |
||
1897 |
verticalPanelView notNil ifTrue:[ |
|
12883 | 1898 |
delta := verticalPanelView preferredHeight - verticalPanelView height. |
1899 |
delta > 0 ifTrue:[ |
|
1900 |
"/ components where added (possibly in the aboutToOpenBoxNotifiction |
|
1901 |
aBuilder window height: (aBuilder window height + delta). |
|
12875 | 1902 |
]. |
12883 | 1903 |
|
1904 |
"/ sumH := 0. |
|
1905 |
"/ verticalPanelView subViews from:2 do:[:view| |
|
1906 |
"/ sumH := sumH + view preferredHeight. |
|
1907 |
"/ ]. |
|
1908 |
"/ sumH ~~ 0 ifTrue:[ |
|
1909 |
"/ newVPanelHeight := verticalPanelView preferredHeight374 |
|
1910 |
"/ aBuilder window height: aBuilder window height + sumH. |
|
1911 |
"/ ]. |
|
8182 | 1912 |
]. |
12816 | 1913 |
|
14151 | 1914 |
treeBrowser currentFileNameHolder value:(Array with:self startFilename). |
1915 |
||
12816 | 1916 |
"Created: / 03-06-2013 / 18:19:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8182 | 1917 |
! |
1918 |
||
9765 | 1919 |
rememberExtent |
5932 | 1920 |
self class lastExtent:self window topView extent. |
9765 | 1921 |
|
1922 |
"Created: / 14-02-2011 / 17:55:11 / cg" |
|
4796 | 1923 |
! ! |
1924 |
||
9113 | 1925 |
!FileDialog methodsFor:'menus'! |
1926 |
||
1927 |
bookmarksMenu |
|
1928 |
^ treeBrowser bookmarksMenu |
|
1929 |
! |
|
1930 |
||
1931 |
directoryMenu |
|
1932 |
^ treeBrowser directoryMenu |
|
1933 |
! |
|
1934 |
||
1935 |
showMenuSpecForDialog |
|
1936 |
^ treeBrowser class showMenuSpecForDialog |
|
1937 |
! |
|
1938 |
||
1939 |
sortMenu |
|
1940 |
^ treeBrowser class sortInTreeMenu |
|
1941 |
! |
|
1942 |
||
1943 |
visitedDirectoriesMenu |
|
1944 |
^ treeBrowser visitedDirectoriesMenu |
|
1945 |
! ! |
|
1946 |
||
4796 | 1947 |
!FileDialog methodsFor:'private'! |
1948 |
||
1949 |
returnWasPressedInFilterField |
|
8663 | 1950 |
|wg ev| |
4796 | 1951 |
|
8663 | 1952 |
((wg := self windowGroup) notNil |
1953 |
and:[ (ev := wg lastEvent) notNil |
|
1954 |
and:[ ev isKeyEvent |
|
1955 |
and:[ ev key == #Return |
|
1956 |
and:[ (ev targetView isSameOrComponentOf:filterField) |
|
1957 |
or:[false "ev targetView isSameOrComponentOf:filenameField"]]]]]) ifTrue:[ |
|
4796 | 1958 |
^ true |
1959 |
]. |
|
1960 |
^ false |
|
1961 |
! |
|
1962 |
||
1963 |
returnWasPressedInFilterOrFilenameField |
|
1964 |
|ev| |
|
1965 |
||
1966 |
ev := self windowGroup lastEvent. |
|
1967 |
(ev notNil |
|
1968 |
and:[ev isKeyEvent |
|
1969 |
and:[ev key == #Return |
|
1970 |
and:[( ev targetView isSameOrComponentOf:filterField) |
|
1971 |
or:[false "ev targetView isSameOrComponentOf:filenameField"]]]]) ifTrue:[ |
|
1972 |
^ true |
|
1973 |
]. |
|
1974 |
^ false |
|
1975 |
! ! |
|
1976 |
||
6065 | 1977 |
!FileDialog methodsFor:'queries'! |
1978 |
||
1979 |
driveSelectorVisible |
|
1980 |
^ OperatingSystem isMSDOSlike |
|
1981 |
! ! |
|
1982 |
||
4796 | 1983 |
!FileDialog methodsFor:'user actions'! |
1984 |
||
1985 |
appendPressed |
|
1986 |
appendWasPressed := true. |
|
1987 |
self commonAcceptAction. |
|
1988 |
! |
|
1989 |
||
1990 |
commonAcceptAction |
|
1991 |
filenameField accept. |
|
1992 |
self result:(self filenameHolder value asString). |
|
1993 |
||
1994 |
^ super doAccept |
|
1995 |
! |
|
1996 |
||
1997 |
doAccept |
|
1998 |
"force accept - ignore in filterField" |
|
1999 |
||
2000 |
self returnWasPressedInFilterField ifTrue:[ |
|
2001 |
^ self |
|
2002 |
]. |
|
4996
5927cc0508e8
close the editor in treebrowser on rename if ENTER is pressed
penk
parents:
4824
diff
changeset
|
2003 |
treeBrowser hasOpenEditor ifTrue:[ |
5927cc0508e8
close the editor in treebrowser on rename if ENTER is pressed
penk
parents:
4824
diff
changeset
|
2004 |
"/ 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
|
2005 |
treeBrowser browser closeEditor. |
5927cc0508e8
close the editor in treebrowser on rename if ENTER is pressed
penk
parents:
4824
diff
changeset
|
2006 |
^ self |
5927cc0508e8
close the editor in treebrowser on rename if ENTER is pressed
penk
parents:
4824
diff
changeset
|
2007 |
]. |
4796 | 2008 |
appendWasPressed := false. |
2009 |
self commonAcceptAction. |
|
2010 |
! |
|
2011 |
||
2012 |
doBack |
|
2013 |
||
2014 |
treeBrowser doBack. |
|
2015 |
! |
|
2016 |
||
5966 | 2017 |
doBrowseDirectory |
2018 |
UserPreferences fileBrowserClass openOn:(treeBrowser currentDirectory ? treeBrowser rootHolder value). |
|
2019 |
||
2020 |
||
2021 |
! |
|
2022 |
||
4796 | 2023 |
doCancel |
2024 |
||
2025 |
self result:nil. |
|
2026 |
^ super doCancel. |
|
2027 |
! |
|
2028 |
||
2029 |
doForward |
|
2030 |
||
2031 |
treeBrowser doForward. |
|
2032 |
! |
|
2033 |
||
2034 |
doGoDirectoryUp |
|
2035 |
||
2036 |
treeBrowser doGoDirectoryUp. |
|
2037 |
! |
|
2038 |
||
8092 | 2039 |
doGotoDesktopDirectory |
2040 |
||
2041 |
treeBrowser doGotoDesktopDirectory. |
|
2042 |
! |
|
2043 |
||
4796 | 2044 |
doGotoHomeDirectory |
2045 |
||
2046 |
treeBrowser doGotoHomeDirectory. |
|
2047 |
! |
|
2048 |
||
2049 |
menuDirHistory:backOrForward |
|
2050 |
||
2051 |
^ treeBrowser menuDirHistory:backOrForward. |
|
2052 |
! |
|
2053 |
||
2054 |
menuDirHistoryBack |
|
2055 |
||
2056 |
^ treeBrowser menuDirHistory:#back. |
|
2057 |
! |
|
2058 |
||
2059 |
menuDirHistoryForward |
|
2060 |
||
2061 |
^ treeBrowser menuDirHistory:#forward. |
|
2062 |
! |
|
2063 |
||
2064 |
newDirectory |
|
2065 |
||
2066 |
^ treeBrowser newDirectory |
|
2067 |
! |
|
2068 |
||
2069 |
okPressed |
|
2070 |
self doAccept |
|
9113 | 2071 |
! |
2072 |
||
2073 |
updateCurrentDirectory |
|
2074 |
treeBrowser updateCurrentDirectory |
|
4796 | 2075 |
! ! |
2076 |
||
2077 |
!FileDialog class methodsFor:'documentation'! |
|
2078 |
||
2079 |
version |
|
14151 | 2080 |
^ '$Header: /cvs/stx/stx/libtool/FileDialog.st,v 1.132 2014-03-21 19:33:09 stefan Exp $' |
12883 | 2081 |
! |
2082 |
||
2083 |
version_CVS |
|
14151 | 2084 |
^ '$Header: /cvs/stx/stx/libtool/FileDialog.st,v 1.132 2014-03-21 19:33:09 stefan Exp $' |
9110 | 2085 |
! |
2086 |
||
12816 | 2087 |
version_HG |
2088 |
||
2089 |
^ '$Changeset: <not expanded> $' |
|
2090 |
! |
|
2091 |
||
2092 |
version_SVN |
|
14151 | 2093 |
^ '$Id: FileDialog.st,v 1.132 2014-03-21 19:33:09 stefan Exp $' |
4796 | 2094 |
! ! |
12816 | 2095 |