author | Claus Gittinger <cg@exept.de> |
Tue, 05 Jul 2005 12:07:41 +0200 | |
changeset 6334 | 89e055168f51 |
parent 6307 | 8e5863ecd881 |
child 6338 | dfc3b7d2c208 |
permissions | -rw-r--r-- |
3892 | 1 |
" |
5140 | 2 |
COPYRIGHT (c) 2002 by eXept Software AG |
3892 | 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 |
|
4651 | 16 |
instanceVariableNames:'fileEntryFieldHolder pathEntryField previewProcess |
5477 | 17 |
listOfDeviceDrives selectedDeviceDrive imgView' |
4651 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-Tools-File' |
|
3892 | 21 |
! |
22 |
||
23 |
!FileBrowserV2 class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
5140 | 27 |
COPYRIGHT (c) 2002 by eXept Software AG |
3892 | 28 |
All Rights Reserved |
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
38 |
||
39 |
documentation |
|
40 |
" |
|
5967 | 41 |
FileBrowserV2 is based on Filebrowser |
3892 | 42 |
|
43 |
WARNING: files edited with FileBrowser will have leading spaces (multiple-8) |
|
44 |
being replaced by tabs. If tabs are to be preserved at other |
|
45 |
positions (for example, sendmail-config files) they will be |
|
46 |
corrupt after being written. |
|
47 |
||
48 |
[instance variables]: |
|
49 |
||
50 |
checkDelta <Integer> number of seconds of check interval |
|
51 |
(looks ever so often if shown directory |
|
52 |
has changed). You may make this number |
|
53 |
higher, if your network-times are |
|
54 |
incorrect and thus, the filebrowser |
|
55 |
checks too often. |
|
56 |
||
57 |
compressTabs <Boolean> if true, leading spaces will be |
|
58 |
replaced by tabs when saving text |
|
59 |
||
60 |
some of the defaults (long/short list etc.) can be set by the resource file; |
|
61 |
see FileBrowser>>initialize for more details.. |
|
62 |
||
63 |
[author:] |
|
64 |
Christian Penk |
|
65 |
||
66 |
[start with:] |
|
67 |
FileBrowserV2 open |
|
68 |
" |
|
5354 | 69 |
! |
70 |
||
71 |
toDo |
|
72 |
||
73 |
" |
|
74 |
- the tab for the directory description text editor not changed if the |
|
75 |
directory description change to a normal text editor |
|
76 |
- FileDialog should get a file history |
|
77 |
- change comment characters on change text file in TextEditor |
|
78 |
- directorycontentsItem isDirectory failed if it is a symbolic link |
|
79 |
- on sort order change in directory contents browser the columnspec shouldnt not reloaded |
|
80 |
- in windows directory up on top of a volume goes to default directory |
|
81 |
- check all windowspecs with different font types |
|
5472 | 82 |
- multiple select with mouse moving is flickering (see bestFilename in FilenameEditField) |
83 |
- too many system calls on update cycle |
|
5532 | 84 |
- stop monitoring task for DirectoryTreebrowser and DirectoryContentsBrowser |
5354 | 85 |
" |
3892 | 86 |
! ! |
87 |
||
88 |
!FileBrowserV2 class methodsFor:'instance creation'! |
|
89 |
||
90 |
on:aDirectoryPath |
|
91 |
"return a new FileBrowserV2 in a pathname" |
|
92 |
||
4015 | 93 |
|instance files| |
94 |
instance := self new createBuilder. |
|
4172 | 95 |
aDirectoryPath isCollection ifTrue:[ |
96 |
files := aDirectoryPath |
|
97 |
] ifFalse:[ |
|
98 |
files := Array with:aDirectoryPath. |
|
99 |
]. |
|
3907 | 100 |
instance currentFileNameHolder value:files. |
3892 | 101 |
^ instance |
102 |
! |
|
103 |
||
104 |
open |
|
105 |
"start a new FileBrowserV2" |
|
106 |
||
107 |
| instance | |
|
108 |
instance := self new. |
|
109 |
instance open. |
|
110 |
^ instance |
|
5123 | 111 |
|
3892 | 112 |
" |
4626 | 113 |
FileBrowserV2 openOn:(OrderedCollection with:(Filename currentDirectory asAbsoluteFilename)) withExtent:800@600 |
3892 | 114 |
" |
115 |
! |
|
116 |
||
117 |
openOn:aDirectoryPath |
|
118 |
"start a new FileBrowserV2 in a pathname" |
|
119 |
||
120 |
| instance| |
|
121 |
instance := self on:aDirectoryPath asFilename. |
|
5123 | 122 |
instance open. |
123 |
^ instance. |
|
124 |
||
3892 | 125 |
" |
4626 | 126 |
FileBrowserV2 openOn:(OrderedCollection with:(Filename currentDirectory asAbsoluteFilename)) |
3892 | 127 |
" |
128 |
! |
|
129 |
||
130 |
openOn:aDirectoryPath withExtent:extent |
|
131 |
"start a new FileBrowserV2 in a pathname" |
|
132 |
||
133 |
| instance builder| |
|
134 |
instance := self on:aDirectoryPath. |
|
135 |
builder := instance open. |
|
136 |
builder window extent:extent. |
|
137 |
^ instance |
|
5123 | 138 |
|
3892 | 139 |
" |
4626 | 140 |
FileBrowserV2 openOn:(OrderedCollection with:(Filename currentDirectory asAbsoluteFilename)) withExtent:800@600 |
3892 | 141 |
" |
142 |
! |
|
143 |
||
5123 | 144 |
openOnFileNamed:aFilename |
5162 | 145 |
"start a new FileBrowserV2 on a aFilename. |
146 |
The browser looks for an appropriate viewer and uses that if one is found; |
|
147 |
otherwise, the file is opened for text editing." |
|
148 |
||
149 |
^ self openOnFileNamed:aFilename editing:true |
|
150 |
||
151 |
" |
|
152 |
FileBrowserV2 openOnFileNamed:'Makefile' |
|
153 |
" |
|
154 |
! |
|
155 |
||
156 |
openOnFileNamed:aFilename editing:editing |
|
157 |
"start a new FileBrowserV2 on a aFilename; |
|
158 |
If editing is true, the browser opens the document as text to be edited; |
|
159 |
if false, it looks for an appropriate viewer and uses that if one is found." |
|
5123 | 160 |
|
161 |
|f browser| |
|
162 |
||
163 |
f := aFilename asFilename asAbsoluteFilename. |
|
164 |
f isDirectory ifTrue:[ |
|
165 |
^ self openOn:aFilename |
|
166 |
]. |
|
167 |
||
168 |
browser := self on:(f directory). |
|
169 |
browser currentFileNameHolder setValue:(Array with:f). |
|
170 |
browser open. |
|
5162 | 171 |
editing ifTrue:[ |
172 |
browser openTextEditorForFile:f. |
|
173 |
] ifFalse:[ |
|
174 |
browser openApplForFile:f. |
|
175 |
]. |
|
5123 | 176 |
|
177 |
" |
|
178 |
FileBrowserV2 openOnFileNamed:'Makefile' |
|
179 |
" |
|
180 |
! |
|
181 |
||
3892 | 182 |
openWithAspects:someAspects withExtent:extent |
183 |
"start a new FileBrowserV2 in a pathname" |
|
184 |
||
185 |
|dir clone| |
|
186 |
||
187 |
dir := someAspects at:#currentFileNameHolder ifAbsent:nil. |
|
188 |
clone := self openOn:(dir value) withExtent:extent. |
|
189 |
! ! |
|
190 |
||
191 |
!FileBrowserV2 class methodsFor:'class initialization'! |
|
192 |
||
4027 | 193 |
applicationIcon |
6112 | 194 |
^ NewLauncher startNewFileBrowserIcon |
4027 | 195 |
! |
196 |
||
3892 | 197 |
initialize |
6078 | 198 |
"/ self installInLauncher. - now done in phase 2 |
199 |
ObjectMemory addDependent:self. |
|
3892 | 200 |
! |
201 |
||
202 |
installInLauncher |
|
203 |
"add myself to the launcher menu and toolBar" |
|
204 |
||
3914 | 205 |
|menuItem icon action currentLauncher| |
3892 | 206 |
|
207 |
FileBrowserV2 isNil ifTrue:[^ self]. |
|
208 |
||
209 |
action := [FileBrowserV2 open]. |
|
210 |
||
6112 | 211 |
icon := [self applicationIcon]. "/ self defaultIcon magnifiedTo:28@28. |
3892 | 212 |
|
213 |
menuItem := MenuItem new |
|
4037 | 214 |
translateLabel: true; |
3892 | 215 |
value: action; |
216 |
isButton: false; |
|
6237 | 217 |
label:'File Browser' icon:icon; |
3892 | 218 |
nameKey: #fileBrowserV2; |
219 |
activeHelpKey: #fileBrowserV2; |
|
220 |
submenuChannel: #menuFileHistory; |
|
221 |
showBusyCursorWhilePerforming:true. |
|
222 |
||
5630
167c807f720a
pass mySelf when defining a userAddedItem to allow for re-translation.
Claus Gittinger <cg@exept.de>
parents:
5532
diff
changeset
|
223 |
NewLauncher |
167c807f720a
pass mySelf when defining a userAddedItem to allow for re-translation.
Claus Gittinger <cg@exept.de>
parents:
5532
diff
changeset
|
224 |
addMenuItem:menuItem |
167c807f720a
pass mySelf when defining a userAddedItem to allow for re-translation.
Claus Gittinger <cg@exept.de>
parents:
5532
diff
changeset
|
225 |
from:self |
167c807f720a
pass mySelf when defining a userAddedItem to allow for re-translation.
Claus Gittinger <cg@exept.de>
parents:
5532
diff
changeset
|
226 |
in:'menu.file' |
167c807f720a
pass mySelf when defining a userAddedItem to allow for re-translation.
Claus Gittinger <cg@exept.de>
parents:
5532
diff
changeset
|
227 |
position:#( #before #fileBrowser) |
167c807f720a
pass mySelf when defining a userAddedItem to allow for re-translation.
Claus Gittinger <cg@exept.de>
parents:
5532
diff
changeset
|
228 |
space:true. |
3892 | 229 |
|
230 |
menuItem := MenuItem new |
|
4037 | 231 |
translateLabel: true; |
3892 | 232 |
value: action; |
233 |
isButton: true; |
|
6237 | 234 |
"label:'File Browser'" icon:icon; |
3892 | 235 |
nameKey: #fileBrowserV2; |
236 |
activeHelpKey: #fileBrowserV2; |
|
237 |
submenuChannel: #menuFileHistory; |
|
238 |
showBusyCursorWhilePerforming:true. |
|
239 |
||
5630
167c807f720a
pass mySelf when defining a userAddedItem to allow for re-translation.
Claus Gittinger <cg@exept.de>
parents:
5532
diff
changeset
|
240 |
NewLauncher |
167c807f720a
pass mySelf when defining a userAddedItem to allow for re-translation.
Claus Gittinger <cg@exept.de>
parents:
5532
diff
changeset
|
241 |
addMenuItem:menuItem |
167c807f720a
pass mySelf when defining a userAddedItem to allow for re-translation.
Claus Gittinger <cg@exept.de>
parents:
5532
diff
changeset
|
242 |
from:self |
167c807f720a
pass mySelf when defining a userAddedItem to allow for re-translation.
Claus Gittinger <cg@exept.de>
parents:
5532
diff
changeset
|
243 |
in:'toolbar' |
167c807f720a
pass mySelf when defining a userAddedItem to allow for re-translation.
Claus Gittinger <cg@exept.de>
parents:
5532
diff
changeset
|
244 |
position:#( #before #fileBrowser) |
167c807f720a
pass mySelf when defining a userAddedItem to allow for re-translation.
Claus Gittinger <cg@exept.de>
parents:
5532
diff
changeset
|
245 |
space:false. |
3892 | 246 |
|
3918 | 247 |
currentLauncher := NewLauncher current. |
3914 | 248 |
currentLauncher notNil ifTrue:[ |
249 |
currentLauncher fileBrowserItemVisible value:false |
|
250 |
]. |
|
4380
0987d10ae2ba
install and remove from Launcher install in settings application changed
penk
parents:
4377
diff
changeset
|
251 |
NewLauncher addSettingsApplicationByClass:#'FileBrowserV2SettingsAppl' |
0987d10ae2ba
install and remove from Launcher install in settings application changed
penk
parents:
4377
diff
changeset
|
252 |
withName:'Tools/FileBrowserV2' |
0987d10ae2ba
install and remove from Launcher install in settings application changed
penk
parents:
4377
diff
changeset
|
253 |
icon:nil. |
3908 | 254 |
|
3892 | 255 |
" |
256 |
self installInLauncher |
|
257 |
self removeFromLauncher |
|
258 |
" |
|
259 |
! |
|
260 |
||
261 |
removeFromLauncher |
|
262 |
"/ |
|
263 |
"/ remove myself from the launcher menu |
|
264 |
"/ |
|
265 |
||
3914 | 266 |
|currentLauncher| |
267 |
||
3892 | 268 |
NewLauncher isNil ifTrue:[^ self]. |
3908 | 269 |
NewLauncher removeUserTool:#fileBrowserV2. |
3918 | 270 |
currentLauncher := NewLauncher current. |
3914 | 271 |
currentLauncher notNil ifTrue:[ |
272 |
currentLauncher fileBrowserItemVisible value:false |
|
273 |
]. |
|
4380
0987d10ae2ba
install and remove from Launcher install in settings application changed
penk
parents:
4377
diff
changeset
|
274 |
NewLauncher removeSettingsApplicationByClass:#'FileBrowserV2SettingsAppl'. |
3892 | 275 |
|
276 |
" |
|
277 |
self removeFromLauncher |
|
278 |
" |
|
6078 | 279 |
! |
280 |
||
281 |
update:something with:aParameter from:changedObject |
|
282 |
something == #initialized ifTrue:[ |
|
283 |
changedObject == ObjectMemory ifTrue:[ |
|
284 |
self installInLauncher. |
|
285 |
ObjectMemory removeDependent:self. |
|
286 |
] |
|
287 |
]. |
|
3892 | 288 |
! ! |
289 |
||
290 |
!FileBrowserV2 class methodsFor:'defaults'! |
|
291 |
||
292 |
entryFieldEndStringForMultipleSelection |
|
293 |
||
294 |
^ ('[*]') |
|
295 |
! ! |
|
296 |
||
297 |
!FileBrowserV2 class methodsFor:'help specs'! |
|
298 |
||
6334 | 299 |
flyByHelpSpec |
300 |
"This resource specification was automatically generated |
|
301 |
by the UIHelpTool of ST/X." |
|
302 |
||
303 |
"Do not manually edit this!! If it is corrupted, |
|
304 |
the UIHelpTool may not be able to read the specification." |
|
305 |
||
306 |
" |
|
307 |
UIHelpTool openOnClass:FileBrowserV2 |
|
308 |
" |
|
309 |
||
310 |
<resource: #help> |
|
311 |
||
312 |
^ super flyByHelpSpec addPairsFrom:#( |
|
313 |
||
314 |
#columnLabel |
|
315 |
'The text-cursor''s column number' |
|
316 |
||
317 |
#encodingLabel |
|
318 |
'The file''s encoding (Menu to change)' |
|
319 |
||
320 |
#encodingLockedLabel |
|
321 |
'Lock the file-encoding (do not try to guess from the file''s contents)' |
|
322 |
||
323 |
#lineLabel |
|
324 |
'The text-cursor''s line number' |
|
325 |
||
326 |
#modeLabel |
|
327 |
'The editing mode (insert vs. overwrite)' |
|
328 |
||
329 |
#numberOfFiles |
|
330 |
'Number of files shown (Total number of files in directory)' |
|
331 |
||
332 |
) |
|
333 |
! |
|
334 |
||
4688 | 335 |
helpSpec |
336 |
"This resource specification was automatically generated |
|
337 |
by the UIHelpTool of ST/X." |
|
338 |
||
339 |
"Do not manually edit this!! If it is corrupted, |
|
340 |
the UIHelpTool may not be able to read the specification." |
|
341 |
||
342 |
" |
|
343 |
UIHelpTool openOnClass:FileBrowserV2 |
|
344 |
" |
|
345 |
||
346 |
<resource: #help> |
|
347 |
||
348 |
^ super helpSpec addPairsFrom:#( |
|
349 |
||
6334 | 350 |
#columnLabel |
351 |
'The text-cursor''s column number.' |
|
5398 | 352 |
|
6334 | 353 |
#encodingLabel |
354 |
'The files encoding.' |
|
5398 | 355 |
|
6334 | 356 |
#encodingLockedLabel |
357 |
'Lock the file-encoding (do not try to guess from the file''s contents).' |
|
5398 | 358 |
|
6334 | 359 |
#lineLabel |
360 |
'The text-cursor''s line number.' |
|
361 |
||
362 |
#modeLabel |
|
363 |
'The editing mode (insert vs. overwrite).' |
|
4688 | 364 |
|
365 |
) |
|
3892 | 366 |
! ! |
367 |
||
368 |
!FileBrowserV2 class methodsFor:'icon'! |
|
369 |
||
370 |
defaultIcon |
|
371 |
"This resource specification was automatically generated |
|
372 |
by the ImageEditor of ST/X." |
|
373 |
||
374 |
"Do not manually edit this!! If it is corrupted, |
|
375 |
the ImageEditor may not be able to read the specification." |
|
376 |
||
377 |
" |
|
378 |
self defaultIcon inspect |
|
379 |
ImageEditor openOnClass:self andSelector:#defaultIcon |
|
380 |
" |
|
381 |
||
382 |
<resource: #image> |
|
383 |
||
384 |
^Icon |
|
385 |
constantNamed:#'FileBrowserV2 class defaultIcon' |
|
386 |
ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
387 |
@@@@@@@@@@@@@@@@@@@@CLA&Y&Y&Y&X@@ADP@@@L0F@@@@@@A @ADAD@@@3@XN;.;.8F@ADPDQ@@CLA ;.@@@@@@D@@@D@@L0FC.8O[6=/@QDADP@@3@X@; |
|
388 |
[6=/[0DPDP@@CLA DNC6<@@F<ADP@@@L0F@A@F= [0= @@@@@@3@X@@P=/[6=/@@@@@@CLA @@A/[6=/X@@@@@@L0FC0@O[6=/[0@@@@@@3@XF<@@@@@@@@@ |
|
389 |
@@@@CLA = @@@@@@@@@@@@@L0FA/[6=/A @@@@@@@@3@XO[6=/XF@@@@@@@@CLA @@@@@@X@@@@@@@@L0FY&Y&Y&Y @@@@@@@@C@Y&Y&Y&Y&@@@@@@@@@@@@ |
|
390 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@N@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
391 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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:' |
|
392 |
O??# C??9<@??>? O???<C????@????0O???8C???<@???>@O??<@C???@@???0@O??<@C??8@@??>@@O?? @C??8@@??>@@G?? @@??8@@@@@@@G.P=0AAD |
|
393 |
HP@PQBD@GDP8 AADHD@PQBA@DN^=0@@a') ; yourself); yourself] |
|
394 |
! |
|
395 |
||
396 |
hideFilenameEntryFieldIcon |
|
397 |
<resource: #programImage> |
|
398 |
||
399 |
^ ToolbarIconLibrary hideToolbarIconH14 |
|
400 |
! |
|
401 |
||
402 |
hideToolBarIcon |
|
403 |
<resource: #programImage> |
|
404 |
||
405 |
^ ToolbarIconLibrary hideToolbarIconH26 |
|
406 |
! ! |
|
407 |
||
408 |
!FileBrowserV2 class methodsFor:'interface specs'! |
|
409 |
||
410 |
windowSpec |
|
411 |
"This resource specification was automatically generated |
|
412 |
by the UIPainter of ST/X." |
|
413 |
||
414 |
"Do not manually edit this!! If it is corrupted, |
|
415 |
the UIPainter may not be able to read the specification." |
|
416 |
||
417 |
" |
|
418 |
UIPainter new openOnClass:FileBrowserV2 andSelector:#windowSpec |
|
419 |
FileBrowserV2 new openInterface:#windowSpec |
|
420 |
FileBrowserV2 open |
|
421 |
" |
|
422 |
||
423 |
<resource: #canvas> |
|
424 |
||
425 |
^ |
|
5331 | 426 |
#(FullSpec |
427 |
name: windowSpec |
|
428 |
window: |
|
429 |
(WindowSpec |
|
430 |
label: FileBrowser |
|
431 |
name: FileBrowser |
|
432 |
min: (Point 10 10) |
|
5680 | 433 |
bounds: (Rectangle 0 0 800 600) |
5331 | 434 |
menu: mainMenu |
435 |
icon: applicationIcon |
|
3892 | 436 |
) |
5331 | 437 |
component: |
438 |
(SpecCollection |
|
439 |
collection: ( |
|
440 |
(ViewSpec |
|
6079 | 441 |
name: 'ToolbarBox' |
442 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
443 |
level: 0 |
|
444 |
visibilityChannel: toolBarVisibleHolder |
|
445 |
component: |
|
446 |
(SpecCollection |
|
447 |
collection: ( |
|
448 |
(ActionButtonSpec |
|
449 |
label: 'hideToolBarIcon' |
|
450 |
name: 'HideToolBarButton' |
|
451 |
layout: (LayoutFrame 0 0 0 0 13 0 30 0) |
|
452 |
activeHelpKey: hideToolBar |
|
453 |
hasCharacterOrientedLabel: false |
|
454 |
translateLabel: true |
|
455 |
model: hideToolbar |
|
456 |
postBuildCallback: hideToolBarButtonCreated: |
|
457 |
) |
|
458 |
(MenuPanelSpec |
|
459 |
name: 'ToolBar' |
|
460 |
layout: (LayoutFrame 13 0 0 0 0 1 32 0) |
|
461 |
menu: toolBarMainMenu |
|
462 |
textDefault: true |
|
463 |
) |
|
464 |
) |
|
465 |
||
466 |
) |
|
467 |
) |
|
468 |
(ViewSpec |
|
5331 | 469 |
name: 'FilenameEntryFieldBox' |
6079 | 470 |
layout: (LayoutFrame 0 0 32 0 0 1 57 0) |
5331 | 471 |
level: 0 |
472 |
visibilityChannel: filenameEntryFieldVisibleHolder |
|
473 |
component: |
|
474 |
(SpecCollection |
|
475 |
collection: ( |
|
476 |
(ActionButtonSpec |
|
477 |
label: 'hideFilenameEntryFieldIcon' |
|
478 |
name: 'HideFilenameEntryFieldButton' |
|
479 |
layout: (LayoutFrame 0 0 0 0 13 0 0 1) |
|
480 |
activeHelpKey: hideFilenameEntryField |
|
481 |
hasCharacterOrientedLabel: false |
|
482 |
translateLabel: true |
|
483 |
model: hideFilenameEntryField |
|
484 |
postBuildCallback: hideFilenameEntryFieldButtonCreated: |
|
3892 | 485 |
) |
5331 | 486 |
(HorizontalPanelViewSpec |
487 |
name: 'HorizontalPanel1' |
|
488 |
layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0) |
|
489 |
level: 1 |
|
490 |
horizontalLayout: leftFit |
|
491 |
verticalLayout: fit |
|
492 |
horizontalSpace: 3 |
|
493 |
verticalSpace: 3 |
|
494 |
component: |
|
495 |
(SpecCollection |
|
496 |
collection: ( |
|
497 |
(ComboListSpec |
|
498 |
name: 'ComboList1' |
|
499 |
visibilityChannel: driveSelectorVisible |
|
500 |
model: selectedDeviceDrive |
|
501 |
comboList: listOfDeviceDrives |
|
502 |
useIndex: false |
|
6079 | 503 |
hidePullDownMenuButton: false |
5331 | 504 |
extent: (Point 53 23) |
5120 | 505 |
) |
5331 | 506 |
(VariableHorizontalPanelSpec |
507 |
name: 'VariableHorizontalPanel1' |
|
508 |
level: 0 |
|
509 |
showHandle: true |
|
510 |
component: |
|
511 |
(SpecCollection |
|
512 |
collection: ( |
|
513 |
(NonScrollableArbitraryComponentSpec |
|
514 |
name: 'NonScrollableArbitraryComponent1' |
|
515 |
component: FilenameEditFieldV2 |
|
516 |
postBuildCallback: postBuildEditField: |
|
3892 | 517 |
) |
5331 | 518 |
(ViewSpec |
519 |
name: 'FilterBox' |
|
520 |
component: |
|
521 |
(SpecCollection |
|
522 |
collection: ( |
|
523 |
(LabelSpec |
|
524 |
label: 'Filter:' |
|
525 |
name: 'Filter' |
|
526 |
layout: (LayoutFrame 0 0 0 0 40 0 0 1) |
|
527 |
translateLabel: true |
|
528 |
adjust: left |
|
529 |
postBuildCallback: postBuildPathViewBox: |
|
3892 | 530 |
) |
5331 | 531 |
(ComboBoxSpec |
532 |
name: 'FilterSelectionBox' |
|
533 |
layout: (LayoutFrame 40 0 0 0 0 1 0 1) |
|
534 |
model: filterModel |
|
535 |
immediateAccept: true |
|
536 |
acceptOnPointerLeave: false |
|
537 |
comboList: filterListModel |
|
3892 | 538 |
) |
539 |
) |
|
540 |
||
541 |
) |
|
5331 | 542 |
postBuildCallback: postBuildPathViewBox: |
3892 | 543 |
) |
544 |
) |
|
545 |
||
546 |
) |
|
5331 | 547 |
handles: (Any 0.774936 1.0) |
548 |
postBuildCallback: postBuildPathViewBox: |
|
549 |
useDefaultExtent: true |
|
3892 | 550 |
) |
551 |
) |
|
552 |
||
553 |
) |
|
5331 | 554 |
postBuildCallback: postBuildPathViewBox: |
3892 | 555 |
) |
556 |
) |
|
557 |
||
558 |
) |
|
559 |
) |
|
5331 | 560 |
(#'FileBrowserV2UISpecifications::PanelSpec' |
561 |
name: 'BrowserBox' |
|
6079 | 562 |
layout: (LayoutFrame 0 0.0 57 0.0 0 1.0 -20 1.0) |
5331 | 563 |
level: 0 |
564 |
showHandle: true |
|
565 |
snapMode: both |
|
566 |
whichView: last |
|
567 |
orientation: vertical |
|
568 |
visibility: viewNoteBookApplicationHolder |
|
569 |
component: |
|
570 |
(SpecCollection |
|
571 |
collection: ( |
|
572 |
(#'FileBrowserV2UISpecifications::PanelSpec' |
|
573 |
name: 'HorizontalPanel' |
|
574 |
level: 0 |
|
575 |
snapMode: both |
|
576 |
whichView: first |
|
577 |
orientation: horizontal |
|
578 |
visibility: showDirectoryTree |
|
579 |
component: |
|
580 |
(SpecCollection |
|
581 |
collection: ( |
|
582 |
(SubCanvasSpec |
|
583 |
name: 'DirectoryTreeBrowser' |
|
584 |
hasHorizontalScrollBar: false |
|
585 |
hasVerticalScrollBar: false |
|
586 |
majorKey: DirectoryTreeBrowser |
|
587 |
createNewApplication: true |
|
588 |
createNewBuilder: true |
|
589 |
postBuildCallback: postBuildDirectoryTree: |
|
3892 | 590 |
) |
5331 | 591 |
(SubCanvasSpec |
592 |
name: 'DirectoryContentsBrowser' |
|
593 |
hasHorizontalScrollBar: false |
|
594 |
hasVerticalScrollBar: false |
|
595 |
majorKey: DirectoryContentsBrowser |
|
596 |
createNewApplication: true |
|
597 |
createNewBuilder: true |
|
3892 | 598 |
) |
599 |
) |
|
600 |
||
601 |
) |
|
5331 | 602 |
handles: (Any 0.225 1.0) |
4595
09c632988dad
Add handles to resize VerticalPanel
Stefan Vogel <sv@exept.de>
parents:
4593
diff
changeset
|
603 |
) |
5331 | 604 |
(SubCanvasSpec |
605 |
name: 'FileApplicationNoteBook' |
|
606 |
tabable: false |
|
607 |
hasHorizontalScrollBar: false |
|
608 |
hasVerticalScrollBar: false |
|
609 |
majorKey: FileApplicationNoteBook |
|
610 |
createNewApplication: true |
|
611 |
createNewBuilder: true |
|
3892 | 612 |
) |
613 |
) |
|
614 |
||
615 |
) |
|
5331 | 616 |
handles: (Any 0.5 1.0) |
3892 | 617 |
) |
5331 | 618 |
(ViewSpec |
619 |
name: 'Box2' |
|
620 |
layout: (LayoutFrame 0 0 -20 1 0 1 0 1) |
|
621 |
level: 0 |
|
622 |
component: |
|
623 |
(SpecCollection |
|
624 |
collection: ( |
|
625 |
(LabelSpec |
|
626 |
label: 'NotifyLabel' |
|
627 |
name: 'NotifyLabel' |
|
628 |
layout: (LayoutFrame 0 0 1 0.0 -220 1 1 1.0) |
|
629 |
level: -1 |
|
630 |
translateLabel: true |
|
631 |
labelChannel: notifyChannel |
|
632 |
adjust: left |
|
4018 | 633 |
) |
5528 | 634 |
(LabelSpec |
635 |
label: 'encoding' |
|
636 |
name: 'EncodingLabel' |
|
6334 | 637 |
layout: (LayoutFrame -318 1 2 0.0 -232 1 0 1.0) |
638 |
activeHelpKey: encodingLabel |
|
5528 | 639 |
level: 0 |
640 |
labelChannel: fileEncodingHolder |
|
641 |
adjust: right |
|
642 |
menu: encodingMenu |
|
643 |
) |
|
5331 | 644 |
(LabelSpec |
6334 | 645 |
name: 'FileEncodingLockedLabel' |
646 |
layout: (LayoutFrame -232 1 2 0.0 -220 1 20 0.0) |
|
647 |
activeHelpKey: encodingLockedLabel |
|
648 |
level: 0 |
|
649 |
labelChannel: fileEncodingLockImageHolder |
|
650 |
adjust: right |
|
651 |
menu: encodingMenu |
|
652 |
) |
|
653 |
(LabelSpec |
|
5331 | 654 |
label: 'Shown Files' |
655 |
name: 'ShownFilesLabel' |
|
656 |
layout: (LayoutFrame -220 1 1 0.0 -60 1 1 1.0) |
|
6334 | 657 |
activeHelpKey: numberOfFiles |
5331 | 658 |
level: -1 |
659 |
translateLabel: true |
|
660 |
labelChannel: shownFiles |
|
661 |
adjust: right |
|
5120 | 662 |
) |
6119 | 663 |
(ViewSpec |
664 |
name: 'ProgressIndicatorBox' |
|
665 |
layout: (LayoutFrame -220 1 1 0.0 -60 1 1 1.0) |
|
666 |
level: -1 |
|
667 |
visibilityChannel: activityVisibilityChannel |
|
668 |
component: |
|
669 |
(SpecCollection |
|
670 |
collection: ( |
|
671 |
(ProgressIndicatorSpec |
|
672 |
name: 'ProgressIndicator1' |
|
673 |
layout: (LayoutFrame 5 0.0 -7 0.5 -5 1.0 7 0.5) |
|
674 |
backgroundColor: (Color 0.0 66.666666666667 66.666666666667) |
|
675 |
isActivityIndicator: true |
|
676 |
) |
|
677 |
) |
|
678 |
||
679 |
) |
|
680 |
) |
|
5331 | 681 |
(LabelSpec |
682 |
label: 'M' |
|
683 |
name: 'ModeLabel' |
|
684 |
layout: (LayoutFrame -60 1 1 0.0 -50 1 1 1.0) |
|
6334 | 685 |
activeHelpKey: modeLabel |
5331 | 686 |
level: -1 |
687 |
translateLabel: true |
|
688 |
labelChannel: modeLabelHolder |
|
689 |
adjust: right |
|
4647 | 690 |
) |
5331 | 691 |
(LabelSpec |
692 |
label: 'L' |
|
693 |
name: 'LineLabel' |
|
694 |
layout: (LayoutFrame -50 1 1 0.0 -20 1 1 1.0) |
|
6334 | 695 |
activeHelpKey: lineLabel |
5331 | 696 |
level: -1 |
697 |
translateLabel: true |
|
698 |
labelChannel: cursorLineLabelHolder |
|
699 |
adjust: right |
|
5120 | 700 |
) |
5331 | 701 |
(LabelSpec |
702 |
label: 'C' |
|
703 |
name: 'ColLabel' |
|
704 |
layout: (LayoutFrame -20 1 1 0.0 0 1 1 1.0) |
|
6334 | 705 |
activeHelpKey: columnLabel |
5331 | 706 |
level: -1 |
707 |
translateLabel: true |
|
708 |
labelChannel: cursorColLabelHolder |
|
709 |
adjust: right |
|
4647 | 710 |
) |
711 |
) |
|
712 |
||
713 |
) |
|
714 |
) |
|
5331 | 715 |
(LabelSpec |
716 |
label: 'Preview' |
|
717 |
name: 'PreviewLabel' |
|
718 |
layout: (LayoutFrame 0 0.5 39 0 100 0.5 61 0) |
|
719 |
level: 0 |
|
720 |
borderWidth: 1 |
|
721 |
visibilityChannel: previewVisibleHolder |
|
6079 | 722 |
backgroundColor: (Color 86.999313344015 86.999313344015 86.999313344015) |
5331 | 723 |
translateLabel: true |
4647 | 724 |
) |
5331 | 725 |
(ArbitraryComponentSpec |
726 |
name: 'Preview' |
|
727 |
layout: (LayoutFrame 0 0.5 63 0 -147 1 -319 1) |
|
728 |
level: 1 |
|
729 |
visibilityChannel: previewVisibleHolder |
|
730 |
hasBorder: false |
|
731 |
component: ImageView |
|
4647 | 732 |
) |
733 |
) |
|
734 |
||
735 |
) |
|
736 |
) |
|
3892 | 737 |
! ! |
738 |
||
739 |
!FileBrowserV2 class methodsFor:'menu specs'! |
|
740 |
||
5528 | 741 |
encodingMenu |
742 |
"This resource specification was automatically generated |
|
743 |
by the MenuEditor of ST/X." |
|
744 |
||
745 |
"Do not manually edit this!! If it is corrupted, |
|
746 |
the MenuEditor may not be able to read the specification." |
|
747 |
||
748 |
" |
|
749 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#encodingMenu |
|
750 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 encodingMenu)) startUp |
|
751 |
" |
|
752 |
||
753 |
<resource: #menu> |
|
754 |
||
755 |
^ |
|
756 |
#(Menu |
|
757 |
( |
|
758 |
(MenuItem |
|
759 |
label: 'Encoding...' |
|
760 |
itemValue: fileEncodingDialog |
|
761 |
translateLabel: true |
|
762 |
) |
|
6334 | 763 |
(MenuItem |
764 |
label: '-' |
|
765 |
) |
|
766 |
(MenuItem |
|
767 |
label: 'Locked' |
|
768 |
translateLabel: true |
|
769 |
indication: lockFileEncodingHolder |
|
770 |
) |
|
5528 | 771 |
) |
772 |
nil |
|
773 |
nil |
|
774 |
) |
|
775 |
! |
|
776 |
||
3892 | 777 |
mainMenu |
778 |
"This resource specification was automatically generated |
|
779 |
by the MenuEditor of ST/X." |
|
780 |
||
781 |
"Do not manually edit this!! If it is corrupted, |
|
782 |
the MenuEditor may not be able to read the specification." |
|
783 |
||
784 |
" |
|
785 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#mainMenu |
|
786 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 mainMenu)) startUp |
|
787 |
" |
|
788 |
||
789 |
<resource: #menu> |
|
790 |
||
791 |
^ |
|
5424 | 792 |
#(Menu |
793 |
( |
|
794 |
(MenuItem |
|
795 |
label: 'Browser' |
|
796 |
translateLabel: true |
|
797 |
submenuChannel: browserMenu |
|
798 |
keepLinkedMenu: true |
|
3892 | 799 |
) |
5424 | 800 |
(MenuItem |
801 |
label: 'Directory' |
|
802 |
translateLabel: true |
|
803 |
submenuChannel: directoryMenu |
|
804 |
keepLinkedMenu: true |
|
3892 | 805 |
) |
5424 | 806 |
(MenuItem |
807 |
label: 'File' |
|
808 |
translateLabel: true |
|
809 |
submenuChannel: fileMenu |
|
810 |
keepLinkedMenu: true |
|
3892 | 811 |
) |
5424 | 812 |
(MenuItem |
813 |
label: 'Edit' |
|
814 |
translateLabel: true |
|
815 |
submenuChannel: editMenu |
|
816 |
keepLinkedMenu: true |
|
817 |
) |
|
818 |
(MenuItem |
|
819 |
label: 'View' |
|
820 |
translateLabel: true |
|
821 |
submenu: |
|
822 |
(Menu |
|
823 |
( |
|
824 |
(MenuItem |
|
825 |
label: 'Details' |
|
826 |
translateLabel: true |
|
827 |
submenuChannel: viewInContentsBrowserMenu |
|
3892 | 828 |
) |
5424 | 829 |
(MenuItem |
830 |
label: 'Sort' |
|
831 |
translateLabel: true |
|
832 |
submenuChannel: sortMenu |
|
3892 | 833 |
) |
5424 | 834 |
(MenuItem |
835 |
label: 'Show' |
|
836 |
translateLabel: true |
|
837 |
submenuChannel: showMenuSpec |
|
3892 | 838 |
) |
5424 | 839 |
(MenuItem |
840 |
label: '-' |
|
3892 | 841 |
) |
5424 | 842 |
(MenuItem |
843 |
label: 'Toolbar' |
|
844 |
translateLabel: true |
|
845 |
hideMenuOnActivated: false |
|
846 |
indication: toolBarVisibleHolder |
|
3892 | 847 |
) |
5424 | 848 |
(MenuItem |
849 |
label: 'Path Entry && Filter' |
|
850 |
translateLabel: true |
|
851 |
hideMenuOnActivated: false |
|
852 |
indication: filenameEntryFieldVisibleHolder |
|
3892 | 853 |
) |
5424 | 854 |
(MenuItem |
855 |
label: 'Preview' |
|
856 |
translateLabel: true |
|
857 |
hideMenuOnActivated: false |
|
858 |
indication: previewVisibleHolder |
|
4252 | 859 |
) |
5424 | 860 |
(MenuItem |
861 |
label: '-' |
|
3892 | 862 |
) |
5424 | 863 |
(MenuItem |
864 |
label: 'Update' |
|
865 |
itemValue: updateCurrentDirectory |
|
866 |
translateLabel: true |
|
3892 | 867 |
) |
868 |
) |
|
869 |
nil |
|
870 |
nil |
|
871 |
) |
|
872 |
) |
|
5424 | 873 |
(MenuItem |
874 |
label: 'Tools' |
|
875 |
translateLabel: true |
|
876 |
submenuChannel: toolsMenuSpec |
|
877 |
keepLinkedMenu: true |
|
3892 | 878 |
) |
5424 | 879 |
(MenuItem |
880 |
label: 'CVS' |
|
881 |
translateLabel: true |
|
882 |
submenuChannel: cvsMenu |
|
883 |
keepLinkedMenu: true |
|
3892 | 884 |
) |
5424 | 885 |
(MenuItem |
886 |
label: 'Help' |
|
887 |
translateLabel: true |
|
888 |
startGroup: right |
|
889 |
submenu: |
|
890 |
(Menu |
|
891 |
( |
|
892 |
(MenuItem |
|
893 |
label: 'FileBrowser Documentation' |
|
894 |
itemValue: openHTMLDocument: |
|
895 |
translateLabel: true |
|
5750 | 896 |
argument: 'tools/fbrowserV2/TOP.html' |
3892 | 897 |
) |
5424 | 898 |
(MenuItem |
899 |
label: '-' |
|
3892 | 900 |
) |
5424 | 901 |
(MenuItem |
902 |
label: 'About FileBrowser...' |
|
903 |
itemValue: openAboutThisApplication |
|
904 |
translateLabel: true |
|
3892 | 905 |
) |
906 |
) |
|
907 |
nil |
|
908 |
nil |
|
909 |
) |
|
910 |
) |
|
911 |
) |
|
912 |
nil |
|
913 |
nil |
|
914 |
) |
|
5750 | 915 |
|
916 |
"Modified: / 17-03-2004 / 13:19:04 / cg" |
|
3892 | 917 |
! |
918 |
||
4257 | 919 |
previewLabelMenu |
920 |
"This resource specification was automatically generated |
|
921 |
by the MenuEditor of ST/X." |
|
922 |
||
923 |
"Do not manually edit this!! If it is corrupted, |
|
924 |
the MenuEditor may not be able to read the specification." |
|
925 |
||
926 |
" |
|
927 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#previewLabelMenu |
|
928 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 previewLabelMenu)) startUp |
|
929 |
" |
|
930 |
||
931 |
<resource: #menu> |
|
932 |
||
933 |
^ |
|
934 |
#(#Menu |
|
935 |
#( |
|
936 |
#(#MenuItem |
|
937 |
#label: 'Close Preview' |
|
938 |
#itemValue: #closePreview |
|
939 |
#translateLabel: true |
|
940 |
) |
|
941 |
) |
|
942 |
nil |
|
943 |
nil |
|
944 |
) |
|
945 |
! |
|
946 |
||
3892 | 947 |
toolBarMainMenu |
948 |
"This resource specification was automatically generated |
|
949 |
by the MenuEditor of ST/X." |
|
950 |
||
951 |
"Do not manually edit this!! If it is corrupted, |
|
952 |
the MenuEditor may not be able to read the specification." |
|
953 |
||
954 |
" |
|
955 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#toolBarMainMenu |
|
956 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 toolBarMainMenu)) startUp |
|
957 |
" |
|
958 |
||
959 |
<resource: #menu> |
|
960 |
||
961 |
^ |
|
5398 | 962 |
#(Menu |
963 |
( |
|
964 |
(MenuItem |
|
965 |
activeHelpKey: directoryUp |
|
966 |
enabled: enableDirectoryUp |
|
967 |
label: 'DirectoryUp' |
|
968 |
itemValue: doGoDirectoryUp |
|
969 |
translateLabel: true |
|
970 |
isButton: true |
|
6093 | 971 |
labelImage: (ResourceRetriever ToolbarIconLibrary directoryUpIcon) |
3892 | 972 |
) |
5398 | 973 |
(MenuItem |
974 |
activeHelpKey: directoryBack |
|
975 |
enabled: enableBack |
|
976 |
label: 'Back' |
|
977 |
itemValue: doBack |
|
978 |
translateLabel: true |
|
979 |
isButton: true |
|
980 |
submenuChannel: menuDirHistoryBack |
|
6093 | 981 |
labelImage: (ResourceRetriever ToolbarIconLibrary historyBackIcon) |
3892 | 982 |
) |
5398 | 983 |
(MenuItem |
984 |
label: '' |
|
3892 | 985 |
) |
5398 | 986 |
(MenuItem |
987 |
activeHelpKey: directoryForward |
|
988 |
enabled: enableForward |
|
989 |
label: 'Forward' |
|
990 |
itemValue: doForward |
|
991 |
translateLabel: true |
|
992 |
isButton: true |
|
993 |
submenuChannel: menuDirHistoryForward |
|
6093 | 994 |
labelImage: (ResourceRetriever ToolbarIconLibrary historyForwardIcon) |
3892 | 995 |
) |
5398 | 996 |
(MenuItem |
997 |
label: '' |
|
3892 | 998 |
) |
5398 | 999 |
(MenuItem |
1000 |
activeHelpKey: fileHome |
|
1001 |
enabled: enableHome |
|
1002 |
label: 'Home' |
|
1003 |
itemValue: doGotoHomeDirectory |
|
1004 |
translateLabel: true |
|
1005 |
isButton: true |
|
6096 | 1006 |
labelImage: (ResourceRetriever ToolbarIconLibrary homeIcon) |
3892 | 1007 |
) |
5398 | 1008 |
(MenuItem |
1009 |
activeHelpKey: fileGotoDefault |
|
1010 |
enabled: enableGotoDefault |
|
1011 |
label: 'ST/X Default' |
|
1012 |
itemValue: doGotoDefaultDirectory |
|
1013 |
translateLabel: true |
|
1014 |
isButton: true |
|
6096 | 1015 |
labelImage: (ResourceRetriever ToolbarIconLibrary stxHomeIcon) |
4593 | 1016 |
) |
5398 | 1017 |
(MenuItem |
6099 | 1018 |
activeHelpKey: fileGotoBookmark |
1019 |
label: 'Bookmarks' |
|
1020 |
translateLabel: true |
|
1021 |
isButton: true |
|
1022 |
submenuChannel: gotoBookmarksMenuSpec |
|
1023 |
labelImage: (ResourceRetriever ToolbarIconLibrary directoryBookmarksIcon) |
|
1024 |
) |
|
1025 |
(MenuItem |
|
5398 | 1026 |
label: '' |
3892 | 1027 |
) |
5398 | 1028 |
(MenuItem |
1029 |
activeHelpKey: fileHistory |
|
1030 |
enabled: enableFileHistory |
|
1031 |
label: 'File History' |
|
1032 |
translateLabel: true |
|
1033 |
isButton: true |
|
1034 |
submenuChannel: menuFileHistory |
|
6093 | 1035 |
labelImage: (ResourceRetriever ToolbarIconLibrary historyIcon) |
5398 | 1036 |
) |
1037 |
(MenuItem |
|
1038 |
label: '-' |
|
3892 | 1039 |
) |
5398 | 1040 |
(MenuItem |
1041 |
activeHelpKey: cutFile |
|
1042 |
enabled: hasSelection |
|
1043 |
label: 'Cut' |
|
1044 |
itemValue: cutFiles |
|
1045 |
translateLabel: true |
|
1046 |
isButton: true |
|
6093 | 1047 |
labelImage: (ResourceRetriever ToolbarIconLibrary cutFileIcon) |
3892 | 1048 |
) |
5398 | 1049 |
(MenuItem |
1050 |
activeHelpKey: copyFile |
|
1051 |
enabled: hasSelection |
|
1052 |
label: 'Copy' |
|
1053 |
itemValue: copyFiles |
|
1054 |
translateLabel: true |
|
1055 |
isButton: true |
|
6093 | 1056 |
labelImage: (ResourceRetriever ToolbarIconLibrary copyFileIcon) |
4730 | 1057 |
) |
5398 | 1058 |
(MenuItem |
1059 |
activeHelpKey: pasteFile |
|
1060 |
enabled: canPaste |
|
1061 |
label: 'Paste' |
|
1062 |
itemValue: pasteFiles |
|
1063 |
translateLabel: true |
|
1064 |
isButton: true |
|
6093 | 1065 |
labelImage: (ResourceRetriever ToolbarIconLibrary pasteFileIcon) |
3892 | 1066 |
) |
5398 | 1067 |
(MenuItem |
1068 |
activeHelpKey: deleteFile |
|
1069 |
enabled: hasSelection |
|
1070 |
label: 'Delete' |
|
1071 |
itemValue: deleteFiles |
|
1072 |
translateLabel: true |
|
1073 |
isButton: true |
|
6093 | 1074 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteFileIcon) |
3892 | 1075 |
) |
5398 | 1076 |
(MenuItem |
1077 |
label: '-' |
|
1078 |
) |
|
1079 |
(MenuItem |
|
6116 | 1080 |
activeHelpKey: fileIn |
1081 |
label: 'File In' |
|
1082 |
itemValue: fileFileIn |
|
1083 |
translateLabel: true |
|
1084 |
isButton: true |
|
1085 |
labelImage: (ResourceRetriever ToolbarIconLibrary fileInIcon) |
|
1086 |
) |
|
1087 |
(MenuItem |
|
1088 |
activeHelpKey: openChangeBrowser |
|
1089 |
enabled: hasFileSelection |
|
1090 |
label: 'Changes Browser' |
|
1091 |
itemValue: openChangesBrowser |
|
1092 |
translateLabel: true |
|
1093 |
isButton: true |
|
6307 | 1094 |
labelImage: (ResourceRetriever ToolbarIconLibrary startChangesBrowserIcon) |
6116 | 1095 |
) |
1096 |
(MenuItem |
|
1097 |
label: '-' |
|
1098 |
) |
|
1099 |
(MenuItem |
|
6093 | 1100 |
activeHelpKey: editFile |
1101 |
label: 'Edit File' |
|
1102 |
itemValue: doShowFileContents |
|
1103 |
translateLabel: true |
|
1104 |
isButton: true |
|
1105 |
labelImage: (ResourceRetriever ToolbarIconLibrary editFileIcon) |
|
1106 |
) |
|
1107 |
(MenuItem |
|
5398 | 1108 |
activeHelpKey: searchFile |
1109 |
label: 'Search File' |
|
1110 |
itemValue: doOpenSearchFile |
|
1111 |
translateLabel: true |
|
1112 |
isButton: true |
|
6094 | 1113 |
labelImage: (ResourceRetriever ToolbarIconLibrary searchFileIcon) |
3892 | 1114 |
) |
5398 | 1115 |
(MenuItem |
1116 |
activeHelpKey: addTerminal |
|
1117 |
label: 'VT100' |
|
1118 |
itemValue: doAddTerminal |
|
1119 |
translateLabel: true |
|
1120 |
isButton: true |
|
6094 | 1121 |
labelImage: (ResourceRetriever ToolbarIconLibrary shellTerminalIcon) |
3892 | 1122 |
) |
5398 | 1123 |
(MenuItem |
1124 |
activeHelpKey: make |
|
1125 |
enabled: canMake |
|
1126 |
label: 'Make' |
|
1127 |
itemValue: doMake |
|
1128 |
translateLabel: true |
|
1129 |
isButton: true |
|
6095 | 1130 |
labelImage: (ResourceRetriever ToolbarIconLibrary makeIcon) |
4236 | 1131 |
) |
5398 | 1132 |
(MenuItem |
6116 | 1133 |
activeHelpKey: viewDetails |
5398 | 1134 |
label: 'viewDetails' |
1135 |
translateLabel: true |
|
1136 |
isButton: true |
|
1137 |
startGroup: right |
|
1138 |
hideMenuOnActivated: false |
|
1139 |
indication: viewDetails |
|
6096 | 1140 |
labelImage: (ResourceRetriever ToolbarIconLibrary viewDetailsIcon) |
4688 | 1141 |
) |
5398 | 1142 |
(MenuItem |
6096 | 1143 |
activeHelpKey: viewDetails |
5398 | 1144 |
label: 'viewDetails' |
1145 |
translateLabel: true |
|
1146 |
isButton: true |
|
1147 |
startGroup: right |
|
1148 |
isVisible: false |
|
1149 |
indication: viewDetails |
|
1150 |
submenuChannel: viewDetailsMenuSpec |
|
6096 | 1151 |
labelImage: (ResourceRetriever ToolbarIconLibrary viewDetailsIcon) |
3980 | 1152 |
) |
5398 | 1153 |
(MenuItem |
5686 | 1154 |
activeHelpKey: selectDetails |
5398 | 1155 |
label: '' |
1156 |
isButton: true |
|
1157 |
startGroup: right |
|
1158 |
submenuChannel: viewDetailsMenuSpec |
|
1159 |
labelImage: (ResourceRetriever ToolbarIconLibrary empty1x20Icon) |
|
4688 | 1160 |
) |
3892 | 1161 |
) |
1162 |
nil |
|
1163 |
nil |
|
1164 |
) |
|
1165 |
! ! |
|
1166 |
||
1167 |
!FileBrowserV2 methodsFor:'actions'! |
|
1168 |
||
1169 |
changeFileBrowserTitleTo:aString |
|
1170 |
||
1171 |
|string| |
|
1172 |
||
1173 |
string := 'FileBrowser ', aString. |
|
1174 |
self window label:string. |
|
1175 |
! |
|
1176 |
||
1177 |
doSpawn |
|
1178 |
||
1179 |
self saveRuntimeAspectValues. |
|
1180 |
self class openWithAspects:aspects withExtent:self builder window extent. |
|
1181 |
! |
|
1182 |
||
1183 |
hideFilenameEntryField |
|
1184 |
self filenameEntryFieldVisibleHolder value:false. |
|
1185 |
! |
|
1186 |
||
1187 |
hideToolbar |
|
1188 |
self toolBarVisibleHolder value:false. |
|
3980 | 1189 |
! |
1190 |
||
1191 |
toggleFileDetailsFor:anItem |
|
1192 |
|viewDetails| |
|
1193 |
||
1194 |
viewDetails := self viewDetails value not. |
|
1195 |
self viewDetails value:viewDetails. |
|
1196 |
||
1197 |
viewDetails ifTrue:[ |
|
1198 |
anItem activeHelpKey:#hideFileDetails. |
|
6096 | 1199 |
anItem label:(ToolbarIconLibrary viewNoDetailsIcon). |
3980 | 1200 |
] ifFalse:[ |
1201 |
anItem activeHelpKey:#showFileDetails. |
|
6096 | 1202 |
anItem label:(ToolbarIconLibrary viewDetailsIcon). |
3980 | 1203 |
]. |
3892 | 1204 |
! ! |
1205 |
||
1206 |
!FileBrowserV2 methodsFor:'aspects'! |
|
1207 |
||
5120 | 1208 |
cursorColLabelHolder |
1209 |
^ self |
|
1210 |
aspectFor:#cursorColLabelHolder |
|
1211 |
ifAbsent:[ |
|
1212 |
self |
|
1213 |
applicationNamed:#FileApplicationNoteBook |
|
1214 |
ifPresentDo:[:appl | appl cursorColLabelHolder]. |
|
1215 |
] |
|
1216 |
! |
|
1217 |
||
1218 |
cursorLineLabelHolder |
|
1219 |
^ self |
|
1220 |
aspectFor:#cursorLineLabelHolder |
|
1221 |
ifAbsent:[ |
|
1222 |
self |
|
1223 |
applicationNamed:#FileApplicationNoteBook |
|
1224 |
ifPresentDo:[:appl | appl cursorLineLabelHolder]. |
|
1225 |
] |
|
1226 |
! |
|
1227 |
||
6334 | 1228 |
fileEncodingLockImageHolder |
1229 |
^ self |
|
1230 |
aspectFor:#fileEncodingLockImageHolder |
|
1231 |
ifAbsent:[ |
|
1232 |
BlockValue |
|
1233 |
with:[:m | m value ifTrue:[ToolbarIconLibrary padLockRedMiniIcon] ifFalse:[nil] ] |
|
1234 |
argument:(self lockFileEncodingHolder) |
|
1235 |
] |
|
1236 |
! |
|
1237 |
||
3892 | 1238 |
fileEntryFieldHolder |
1239 |
||
1240 |
fileEntryFieldHolder isNil ifTrue:[ |
|
1241 |
fileEntryFieldHolder := ValueHolder new. |
|
1242 |
fileEntryFieldHolder addDependent:self. |
|
1243 |
]. |
|
1244 |
^ fileEntryFieldHolder. |
|
4647 | 1245 |
! |
1246 |
||
1247 |
listOfDeviceDrives |
|
1248 |
||
1249 |
listOfDeviceDrives isNil ifTrue:[ |
|
1250 |
listOfDeviceDrives := Filename volumes. |
|
1251 |
]. |
|
1252 |
^ listOfDeviceDrives |
|
1253 |
! |
|
1254 |
||
5120 | 1255 |
modeLabelHolder |
1256 |
^ self |
|
1257 |
aspectFor:#modeLabelHolder |
|
1258 |
ifAbsent:[ |
|
1259 |
self |
|
1260 |
applicationNamed:#FileApplicationNoteBook |
|
1261 |
ifPresentDo:[:appl | appl modeLabelHolder]. |
|
1262 |
] |
|
1263 |
! |
|
1264 |
||
4647 | 1265 |
selectedDeviceDrive |
1266 |
||
1267 |
selectedDeviceDrive isNil ifTrue:[ |
|
1268 |
selectedDeviceDrive := self listOfDeviceDrives first asValue. |
|
1269 |
selectedDeviceDrive addDependent:self. |
|
1270 |
]. |
|
1271 |
^ selectedDeviceDrive |
|
3892 | 1272 |
! ! |
1273 |
||
4252 | 1274 |
!FileBrowserV2 methodsFor:'aspects-visibility'! |
1275 |
||
5120 | 1276 |
driveSelectorVisible |
1277 |
^ self systemIsDOS |
|
1278 |
! |
|
1279 |
||
4252 | 1280 |
filenameEntryFieldVisibleHolder |
1281 |
" aspect for show FileEntryField " |
|
1282 |
||
1283 |
^ self aspectFor:#filenameEntryFieldVisibleHolder ifAbsent:[true asValue] |
|
1284 |
! |
|
1285 |
||
1286 |
previewVisibleHolder |
|
1287 |
" aspect for show preview" |
|
1288 |
||
1289 |
^ self aspectFor:#previewVisibleHolder ifAbsent:[false asValue] |
|
1290 |
! |
|
1291 |
||
1292 |
toolBarVisibleHolder |
|
1293 |
" aspect for show toolbar" |
|
1294 |
||
1295 |
^ self aspectFor:#toolBarVisibleHolder ifAbsent:[true asValue] |
|
1296 |
! ! |
|
1297 |
||
3892 | 1298 |
!FileBrowserV2 methodsFor:'change & update'! |
1299 |
||
4011 | 1300 |
currentFileNameHolderChanged |
4775 | 1301 |
|newEntryValue nSelected files volume| |
4011 | 1302 |
|
1303 |
files := self currentFileNameHolder value. |
|
4252 | 1304 |
nSelected := files size. |
4011 | 1305 |
|
4252 | 1306 |
nSelected == 0 ifTrue:[ |
4454
c85336c15975
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4451
diff
changeset
|
1307 |
newEntryValue := ''. |
4011 | 1308 |
] ifFalse:[ |
4252 | 1309 |
nSelected == 1 ifTrue:[ |
4775 | 1310 |
newEntryValue := files first. |
4011 | 1311 |
] ifFalse:[ |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4750
diff
changeset
|
1312 |
newEntryValue := self commonPrefixOfSelectedFiles. |
4011 | 1313 |
]. |
1314 |
]. |
|
4390
e9e2343d5569
no expand on change filename holder for entry field anymore
penk
parents:
4380
diff
changeset
|
1315 |
self fileEntryFieldHolder value:(newEntryValue asString) withoutNotifying:self. |
4775 | 1316 |
|
5187
ce7e3132b012
supportsVolumes instead of OperatingSystem isWindowsLike for volume widget
james
parents:
5185
diff
changeset
|
1317 |
OperatingSystem supportsVolumes ifTrue:[ |
5185
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1318 |
volume := (nSelected >= 1) |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1319 |
ifTrue:[files first volume] |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1320 |
ifFalse:nil. |
4775 | 1321 |
self selectedDeviceDrive value:volume. |
5187
ce7e3132b012
supportsVolumes instead of OperatingSystem isWindowsLike for volume widget
james
parents:
5185
diff
changeset
|
1322 |
]. |
4252 | 1323 |
self updatePreview. |
4011 | 1324 |
! |
1325 |
||
1326 |
fileEntryFieldHolderChanged |
|
5185
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1327 |
|fileName fileNameString answer dir| |
4011 | 1328 |
|
4507
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1329 |
fileNameString := fileEntryFieldHolder value withoutSeparators. |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1330 |
fileName := fileNameString asFilename. |
5281 | 1331 |
fileNameString isEmpty ifTrue:[ |
1332 |
pathEntryField flash. |
|
1333 |
^ self |
|
1334 |
]. |
|
4507
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1335 |
|
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1336 |
(fileName exists) ifFalse:[ |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1337 |
pathEntryField flash. |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1338 |
|
5185
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1339 |
dir := fileName directory. |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1340 |
dir exists ifTrue:[ |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1341 |
self currentFileNameHolder |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1342 |
value:(OrderedCollection with:dir) |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1343 |
withoutNotifying:self. |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1344 |
]. |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1345 |
fileName baseName includesMatchCharacters ifTrue:[ |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1346 |
self fileEntryFieldHolder value:(fileName directoryName) withoutNotifying:self. |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1347 |
self filterModel value:fileName baseName. |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1348 |
]. |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1349 |
|
4531 | 1350 |
"/ answer := OptionBox |
1351 |
"/ request:(resources string:'No file or directory named "%1" exists.\\Create ?' with:fileNameString allBold) withCRs |
|
1352 |
"/ buttonLabels:#('Create as File' 'Create as Directory' 'Cancel') |
|
1353 |
"/ values:#(createFile createDirectory nil) |
|
1354 |
"/ default:nil. |
|
1355 |
"/ |
|
4507
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1356 |
answer isNil ifTrue:[ |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1357 |
^ self. |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1358 |
]. |
5185
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1359 |
|
4507
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1360 |
[ |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1361 |
answer == #createFile ifTrue:[ |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1362 |
fileName directory recursiveMakeDirectory. |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1363 |
fileName createAsEmptyFile. |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1364 |
] ifFalse:[ |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1365 |
answer == #createDirectory ifTrue:[ |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1366 |
fileName recursiveMakeDirectory. |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1367 |
] |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1368 |
]. |
4819 | 1369 |
] on:OperatingSystem accessDeniedErrorSignal do:[:ex | |
1370 |
Dialog warn:'Error: ' , ex description. |
|
1371 |
]. |
|
4507
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1372 |
^ self |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1373 |
]. |
5959 | 1374 |
self setCurrentFileName:fileName. |
4011 | 1375 |
! |
1376 |
||
4647 | 1377 |
selectedDeviceDriveChanged |
1378 |
||
1379 |
| newDrive curSel newFile| |
|
1380 |
||
1381 |
newDrive := self selectedDeviceDrive value. |
|
1382 |
curSel := self currentFileNameHolder value. |
|
1383 |
curSel notEmpty ifTrue:[ |
|
1384 |
curSel first volume = newDrive ifTrue:[ ^self]. |
|
1385 |
]. |
|
5411
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1386 |
newDrive notNil ifTrue:[ |
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1387 |
newFile := newDrive asFilename. |
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1388 |
|
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1389 |
newFile isReadable ifTrue:[ |
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1390 |
self gotoFile:newFile. |
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1391 |
^self. |
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1392 |
]. |
4651 | 1393 |
]. |
1394 |
curSel notEmpty ifTrue:[ |
|
1395 |
self selectedDeviceDrive value:(curSel first volume). |
|
1396 |
] ifFalse:[ |
|
1397 |
self selectedDeviceDrive value:'C:'. |
|
1398 |
]. |
|
4647 | 1399 |
! |
1400 |
||
4252 | 1401 |
selectedImage |
1402 |
|files selectedFile mime img| |
|
1403 |
||
4451
6f06f760a64b
only open preview for selected files not for directories
penk
parents:
4390
diff
changeset
|
1404 |
files := self currentSelectedFiles. |
4259 | 1405 |
files size >= 1 ifFalse:[ |
4252 | 1406 |
^ nil |
1407 |
]. |
|
4259 | 1408 |
selectedFile := files last. |
4252 | 1409 |
|
1410 |
mime := MIMETypes mimeTypeForFilename:selectedFile. |
|
1411 |
(mime notNil and:[mime startsWith:'image/']) ifTrue:[ |
|
1412 |
img := Image fromFile:selectedFile. |
|
1413 |
^ img |
|
1414 |
]. |
|
1415 |
||
1416 |
^ nil. |
|
1417 |
! |
|
1418 |
||
4262 | 1419 |
showImagePreview:image |
4252 | 1420 |
|imgView| |
1421 |
||
4262 | 1422 |
imgView := builder componentAt:#Preview. |
4252 | 1423 |
|
1424 |
imgView adjust:#fitBig. |
|
1425 |
imgView image:image. |
|
1426 |
! |
|
1427 |
||
4262 | 1428 |
showPreview |
1429 |
|shownImage lbl previewLabel| |
|
1430 |
||
1431 |
shownImage := self selectedImage. |
|
4300 | 1432 |
lbl := shownImage isNil ifTrue:'Preview' ifFalse:[ shownImage fileName asFilename baseName ]. |
4262 | 1433 |
|
1434 |
previewLabel := builder componentAt:#PreviewLabel. |
|
1435 |
previewLabel label:lbl; forceResizeHorizontally. |
|
1436 |
self enqueueMessage:#'showImagePreview:' for:self arguments:(Array with:shownImage). |
|
1437 |
! |
|
1438 |
||
3892 | 1439 |
update:something with:aParameter from:changedObject |
1440 |
||
1441 |
||
4647 | 1442 |
changedObject == self selectedDeviceDrive ifTrue:[ |
1443 |
self selectedDeviceDriveChanged. |
|
1444 |
^ self. |
|
1445 |
]. |
|
3892 | 1446 |
changedObject == self fileEntryFieldHolder ifTrue:[ |
4011 | 1447 |
self fileEntryFieldHolderChanged. |
1448 |
^ self. |
|
3892 | 1449 |
]. |
1450 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4011 | 1451 |
super update:something with:aParameter from:changedObject. |
1452 |
self currentFileNameHolderChanged. |
|
1453 |
^ self. |
|
3892 | 1454 |
]. |
4252 | 1455 |
(changedObject == self previewVisibleHolder) ifTrue:[ |
1456 |
self updatePreview. |
|
1457 |
^ self. |
|
1458 |
]. |
|
3892 | 1459 |
(changedObject == self toolBarVisibleHolder |
1460 |
or:[changedObject == self filenameEntryFieldVisibleHolder]) ifTrue:[ |
|
1461 |
self updateToolVisibility. |
|
1462 |
^ self. |
|
1463 |
]. |
|
4085
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1464 |
(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
|
1465 |
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
|
1466 |
^ self. |
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1467 |
]. |
3892 | 1468 |
|
1469 |
^ super update:something with:aParameter from:changedObject. |
|
1470 |
! |
|
1471 |
||
4252 | 1472 |
updatePreview |
5477 | 1473 |
|previewLabel shownImage plug| |
4252 | 1474 |
|
1475 |
self previewVisibleHolder value ifTrue:[ |
|
5477 | 1476 |
shownImage := nil. |
1477 |
imgView := builder componentAt:#Preview. |
|
1478 |
previewLabel := builder componentAt:#PreviewLabel. |
|
4257 | 1479 |
plug := Plug new. |
1480 |
plug respondTo:#closePreview with:[ self previewVisibleHolder value:false ]. |
|
1481 |
||
1482 |
previewLabel menuHolder:(self class previewLabelMenu decodeAsLiteralArray). |
|
1483 |
previewLabel menuPerformer:plug asValue. |
|
1484 |
||
4252 | 1485 |
previewProcess notNil ifTrue:[ |
1486 |
previewProcess terminate |
|
1487 |
]. |
|
1488 |
previewProcess := [ |
|
1489 |
|imgView oldBg shownImage lbl| |
|
1490 |
||
1491 |
oldBg := previewLabel backgroundColor. |
|
1492 |
previewLabel backgroundColor:(Color red lightened lightened). |
|
1493 |
[ |
|
4262 | 1494 |
self showPreview. |
4252 | 1495 |
previewProcess := nil. |
1496 |
] ensure:[ |
|
1497 |
previewLabel backgroundColor:oldBg. |
|
1498 |
]. |
|
1499 |
] forkAt:7. |
|
1500 |
] ifFalse:[ |
|
4254 | 1501 |
imgView notNil ifTrue:[ |
1502 |
imgView image:nil. |
|
1503 |
] |
|
4252 | 1504 |
]. |
1505 |
! |
|
1506 |
||
3892 | 1507 |
updateToolVisibility |
1508 |
|builder toolBar filenameEntryField vPanel topOffset visible d| |
|
1509 |
||
1510 |
builder := self builder. |
|
1511 |
||
1512 |
topOffset := 0. |
|
1513 |
visible := self toolBarVisibleHolder value. |
|
1514 |
visible ifTrue:[ |
|
1515 |
toolBar := builder componentAt:#ToolbarBox. |
|
1516 |
topOffset := topOffset + toolBar height. |
|
1517 |
]. |
|
1518 |
||
1519 |
visible := self filenameEntryFieldVisibleHolder value. |
|
1520 |
visible ifTrue:[ |
|
1521 |
filenameEntryField := builder componentAt:#FilenameEntryFieldBox. |
|
1522 |
d := filenameEntryField layout bottomOffset - filenameEntryField layout topOffset. |
|
1523 |
filenameEntryField layout topOffset:topOffset bottomOffset:topOffset + d. |
|
1524 |
topOffset := topOffset + filenameEntryField height. |
|
1525 |
filenameEntryField container notNil ifTrue:[ |
|
1526 |
filenameEntryField containerChangedSize. |
|
1527 |
]. |
|
1528 |
]. |
|
1529 |
||
1530 |
vPanel := builder componentAt:#BrowserBox. |
|
1531 |
vPanel layout topOffset:topOffset+1. |
|
1532 |
vPanel container notNil ifTrue:[ |
|
1533 |
vPanel containerChangedSize. |
|
1534 |
]. |
|
1535 |
! ! |
|
1536 |
||
3957 | 1537 |
!FileBrowserV2 methodsFor:'event handling'! |
1538 |
||
4904 | 1539 |
crPressedInPathField |
1540 |
|path fn| |
|
1541 |
||
1542 |
path := fileEntryFieldHolder value. |
|
1543 |
fn := path asFilename. |
|
1544 |
(fn exists and:[ fn isDirectory not ]) ifTrue:[ |
|
1545 |
self openApplForFile:path. |
|
1546 |
] |
|
1547 |
! |
|
1548 |
||
3957 | 1549 |
processEvent:anEvent |
1550 |
"filter keyboard events. |
|
1551 |
Return true, if I have eaten the event" |
|
1552 |
||
1553 |
|focusView key rawKey fileName| |
|
1554 |
||
1555 |
anEvent isKeyPressEvent ifTrue:[ |
|
1556 |
focusView := anEvent targetView. |
|
1557 |
key := anEvent key. |
|
1558 |
rawKey := anEvent rawKey. |
|
1559 |
||
1560 |
(focusView isSameOrComponentOf:self window) ifTrue:[ |
|
1561 |
||
6145 | 1562 |
(focusView == pathEntryField) ifFalse:[ ^ false]. |
3957 | 1563 |
|
1564 |
(key == #Return) ifTrue:[ |
|
1565 |
fileName := pathEntryField list first asFilename. |
|
1566 |
(fileName exists and:[fileName isDirectory not]) ifTrue:[ |
|
4101 | 1567 |
self openApplForFile:fileName |
3957 | 1568 |
]. |
1569 |
]. |
|
1570 |
] |
|
1571 |
]. |
|
1572 |
^ false |
|
1573 |
! ! |
|
1574 |
||
6131 | 1575 |
!FileBrowserV2 methodsFor:'menu accessing'! |
1576 |
||
1577 |
menuFileHistory |
|
1578 |
"initialize the file history menu |
|
1579 |
" |
|
1580 |
<resource: #programMenu > |
|
1581 |
||
1582 |
|menu hist text removeItem removeCol| |
|
1583 |
||
1584 |
menu := Menu new. |
|
1585 |
menu findGuiResourcesIn:self. |
|
1586 |
menu receiver:self. |
|
1587 |
||
1588 |
hist := self fileHistory. |
|
1589 |
hist isEmpty ifTrue:[^ nil]. |
|
1590 |
||
1591 |
removeCol := OrderedCollection new. |
|
1592 |
hist do:[:aFileItem| |
|
1593 |
"aFileItem fileName exists" true ifTrue:[ |
|
1594 |
menu addItem:(MenuItem label: aFileItem fileName asString value:[ |
|
1595 |
self setCurrentFileName:(aFileItem fileName). |
|
1596 |
self openApplByFileItem:aFileItem |
|
1597 |
]). |
|
1598 |
] ifFalse:[ |
|
1599 |
removeCol add:aFileItem. |
|
1600 |
] |
|
1601 |
]. |
|
1602 |
"/ remove all not existing history entries |
|
1603 |
removeCol do:[ : el | |
|
1604 |
hist remove:el. |
|
1605 |
]. |
|
1606 |
removeItem := MenuItem new. |
|
1607 |
removeItem translateLabel:true. |
|
1608 |
text := resources string:'Clear History'. |
|
1609 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text. |
|
1610 |
removeItem label:text. |
|
1611 |
removeItem value:[ |
|
1612 |
self fileHistory removeAll. |
|
1613 |
self enableFileHistory value:false. |
|
1614 |
]. |
|
1615 |
menu addSeparator. |
|
1616 |
menu addItem:removeItem. |
|
1617 |
^ menu |
|
1618 |
! ! |
|
1619 |
||
3892 | 1620 |
!FileBrowserV2 methodsFor:'startup & release'! |
1621 |
||
3954 | 1622 |
closeRequest |
5010 | 1623 |
self |
1624 |
applicationNamed:#FileApplicationNoteBook |
|
1625 |
ifPresentDo:[:appl | appl tryCloseApplications ifFalse:[^ self] ]. |
|
1626 |
||
3954 | 1627 |
^ super closeRequest. |
1628 |
! |
|
1629 |
||
3892 | 1630 |
hideFilenameEntryFieldButtonCreated:aButton |
1631 |
||
1632 |
aButton passiveLevel:(MenuPanel defaultLevel). |
|
1633 |
aButton activeLevel:-1. |
|
1634 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
|
1635 |
! |
|
1636 |
||
1637 |
hideToolBarButtonCreated:aButton |
|
1638 |
||
1639 |
aButton passiveLevel:(MenuPanel defaultLevel). |
|
1640 |
aButton activeLevel:-1. |
|
1641 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
|
1642 |
! |
|
1643 |
||
1644 |
initialize |
|
1645 |
||
1646 |
self masterApplication:nil. |
|
4022 | 1647 |
self dirHistory resetForwardBackward. |
3892 | 1648 |
! |
1649 |
||
1650 |
makeDependent |
|
4008 | 1651 |
|
4004 | 1652 |
super makeDependent. |
4085
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1653 |
self sortBlockProperty addDependent:self. |
3892 | 1654 |
self filenameEntryFieldVisibleHolder addDependent:self. |
1655 |
self toolBarVisibleHolder addDependent:self. |
|
4255 | 1656 |
self previewVisibleHolder addDependent:self. |
3892 | 1657 |
! |
1658 |
||
4884 | 1659 |
postBuildDirectoryTree:aWidget |
1660 |
aWidget application multipleSelect:true. |
|
1661 |
! |
|
1662 |
||
4365 | 1663 |
postBuildEditField:aWidget |
1664 |
||
1665 |
pathEntryField := aWidget. |
|
1666 |
aWidget model:self fileEntryFieldHolder. |
|
1667 |
aWidget listHolder:self dirHistory. |
|
1668 |
aWidget level:-1. |
|
4904 | 1669 |
aWidget acceptIfUnchanged:true. |
1670 |
aWidget crAction:[ self crPressedInPathField ]. |
|
4365 | 1671 |
! |
1672 |
||
4018 | 1673 |
postBuildFilterBox:aWidget |
1674 |
||
1675 |
self filterValueBox value:aWidget. |
|
1676 |
self filterBackgroundColor value:aWidget backgroundColor. |
|
1677 |
! |
|
1678 |
||
3892 | 1679 |
postBuildPathViewBox:aWidget |
1680 |
||
1681 |
aWidget backgroundColor:(MenuPanel defaultBackgroundColor). |
|
1682 |
! |
|
1683 |
||
1684 |
postBuildWith:aBuilder |
|
1685 |
||
1686 |
super postBuildWith:aBuilder. |
|
3980 | 1687 |
self updateToolVisibility. |
3892 | 1688 |
! |
1689 |
||
1690 |
postOpenWith:aBuilder |
|
1691 |
||
4071 | 1692 |
super postOpenWith:aBuilder. |
4577 | 1693 |
self currentFileNameHolderChangedForCommon. |
4071 | 1694 |
self currentFileNameHolderChanged. |
4027 | 1695 |
|
3957 | 1696 |
self windowGroup addPreEventHook:self. |
3892 | 1697 |
! |
1698 |
||
1699 |
release |
|
1700 |
||
1701 |
self saveRuntimeAspectValues. |
|
1702 |
^ super release |
|
1703 |
! ! |
|
1704 |
||
1705 |
!FileBrowserV2 class methodsFor:'documentation'! |
|
1706 |
||
1707 |
version |
|
6334 | 1708 |
^ '$Header: /cvs/stx/stx/libtool/FileBrowserV2.st,v 1.137 2005-07-05 10:07:41 cg Exp $' |
3892 | 1709 |
! ! |
1710 |
||
1711 |
FileBrowserV2 initialize! |