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