author | penk |
Tue, 05 Nov 2002 10:19:28 +0100 | |
changeset 4173 | ad23671bdc56 |
parent 4172 | d2f6ba6a98ed |
child 4201 | be512c7e5ea8 |
permissions | -rw-r--r-- |
3892 | 1 |
" |
2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
"{ Package: 'stx:libtool' }" |
|
14 |
||
15 |
AbstractFileBrowser subclass:#FileBrowserV2 |
|
3957 | 16 |
instanceVariableNames:'fileEntryFieldHolder pathEntryField' |
4173 | 17 |
classVariableNames:'' |
3914 | 18 |
poolDictionaries:'' |
19 |
category:'Interface-Tools-File' |
|
3892 | 20 |
! |
21 |
||
22 |
!FileBrowserV2 class methodsFor:'documentation'! |
|
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
40 |
FileBrowserV2 is based on Filebrowser created by Claus Gittinger |
|
41 |
||
42 |
WARNING: files edited with FileBrowser will have leading spaces (multiple-8) |
|
43 |
being replaced by tabs. If tabs are to be preserved at other |
|
44 |
positions (for example, sendmail-config files) they will be |
|
45 |
corrupt after being written. |
|
46 |
||
47 |
[instance variables]: |
|
48 |
||
49 |
checkDelta <Integer> number of seconds of check interval |
|
50 |
(looks ever so often if shown directory |
|
51 |
has changed). You may make this number |
|
52 |
higher, if your network-times are |
|
53 |
incorrect and thus, the filebrowser |
|
54 |
checks too often. |
|
55 |
||
56 |
compressTabs <Boolean> if true, leading spaces will be |
|
57 |
replaced by tabs when saving text |
|
58 |
||
59 |
some of the defaults (long/short list etc.) can be set by the resource file; |
|
60 |
see FileBrowser>>initialize for more details.. |
|
61 |
||
62 |
[author:] |
|
63 |
Christian Penk |
|
64 |
||
65 |
[start with:] |
|
66 |
FileBrowserV2 open |
|
67 |
" |
|
68 |
! ! |
|
69 |
||
70 |
!FileBrowserV2 class methodsFor:'instance creation'! |
|
71 |
||
72 |
on:aDirectoryPath |
|
73 |
"return a new FileBrowserV2 in a pathname" |
|
74 |
||
4015 | 75 |
|instance files| |
76 |
instance := self new createBuilder. |
|
4172 | 77 |
aDirectoryPath isCollection ifTrue:[ |
78 |
files := aDirectoryPath |
|
79 |
] ifFalse:[ |
|
80 |
files := Array with:aDirectoryPath. |
|
81 |
]. |
|
3907 | 82 |
instance currentFileNameHolder value:files. |
3892 | 83 |
^ instance |
84 |
||
85 |
"/ | instance builder| |
|
86 |
"/ |
|
87 |
"/ builder := super open. |
|
88 |
"/ instance := builder application. |
|
89 |
"/ instance currentFileNameHolder value:aDirectoryPath. |
|
90 |
"/ ^ instance |
|
91 |
||
92 |
" |
|
93 |
(FileBrowserV2 on:'/usr/local/bin') open |
|
94 |
(FileBrowserV2 on:'/etc' ) open |
|
95 |
(FileBrowserV2 on:'..' ) open |
|
96 |
(FileBrowserV2 on:'.' ) open |
|
97 |
" |
|
98 |
! |
|
99 |
||
100 |
open |
|
101 |
"start a new FileBrowserV2" |
|
102 |
||
103 |
| instance | |
|
104 |
instance := self new. |
|
105 |
instance open. |
|
106 |
^ instance |
|
107 |
" |
|
108 |
FileBrowserV2 openOn:'/etc' withExtent:800@600 |
|
109 |
FileBrowserV2 openOn:'..' withExtent:200@300 |
|
110 |
FileBrowserV2 openOn:'.' withExtent:1024@768 |
|
111 |
" |
|
112 |
! |
|
113 |
||
114 |
openOn:aDirectoryPath |
|
115 |
"start a new FileBrowserV2 in a pathname" |
|
116 |
||
117 |
| instance| |
|
118 |
instance := self on:aDirectoryPath asFilename. |
|
119 |
^ instance open. |
|
120 |
" |
|
121 |
FileBrowserV2 openOn:'/etc' |
|
122 |
FileBrowserV2 openOn:'..' |
|
123 |
FileBrowserV2 openOn:'.' |
|
124 |
" |
|
125 |
! |
|
126 |
||
127 |
openOn:aDirectoryPath withExtent:extent |
|
128 |
"start a new FileBrowserV2 in a pathname" |
|
129 |
||
130 |
| instance builder| |
|
131 |
instance := self on:aDirectoryPath. |
|
132 |
builder := instance open. |
|
133 |
builder window extent:extent. |
|
134 |
^ instance |
|
135 |
" |
|
136 |
FileBrowserV2 openOn:'/etc' withExtent:800@600 |
|
137 |
FileBrowserV2 openOn:'..' withExtent:200@300 |
|
138 |
FileBrowserV2 openOn:'.' withExtent:1024@768 |
|
139 |
" |
|
140 |
! |
|
141 |
||
142 |
openWithAspects:someAspects withExtent:extent |
|
143 |
"start a new FileBrowserV2 in a pathname" |
|
144 |
||
145 |
|dir clone| |
|
146 |
||
147 |
dir := someAspects at:#currentFileNameHolder ifAbsent:nil. |
|
148 |
clone := self openOn:(dir value) withExtent:extent. |
|
149 |
||
150 |
" |
|
151 |
FileBrowserV2 openOn:'/etc' withExtent:800@600 |
|
152 |
FileBrowserV2 openOn:'..' withExtent:200@300 |
|
153 |
FileBrowserV2 openOn:'.' withExtent:1024@768 |
|
154 |
" |
|
155 |
! ! |
|
156 |
||
157 |
!FileBrowserV2 class methodsFor:'class initialization'! |
|
158 |
||
4027 | 159 |
applicationIcon |
160 |
^ NewLauncher startNewFileBrowserIcon |
|
161 |
! |
|
162 |
||
3892 | 163 |
clearHistoryIcon |
164 |
^ Icon deleteIcon |
|
165 |
! |
|
166 |
||
167 |
initialize |
|
168 |
||
169 |
self installInLauncher. |
|
170 |
! |
|
171 |
||
172 |
initializeDefaultCommands |
|
173 |
DefaultCommandPerMIME := Dictionary new. |
|
174 |
||
175 |
DefaultCommandPerMIME at:'application/x-tar-compressed' put:'gunzip < %1 | tar tvf -'. |
|
176 |
DefaultCommandPerMIME at:'application/pdf' put:'acroread %1'. |
|
177 |
||
178 |
" |
|
179 |
self initializeDefaultCommands |
|
180 |
" |
|
181 |
! |
|
182 |
||
183 |
installInLauncher |
|
184 |
"add myself to the launcher menu and toolBar" |
|
185 |
||
3914 | 186 |
|menuItem icon action currentLauncher| |
3892 | 187 |
|
188 |
FileBrowserV2 isNil ifTrue:[^ self]. |
|
189 |
||
190 |
action := [FileBrowserV2 open]. |
|
191 |
||
4027 | 192 |
icon := self applicationIcon. "/ self defaultIcon magnifiedTo:28@28. |
3892 | 193 |
|
194 |
menuItem := MenuItem new |
|
4037 | 195 |
translateLabel: true; |
3892 | 196 |
value: action; |
197 |
isButton: false; |
|
4037 | 198 |
label:'File Browser V2' icon:icon; |
3892 | 199 |
nameKey: #fileBrowserV2; |
200 |
activeHelpKey: #fileBrowserV2; |
|
201 |
submenuChannel: #menuFileHistory; |
|
202 |
showBusyCursorWhilePerforming:true. |
|
203 |
||
204 |
NewLauncher addMenuItem:menuItem in:'menu.file' position:#( #before #fileBrowser) space:true. |
|
205 |
||
206 |
menuItem := MenuItem new |
|
4037 | 207 |
translateLabel: true; |
3892 | 208 |
value: action; |
209 |
isButton: true; |
|
4037 | 210 |
"label:'File Browser V2'" icon:icon; |
3892 | 211 |
nameKey: #fileBrowserV2; |
212 |
activeHelpKey: #fileBrowserV2; |
|
213 |
submenuChannel: #menuFileHistory; |
|
214 |
showBusyCursorWhilePerforming:true. |
|
215 |
||
216 |
NewLauncher addMenuItem:menuItem in:'toolbar' position:#( #before #fileBrowser) space:false. |
|
217 |
||
3918 | 218 |
currentLauncher := NewLauncher current. |
3914 | 219 |
currentLauncher notNil ifTrue:[ |
220 |
currentLauncher fileBrowserItemVisible value:false |
|
221 |
]. |
|
3908 | 222 |
|
3892 | 223 |
" |
224 |
self installInLauncher |
|
225 |
self removeFromLauncher |
|
226 |
" |
|
227 |
! |
|
228 |
||
229 |
removeFromLauncher |
|
230 |
"/ |
|
231 |
"/ remove myself from the launcher menu |
|
232 |
"/ |
|
233 |
||
3914 | 234 |
|currentLauncher| |
235 |
||
3892 | 236 |
NewLauncher isNil ifTrue:[^ self]. |
3908 | 237 |
NewLauncher removeUserTool:#fileBrowserV2. |
3918 | 238 |
currentLauncher := NewLauncher current. |
3914 | 239 |
currentLauncher notNil ifTrue:[ |
240 |
currentLauncher fileBrowserItemVisible value:false |
|
241 |
]. |
|
3892 | 242 |
|
243 |
" |
|
244 |
self removeFromLauncher |
|
245 |
" |
|
246 |
! ! |
|
247 |
||
248 |
!FileBrowserV2 class methodsFor:'defaults'! |
|
249 |
||
250 |
entryFieldEndStringForMultipleSelection |
|
251 |
||
252 |
^ ('[*]') |
|
253 |
! ! |
|
254 |
||
255 |
!FileBrowserV2 class methodsFor:'help specs'! |
|
256 |
||
257 |
flyByHelpSpec |
|
258 |
<resource: #help> |
|
259 |
||
260 |
|spec| |
|
261 |
||
262 |
spec := super flyByHelpSpec addPairsFrom:#( |
|
263 |
||
264 |
#addTerminal |
|
265 |
'Shell Terminal' |
|
266 |
||
267 |
#searchFile |
|
268 |
'Search a File' |
|
269 |
||
270 |
#directoryUp |
|
4060 | 271 |
'Directory Up' |
3892 | 272 |
|
273 |
#directoryBack |
|
4060 | 274 |
'Directory Back' |
3892 | 275 |
|
276 |
#copyFile |
|
4060 | 277 |
'Copy File' |
3892 | 278 |
|
279 |
#cutFile |
|
4060 | 280 |
'Cut File' |
3892 | 281 |
|
282 |
#fileHome |
|
4060 | 283 |
'Home Directory' |
3892 | 284 |
|
285 |
#pasteFile |
|
286 |
'PasteFile' |
|
287 |
||
288 |
#deleteFile |
|
4060 | 289 |
'Delete File' |
3892 | 290 |
|
291 |
#fileIn |
|
4060 | 292 |
'File In' |
3892 | 293 |
|
294 |
#directoryForward |
|
4060 | 295 |
'Directory Forward' |
3892 | 296 |
|
297 |
#directoryHistory |
|
298 |
'Directory' |
|
299 |
||
300 |
#fileHistory |
|
4060 | 301 |
'File History' |
3892 | 302 |
|
303 |
#hideToolBar |
|
304 |
'Hide Toolbar' |
|
305 |
||
306 |
#hideFilenameEntryField |
|
307 |
'Hide Filename Field' |
|
308 |
||
3980 | 309 |
#showFileDetails |
310 |
'Show File Details' |
|
311 |
||
312 |
#hideFileDetails |
|
313 |
'Hide File Details' |
|
314 |
||
315 |
#toggleDetails |
|
316 |
'Show/Hide File Details' |
|
317 |
||
3892 | 318 |
). |
319 |
||
320 |
^ spec. |
|
3980 | 321 |
! |
322 |
||
323 |
helpSpec |
|
324 |
"This resource specification was automatically generated |
|
325 |
by the UIHelpTool of ST/X." |
|
326 |
||
327 |
"Do not manually edit this!! If it is corrupted, |
|
328 |
the UIHelpTool may not be able to read the specification." |
|
329 |
||
330 |
" |
|
331 |
UIHelpTool openOnClass:FileBrowserV2 |
|
332 |
" |
|
333 |
||
334 |
<resource: #help> |
|
335 |
||
336 |
^super helpSpec addPairsFrom:#( |
|
337 |
||
338 |
||
339 |
) |
|
3892 | 340 |
! ! |
341 |
||
342 |
!FileBrowserV2 class methodsFor:'icon'! |
|
343 |
||
344 |
defaultIcon |
|
345 |
"This resource specification was automatically generated |
|
346 |
by the ImageEditor of ST/X." |
|
347 |
||
348 |
"Do not manually edit this!! If it is corrupted, |
|
349 |
the ImageEditor may not be able to read the specification." |
|
350 |
||
351 |
" |
|
352 |
self defaultIcon inspect |
|
353 |
ImageEditor openOnClass:self andSelector:#defaultIcon |
|
354 |
" |
|
355 |
||
356 |
<resource: #image> |
|
357 |
||
358 |
^Icon |
|
359 |
constantNamed:#'FileBrowserV2 class defaultIcon' |
|
360 |
ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
361 |
@@@@@@@@@@@@@@@@@@@@CLA&Y&Y&Y&X@@ADP@@@L0F@@@@@@A @ADAD@@@3@XN;.;.8F@ADPDQ@@CLA ;.@@@@@@D@@@D@@L0FC.8O[6=/@QDADP@@3@X@; |
|
362 |
[6=/[0DPDP@@CLA DNC6<@@F<ADP@@@L0F@A@F= [0= @@@@@@3@X@@P=/[6=/@@@@@@CLA @@A/[6=/X@@@@@@L0FC0@O[6=/[0@@@@@@3@XF<@@@@@@@@@ |
|
363 |
@@@@CLA = @@@@@@@@@@@@@L0FA/[6=/A @@@@@@@@3@XO[6=/XF@@@@@@@@CLA @@@@@@X@@@@@@@@L0FY&Y&Y&Y @@@@@@@@C@Y&Y&Y&Y&@@@@@@@@@@@@ |
|
364 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@N@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
365 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@C @b') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127 127 127 127 170 170 170]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
366 |
O??# C??9<@??>? O???<C????@????0O???8C???<@???>@O??<@C???@@???0@O??<@C??8@@??>@@O?? @C??8@@??>@@G?? @@??8@@@@@@@G.P=0AAD |
|
367 |
HP@PQBD@GDP8 AADHD@PQBA@DN^=0@@a') ; yourself); yourself] |
|
368 |
! |
|
369 |
||
370 |
hideFilenameEntryFieldIcon |
|
371 |
<resource: #programImage> |
|
372 |
||
373 |
^ ToolbarIconLibrary hideToolbarIconH14 |
|
374 |
! |
|
375 |
||
376 |
hideToolBarIcon |
|
377 |
<resource: #programImage> |
|
378 |
||
379 |
^ ToolbarIconLibrary hideToolbarIconH26 |
|
380 |
! ! |
|
381 |
||
3980 | 382 |
!FileBrowserV2 class methodsFor:'image specs'! |
383 |
||
384 |
viewDetailsIcon |
|
385 |
"This resource specification was automatically generated |
|
386 |
by the ImageEditor of ST/X." |
|
387 |
||
388 |
"Do not manually edit this!! If it is corrupted, |
|
389 |
the ImageEditor may not be able to read the specification." |
|
390 |
||
391 |
" |
|
392 |
self viewDetailsIcon inspect |
|
393 |
ImageEditor openOnClass:self andSelector:#viewDetailsIcon |
|
394 |
Icon flushCachedIcons |
|
395 |
" |
|
396 |
||
397 |
<resource: #image> |
|
398 |
||
399 |
^Icon |
|
400 |
constantNamed:#'FileBrowserV2 class viewDetailsIcon' |
|
401 |
ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@]+X@@@@@]+X@@@@@]+X@@@@@]+X@@@@@@@@b') ; yourself); yourself] |
|
402 |
! |
|
403 |
||
404 |
viewNoDetailsIcon |
|
405 |
"This resource specification was automatically generated |
|
406 |
by the ImageEditor of ST/X." |
|
407 |
||
408 |
"Do not manually edit this!! If it is corrupted, |
|
409 |
the ImageEditor may not be able to read the specification." |
|
410 |
||
411 |
" |
|
412 |
self viewNoDetailsIcon inspect |
|
413 |
ImageEditor openOnClass:self andSelector:#viewNoDetailsIcon |
|
414 |
Icon flushCachedIcons |
|
415 |
" |
|
416 |
||
417 |
<resource: #image> |
|
418 |
||
419 |
^Icon |
|
420 |
constantNamed:#'FileBrowserV2 class viewNoDetailsIcon' |
|
421 |
ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@A<@@@@@@A<@@@@@@A<@@@@@@A<@@@@@@@@@b') ; yourself); yourself] |
|
422 |
! ! |
|
423 |
||
3892 | 424 |
!FileBrowserV2 class methodsFor:'interface specs'! |
425 |
||
426 |
windowSpec |
|
427 |
"This resource specification was automatically generated |
|
428 |
by the UIPainter of ST/X." |
|
429 |
||
430 |
"Do not manually edit this!! If it is corrupted, |
|
431 |
the UIPainter may not be able to read the specification." |
|
432 |
||
433 |
" |
|
434 |
UIPainter new openOnClass:FileBrowserV2 andSelector:#windowSpec |
|
435 |
FileBrowserV2 new openInterface:#windowSpec |
|
436 |
FileBrowserV2 open |
|
437 |
" |
|
438 |
||
439 |
<resource: #canvas> |
|
440 |
||
441 |
^ |
|
442 |
#(#FullSpec |
|
443 |
#name: #windowSpec |
|
444 |
#window: |
|
445 |
#(#WindowSpec |
|
446 |
#label: #FileBrowser |
|
447 |
#name: #FileBrowser |
|
448 |
#min: #(#Point 10 10) |
|
4027 | 449 |
#bounds: #(#Rectangle 216 173 1016 773) |
3892 | 450 |
#menu: #mainMenu |
4027 | 451 |
#icon: #applicationIcon |
3892 | 452 |
) |
453 |
#component: |
|
454 |
#(#SpecCollection |
|
455 |
#collection: #( |
|
456 |
#(#ViewSpec |
|
457 |
#name: 'ToolbarBox' |
|
458 |
#layout: #(#LayoutFrame 0 0 0 0 0 1 30 0) |
|
459 |
#level: 0 |
|
460 |
#visibilityChannel: #toolBarVisibleHolder |
|
461 |
#component: |
|
462 |
#(#SpecCollection |
|
463 |
#collection: #( |
|
464 |
#(#ActionButtonSpec |
|
465 |
#label: 'hideToolBarIcon' |
|
466 |
#name: 'HideToolBarButton' |
|
467 |
#layout: #(#LayoutFrame 0 0 0 0 13 0 30 0) |
|
468 |
#activeHelpKey: #hideToolBar |
|
469 |
#hasCharacterOrientedLabel: false |
|
470 |
#translateLabel: true |
|
471 |
#model: #hideToolbar |
|
472 |
#postBuildCallback: #hideToolBarButtonCreated: |
|
473 |
) |
|
474 |
#(#MenuPanelSpec |
|
475 |
#name: 'ToolBar' |
|
476 |
#layout: #(#LayoutFrame 13 0 0 0 0 1 30 0) |
|
477 |
#menu: #toolBarMainMenu |
|
478 |
#textDefault: true |
|
479 |
) |
|
480 |
) |
|
481 |
||
482 |
) |
|
483 |
) |
|
484 |
#(#ViewSpec |
|
485 |
#name: 'FilenameEntryFieldBox' |
|
486 |
#layout: #(#LayoutFrame 0 0 30 0 0 1 55 0) |
|
487 |
#level: 0 |
|
488 |
#visibilityChannel: #filenameEntryFieldVisibleHolder |
|
489 |
#component: |
|
490 |
#(#SpecCollection |
|
491 |
#collection: #( |
|
492 |
#(#ActionButtonSpec |
|
493 |
#label: 'hideFilenameEntryFieldIcon' |
|
494 |
#name: 'HideFilenameEntryFieldButton' |
|
495 |
#layout: #(#LayoutFrame 0 0 0 0 13 0 0 1) |
|
496 |
#activeHelpKey: #hideFilenameEntryField |
|
497 |
#hasCharacterOrientedLabel: false |
|
498 |
#translateLabel: true |
|
499 |
#model: #hideFilenameEntryField |
|
500 |
#postBuildCallback: #hideFilenameEntryFieldButtonCreated: |
|
501 |
) |
|
502 |
#(#ViewSpec |
|
503 |
#name: 'Box1' |
|
504 |
#layout: #(#LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0) |
|
505 |
#level: 1 |
|
506 |
#component: |
|
507 |
#(#SpecCollection |
|
508 |
#collection: #( |
|
509 |
#(#VariableHorizontalPanelSpec |
|
510 |
#name: 'VariableHorizontalPanel1' |
|
511 |
#layout: #(#LayoutFrame 1 0.0 1 0.0 -1 1.0 -1 1.0) |
|
512 |
#level: 0 |
|
513 |
#showHandle: true |
|
514 |
#component: |
|
515 |
#(#SpecCollection |
|
516 |
#collection: #( |
|
517 |
#(#FilenameInputFieldSpec |
|
518 |
#name: 'FilenameEntryField' |
|
519 |
#level: 1 |
|
520 |
#model: #fileEntryFieldHolder |
|
521 |
#acceptOnPointerLeave: false |
|
522 |
#postBuildCallback: #postBuildPathField: |
|
523 |
) |
|
524 |
#(#ViewSpec |
|
525 |
#name: 'FilterBox' |
|
526 |
#component: |
|
527 |
#(#SpecCollection |
|
528 |
#collection: #( |
|
529 |
#(#LabelSpec |
|
530 |
#label: 'Filter:' |
|
531 |
#name: 'Filter' |
|
532 |
#layout: #(#LayoutFrame 0 0 0 0 40 0 0 1) |
|
533 |
#translateLabel: true |
|
534 |
#adjust: #left |
|
535 |
#postBuildCallback: #postBuildPathViewBox: |
|
536 |
) |
|
537 |
#(#ComboBoxSpec |
|
538 |
#name: 'FilterSelectionBox' |
|
539 |
#layout: #(#LayoutFrame 40 0 0 0 0 1 0 1) |
|
540 |
#model: #filterModel |
|
541 |
#immediateAccept: true |
|
542 |
#acceptOnPointerLeave: false |
|
543 |
#comboList: #filterListModel |
|
544 |
) |
|
545 |
) |
|
546 |
||
547 |
) |
|
548 |
#postBuildCallback: #postBuildPathViewBox: |
|
549 |
) |
|
550 |
) |
|
551 |
||
552 |
) |
|
553 |
#handles: #(#Any 0.8 1.0) |
|
554 |
#postBuildCallback: #postBuildPathViewBox: |
|
555 |
) |
|
556 |
) |
|
557 |
||
558 |
) |
|
559 |
#postBuildCallback: #postBuildPathViewBox: |
|
560 |
) |
|
561 |
) |
|
562 |
||
563 |
) |
|
564 |
) |
|
565 |
#(#ViewSpec |
|
566 |
#name: 'BrowserBox' |
|
567 |
#layout: #(#LayoutFrame 0 0.0 55 0 0 1.0 -20 1) |
|
568 |
#level: 0 |
|
569 |
#component: |
|
570 |
#(#SpecCollection |
|
571 |
#collection: #( |
|
572 |
#(#'FileBrowserV2UISpecifications::PanelSpec' |
|
573 |
#name: 'VerticalPanel' |
|
574 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
575 |
#level: 0 |
|
576 |
#whichView: #last |
|
577 |
#orientation: #vertical |
|
578 |
#visibility: #viewNoteBookApplicationHolder |
|
579 |
#component: |
|
580 |
#(#SpecCollection |
|
581 |
#collection: #( |
|
582 |
#(#'FileBrowserV2UISpecifications::PanelSpec' |
|
583 |
#name: 'HorizontalPanel' |
|
584 |
#level: 0 |
|
585 |
#whichView: #first |
|
586 |
#orientation: #horizontal |
|
587 |
#visibility: #showDirectoryTreeHolder |
|
588 |
#component: |
|
589 |
#(#SpecCollection |
|
590 |
#collection: #( |
|
591 |
#(#SubCanvasSpec |
|
592 |
#name: 'DirectoryTreeBrowser' |
|
593 |
#hasHorizontalScrollBar: false |
|
594 |
#hasVerticalScrollBar: false |
|
595 |
#majorKey: #DirectoryTreeBrowser |
|
596 |
#createNewApplication: true |
|
597 |
#createNewBuilder: true |
|
598 |
) |
|
599 |
#(#SubCanvasSpec |
|
600 |
#name: 'DirectoryContentsBrowser' |
|
601 |
#hasHorizontalScrollBar: false |
|
602 |
#hasVerticalScrollBar: false |
|
603 |
#majorKey: #DirectoryContentsBrowser |
|
604 |
#createNewApplication: true |
|
605 |
#createNewBuilder: true |
|
606 |
) |
|
607 |
) |
|
608 |
||
609 |
) |
|
610 |
#handles: #(#Any 0.229621 1.0) |
|
611 |
) |
|
612 |
#(#SubCanvasSpec |
|
613 |
#name: 'FileApplicationNoteBook' |
|
4018 | 614 |
#tabable: false |
3892 | 615 |
#hasHorizontalScrollBar: false |
616 |
#hasVerticalScrollBar: false |
|
617 |
#majorKey: #FileApplicationNoteBook |
|
618 |
#createNewApplication: true |
|
619 |
#createNewBuilder: true |
|
620 |
) |
|
621 |
) |
|
622 |
||
623 |
) |
|
624 |
#handles: #(#Any 0.5 1.0) |
|
625 |
) |
|
626 |
) |
|
627 |
||
628 |
) |
|
629 |
) |
|
630 |
#(#ViewSpec |
|
631 |
#name: 'Box2' |
|
632 |
#layout: #(#LayoutFrame 0 0 -20 1 0 1 0 1) |
|
633 |
#level: 0 |
|
634 |
#component: |
|
635 |
#(#SpecCollection |
|
636 |
#collection: #( |
|
637 |
#(#LabelSpec |
|
638 |
#label: 'NotifyLabel' |
|
639 |
#name: 'NotifyLabel' |
|
4018 | 640 |
#layout: #(#LayoutFrame 1 0.0 1 0.0 -50 1 1 1.0) |
3892 | 641 |
#level: -1 |
642 |
#translateLabel: true |
|
643 |
#labelChannel: #notifyChannel |
|
644 |
#adjust: #left |
|
645 |
) |
|
4018 | 646 |
#(#LabelSpec |
647 |
#label: 'Shown Files' |
|
648 |
#name: 'Label1' |
|
649 |
#layout: #(#LayoutFrame -50 1 1 0.0 1 1 1 1.0) |
|
650 |
#level: -1 |
|
651 |
#translateLabel: true |
|
652 |
#labelChannel: #shownFiles |
|
653 |
#adjust: #left |
|
654 |
#postBuildCallback: #postBuildFilterBox: |
|
655 |
) |
|
3892 | 656 |
) |
657 |
||
658 |
) |
|
659 |
) |
|
660 |
) |
|
661 |
||
662 |
) |
|
663 |
) |
|
664 |
! ! |
|
665 |
||
666 |
!FileBrowserV2 class methodsFor:'menu specs'! |
|
667 |
||
668 |
mainMenu |
|
669 |
"This resource specification was automatically generated |
|
670 |
by the MenuEditor of ST/X." |
|
671 |
||
672 |
"Do not manually edit this!! If it is corrupted, |
|
673 |
the MenuEditor may not be able to read the specification." |
|
674 |
||
675 |
" |
|
676 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#mainMenu |
|
677 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 mainMenu)) startUp |
|
678 |
" |
|
679 |
||
680 |
<resource: #menu> |
|
681 |
||
682 |
^ |
|
683 |
#(#Menu |
|
684 |
#( |
|
685 |
#(#MenuItem |
|
686 |
#label: 'Browser' |
|
687 |
#translateLabel: true |
|
688 |
#submenuChannel: #browserMenu |
|
689 |
) |
|
690 |
#(#MenuItem |
|
691 |
#label: 'Directory' |
|
692 |
#translateLabel: true |
|
693 |
#submenuChannel: #directoryMenu |
|
694 |
) |
|
695 |
#(#MenuItem |
|
696 |
#label: 'File' |
|
697 |
#translateLabel: true |
|
698 |
#submenuChannel: #fileMenu |
|
699 |
) |
|
700 |
#(#MenuItem |
|
701 |
#label: 'Edit' |
|
702 |
#translateLabel: true |
|
703 |
#submenuChannel: #editMenu |
|
704 |
) |
|
705 |
#(#MenuItem |
|
706 |
#label: 'View' |
|
707 |
#translateLabel: true |
|
708 |
#submenu: |
|
709 |
#(#Menu |
|
710 |
#( |
|
711 |
#(#MenuItem |
|
3980 | 712 |
#label: 'Show' |
3892 | 713 |
#translateLabel: true |
3980 | 714 |
#submenu: |
715 |
#(#Menu |
|
716 |
#( |
|
717 |
#(#MenuItem |
|
718 |
#label: 'Hidden Files' |
|
719 |
#translateLabel: true |
|
720 |
#indication: #showHiddenFiles |
|
721 |
) |
|
722 |
#(#MenuItem |
|
723 |
#label: '-' |
|
724 |
) |
|
725 |
#(#MenuItem |
|
726 |
#label: 'Directory Tree' |
|
727 |
#translateLabel: true |
|
728 |
#indication: #showDirectoryTreeHolder |
|
729 |
) |
|
730 |
#(#MenuItem |
|
731 |
#label: 'Regular Files in TreeView (Left)' |
|
732 |
#translateLabel: true |
|
733 |
#indication: #viewFilesInDirectoryTree |
|
734 |
) |
|
735 |
#(#MenuItem |
|
736 |
#label: 'Directories in ContentsView (Right)' |
|
737 |
#translateLabel: true |
|
738 |
#indication: #viewDirectoriesInDirectoryContentsBrowser |
|
739 |
) |
|
740 |
#(#MenuItem |
|
4080 | 741 |
#enabled: #enableViewNoteBookApplication |
3980 | 742 |
#label: 'File Applications' |
743 |
#translateLabel: true |
|
744 |
#indication: #viewNoteBookApplicationHolder |
|
745 |
) |
|
746 |
) |
|
747 |
nil |
|
748 |
nil |
|
749 |
) |
|
3892 | 750 |
) |
751 |
#(#MenuItem |
|
3980 | 752 |
#label: 'Sort' |
3892 | 753 |
#translateLabel: true |
754 |
#submenuChannel: #sortMenu |
|
755 |
) |
|
756 |
#(#MenuItem |
|
3980 | 757 |
#label: 'Details' |
3892 | 758 |
#translateLabel: true |
3980 | 759 |
#submenuChannel: #viewInContentsBrowserMenu |
3892 | 760 |
) |
761 |
#(#MenuItem |
|
762 |
#label: '-' |
|
763 |
) |
|
764 |
#(#MenuItem |
|
765 |
#label: 'Toolbar' |
|
766 |
#translateLabel: true |
|
767 |
#hideMenuOnActivated: false |
|
768 |
#indication: #toolBarVisibleHolder |
|
769 |
) |
|
770 |
#(#MenuItem |
|
4084 | 771 |
#label: 'Path Entry && Filter' |
3892 | 772 |
#translateLabel: true |
773 |
#hideMenuOnActivated: false |
|
774 |
#indication: #filenameEntryFieldVisibleHolder |
|
775 |
) |
|
776 |
#(#MenuItem |
|
777 |
#label: '-' |
|
778 |
) |
|
779 |
#(#MenuItem |
|
780 |
#label: 'Update' |
|
781 |
#translateLabel: true |
|
782 |
) |
|
783 |
) |
|
784 |
nil |
|
785 |
nil |
|
786 |
) |
|
787 |
) |
|
788 |
#(#MenuItem |
|
789 |
#label: 'Tools' |
|
790 |
#translateLabel: true |
|
791 |
#submenuChannel: #toolsMenuSpec |
|
792 |
) |
|
793 |
#(#MenuItem |
|
794 |
#label: 'CVS' |
|
795 |
#translateLabel: true |
|
4105 | 796 |
#submenuChannel: #cvsMenu |
3892 | 797 |
) |
798 |
#(#MenuItem |
|
799 |
#label: 'Help' |
|
800 |
#translateLabel: true |
|
801 |
#startGroup: #right |
|
802 |
#submenu: |
|
803 |
#(#Menu |
|
804 |
#( |
|
805 |
#(#MenuItem |
|
806 |
#label: 'FileBrowser Documentation' |
|
807 |
#translateLabel: true |
|
808 |
) |
|
809 |
#(#MenuItem |
|
810 |
#label: '-' |
|
811 |
) |
|
812 |
#(#MenuItem |
|
813 |
#label: 'About FileBrowser...' |
|
814 |
#translateLabel: true |
|
815 |
) |
|
816 |
) |
|
817 |
nil |
|
818 |
nil |
|
819 |
) |
|
820 |
) |
|
821 |
) |
|
822 |
nil |
|
823 |
nil |
|
824 |
) |
|
825 |
! |
|
826 |
||
827 |
toolBarMainMenu |
|
828 |
"This resource specification was automatically generated |
|
829 |
by the MenuEditor of ST/X." |
|
830 |
||
831 |
"Do not manually edit this!! If it is corrupted, |
|
832 |
the MenuEditor may not be able to read the specification." |
|
833 |
||
834 |
" |
|
835 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#toolBarMainMenu |
|
836 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 toolBarMainMenu)) startUp |
|
837 |
" |
|
838 |
||
839 |
<resource: #menu> |
|
840 |
||
841 |
^ |
|
842 |
#(#Menu |
|
843 |
#( |
|
844 |
#(#MenuItem |
|
4084 | 845 |
#activeHelpKey: #directoryUp |
846 |
#enabled: #enableDirectoryUp |
|
3892 | 847 |
#label: 'DirectoryUp' |
4084 | 848 |
#itemValue: #doGoDirectoryUp |
3892 | 849 |
#translateLabel: true |
850 |
#isButton: true |
|
4094 | 851 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #upArrowIcon) |
3892 | 852 |
) |
853 |
#(#MenuItem |
|
854 |
#label: '' |
|
855 |
) |
|
856 |
#(#MenuItem |
|
4084 | 857 |
#activeHelpKey: #directoryBack |
858 |
#enabled: #enableBack |
|
3892 | 859 |
#label: 'Back' |
4084 | 860 |
#itemValue: #doBack |
3892 | 861 |
#translateLabel: true |
862 |
#isButton: true |
|
4084 | 863 |
#submenuChannel: #menuDirHistoryBack |
4094 | 864 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #leftArrowIcon) |
3892 | 865 |
) |
866 |
#(#MenuItem |
|
867 |
#label: '' |
|
868 |
) |
|
869 |
#(#MenuItem |
|
4084 | 870 |
#activeHelpKey: #directoryForward |
871 |
#enabled: #enableForward |
|
3892 | 872 |
#label: 'Forward' |
4084 | 873 |
#itemValue: #doForward |
3892 | 874 |
#translateLabel: true |
875 |
#isButton: true |
|
4084 | 876 |
#submenuChannel: #menuDirHistoryForward |
4094 | 877 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #rightArrowIcon) |
3892 | 878 |
) |
879 |
#(#MenuItem |
|
880 |
#label: '' |
|
881 |
) |
|
882 |
#(#MenuItem |
|
4084 | 883 |
#activeHelpKey: #fileHome |
884 |
#enabled: #enableHome |
|
3892 | 885 |
#label: 'Home' |
4084 | 886 |
#itemValue: #doGotoHomeDirectory |
3892 | 887 |
#translateLabel: true |
888 |
#isButton: true |
|
4084 | 889 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #goHomeIcon) |
3892 | 890 |
) |
891 |
#(#MenuItem |
|
892 |
#label: '' |
|
893 |
) |
|
894 |
#(#MenuItem |
|
4084 | 895 |
#activeHelpKey: #fileHistory |
896 |
#enabled: #enableFileHistory |
|
3892 | 897 |
#label: 'File History' |
898 |
#translateLabel: true |
|
899 |
#isButton: true |
|
4084 | 900 |
#submenuChannel: #menuFileHistory |
4094 | 901 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #historyIcon) |
3892 | 902 |
) |
903 |
#(#MenuItem |
|
904 |
#label: '' |
|
905 |
) |
|
906 |
#(#MenuItem |
|
4084 | 907 |
#activeHelpKey: #copyFile |
908 |
#enabled: #hasSelection |
|
3892 | 909 |
#label: 'Copy' |
4084 | 910 |
#itemValue: #copyInDirContentsBrowser |
3892 | 911 |
#translateLabel: true |
912 |
#isButton: true |
|
4094 | 913 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #copyIcon) |
3892 | 914 |
) |
915 |
#(#MenuItem |
|
4084 | 916 |
#activeHelpKey: #cutFile |
917 |
#enabled: #hasSelection |
|
3892 | 918 |
#label: 'Cut' |
4084 | 919 |
#itemValue: #cutInDirContentsBrowser |
3892 | 920 |
#translateLabel: true |
921 |
#isButton: true |
|
4094 | 922 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #cutIcon) |
3892 | 923 |
) |
924 |
#(#MenuItem |
|
4084 | 925 |
#activeHelpKey: #pasteFile |
926 |
#enabled: #canPaste |
|
3892 | 927 |
#label: 'Paste' |
4084 | 928 |
#itemValue: #pasteFiles |
3892 | 929 |
#translateLabel: true |
930 |
#isButton: true |
|
4094 | 931 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #pasteIcon) |
3892 | 932 |
) |
933 |
#(#MenuItem |
|
4084 | 934 |
#activeHelpKey: #deleteFile |
935 |
#enabled: #hasSelection |
|
3892 | 936 |
#label: 'Delete' |
4084 | 937 |
#itemValue: #deleteInDirContentsBrowser |
3892 | 938 |
#translateLabel: true |
939 |
#isButton: true |
|
4094 | 940 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #deleteIcon) |
3892 | 941 |
) |
942 |
#(#MenuItem |
|
943 |
#label: '' |
|
944 |
) |
|
945 |
#(#MenuItem |
|
4084 | 946 |
#activeHelpKey: #fileIn |
947 |
#enabled: #hasSelection |
|
3892 | 948 |
#label: 'File In' |
4084 | 949 |
#itemValue: #fileFileIn |
3892 | 950 |
#translateLabel: true |
951 |
#isButton: true |
|
4094 | 952 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #fileInIcon) |
3892 | 953 |
) |
954 |
#(#MenuItem |
|
955 |
#label: '' |
|
956 |
) |
|
957 |
#(#MenuItem |
|
4084 | 958 |
#activeHelpKey: #searchFile |
3892 | 959 |
#label: 'Search File' |
4084 | 960 |
#itemValue: #doOpenSearchFile |
3892 | 961 |
#translateLabel: true |
962 |
#isButton: true |
|
4094 | 963 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #searchIcon) |
3892 | 964 |
) |
965 |
#(#MenuItem |
|
4084 | 966 |
#activeHelpKey: #addTerminal |
3892 | 967 |
#label: 'VT100' |
4084 | 968 |
#itemValue: #doAddTerminal |
3892 | 969 |
#translateLabel: true |
970 |
#isButton: true |
|
4094 | 971 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #shellWithoutTextIcon) |
3892 | 972 |
) |
3980 | 973 |
#(#MenuItem |
4084 | 974 |
#activeHelpKey: #toggleDetails |
3980 | 975 |
#label: 'viewDetails' |
4084 | 976 |
#translateLabel: true |
3980 | 977 |
#isButton: true |
978 |
#startGroup: #right |
|
4084 | 979 |
#indication: #viewDetails |
980 |
#submenuChannel: #viewDetailsMenuSpec |
|
3980 | 981 |
#labelImage: #(#ResourceRetriever nil #viewDetailsIcon) |
982 |
) |
|
3892 | 983 |
) |
984 |
nil |
|
985 |
nil |
|
986 |
) |
|
987 |
! ! |
|
988 |
||
989 |
!FileBrowserV2 methodsFor:'actions'! |
|
990 |
||
991 |
changeFileBrowserTitleTo:aString |
|
992 |
||
993 |
|string| |
|
994 |
||
995 |
string := 'FileBrowser ', aString. |
|
996 |
self window label:string. |
|
997 |
! |
|
998 |
||
999 |
doSpawn |
|
1000 |
||
1001 |
self saveRuntimeAspectValues. |
|
1002 |
self class openWithAspects:aspects withExtent:self builder window extent. |
|
1003 |
! |
|
1004 |
||
1005 |
hideFilenameEntryField |
|
1006 |
self filenameEntryFieldVisibleHolder value:false. |
|
1007 |
! |
|
1008 |
||
1009 |
hideToolbar |
|
1010 |
self toolBarVisibleHolder value:false. |
|
3980 | 1011 |
! |
1012 |
||
1013 |
toggleFileDetailsFor:anItem |
|
1014 |
|viewDetails| |
|
1015 |
||
1016 |
viewDetails := self viewDetails value not. |
|
1017 |
self viewDetails value:viewDetails. |
|
1018 |
||
1019 |
viewDetails ifTrue:[ |
|
1020 |
anItem activeHelpKey:#hideFileDetails. |
|
1021 |
anItem label:(self class viewNoDetailsIcon). |
|
1022 |
] ifFalse:[ |
|
1023 |
anItem activeHelpKey:#showFileDetails. |
|
1024 |
anItem label:(self class viewDetailsIcon). |
|
1025 |
]. |
|
3892 | 1026 |
! ! |
1027 |
||
1028 |
!FileBrowserV2 methodsFor:'aspects'! |
|
1029 |
||
1030 |
fileEntryFieldHolder |
|
1031 |
||
1032 |
fileEntryFieldHolder isNil ifTrue:[ |
|
1033 |
fileEntryFieldHolder := ValueHolder new. |
|
1034 |
fileEntryFieldHolder addDependent:self. |
|
1035 |
]. |
|
1036 |
^ fileEntryFieldHolder. |
|
1037 |
! ! |
|
1038 |
||
1039 |
!FileBrowserV2 methodsFor:'change & update'! |
|
1040 |
||
4011 | 1041 |
currentFileNameHolderChanged |
1042 |
||
1043 |
| files| |
|
1044 |
||
1045 |
files := self currentFileNameHolder value. |
|
1046 |
||
1047 |
(files isEmpty) ifTrue:[ |
|
1048 |
self fileEntryFieldHolder value:nil withoutNotifying:self. |
|
1049 |
] ifFalse:[ |
|
1050 |
files size == 1 ifTrue:[ |
|
1051 |
self fileEntryFieldHolder value:(files first) withoutNotifying:self. |
|
1052 |
] ifFalse:[ |
|
1053 |
self fileEntryFieldHolder value:self getCommonForCurrentFiles withoutNotifying:self. |
|
1054 |
]. |
|
1055 |
]. |
|
1056 |
! |
|
1057 |
||
1058 |
fileEntryFieldHolderChanged |
|
1059 |
||
1060 |
(fileEntryFieldHolder value asFilename exists) ifFalse:[ pathEntryField flash. ^ self]. |
|
1061 |
self currentFileNameHolder value:(OrderedCollection with:(fileEntryFieldHolder value asFilename)). |
|
1062 |
! |
|
1063 |
||
3892 | 1064 |
update:something with:aParameter from:changedObject |
1065 |
||
1066 |
||
1067 |
changedObject == self fileEntryFieldHolder ifTrue:[ |
|
4011 | 1068 |
self fileEntryFieldHolderChanged. |
1069 |
^ self. |
|
3892 | 1070 |
]. |
1071 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4011 | 1072 |
super update:something with:aParameter from:changedObject. |
1073 |
self currentFileNameHolderChanged. |
|
1074 |
^ self. |
|
3892 | 1075 |
]. |
1076 |
(changedObject == self toolBarVisibleHolder |
|
1077 |
or:[changedObject == self filenameEntryFieldVisibleHolder]) ifTrue:[ |
|
1078 |
self updateToolVisibility. |
|
1079 |
^ self. |
|
1080 |
]. |
|
4085
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1081 |
(changedObject == self sortBlockProperty or:[changedObject == self sortDirectoriesBeforeFiles]) ifTrue:[ |
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1082 |
self sortFileListsBy:(self sortBlockProperty value) withReverse:false. |
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1083 |
^ self. |
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1084 |
]. |
3892 | 1085 |
|
1086 |
^ super update:something with:aParameter from:changedObject. |
|
1087 |
! |
|
1088 |
||
1089 |
updateToolVisibility |
|
1090 |
|builder toolBar filenameEntryField vPanel topOffset visible d| |
|
1091 |
||
1092 |
builder := self builder. |
|
1093 |
||
1094 |
topOffset := 0. |
|
1095 |
visible := self toolBarVisibleHolder value. |
|
1096 |
visible ifTrue:[ |
|
1097 |
toolBar := builder componentAt:#ToolbarBox. |
|
1098 |
topOffset := topOffset + toolBar height. |
|
1099 |
]. |
|
1100 |
||
1101 |
visible := self filenameEntryFieldVisibleHolder value. |
|
1102 |
visible ifTrue:[ |
|
1103 |
filenameEntryField := builder componentAt:#FilenameEntryFieldBox. |
|
1104 |
d := filenameEntryField layout bottomOffset - filenameEntryField layout topOffset. |
|
1105 |
filenameEntryField layout topOffset:topOffset bottomOffset:topOffset + d. |
|
1106 |
topOffset := topOffset + filenameEntryField height. |
|
1107 |
filenameEntryField container notNil ifTrue:[ |
|
1108 |
filenameEntryField containerChangedSize. |
|
1109 |
]. |
|
1110 |
]. |
|
1111 |
||
1112 |
vPanel := builder componentAt:#BrowserBox. |
|
1113 |
vPanel layout topOffset:topOffset+1. |
|
1114 |
vPanel container notNil ifTrue:[ |
|
1115 |
vPanel containerChangedSize. |
|
1116 |
]. |
|
1117 |
! ! |
|
1118 |
||
3957 | 1119 |
!FileBrowserV2 methodsFor:'event handling'! |
1120 |
||
1121 |
processEvent:anEvent |
|
1122 |
"filter keyboard events. |
|
1123 |
Return true, if I have eaten the event" |
|
1124 |
||
1125 |
|focusView key rawKey fileName| |
|
1126 |
||
1127 |
anEvent isKeyPressEvent ifTrue:[ |
|
1128 |
focusView := anEvent targetView. |
|
1129 |
key := anEvent key. |
|
1130 |
rawKey := anEvent rawKey. |
|
1131 |
||
1132 |
(focusView isSameOrComponentOf:self window) ifTrue:[ |
|
1133 |
||
1134 |
((focusView == pathEntryField) not) ifTrue:[ ^ false]. |
|
1135 |
||
1136 |
(key == #Return) ifTrue:[ |
|
1137 |
fileName := pathEntryField list first asFilename. |
|
1138 |
(fileName exists and:[fileName isDirectory not]) ifTrue:[ |
|
4101 | 1139 |
self openApplForFile:fileName |
3957 | 1140 |
]. |
1141 |
]. |
|
1142 |
] |
|
1143 |
]. |
|
1144 |
^ false |
|
1145 |
! ! |
|
1146 |
||
3892 | 1147 |
!FileBrowserV2 methodsFor:'startup & release'! |
1148 |
||
3954 | 1149 |
closeRequest |
1150 |
||
4082 | 1151 |
(self application:#FileApplicationNoteBook do:#tryCloseApplications) not ifTrue:[ |
3954 | 1152 |
^ self |
1153 |
]. |
|
1154 |
^ super closeRequest. |
|
1155 |
! |
|
1156 |
||
3892 | 1157 |
hideFilenameEntryFieldButtonCreated:aButton |
1158 |
||
1159 |
aButton passiveLevel:(MenuPanel defaultLevel). |
|
1160 |
aButton activeLevel:-1. |
|
1161 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
|
1162 |
! |
|
1163 |
||
1164 |
hideToolBarButtonCreated:aButton |
|
1165 |
||
1166 |
aButton passiveLevel:(MenuPanel defaultLevel). |
|
1167 |
aButton activeLevel:-1. |
|
1168 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
|
1169 |
! |
|
1170 |
||
1171 |
initialize |
|
1172 |
||
1173 |
self masterApplication:nil. |
|
4022 | 1174 |
self dirHistory resetForwardBackward. |
3892 | 1175 |
! |
1176 |
||
1177 |
makeDependent |
|
4008 | 1178 |
|
4004 | 1179 |
super makeDependent. |
4085
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1180 |
self sortBlockProperty addDependent:self. |
3892 | 1181 |
self filenameEntryFieldVisibleHolder addDependent:self. |
1182 |
self toolBarVisibleHolder addDependent:self. |
|
1183 |
! |
|
1184 |
||
4018 | 1185 |
postBuildFilterBox:aWidget |
1186 |
||
1187 |
self filterValueBox value:aWidget. |
|
1188 |
self filterBackgroundColor value:aWidget backgroundColor. |
|
1189 |
! |
|
1190 |
||
3892 | 1191 |
postBuildPathField:aWidget |
1192 |
" |
|
1193 |
set the pramters that not can be changed in the window spec |
|
1194 |
" |
|
1195 |
||
3957 | 1196 |
pathEntryField := aWidget. |
3892 | 1197 |
aWidget level:-1. |
1198 |
||
1199 |
"/ sClr := aWidget shadowColor. |
|
1200 |
"/ lClr := aWidget lightColor. |
|
1201 |
"/ sClr := (self builder componentAt:#ToolBar) shadowColor. |
|
1202 |
"/ lClr := (self builder componentAt:#ToolBar) lightColor. |
|
1203 |
||
1204 |
"/ aWidget backgroundColor:(aWidget superView viewBackground). |
|
1205 |
"/ aWidget shadowColor:sClr. |
|
1206 |
! |
|
1207 |
||
1208 |
postBuildPathViewBox:aWidget |
|
1209 |
||
1210 |
aWidget backgroundColor:(MenuPanel defaultBackgroundColor). |
|
1211 |
! |
|
1212 |
||
1213 |
postBuildWith:aBuilder |
|
1214 |
||
1215 |
super postBuildWith:aBuilder. |
|
3980 | 1216 |
self updateToolVisibility. |
3892 | 1217 |
! |
1218 |
||
1219 |
postOpenWith:aBuilder |
|
1220 |
||
4071 | 1221 |
super postOpenWith:aBuilder. |
1222 |
self abstractCurrentFileNameHolderChanged. |
|
1223 |
self currentFileNameHolderChanged. |
|
1224 |
"/ self showDirectoryTreeHolder changed. |
|
1225 |
"/ self sortBlockProperty changed. |
|
4027 | 1226 |
|
3957 | 1227 |
self windowGroup addPreEventHook:self. |
3892 | 1228 |
! |
1229 |
||
1230 |
release |
|
1231 |
||
1232 |
self saveRuntimeAspectValues. |
|
1233 |
^ super release |
|
1234 |
! ! |
|
1235 |
||
1236 |
!FileBrowserV2 class methodsFor:'documentation'! |
|
1237 |
||
1238 |
version |
|
4173 | 1239 |
^ '$Header: /cvs/stx/stx/libtool/FileBrowserV2.st,v 1.38 2002-11-05 09:19:28 penk Exp $' |
3892 | 1240 |
! ! |
1241 |
||
1242 |
FileBrowserV2 initialize! |