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