author | Claus Gittinger <cg@exept.de> |
Tue, 29 Oct 2002 16:15:55 +0100 | |
changeset 4101 | cc9cdc23b789 |
parent 4094 | aa3dbbfe7ea4 |
child 4105 | c2b7dee530fc |
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' |
3914 | 17 |
classVariableNames:'Icons' |
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. |
|
3907 | 77 |
files := aDirectoryPath isCollection ifTrue:[aDirectoryPath] ifFalse:[(Array with:aDirectoryPath)]. |
78 |
instance currentFileNameHolder value:files. |
|
3892 | 79 |
^ instance |
80 |
||
81 |
"/ | instance builder| |
|
82 |
"/ |
|
83 |
"/ builder := super open. |
|
84 |
"/ instance := builder application. |
|
85 |
"/ instance currentFileNameHolder value:aDirectoryPath. |
|
86 |
"/ ^ instance |
|
87 |
||
88 |
" |
|
89 |
(FileBrowserV2 on:'/usr/local/bin') open |
|
90 |
(FileBrowserV2 on:'/etc' ) open |
|
91 |
(FileBrowserV2 on:'..' ) open |
|
92 |
(FileBrowserV2 on:'.' ) open |
|
93 |
" |
|
94 |
! |
|
95 |
||
96 |
open |
|
97 |
"start a new FileBrowserV2" |
|
98 |
||
99 |
| instance | |
|
100 |
instance := self new. |
|
101 |
instance open. |
|
102 |
^ instance |
|
103 |
" |
|
104 |
FileBrowserV2 openOn:'/etc' withExtent:800@600 |
|
105 |
FileBrowserV2 openOn:'..' withExtent:200@300 |
|
106 |
FileBrowserV2 openOn:'.' withExtent:1024@768 |
|
107 |
" |
|
108 |
! |
|
109 |
||
110 |
openOn:aDirectoryPath |
|
111 |
"start a new FileBrowserV2 in a pathname" |
|
112 |
||
113 |
| instance| |
|
114 |
instance := self on:aDirectoryPath asFilename. |
|
115 |
^ instance open. |
|
116 |
" |
|
117 |
FileBrowserV2 openOn:'/etc' |
|
118 |
FileBrowserV2 openOn:'..' |
|
119 |
FileBrowserV2 openOn:'.' |
|
120 |
" |
|
121 |
! |
|
122 |
||
123 |
openOn:aDirectoryPath withExtent:extent |
|
124 |
"start a new FileBrowserV2 in a pathname" |
|
125 |
||
126 |
| instance builder| |
|
127 |
instance := self on:aDirectoryPath. |
|
128 |
builder := instance open. |
|
129 |
builder window extent:extent. |
|
130 |
^ instance |
|
131 |
" |
|
132 |
FileBrowserV2 openOn:'/etc' withExtent:800@600 |
|
133 |
FileBrowserV2 openOn:'..' withExtent:200@300 |
|
134 |
FileBrowserV2 openOn:'.' withExtent:1024@768 |
|
135 |
" |
|
136 |
! |
|
137 |
||
138 |
openWithAspects:someAspects withExtent:extent |
|
139 |
"start a new FileBrowserV2 in a pathname" |
|
140 |
||
141 |
|dir clone| |
|
142 |
||
143 |
dir := someAspects at:#currentFileNameHolder ifAbsent:nil. |
|
144 |
clone := self openOn:(dir value) withExtent:extent. |
|
145 |
||
146 |
" |
|
147 |
FileBrowserV2 openOn:'/etc' withExtent:800@600 |
|
148 |
FileBrowserV2 openOn:'..' withExtent:200@300 |
|
149 |
FileBrowserV2 openOn:'.' withExtent:1024@768 |
|
150 |
" |
|
151 |
! ! |
|
152 |
||
153 |
!FileBrowserV2 class methodsFor:'class initialization'! |
|
154 |
||
4027 | 155 |
applicationIcon |
156 |
^ NewLauncher startNewFileBrowserIcon |
|
157 |
! |
|
158 |
||
3892 | 159 |
clearHistoryIcon |
160 |
^ Icon deleteIcon |
|
161 |
! |
|
162 |
||
163 |
initialize |
|
164 |
||
165 |
self installInLauncher. |
|
166 |
! |
|
167 |
||
168 |
initializeDefaultCommands |
|
169 |
DefaultCommandPerMIME := Dictionary new. |
|
170 |
||
171 |
DefaultCommandPerMIME at:'application/x-tar-compressed' put:'gunzip < %1 | tar tvf -'. |
|
172 |
DefaultCommandPerMIME at:'application/pdf' put:'acroread %1'. |
|
173 |
||
174 |
" |
|
175 |
self initializeDefaultCommands |
|
176 |
" |
|
177 |
! |
|
178 |
||
179 |
installInLauncher |
|
180 |
"add myself to the launcher menu and toolBar" |
|
181 |
||
3914 | 182 |
|menuItem icon action currentLauncher| |
3892 | 183 |
|
184 |
FileBrowserV2 isNil ifTrue:[^ self]. |
|
185 |
||
186 |
action := [FileBrowserV2 open]. |
|
187 |
||
4027 | 188 |
icon := self applicationIcon. "/ self defaultIcon magnifiedTo:28@28. |
3892 | 189 |
|
190 |
menuItem := MenuItem new |
|
4037 | 191 |
translateLabel: true; |
3892 | 192 |
value: action; |
193 |
isButton: false; |
|
4037 | 194 |
label:'File Browser V2' icon:icon; |
3892 | 195 |
nameKey: #fileBrowserV2; |
196 |
activeHelpKey: #fileBrowserV2; |
|
197 |
submenuChannel: #menuFileHistory; |
|
198 |
showBusyCursorWhilePerforming:true. |
|
199 |
||
200 |
NewLauncher addMenuItem:menuItem in:'menu.file' position:#( #before #fileBrowser) space:true. |
|
201 |
||
202 |
menuItem := MenuItem new |
|
4037 | 203 |
translateLabel: true; |
3892 | 204 |
value: action; |
205 |
isButton: true; |
|
4037 | 206 |
"label:'File Browser V2'" icon:icon; |
3892 | 207 |
nameKey: #fileBrowserV2; |
208 |
activeHelpKey: #fileBrowserV2; |
|
209 |
submenuChannel: #menuFileHistory; |
|
210 |
showBusyCursorWhilePerforming:true. |
|
211 |
||
212 |
NewLauncher addMenuItem:menuItem in:'toolbar' position:#( #before #fileBrowser) space:false. |
|
213 |
||
3918 | 214 |
currentLauncher := NewLauncher current. |
3914 | 215 |
currentLauncher notNil ifTrue:[ |
216 |
currentLauncher fileBrowserItemVisible value:false |
|
217 |
]. |
|
3908 | 218 |
|
3892 | 219 |
" |
220 |
self installInLauncher |
|
221 |
self removeFromLauncher |
|
222 |
" |
|
223 |
! |
|
224 |
||
225 |
removeFromLauncher |
|
226 |
"/ |
|
227 |
"/ remove myself from the launcher menu |
|
228 |
"/ |
|
229 |
||
3914 | 230 |
|currentLauncher| |
231 |
||
3892 | 232 |
NewLauncher isNil ifTrue:[^ self]. |
3908 | 233 |
NewLauncher removeUserTool:#fileBrowserV2. |
3918 | 234 |
currentLauncher := NewLauncher current. |
3914 | 235 |
currentLauncher notNil ifTrue:[ |
236 |
currentLauncher fileBrowserItemVisible value:false |
|
237 |
]. |
|
3892 | 238 |
|
239 |
" |
|
240 |
self removeFromLauncher |
|
241 |
" |
|
242 |
! ! |
|
243 |
||
244 |
!FileBrowserV2 class methodsFor:'defaults'! |
|
245 |
||
246 |
entryFieldEndStringForMultipleSelection |
|
247 |
||
248 |
^ ('[*]') |
|
249 |
! ! |
|
250 |
||
251 |
!FileBrowserV2 class methodsFor:'help specs'! |
|
252 |
||
253 |
flyByHelpSpec |
|
254 |
<resource: #help> |
|
255 |
||
256 |
|spec| |
|
257 |
||
258 |
spec := super flyByHelpSpec addPairsFrom:#( |
|
259 |
||
260 |
#addTerminal |
|
261 |
'Shell Terminal' |
|
262 |
||
263 |
#searchFile |
|
264 |
'Search a File' |
|
265 |
||
266 |
#directoryUp |
|
4060 | 267 |
'Directory Up' |
3892 | 268 |
|
269 |
#directoryBack |
|
4060 | 270 |
'Directory Back' |
3892 | 271 |
|
272 |
#copyFile |
|
4060 | 273 |
'Copy File' |
3892 | 274 |
|
275 |
#cutFile |
|
4060 | 276 |
'Cut File' |
3892 | 277 |
|
278 |
#fileHome |
|
4060 | 279 |
'Home Directory' |
3892 | 280 |
|
281 |
#pasteFile |
|
282 |
'PasteFile' |
|
283 |
||
284 |
#deleteFile |
|
4060 | 285 |
'Delete File' |
3892 | 286 |
|
287 |
#fileIn |
|
4060 | 288 |
'File In' |
3892 | 289 |
|
290 |
#directoryForward |
|
4060 | 291 |
'Directory Forward' |
3892 | 292 |
|
293 |
#directoryHistory |
|
294 |
'Directory' |
|
295 |
||
296 |
#fileHistory |
|
4060 | 297 |
'File History' |
3892 | 298 |
|
299 |
#hideToolBar |
|
300 |
'Hide Toolbar' |
|
301 |
||
302 |
#hideFilenameEntryField |
|
303 |
'Hide Filename Field' |
|
304 |
||
3980 | 305 |
#showFileDetails |
306 |
'Show File Details' |
|
307 |
||
308 |
#hideFileDetails |
|
309 |
'Hide File Details' |
|
310 |
||
311 |
#toggleDetails |
|
312 |
'Show/Hide File Details' |
|
313 |
||
3892 | 314 |
). |
315 |
||
316 |
^ spec. |
|
3980 | 317 |
! |
318 |
||
319 |
helpSpec |
|
320 |
"This resource specification was automatically generated |
|
321 |
by the UIHelpTool of ST/X." |
|
322 |
||
323 |
"Do not manually edit this!! If it is corrupted, |
|
324 |
the UIHelpTool may not be able to read the specification." |
|
325 |
||
326 |
" |
|
327 |
UIHelpTool openOnClass:FileBrowserV2 |
|
328 |
" |
|
329 |
||
330 |
<resource: #help> |
|
331 |
||
332 |
^super helpSpec addPairsFrom:#( |
|
333 |
||
334 |
||
335 |
) |
|
3892 | 336 |
! ! |
337 |
||
338 |
!FileBrowserV2 class methodsFor:'icon'! |
|
339 |
||
340 |
defaultIcon |
|
341 |
"This resource specification was automatically generated |
|
342 |
by the ImageEditor of ST/X." |
|
343 |
||
344 |
"Do not manually edit this!! If it is corrupted, |
|
345 |
the ImageEditor may not be able to read the specification." |
|
346 |
||
347 |
" |
|
348 |
self defaultIcon inspect |
|
349 |
ImageEditor openOnClass:self andSelector:#defaultIcon |
|
350 |
" |
|
351 |
||
352 |
<resource: #image> |
|
353 |
||
354 |
^Icon |
|
355 |
constantNamed:#'FileBrowserV2 class defaultIcon' |
|
356 |
ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
357 |
@@@@@@@@@@@@@@@@@@@@CLA&Y&Y&Y&X@@ADP@@@L0F@@@@@@A @ADAD@@@3@XN;.;.8F@ADPDQ@@CLA ;.@@@@@@D@@@D@@L0FC.8O[6=/@QDADP@@3@X@; |
|
358 |
[6=/[0DPDP@@CLA DNC6<@@F<ADP@@@L0F@A@F= [0= @@@@@@3@X@@P=/[6=/@@@@@@CLA @@A/[6=/X@@@@@@L0FC0@O[6=/[0@@@@@@3@XF<@@@@@@@@@ |
|
359 |
@@@@CLA = @@@@@@@@@@@@@L0FA/[6=/A @@@@@@@@3@XO[6=/XF@@@@@@@@CLA @@@@@@X@@@@@@@@L0FY&Y&Y&Y @@@@@@@@C@Y&Y&Y&Y&@@@@@@@@@@@@ |
|
360 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@N@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
361 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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:' |
|
362 |
O??# C??9<@??>? O???<C????@????0O???8C???<@???>@O??<@C???@@???0@O??<@C??8@@??>@@O?? @C??8@@??>@@G?? @@??8@@@@@@@G.P=0AAD |
|
363 |
HP@PQBD@GDP8 AADHD@PQBA@DN^=0@@a') ; yourself); yourself] |
|
364 |
! |
|
365 |
||
366 |
hideFilenameEntryFieldIcon |
|
367 |
<resource: #programImage> |
|
368 |
||
369 |
^ ToolbarIconLibrary hideToolbarIconH14 |
|
370 |
! |
|
371 |
||
372 |
hideToolBarIcon |
|
373 |
<resource: #programImage> |
|
374 |
||
375 |
^ ToolbarIconLibrary hideToolbarIconH26 |
|
376 |
! ! |
|
377 |
||
3980 | 378 |
!FileBrowserV2 class methodsFor:'image specs'! |
379 |
||
380 |
viewDetailsIcon |
|
381 |
"This resource specification was automatically generated |
|
382 |
by the ImageEditor of ST/X." |
|
383 |
||
384 |
"Do not manually edit this!! If it is corrupted, |
|
385 |
the ImageEditor may not be able to read the specification." |
|
386 |
||
387 |
" |
|
388 |
self viewDetailsIcon inspect |
|
389 |
ImageEditor openOnClass:self andSelector:#viewDetailsIcon |
|
390 |
Icon flushCachedIcons |
|
391 |
" |
|
392 |
||
393 |
<resource: #image> |
|
394 |
||
395 |
^Icon |
|
396 |
constantNamed:#'FileBrowserV2 class viewDetailsIcon' |
|
397 |
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] |
|
398 |
! |
|
399 |
||
400 |
viewNoDetailsIcon |
|
401 |
"This resource specification was automatically generated |
|
402 |
by the ImageEditor of ST/X." |
|
403 |
||
404 |
"Do not manually edit this!! If it is corrupted, |
|
405 |
the ImageEditor may not be able to read the specification." |
|
406 |
||
407 |
" |
|
408 |
self viewNoDetailsIcon inspect |
|
409 |
ImageEditor openOnClass:self andSelector:#viewNoDetailsIcon |
|
410 |
Icon flushCachedIcons |
|
411 |
" |
|
412 |
||
413 |
<resource: #image> |
|
414 |
||
415 |
^Icon |
|
416 |
constantNamed:#'FileBrowserV2 class viewNoDetailsIcon' |
|
417 |
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] |
|
418 |
! ! |
|
419 |
||
3892 | 420 |
!FileBrowserV2 class methodsFor:'interface specs'! |
421 |
||
422 |
windowSpec |
|
423 |
"This resource specification was automatically generated |
|
424 |
by the UIPainter of ST/X." |
|
425 |
||
426 |
"Do not manually edit this!! If it is corrupted, |
|
427 |
the UIPainter may not be able to read the specification." |
|
428 |
||
429 |
" |
|
430 |
UIPainter new openOnClass:FileBrowserV2 andSelector:#windowSpec |
|
431 |
FileBrowserV2 new openInterface:#windowSpec |
|
432 |
FileBrowserV2 open |
|
433 |
" |
|
434 |
||
435 |
<resource: #canvas> |
|
436 |
||
437 |
^ |
|
438 |
#(#FullSpec |
|
439 |
#name: #windowSpec |
|
440 |
#window: |
|
441 |
#(#WindowSpec |
|
442 |
#label: #FileBrowser |
|
443 |
#name: #FileBrowser |
|
444 |
#min: #(#Point 10 10) |
|
4027 | 445 |
#bounds: #(#Rectangle 216 173 1016 773) |
3892 | 446 |
#menu: #mainMenu |
4027 | 447 |
#icon: #applicationIcon |
3892 | 448 |
) |
449 |
#component: |
|
450 |
#(#SpecCollection |
|
451 |
#collection: #( |
|
452 |
#(#ViewSpec |
|
453 |
#name: 'ToolbarBox' |
|
454 |
#layout: #(#LayoutFrame 0 0 0 0 0 1 30 0) |
|
455 |
#level: 0 |
|
456 |
#visibilityChannel: #toolBarVisibleHolder |
|
457 |
#component: |
|
458 |
#(#SpecCollection |
|
459 |
#collection: #( |
|
460 |
#(#ActionButtonSpec |
|
461 |
#label: 'hideToolBarIcon' |
|
462 |
#name: 'HideToolBarButton' |
|
463 |
#layout: #(#LayoutFrame 0 0 0 0 13 0 30 0) |
|
464 |
#activeHelpKey: #hideToolBar |
|
465 |
#hasCharacterOrientedLabel: false |
|
466 |
#translateLabel: true |
|
467 |
#model: #hideToolbar |
|
468 |
#postBuildCallback: #hideToolBarButtonCreated: |
|
469 |
) |
|
470 |
#(#MenuPanelSpec |
|
471 |
#name: 'ToolBar' |
|
472 |
#layout: #(#LayoutFrame 13 0 0 0 0 1 30 0) |
|
473 |
#menu: #toolBarMainMenu |
|
474 |
#textDefault: true |
|
475 |
) |
|
476 |
) |
|
477 |
||
478 |
) |
|
479 |
) |
|
480 |
#(#ViewSpec |
|
481 |
#name: 'FilenameEntryFieldBox' |
|
482 |
#layout: #(#LayoutFrame 0 0 30 0 0 1 55 0) |
|
483 |
#level: 0 |
|
484 |
#visibilityChannel: #filenameEntryFieldVisibleHolder |
|
485 |
#component: |
|
486 |
#(#SpecCollection |
|
487 |
#collection: #( |
|
488 |
#(#ActionButtonSpec |
|
489 |
#label: 'hideFilenameEntryFieldIcon' |
|
490 |
#name: 'HideFilenameEntryFieldButton' |
|
491 |
#layout: #(#LayoutFrame 0 0 0 0 13 0 0 1) |
|
492 |
#activeHelpKey: #hideFilenameEntryField |
|
493 |
#hasCharacterOrientedLabel: false |
|
494 |
#translateLabel: true |
|
495 |
#model: #hideFilenameEntryField |
|
496 |
#postBuildCallback: #hideFilenameEntryFieldButtonCreated: |
|
497 |
) |
|
498 |
#(#ViewSpec |
|
499 |
#name: 'Box1' |
|
500 |
#layout: #(#LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0) |
|
501 |
#level: 1 |
|
502 |
#component: |
|
503 |
#(#SpecCollection |
|
504 |
#collection: #( |
|
505 |
#(#VariableHorizontalPanelSpec |
|
506 |
#name: 'VariableHorizontalPanel1' |
|
507 |
#layout: #(#LayoutFrame 1 0.0 1 0.0 -1 1.0 -1 1.0) |
|
508 |
#level: 0 |
|
509 |
#showHandle: true |
|
510 |
#component: |
|
511 |
#(#SpecCollection |
|
512 |
#collection: #( |
|
513 |
#(#FilenameInputFieldSpec |
|
514 |
#name: 'FilenameEntryField' |
|
515 |
#level: 1 |
|
516 |
#model: #fileEntryFieldHolder |
|
517 |
#acceptOnPointerLeave: false |
|
518 |
#postBuildCallback: #postBuildPathField: |
|
519 |
) |
|
520 |
#(#ViewSpec |
|
521 |
#name: 'FilterBox' |
|
522 |
#component: |
|
523 |
#(#SpecCollection |
|
524 |
#collection: #( |
|
525 |
#(#LabelSpec |
|
526 |
#label: 'Filter:' |
|
527 |
#name: 'Filter' |
|
528 |
#layout: #(#LayoutFrame 0 0 0 0 40 0 0 1) |
|
529 |
#translateLabel: true |
|
530 |
#adjust: #left |
|
531 |
#postBuildCallback: #postBuildPathViewBox: |
|
532 |
) |
|
533 |
#(#ComboBoxSpec |
|
534 |
#name: 'FilterSelectionBox' |
|
535 |
#layout: #(#LayoutFrame 40 0 0 0 0 1 0 1) |
|
536 |
#model: #filterModel |
|
537 |
#immediateAccept: true |
|
538 |
#acceptOnPointerLeave: false |
|
539 |
#comboList: #filterListModel |
|
540 |
) |
|
541 |
) |
|
542 |
||
543 |
) |
|
544 |
#postBuildCallback: #postBuildPathViewBox: |
|
545 |
) |
|
546 |
) |
|
547 |
||
548 |
) |
|
549 |
#handles: #(#Any 0.8 1.0) |
|
550 |
#postBuildCallback: #postBuildPathViewBox: |
|
551 |
) |
|
552 |
) |
|
553 |
||
554 |
) |
|
555 |
#postBuildCallback: #postBuildPathViewBox: |
|
556 |
) |
|
557 |
) |
|
558 |
||
559 |
) |
|
560 |
) |
|
561 |
#(#ViewSpec |
|
562 |
#name: 'BrowserBox' |
|
563 |
#layout: #(#LayoutFrame 0 0.0 55 0 0 1.0 -20 1) |
|
564 |
#level: 0 |
|
565 |
#component: |
|
566 |
#(#SpecCollection |
|
567 |
#collection: #( |
|
568 |
#(#'FileBrowserV2UISpecifications::PanelSpec' |
|
569 |
#name: 'VerticalPanel' |
|
570 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
571 |
#level: 0 |
|
572 |
#whichView: #last |
|
573 |
#orientation: #vertical |
|
574 |
#visibility: #viewNoteBookApplicationHolder |
|
575 |
#component: |
|
576 |
#(#SpecCollection |
|
577 |
#collection: #( |
|
578 |
#(#'FileBrowserV2UISpecifications::PanelSpec' |
|
579 |
#name: 'HorizontalPanel' |
|
580 |
#level: 0 |
|
581 |
#whichView: #first |
|
582 |
#orientation: #horizontal |
|
583 |
#visibility: #showDirectoryTreeHolder |
|
584 |
#component: |
|
585 |
#(#SpecCollection |
|
586 |
#collection: #( |
|
587 |
#(#SubCanvasSpec |
|
588 |
#name: 'DirectoryTreeBrowser' |
|
589 |
#hasHorizontalScrollBar: false |
|
590 |
#hasVerticalScrollBar: false |
|
591 |
#majorKey: #DirectoryTreeBrowser |
|
592 |
#createNewApplication: true |
|
593 |
#createNewBuilder: true |
|
594 |
) |
|
595 |
#(#SubCanvasSpec |
|
596 |
#name: 'DirectoryContentsBrowser' |
|
597 |
#hasHorizontalScrollBar: false |
|
598 |
#hasVerticalScrollBar: false |
|
599 |
#majorKey: #DirectoryContentsBrowser |
|
600 |
#createNewApplication: true |
|
601 |
#createNewBuilder: true |
|
602 |
) |
|
603 |
) |
|
604 |
||
605 |
) |
|
606 |
#handles: #(#Any 0.229621 1.0) |
|
607 |
) |
|
608 |
#(#SubCanvasSpec |
|
609 |
#name: 'FileApplicationNoteBook' |
|
4018 | 610 |
#tabable: false |
3892 | 611 |
#hasHorizontalScrollBar: false |
612 |
#hasVerticalScrollBar: false |
|
613 |
#majorKey: #FileApplicationNoteBook |
|
614 |
#createNewApplication: true |
|
615 |
#createNewBuilder: true |
|
616 |
) |
|
617 |
) |
|
618 |
||
619 |
) |
|
620 |
#handles: #(#Any 0.5 1.0) |
|
621 |
) |
|
622 |
) |
|
623 |
||
624 |
) |
|
625 |
) |
|
626 |
#(#ViewSpec |
|
627 |
#name: 'Box2' |
|
628 |
#layout: #(#LayoutFrame 0 0 -20 1 0 1 0 1) |
|
629 |
#level: 0 |
|
630 |
#component: |
|
631 |
#(#SpecCollection |
|
632 |
#collection: #( |
|
633 |
#(#LabelSpec |
|
634 |
#label: 'NotifyLabel' |
|
635 |
#name: 'NotifyLabel' |
|
4018 | 636 |
#layout: #(#LayoutFrame 1 0.0 1 0.0 -50 1 1 1.0) |
3892 | 637 |
#level: -1 |
638 |
#translateLabel: true |
|
639 |
#labelChannel: #notifyChannel |
|
640 |
#adjust: #left |
|
641 |
) |
|
4018 | 642 |
#(#LabelSpec |
643 |
#label: 'Shown Files' |
|
644 |
#name: 'Label1' |
|
645 |
#layout: #(#LayoutFrame -50 1 1 0.0 1 1 1 1.0) |
|
646 |
#level: -1 |
|
647 |
#translateLabel: true |
|
648 |
#labelChannel: #shownFiles |
|
649 |
#adjust: #left |
|
650 |
#postBuildCallback: #postBuildFilterBox: |
|
651 |
) |
|
3892 | 652 |
) |
653 |
||
654 |
) |
|
655 |
) |
|
656 |
) |
|
657 |
||
658 |
) |
|
659 |
) |
|
660 |
! ! |
|
661 |
||
662 |
!FileBrowserV2 class methodsFor:'menu specs'! |
|
663 |
||
664 |
browserMenu |
|
665 |
"This resource specification was automatically generated |
|
666 |
by the MenuEditor of ST/X." |
|
667 |
||
668 |
"Do not manually edit this!! If it is corrupted, |
|
669 |
the MenuEditor may not be able to read the specification." |
|
670 |
||
671 |
" |
|
672 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#browserMenu |
|
673 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 browserMenu)) startUp |
|
674 |
" |
|
675 |
||
676 |
<resource: #menu> |
|
677 |
||
678 |
^ |
|
679 |
#(#Menu |
|
680 |
#( |
|
681 |
#(#MenuItem |
|
682 |
#label: 'Spawn' |
|
4060 | 683 |
#itemValue: #doSpawn |
3892 | 684 |
#translateLabel: true |
685 |
) |
|
686 |
#(#MenuItem |
|
687 |
#label: 'Save Settings' |
|
4060 | 688 |
#itemValue: #saveSettingsAspectValues |
3892 | 689 |
#translateLabel: true |
690 |
) |
|
691 |
#(#MenuItem |
|
692 |
#label: '-' |
|
693 |
) |
|
694 |
#(#MenuItem |
|
4041 | 695 |
#label: 'Search Files' |
4060 | 696 |
#itemValue: #doOpenSearchFile |
3892 | 697 |
#translateLabel: true |
698 |
) |
|
699 |
#(#MenuItem |
|
4060 | 700 |
#label: 'Shell Terminal' |
701 |
#itemValue: #doAddTerminal |
|
3892 | 702 |
#translateLabel: true |
703 |
) |
|
704 |
#(#MenuItem |
|
705 |
#label: '-' |
|
706 |
) |
|
707 |
#(#MenuItem |
|
708 |
#label: 'Exit' |
|
4060 | 709 |
#itemValue: #closeRequest |
3892 | 710 |
#translateLabel: true |
711 |
) |
|
712 |
) |
|
713 |
nil |
|
714 |
nil |
|
715 |
) |
|
716 |
! |
|
717 |
||
718 |
mainMenu |
|
719 |
"This resource specification was automatically generated |
|
720 |
by the MenuEditor of ST/X." |
|
721 |
||
722 |
"Do not manually edit this!! If it is corrupted, |
|
723 |
the MenuEditor may not be able to read the specification." |
|
724 |
||
725 |
" |
|
726 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#mainMenu |
|
727 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 mainMenu)) startUp |
|
728 |
" |
|
729 |
||
730 |
<resource: #menu> |
|
731 |
||
732 |
^ |
|
733 |
#(#Menu |
|
734 |
#( |
|
735 |
#(#MenuItem |
|
736 |
#label: 'Browser' |
|
737 |
#translateLabel: true |
|
738 |
#submenuChannel: #browserMenu |
|
739 |
) |
|
740 |
#(#MenuItem |
|
741 |
#label: 'Directory' |
|
742 |
#translateLabel: true |
|
743 |
#submenuChannel: #directoryMenu |
|
744 |
) |
|
745 |
#(#MenuItem |
|
746 |
#label: 'File' |
|
747 |
#translateLabel: true |
|
748 |
#submenuChannel: #fileMenu |
|
749 |
) |
|
750 |
#(#MenuItem |
|
751 |
#label: 'Edit' |
|
752 |
#translateLabel: true |
|
753 |
#submenuChannel: #editMenu |
|
754 |
) |
|
755 |
#(#MenuItem |
|
756 |
#label: 'View' |
|
757 |
#translateLabel: true |
|
758 |
#submenu: |
|
759 |
#(#Menu |
|
760 |
#( |
|
761 |
#(#MenuItem |
|
3980 | 762 |
#label: 'Show' |
3892 | 763 |
#translateLabel: true |
3980 | 764 |
#submenu: |
765 |
#(#Menu |
|
766 |
#( |
|
767 |
#(#MenuItem |
|
768 |
#label: 'Hidden Files' |
|
769 |
#translateLabel: true |
|
770 |
#indication: #showHiddenFiles |
|
771 |
) |
|
772 |
#(#MenuItem |
|
773 |
#label: '-' |
|
774 |
) |
|
775 |
#(#MenuItem |
|
776 |
#label: 'Directory Tree' |
|
777 |
#translateLabel: true |
|
778 |
#indication: #showDirectoryTreeHolder |
|
779 |
) |
|
780 |
#(#MenuItem |
|
781 |
#label: 'Directory Description' |
|
782 |
#translateLabel: true |
|
783 |
#indication: #viewDirectoryDescription |
|
784 |
) |
|
785 |
#(#MenuItem |
|
786 |
#label: 'Regular Files in TreeView (Left)' |
|
787 |
#translateLabel: true |
|
788 |
#indication: #viewFilesInDirectoryTree |
|
789 |
) |
|
790 |
#(#MenuItem |
|
791 |
#label: 'Directories in ContentsView (Right)' |
|
792 |
#translateLabel: true |
|
793 |
#indication: #viewDirectoriesInDirectoryContentsBrowser |
|
794 |
) |
|
795 |
#(#MenuItem |
|
4080 | 796 |
#enabled: #enableViewNoteBookApplication |
3980 | 797 |
#label: 'File Applications' |
798 |
#translateLabel: true |
|
799 |
#indication: #viewNoteBookApplicationHolder |
|
800 |
) |
|
801 |
#(#MenuItem |
|
802 |
#label: '-' |
|
803 |
) |
|
804 |
#(#MenuItem |
|
805 |
#label: 'Open Multiple Applications' |
|
806 |
#translateLabel: true |
|
807 |
#indication: #openMultipleApplicationsForType |
|
808 |
) |
|
809 |
) |
|
810 |
nil |
|
811 |
nil |
|
812 |
) |
|
3892 | 813 |
) |
814 |
#(#MenuItem |
|
3980 | 815 |
#label: 'Sort' |
3892 | 816 |
#translateLabel: true |
817 |
#submenuChannel: #sortMenu |
|
818 |
) |
|
819 |
#(#MenuItem |
|
3980 | 820 |
#label: 'Details' |
3892 | 821 |
#translateLabel: true |
3980 | 822 |
#submenuChannel: #viewInContentsBrowserMenu |
3892 | 823 |
) |
824 |
#(#MenuItem |
|
825 |
#label: '-' |
|
826 |
) |
|
827 |
#(#MenuItem |
|
828 |
#label: 'Toolbar' |
|
829 |
#translateLabel: true |
|
830 |
#hideMenuOnActivated: false |
|
831 |
#indication: #toolBarVisibleHolder |
|
832 |
) |
|
833 |
#(#MenuItem |
|
4084 | 834 |
#label: 'Path Entry && Filter' |
3892 | 835 |
#translateLabel: true |
836 |
#hideMenuOnActivated: false |
|
837 |
#indication: #filenameEntryFieldVisibleHolder |
|
838 |
) |
|
839 |
#(#MenuItem |
|
840 |
#label: '-' |
|
841 |
) |
|
842 |
#(#MenuItem |
|
843 |
#label: 'Update' |
|
844 |
#translateLabel: true |
|
845 |
) |
|
846 |
) |
|
847 |
nil |
|
848 |
nil |
|
849 |
) |
|
850 |
) |
|
851 |
#(#MenuItem |
|
852 |
#label: 'Tools' |
|
853 |
#translateLabel: true |
|
854 |
#submenuChannel: #toolsMenuSpec |
|
855 |
) |
|
856 |
#(#MenuItem |
|
857 |
#label: 'CVS' |
|
858 |
#translateLabel: true |
|
859 |
#submenu: |
|
860 |
#(#Menu |
|
861 |
#( |
|
862 |
#(#MenuItem |
|
4080 | 863 |
#enabled: #hasSelection |
3892 | 864 |
#label: 'Update selected Files/Directories' |
4080 | 865 |
#itemValue: #cvsUpdateSelection |
3892 | 866 |
#translateLabel: true |
867 |
) |
|
868 |
#(#MenuItem |
|
869 |
#label: 'Update Directory Local' |
|
4080 | 870 |
#itemValue: #cvsUpdateAll |
3892 | 871 |
#translateLabel: true |
872 |
) |
|
873 |
#(#MenuItem |
|
874 |
#label: 'Update Directory Recursive' |
|
4080 | 875 |
#itemValue: #cvsUpdateAllRecursive |
3892 | 876 |
#translateLabel: true |
877 |
) |
|
878 |
#(#MenuItem |
|
879 |
#label: '-' |
|
880 |
) |
|
881 |
#(#MenuItem |
|
882 |
#label: 'Commit...' |
|
4080 | 883 |
#itemValue: #cvsCommit |
3892 | 884 |
#translateLabel: true |
885 |
) |
|
886 |
#(#MenuItem |
|
4080 | 887 |
#enabled: #canCvsAddAndCommit |
3892 | 888 |
#label: 'Add && Commit...' |
4080 | 889 |
#itemValue: #cvsAddAndCommit |
3892 | 890 |
#translateLabel: true |
891 |
) |
|
892 |
#(#MenuItem |
|
893 |
#label: '-' |
|
894 |
) |
|
895 |
#(#MenuItem |
|
4080 | 896 |
#enabled: #canRemoveCVSContainer |
3892 | 897 |
#label: 'Remove File && CVS Container...' |
4080 | 898 |
#itemValue: #cvsRemoveFileAndCVSContainer |
3892 | 899 |
#translateLabel: true |
900 |
) |
|
901 |
) |
|
902 |
nil |
|
903 |
nil |
|
904 |
) |
|
905 |
) |
|
906 |
#(#MenuItem |
|
907 |
#label: 'Help' |
|
908 |
#translateLabel: true |
|
909 |
#startGroup: #right |
|
910 |
#submenu: |
|
911 |
#(#Menu |
|
912 |
#( |
|
913 |
#(#MenuItem |
|
914 |
#label: 'FileBrowser Documentation' |
|
915 |
#translateLabel: true |
|
916 |
) |
|
917 |
#(#MenuItem |
|
918 |
#label: '-' |
|
919 |
) |
|
920 |
#(#MenuItem |
|
921 |
#label: 'About FileBrowser...' |
|
922 |
#translateLabel: true |
|
923 |
) |
|
924 |
) |
|
925 |
nil |
|
926 |
nil |
|
927 |
) |
|
928 |
) |
|
929 |
) |
|
930 |
nil |
|
931 |
nil |
|
932 |
) |
|
933 |
! |
|
934 |
||
935 |
toolBarMainMenu |
|
936 |
"This resource specification was automatically generated |
|
937 |
by the MenuEditor of ST/X." |
|
938 |
||
939 |
"Do not manually edit this!! If it is corrupted, |
|
940 |
the MenuEditor may not be able to read the specification." |
|
941 |
||
942 |
" |
|
943 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#toolBarMainMenu |
|
944 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 toolBarMainMenu)) startUp |
|
945 |
" |
|
946 |
||
947 |
<resource: #menu> |
|
948 |
||
949 |
^ |
|
950 |
#(#Menu |
|
951 |
#( |
|
952 |
#(#MenuItem |
|
4084 | 953 |
#activeHelpKey: #directoryUp |
954 |
#enabled: #enableDirectoryUp |
|
3892 | 955 |
#label: 'DirectoryUp' |
4084 | 956 |
#itemValue: #doGoDirectoryUp |
3892 | 957 |
#translateLabel: true |
958 |
#isButton: true |
|
4094 | 959 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #upArrowIcon) |
3892 | 960 |
) |
961 |
#(#MenuItem |
|
962 |
#label: '' |
|
963 |
) |
|
964 |
#(#MenuItem |
|
4084 | 965 |
#activeHelpKey: #directoryBack |
966 |
#enabled: #enableBack |
|
3892 | 967 |
#label: 'Back' |
4084 | 968 |
#itemValue: #doBack |
3892 | 969 |
#translateLabel: true |
970 |
#isButton: true |
|
4084 | 971 |
#submenuChannel: #menuDirHistoryBack |
4094 | 972 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #leftArrowIcon) |
3892 | 973 |
) |
974 |
#(#MenuItem |
|
975 |
#label: '' |
|
976 |
) |
|
977 |
#(#MenuItem |
|
4084 | 978 |
#activeHelpKey: #directoryForward |
979 |
#enabled: #enableForward |
|
3892 | 980 |
#label: 'Forward' |
4084 | 981 |
#itemValue: #doForward |
3892 | 982 |
#translateLabel: true |
983 |
#isButton: true |
|
4084 | 984 |
#submenuChannel: #menuDirHistoryForward |
4094 | 985 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #rightArrowIcon) |
3892 | 986 |
) |
987 |
#(#MenuItem |
|
988 |
#label: '' |
|
989 |
) |
|
990 |
#(#MenuItem |
|
4084 | 991 |
#activeHelpKey: #fileHome |
992 |
#enabled: #enableHome |
|
3892 | 993 |
#label: 'Home' |
4084 | 994 |
#itemValue: #doGotoHomeDirectory |
3892 | 995 |
#translateLabel: true |
996 |
#isButton: true |
|
4084 | 997 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #goHomeIcon) |
3892 | 998 |
) |
999 |
#(#MenuItem |
|
1000 |
#label: '' |
|
1001 |
) |
|
1002 |
#(#MenuItem |
|
4084 | 1003 |
#activeHelpKey: #fileHistory |
1004 |
#enabled: #enableFileHistory |
|
3892 | 1005 |
#label: 'File History' |
1006 |
#translateLabel: true |
|
1007 |
#isButton: true |
|
4084 | 1008 |
#submenuChannel: #menuFileHistory |
4094 | 1009 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #historyIcon) |
3892 | 1010 |
) |
1011 |
#(#MenuItem |
|
1012 |
#label: '' |
|
1013 |
) |
|
1014 |
#(#MenuItem |
|
4084 | 1015 |
#activeHelpKey: #copyFile |
1016 |
#enabled: #hasSelection |
|
3892 | 1017 |
#label: 'Copy' |
4084 | 1018 |
#itemValue: #copyInDirContentsBrowser |
3892 | 1019 |
#translateLabel: true |
1020 |
#isButton: true |
|
4094 | 1021 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #copyIcon) |
3892 | 1022 |
) |
1023 |
#(#MenuItem |
|
4084 | 1024 |
#activeHelpKey: #cutFile |
1025 |
#enabled: #hasSelection |
|
3892 | 1026 |
#label: 'Cut' |
4084 | 1027 |
#itemValue: #cutInDirContentsBrowser |
3892 | 1028 |
#translateLabel: true |
1029 |
#isButton: true |
|
4094 | 1030 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #cutIcon) |
3892 | 1031 |
) |
1032 |
#(#MenuItem |
|
4084 | 1033 |
#activeHelpKey: #pasteFile |
1034 |
#enabled: #canPaste |
|
3892 | 1035 |
#label: 'Paste' |
4084 | 1036 |
#itemValue: #pasteFiles |
3892 | 1037 |
#translateLabel: true |
1038 |
#isButton: true |
|
4094 | 1039 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #pasteIcon) |
3892 | 1040 |
) |
1041 |
#(#MenuItem |
|
4084 | 1042 |
#activeHelpKey: #deleteFile |
1043 |
#enabled: #hasSelection |
|
3892 | 1044 |
#label: 'Delete' |
4084 | 1045 |
#itemValue: #deleteInDirContentsBrowser |
3892 | 1046 |
#translateLabel: true |
1047 |
#isButton: true |
|
4094 | 1048 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #deleteIcon) |
3892 | 1049 |
) |
1050 |
#(#MenuItem |
|
1051 |
#label: '' |
|
1052 |
) |
|
1053 |
#(#MenuItem |
|
4084 | 1054 |
#activeHelpKey: #fileIn |
1055 |
#enabled: #hasSelection |
|
3892 | 1056 |
#label: 'File In' |
4084 | 1057 |
#itemValue: #fileFileIn |
3892 | 1058 |
#translateLabel: true |
1059 |
#isButton: true |
|
4094 | 1060 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #fileInIcon) |
3892 | 1061 |
) |
1062 |
#(#MenuItem |
|
1063 |
#label: '' |
|
1064 |
) |
|
1065 |
#(#MenuItem |
|
4084 | 1066 |
#activeHelpKey: #searchFile |
3892 | 1067 |
#label: 'Search File' |
4084 | 1068 |
#itemValue: #doOpenSearchFile |
3892 | 1069 |
#translateLabel: true |
1070 |
#isButton: true |
|
4094 | 1071 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #searchIcon) |
3892 | 1072 |
) |
1073 |
#(#MenuItem |
|
4084 | 1074 |
#activeHelpKey: #addTerminal |
3892 | 1075 |
#label: 'VT100' |
4084 | 1076 |
#itemValue: #doAddTerminal |
3892 | 1077 |
#translateLabel: true |
1078 |
#isButton: true |
|
4094 | 1079 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #shellWithoutTextIcon) |
3892 | 1080 |
) |
3980 | 1081 |
#(#MenuItem |
4084 | 1082 |
#activeHelpKey: #toggleDetails |
3980 | 1083 |
#label: 'viewDetails' |
4084 | 1084 |
#translateLabel: true |
3980 | 1085 |
#isButton: true |
1086 |
#startGroup: #right |
|
4084 | 1087 |
#indication: #viewDetails |
1088 |
#submenuChannel: #viewDetailsMenuSpec |
|
3980 | 1089 |
#labelImage: #(#ResourceRetriever nil #viewDetailsIcon) |
1090 |
) |
|
3892 | 1091 |
) |
1092 |
nil |
|
1093 |
nil |
|
1094 |
) |
|
1095 |
! |
|
1096 |
||
1097 |
toolsMenuSpec |
|
1098 |
"This resource specification was automatically generated |
|
1099 |
by the MenuEditor of ST/X." |
|
1100 |
||
1101 |
"Do not manually edit this!! If it is corrupted, |
|
1102 |
the MenuEditor may not be able to read the specification." |
|
1103 |
||
1104 |
" |
|
1105 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#toolsMenuSpec |
|
1106 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 toolsMenuSpec)) startUp |
|
1107 |
" |
|
1108 |
||
1109 |
<resource: #menu> |
|
1110 |
||
1111 |
^ |
|
1112 |
#(#Menu |
|
1113 |
#( |
|
1114 |
#(#MenuItem |
|
1115 |
#label: 'Execute Command...' |
|
1116 |
#translateLabel: true |
|
1117 |
#value: #doExecuteCommand |
|
1118 |
) |
|
1119 |
#(#MenuItem |
|
1120 |
#label: 'Shell Terminal' |
|
1121 |
#translateLabel: true |
|
1122 |
#isVisible: #canDoTerminalAndSystemIsUnix |
|
1123 |
#value: #openTerminal |
|
1124 |
#enabled: #canDoTerminal |
|
1125 |
) |
|
1126 |
#(#MenuItem |
|
1127 |
#label: 'DOS Terminal' |
|
1128 |
#translateLabel: true |
|
1129 |
#isVisible: #canDoTerminalAndSystemIsDOS |
|
1130 |
#value: #openTerminal |
|
1131 |
#enabled: #canDoTerminal |
|
1132 |
) |
|
1133 |
#(#MenuItem |
|
1134 |
#label: '-' |
|
1135 |
) |
|
1136 |
#(#MenuItem |
|
1137 |
#label: 'Changes Browser' |
|
1138 |
#translateLabel: true |
|
1139 |
#value: #openChangesBrowser |
|
1140 |
#enabled: #hasSelection |
|
1141 |
) |
|
1142 |
#(#MenuItem |
|
1143 |
#label: 'Snapshot Image Browser' |
|
1144 |
#translateLabel: true |
|
1145 |
#value: #openSnapshotImageBrowser |
|
1146 |
#enabled: #hasSnapshotSelection |
|
1147 |
) |
|
1148 |
#(#MenuItem |
|
1149 |
#label: 'Create Smalltalk Project' |
|
1150 |
#translateLabel: true |
|
1151 |
#value: #createProjectAndOpenProjectBrowser |
|
1152 |
#enabled: #canCreateNewProject |
|
1153 |
) |
|
1154 |
#(#MenuItem |
|
1155 |
#label: 'Install Autoloaded' |
|
1156 |
#translateLabel: true |
|
1157 |
#value: #readAbbrevFile |
|
1158 |
#enabled: #canReadAbbrevFile |
|
1159 |
) |
|
1160 |
#(#MenuItem |
|
1161 |
#label: 'Install all as Autoloaded' |
|
1162 |
#translateLabel: true |
|
1163 |
#value: #installAllAsAutoloaded |
|
1164 |
#enabled: #anySTFilesPresent |
|
1165 |
) |
|
1166 |
#(#MenuItem |
|
1167 |
#label: 'Editor' |
|
1168 |
#translateLabel: true |
|
1169 |
#value: #openEditor |
|
1170 |
#enabled: #hasSelection |
|
1171 |
) |
|
1172 |
#(#MenuItem |
|
1173 |
#label: 'HTML Reader' |
|
1174 |
#translateLabel: true |
|
1175 |
#value: #openHTMLReader |
|
1176 |
#enabled: #hasSelection |
|
1177 |
) |
|
1178 |
#(#MenuItem |
|
1179 |
#label: 'ASN1 Browser' |
|
1180 |
#translateLabel: true |
|
1181 |
#isVisible: #hasASN1 |
|
1182 |
#value: #openASN1Browser |
|
1183 |
#enabled: #hasASN1AndSelection |
|
1184 |
) |
|
1185 |
#(#MenuItem |
|
1186 |
#label: 'C Browser' |
|
1187 |
#translateLabel: true |
|
1188 |
#isVisible: #hasCBrowser |
|
1189 |
#value: #openCBrowser |
|
1190 |
#enabled: #hasCBrowser |
|
1191 |
) |
|
1192 |
#(#MenuItem |
|
1193 |
#label: 'Applet Viewer' |
|
1194 |
#translateLabel: true |
|
1195 |
#isVisible: #hasJava |
|
1196 |
#value: #openAppletViewer |
|
1197 |
#enabled: #hasJavaAndSelection |
|
1198 |
) |
|
1199 |
#(#MenuItem |
|
1200 |
#label: 'Image Inspector' |
|
1201 |
#translateLabel: true |
|
1202 |
#value: #openImageInspector |
|
1203 |
#enabled: #hasSelection |
|
1204 |
) |
|
1205 |
#(#MenuItem |
|
1206 |
#label: 'Image Preview' |
|
1207 |
#translateLabel: true |
|
1208 |
#value: #openImagePreview |
|
1209 |
#enabled: #hasSelection |
|
1210 |
) |
|
1211 |
#(#MenuItem |
|
1212 |
#label: 'Image Editor' |
|
1213 |
#translateLabel: true |
|
1214 |
#value: #openImageEditor |
|
1215 |
#enabled: #hasSelection |
|
1216 |
) |
|
1217 |
#(#MenuItem |
|
1218 |
#label: 'MP3 Player' |
|
1219 |
#translateLabel: true |
|
1220 |
#isVisible: #hasMP3Player |
|
1221 |
#value: #openMP3Player |
|
1222 |
#enabled: #hasMP3PlayerAndSelection |
|
1223 |
) |
|
1224 |
#(#MenuItem |
|
1225 |
#label: 'ZipFile Tool' |
|
1226 |
#translateLabel: true |
|
1227 |
#value: #openZipTool |
|
1228 |
#enabled: #hasZipFileSelected |
|
1229 |
) |
|
1230 |
#(#MenuItem |
|
1231 |
#label: 'Slide Show' |
|
1232 |
#translateLabel: true |
|
1233 |
#isVisible: #hasSlideShow |
|
1234 |
#value: #openSlideShow |
|
1235 |
#enabled: #currentFilesAreInSameDirectory |
|
1236 |
) |
|
1237 |
#(#MenuItem |
|
1238 |
#label: 'File Differences...' |
|
1239 |
#translateLabel: true |
|
1240 |
#value: #openDiffView |
|
1241 |
#enabled: #hasSelection |
|
1242 |
) |
|
1243 |
#(#MenuItem |
|
1244 |
#label: 'Find Duplicate Files' |
|
1245 |
#translateLabel: true |
|
1246 |
#value: #fileFindDuplicates |
|
1247 |
) |
|
1248 |
#(#MenuItem |
|
1249 |
#label: 'Find All Duplicate Files (Recursive)' |
|
1250 |
#translateLabel: true |
|
1251 |
#value: #fileFindAllDuplicates |
|
1252 |
#enabled: #hasSelection |
|
1253 |
) |
|
1254 |
#(#MenuItem |
|
1255 |
#label: 'Find a File...' |
|
1256 |
#translateLabel: true |
|
1257 |
#value: #fileFindFile |
|
1258 |
) |
|
1259 |
#(#MenuItem |
|
1260 |
#label: 'Hex Dump' |
|
1261 |
#translateLabel: true |
|
1262 |
#value: #fileHexDump |
|
1263 |
#enabled: #hasSelection |
|
1264 |
) |
|
1265 |
) |
|
1266 |
nil |
|
1267 |
nil |
|
1268 |
) |
|
1269 |
! ! |
|
1270 |
||
1271 |
!FileBrowserV2 methodsFor:'actions'! |
|
1272 |
||
1273 |
changeFileBrowserTitleTo:aString |
|
1274 |
||
1275 |
|string| |
|
1276 |
||
1277 |
string := 'FileBrowser ', aString. |
|
1278 |
self window label:string. |
|
1279 |
! |
|
1280 |
||
1281 |
doSpawn |
|
1282 |
||
1283 |
self saveRuntimeAspectValues. |
|
1284 |
self class openWithAspects:aspects withExtent:self builder window extent. |
|
1285 |
! |
|
1286 |
||
1287 |
hideFilenameEntryField |
|
1288 |
self filenameEntryFieldVisibleHolder value:false. |
|
1289 |
! |
|
1290 |
||
1291 |
hideToolbar |
|
1292 |
self toolBarVisibleHolder value:false. |
|
3980 | 1293 |
! |
1294 |
||
1295 |
toggleFileDetailsFor:anItem |
|
1296 |
|viewDetails| |
|
1297 |
||
1298 |
viewDetails := self viewDetails value not. |
|
1299 |
self viewDetails value:viewDetails. |
|
1300 |
||
1301 |
viewDetails ifTrue:[ |
|
1302 |
anItem activeHelpKey:#hideFileDetails. |
|
1303 |
anItem label:(self class viewNoDetailsIcon). |
|
1304 |
] ifFalse:[ |
|
1305 |
anItem activeHelpKey:#showFileDetails. |
|
1306 |
anItem label:(self class viewDetailsIcon). |
|
1307 |
]. |
|
3892 | 1308 |
! ! |
1309 |
||
1310 |
!FileBrowserV2 methodsFor:'aspects'! |
|
1311 |
||
1312 |
fileEntryFieldHolder |
|
1313 |
||
1314 |
fileEntryFieldHolder isNil ifTrue:[ |
|
1315 |
fileEntryFieldHolder := ValueHolder new. |
|
1316 |
fileEntryFieldHolder addDependent:self. |
|
1317 |
]. |
|
1318 |
^ fileEntryFieldHolder. |
|
1319 |
! ! |
|
1320 |
||
1321 |
!FileBrowserV2 methodsFor:'change & update'! |
|
1322 |
||
4011 | 1323 |
currentFileNameHolderChanged |
1324 |
||
1325 |
| files| |
|
1326 |
||
1327 |
files := self currentFileNameHolder value. |
|
1328 |
||
1329 |
(files isEmpty) ifTrue:[ |
|
1330 |
self fileEntryFieldHolder value:nil withoutNotifying:self. |
|
1331 |
] ifFalse:[ |
|
1332 |
files size == 1 ifTrue:[ |
|
1333 |
self fileEntryFieldHolder value:(files first) withoutNotifying:self. |
|
1334 |
] ifFalse:[ |
|
1335 |
self fileEntryFieldHolder value:self getCommonForCurrentFiles withoutNotifying:self. |
|
1336 |
]. |
|
1337 |
]. |
|
1338 |
! |
|
1339 |
||
1340 |
fileEntryFieldHolderChanged |
|
1341 |
||
1342 |
(fileEntryFieldHolder value asFilename exists) ifFalse:[ pathEntryField flash. ^ self]. |
|
1343 |
self currentFileNameHolder value:(OrderedCollection with:(fileEntryFieldHolder value asFilename)). |
|
1344 |
! |
|
1345 |
||
3892 | 1346 |
update:something with:aParameter from:changedObject |
1347 |
||
1348 |
||
1349 |
changedObject == self fileEntryFieldHolder ifTrue:[ |
|
4011 | 1350 |
self fileEntryFieldHolderChanged. |
1351 |
^ self. |
|
3892 | 1352 |
]. |
1353 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4011 | 1354 |
super update:something with:aParameter from:changedObject. |
1355 |
self currentFileNameHolderChanged. |
|
1356 |
^ self. |
|
3892 | 1357 |
]. |
1358 |
(changedObject == self toolBarVisibleHolder |
|
1359 |
or:[changedObject == self filenameEntryFieldVisibleHolder]) ifTrue:[ |
|
1360 |
self updateToolVisibility. |
|
1361 |
^ self. |
|
1362 |
]. |
|
4085
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1363 |
(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
|
1364 |
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
|
1365 |
^ self. |
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1366 |
]. |
3892 | 1367 |
|
1368 |
^ super update:something with:aParameter from:changedObject. |
|
1369 |
! |
|
1370 |
||
1371 |
updateToolVisibility |
|
1372 |
|builder toolBar filenameEntryField vPanel topOffset visible d| |
|
1373 |
||
1374 |
builder := self builder. |
|
1375 |
||
1376 |
topOffset := 0. |
|
1377 |
visible := self toolBarVisibleHolder value. |
|
1378 |
visible ifTrue:[ |
|
1379 |
toolBar := builder componentAt:#ToolbarBox. |
|
1380 |
topOffset := topOffset + toolBar height. |
|
1381 |
]. |
|
1382 |
||
1383 |
visible := self filenameEntryFieldVisibleHolder value. |
|
1384 |
visible ifTrue:[ |
|
1385 |
filenameEntryField := builder componentAt:#FilenameEntryFieldBox. |
|
1386 |
d := filenameEntryField layout bottomOffset - filenameEntryField layout topOffset. |
|
1387 |
filenameEntryField layout topOffset:topOffset bottomOffset:topOffset + d. |
|
1388 |
topOffset := topOffset + filenameEntryField height. |
|
1389 |
filenameEntryField container notNil ifTrue:[ |
|
1390 |
filenameEntryField containerChangedSize. |
|
1391 |
]. |
|
1392 |
]. |
|
1393 |
||
1394 |
vPanel := builder componentAt:#BrowserBox. |
|
1395 |
vPanel layout topOffset:topOffset+1. |
|
1396 |
vPanel container notNil ifTrue:[ |
|
1397 |
vPanel containerChangedSize. |
|
1398 |
]. |
|
1399 |
! ! |
|
1400 |
||
3957 | 1401 |
!FileBrowserV2 methodsFor:'event handling'! |
1402 |
||
1403 |
processEvent:anEvent |
|
1404 |
"filter keyboard events. |
|
1405 |
Return true, if I have eaten the event" |
|
1406 |
||
1407 |
|focusView key rawKey fileName| |
|
1408 |
||
1409 |
anEvent isKeyPressEvent ifTrue:[ |
|
1410 |
focusView := anEvent targetView. |
|
1411 |
key := anEvent key. |
|
1412 |
rawKey := anEvent rawKey. |
|
1413 |
||
1414 |
(focusView isSameOrComponentOf:self window) ifTrue:[ |
|
1415 |
||
1416 |
((focusView == pathEntryField) not) ifTrue:[ ^ false]. |
|
1417 |
||
1418 |
(key == #Return) ifTrue:[ |
|
1419 |
fileName := pathEntryField list first asFilename. |
|
1420 |
(fileName exists and:[fileName isDirectory not]) ifTrue:[ |
|
4101 | 1421 |
self openApplForFile:fileName |
3957 | 1422 |
]. |
1423 |
]. |
|
1424 |
] |
|
1425 |
]. |
|
1426 |
^ false |
|
1427 |
! ! |
|
1428 |
||
3892 | 1429 |
!FileBrowserV2 methodsFor:'startup & release'! |
1430 |
||
3954 | 1431 |
closeRequest |
1432 |
||
4082 | 1433 |
(self application:#FileApplicationNoteBook do:#tryCloseApplications) not ifTrue:[ |
3954 | 1434 |
^ self |
1435 |
]. |
|
1436 |
^ super closeRequest. |
|
1437 |
! |
|
1438 |
||
3892 | 1439 |
hideFilenameEntryFieldButtonCreated:aButton |
1440 |
||
1441 |
aButton passiveLevel:(MenuPanel defaultLevel). |
|
1442 |
aButton activeLevel:-1. |
|
1443 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
|
1444 |
! |
|
1445 |
||
1446 |
hideToolBarButtonCreated:aButton |
|
1447 |
||
1448 |
aButton passiveLevel:(MenuPanel defaultLevel). |
|
1449 |
aButton activeLevel:-1. |
|
1450 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
|
1451 |
! |
|
1452 |
||
1453 |
initialize |
|
1454 |
||
1455 |
self masterApplication:nil. |
|
4022 | 1456 |
self dirHistory resetForwardBackward. |
3892 | 1457 |
! |
1458 |
||
1459 |
makeDependent |
|
4008 | 1460 |
|
4004 | 1461 |
super makeDependent. |
4085
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1462 |
self sortBlockProperty addDependent:self. |
3892 | 1463 |
self filenameEntryFieldVisibleHolder addDependent:self. |
1464 |
self toolBarVisibleHolder addDependent:self. |
|
1465 |
! |
|
1466 |
||
4018 | 1467 |
postBuildFilterBox:aWidget |
1468 |
||
1469 |
self filterValueBox value:aWidget. |
|
1470 |
self filterBackgroundColor value:aWidget backgroundColor. |
|
1471 |
! |
|
1472 |
||
3892 | 1473 |
postBuildPathField:aWidget |
1474 |
" |
|
1475 |
set the pramters that not can be changed in the window spec |
|
1476 |
" |
|
1477 |
||
3957 | 1478 |
pathEntryField := aWidget. |
3892 | 1479 |
aWidget level:-1. |
1480 |
||
1481 |
"/ sClr := aWidget shadowColor. |
|
1482 |
"/ lClr := aWidget lightColor. |
|
1483 |
"/ sClr := (self builder componentAt:#ToolBar) shadowColor. |
|
1484 |
"/ lClr := (self builder componentAt:#ToolBar) lightColor. |
|
1485 |
||
1486 |
"/ aWidget backgroundColor:(aWidget superView viewBackground). |
|
1487 |
"/ aWidget shadowColor:sClr. |
|
1488 |
! |
|
1489 |
||
1490 |
postBuildPathViewBox:aWidget |
|
1491 |
||
1492 |
aWidget backgroundColor:(MenuPanel defaultBackgroundColor). |
|
1493 |
! |
|
1494 |
||
1495 |
postBuildWith:aBuilder |
|
1496 |
||
1497 |
super postBuildWith:aBuilder. |
|
3980 | 1498 |
self updateToolVisibility. |
3892 | 1499 |
! |
1500 |
||
1501 |
postOpenWith:aBuilder |
|
1502 |
||
4071 | 1503 |
super postOpenWith:aBuilder. |
1504 |
self abstractCurrentFileNameHolderChanged. |
|
1505 |
self currentFileNameHolderChanged. |
|
1506 |
"/ self showDirectoryTreeHolder changed. |
|
1507 |
"/ self sortBlockProperty changed. |
|
4027 | 1508 |
|
3957 | 1509 |
self windowGroup addPreEventHook:self. |
3892 | 1510 |
! |
1511 |
||
1512 |
release |
|
1513 |
||
1514 |
self saveRuntimeAspectValues. |
|
1515 |
^ super release |
|
1516 |
! ! |
|
1517 |
||
1518 |
!FileBrowserV2 class methodsFor:'documentation'! |
|
1519 |
||
1520 |
version |
|
4101 | 1521 |
^ '$Header: /cvs/stx/stx/libtool/FileBrowserV2.st,v 1.33 2002-10-29 15:15:55 cg Exp $' |
3892 | 1522 |
! ! |
1523 |
||
1524 |
FileBrowserV2 initialize! |