author | Claus Gittinger <cg@exept.de> |
Thu, 14 Apr 2005 11:13:31 +0200 | |
changeset 6250 | 5b0673ccff1c |
parent 6241 | 9cc17d183247 |
child 6307 | 8e5863ecd881 |
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 |
||
4688 | 299 |
helpSpec |
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 helpSpec addPairsFrom:#( |
|
313 |
||
5398 | 314 |
#editFile |
315 |
'' |
|
316 |
||
317 |
#fileIn |
|
318 |
'' |
|
319 |
||
320 |
#searchFile |
|
321 |
'' |
|
322 |
||
4688 | 323 |
#toggleDetails |
324 |
'' |
|
325 |
||
326 |
) |
|
3892 | 327 |
! ! |
328 |
||
329 |
!FileBrowserV2 class methodsFor:'icon'! |
|
330 |
||
331 |
defaultIcon |
|
332 |
"This resource specification was automatically generated |
|
333 |
by the ImageEditor of ST/X." |
|
334 |
||
335 |
"Do not manually edit this!! If it is corrupted, |
|
336 |
the ImageEditor may not be able to read the specification." |
|
337 |
||
338 |
" |
|
339 |
self defaultIcon inspect |
|
340 |
ImageEditor openOnClass:self andSelector:#defaultIcon |
|
341 |
" |
|
342 |
||
343 |
<resource: #image> |
|
344 |
||
345 |
^Icon |
|
346 |
constantNamed:#'FileBrowserV2 class defaultIcon' |
|
347 |
ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
348 |
@@@@@@@@@@@@@@@@@@@@CLA&Y&Y&Y&X@@ADP@@@L0F@@@@@@A @ADAD@@@3@XN;.;.8F@ADPDQ@@CLA ;.@@@@@@D@@@D@@L0FC.8O[6=/@QDADP@@3@X@; |
|
349 |
[6=/[0DPDP@@CLA DNC6<@@F<ADP@@@L0F@A@F= [0= @@@@@@3@X@@P=/[6=/@@@@@@CLA @@A/[6=/X@@@@@@L0FC0@O[6=/[0@@@@@@3@XF<@@@@@@@@@ |
|
350 |
@@@@CLA = @@@@@@@@@@@@@L0FA/[6=/A @@@@@@@@3@XO[6=/XF@@@@@@@@CLA @@@@@@X@@@@@@@@L0FY&Y&Y&Y @@@@@@@@C@Y&Y&Y&Y&@@@@@@@@@@@@ |
|
351 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@N@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
352 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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:' |
|
353 |
O??# C??9<@??>? O???<C????@????0O???8C???<@???>@O??<@C???@@???0@O??<@C??8@@??>@@O?? @C??8@@??>@@G?? @@??8@@@@@@@G.P=0AAD |
|
354 |
HP@PQBD@GDP8 AADHD@PQBA@DN^=0@@a') ; yourself); yourself] |
|
355 |
! |
|
356 |
||
357 |
hideFilenameEntryFieldIcon |
|
358 |
<resource: #programImage> |
|
359 |
||
360 |
^ ToolbarIconLibrary hideToolbarIconH14 |
|
361 |
! |
|
362 |
||
363 |
hideToolBarIcon |
|
364 |
<resource: #programImage> |
|
365 |
||
366 |
^ ToolbarIconLibrary hideToolbarIconH26 |
|
367 |
! ! |
|
368 |
||
369 |
!FileBrowserV2 class methodsFor:'interface specs'! |
|
370 |
||
371 |
windowSpec |
|
372 |
"This resource specification was automatically generated |
|
373 |
by the UIPainter of ST/X." |
|
374 |
||
375 |
"Do not manually edit this!! If it is corrupted, |
|
376 |
the UIPainter may not be able to read the specification." |
|
377 |
||
378 |
" |
|
379 |
UIPainter new openOnClass:FileBrowserV2 andSelector:#windowSpec |
|
380 |
FileBrowserV2 new openInterface:#windowSpec |
|
381 |
FileBrowserV2 open |
|
382 |
" |
|
383 |
||
384 |
<resource: #canvas> |
|
385 |
||
386 |
^ |
|
5331 | 387 |
#(FullSpec |
388 |
name: windowSpec |
|
389 |
window: |
|
390 |
(WindowSpec |
|
391 |
label: FileBrowser |
|
392 |
name: FileBrowser |
|
393 |
min: (Point 10 10) |
|
5680 | 394 |
bounds: (Rectangle 0 0 800 600) |
5331 | 395 |
menu: mainMenu |
396 |
icon: applicationIcon |
|
3892 | 397 |
) |
5331 | 398 |
component: |
399 |
(SpecCollection |
|
400 |
collection: ( |
|
401 |
(ViewSpec |
|
6079 | 402 |
name: 'ToolbarBox' |
403 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
404 |
level: 0 |
|
405 |
visibilityChannel: toolBarVisibleHolder |
|
406 |
component: |
|
407 |
(SpecCollection |
|
408 |
collection: ( |
|
409 |
(ActionButtonSpec |
|
410 |
label: 'hideToolBarIcon' |
|
411 |
name: 'HideToolBarButton' |
|
412 |
layout: (LayoutFrame 0 0 0 0 13 0 30 0) |
|
413 |
activeHelpKey: hideToolBar |
|
414 |
hasCharacterOrientedLabel: false |
|
415 |
translateLabel: true |
|
416 |
model: hideToolbar |
|
417 |
postBuildCallback: hideToolBarButtonCreated: |
|
418 |
) |
|
419 |
(MenuPanelSpec |
|
420 |
name: 'ToolBar' |
|
421 |
layout: (LayoutFrame 13 0 0 0 0 1 32 0) |
|
422 |
menu: toolBarMainMenu |
|
423 |
textDefault: true |
|
424 |
) |
|
425 |
) |
|
426 |
||
427 |
) |
|
428 |
) |
|
429 |
(ViewSpec |
|
5331 | 430 |
name: 'FilenameEntryFieldBox' |
6079 | 431 |
layout: (LayoutFrame 0 0 32 0 0 1 57 0) |
5331 | 432 |
level: 0 |
433 |
visibilityChannel: filenameEntryFieldVisibleHolder |
|
434 |
component: |
|
435 |
(SpecCollection |
|
436 |
collection: ( |
|
437 |
(ActionButtonSpec |
|
438 |
label: 'hideFilenameEntryFieldIcon' |
|
439 |
name: 'HideFilenameEntryFieldButton' |
|
440 |
layout: (LayoutFrame 0 0 0 0 13 0 0 1) |
|
441 |
activeHelpKey: hideFilenameEntryField |
|
442 |
hasCharacterOrientedLabel: false |
|
443 |
translateLabel: true |
|
444 |
model: hideFilenameEntryField |
|
445 |
postBuildCallback: hideFilenameEntryFieldButtonCreated: |
|
3892 | 446 |
) |
5331 | 447 |
(HorizontalPanelViewSpec |
448 |
name: 'HorizontalPanel1' |
|
449 |
layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0) |
|
450 |
level: 1 |
|
451 |
horizontalLayout: leftFit |
|
452 |
verticalLayout: fit |
|
453 |
horizontalSpace: 3 |
|
454 |
verticalSpace: 3 |
|
455 |
component: |
|
456 |
(SpecCollection |
|
457 |
collection: ( |
|
458 |
(ComboListSpec |
|
459 |
name: 'ComboList1' |
|
460 |
visibilityChannel: driveSelectorVisible |
|
461 |
model: selectedDeviceDrive |
|
462 |
comboList: listOfDeviceDrives |
|
463 |
useIndex: false |
|
6079 | 464 |
hidePullDownMenuButton: false |
5331 | 465 |
extent: (Point 53 23) |
5120 | 466 |
) |
5331 | 467 |
(VariableHorizontalPanelSpec |
468 |
name: 'VariableHorizontalPanel1' |
|
469 |
level: 0 |
|
470 |
showHandle: true |
|
471 |
component: |
|
472 |
(SpecCollection |
|
473 |
collection: ( |
|
474 |
(NonScrollableArbitraryComponentSpec |
|
475 |
name: 'NonScrollableArbitraryComponent1' |
|
476 |
component: FilenameEditFieldV2 |
|
477 |
postBuildCallback: postBuildEditField: |
|
3892 | 478 |
) |
5331 | 479 |
(ViewSpec |
480 |
name: 'FilterBox' |
|
481 |
component: |
|
482 |
(SpecCollection |
|
483 |
collection: ( |
|
484 |
(LabelSpec |
|
485 |
label: 'Filter:' |
|
486 |
name: 'Filter' |
|
487 |
layout: (LayoutFrame 0 0 0 0 40 0 0 1) |
|
488 |
translateLabel: true |
|
489 |
adjust: left |
|
490 |
postBuildCallback: postBuildPathViewBox: |
|
3892 | 491 |
) |
5331 | 492 |
(ComboBoxSpec |
493 |
name: 'FilterSelectionBox' |
|
494 |
layout: (LayoutFrame 40 0 0 0 0 1 0 1) |
|
495 |
model: filterModel |
|
496 |
immediateAccept: true |
|
497 |
acceptOnPointerLeave: false |
|
498 |
comboList: filterListModel |
|
3892 | 499 |
) |
500 |
) |
|
501 |
||
502 |
) |
|
5331 | 503 |
postBuildCallback: postBuildPathViewBox: |
3892 | 504 |
) |
505 |
) |
|
506 |
||
507 |
) |
|
5331 | 508 |
handles: (Any 0.774936 1.0) |
509 |
postBuildCallback: postBuildPathViewBox: |
|
510 |
useDefaultExtent: true |
|
3892 | 511 |
) |
512 |
) |
|
513 |
||
514 |
) |
|
5331 | 515 |
postBuildCallback: postBuildPathViewBox: |
3892 | 516 |
) |
517 |
) |
|
518 |
||
519 |
) |
|
520 |
) |
|
5331 | 521 |
(#'FileBrowserV2UISpecifications::PanelSpec' |
522 |
name: 'BrowserBox' |
|
6079 | 523 |
layout: (LayoutFrame 0 0.0 57 0.0 0 1.0 -20 1.0) |
5331 | 524 |
level: 0 |
525 |
showHandle: true |
|
526 |
snapMode: both |
|
527 |
whichView: last |
|
528 |
orientation: vertical |
|
529 |
visibility: viewNoteBookApplicationHolder |
|
530 |
component: |
|
531 |
(SpecCollection |
|
532 |
collection: ( |
|
533 |
(#'FileBrowserV2UISpecifications::PanelSpec' |
|
534 |
name: 'HorizontalPanel' |
|
535 |
level: 0 |
|
536 |
snapMode: both |
|
537 |
whichView: first |
|
538 |
orientation: horizontal |
|
539 |
visibility: showDirectoryTree |
|
540 |
component: |
|
541 |
(SpecCollection |
|
542 |
collection: ( |
|
543 |
(SubCanvasSpec |
|
544 |
name: 'DirectoryTreeBrowser' |
|
545 |
hasHorizontalScrollBar: false |
|
546 |
hasVerticalScrollBar: false |
|
547 |
majorKey: DirectoryTreeBrowser |
|
548 |
createNewApplication: true |
|
549 |
createNewBuilder: true |
|
550 |
postBuildCallback: postBuildDirectoryTree: |
|
3892 | 551 |
) |
5331 | 552 |
(SubCanvasSpec |
553 |
name: 'DirectoryContentsBrowser' |
|
554 |
hasHorizontalScrollBar: false |
|
555 |
hasVerticalScrollBar: false |
|
556 |
majorKey: DirectoryContentsBrowser |
|
557 |
createNewApplication: true |
|
558 |
createNewBuilder: true |
|
3892 | 559 |
) |
560 |
) |
|
561 |
||
562 |
) |
|
5331 | 563 |
handles: (Any 0.225 1.0) |
4595
09c632988dad
Add handles to resize VerticalPanel
Stefan Vogel <sv@exept.de>
parents:
4593
diff
changeset
|
564 |
) |
5331 | 565 |
(SubCanvasSpec |
566 |
name: 'FileApplicationNoteBook' |
|
567 |
tabable: false |
|
568 |
hasHorizontalScrollBar: false |
|
569 |
hasVerticalScrollBar: false |
|
570 |
majorKey: FileApplicationNoteBook |
|
571 |
createNewApplication: true |
|
572 |
createNewBuilder: true |
|
3892 | 573 |
) |
574 |
) |
|
575 |
||
576 |
) |
|
5331 | 577 |
handles: (Any 0.5 1.0) |
3892 | 578 |
) |
5331 | 579 |
(ViewSpec |
580 |
name: 'Box2' |
|
581 |
layout: (LayoutFrame 0 0 -20 1 0 1 0 1) |
|
582 |
level: 0 |
|
583 |
component: |
|
584 |
(SpecCollection |
|
585 |
collection: ( |
|
586 |
(LabelSpec |
|
587 |
label: 'NotifyLabel' |
|
588 |
name: 'NotifyLabel' |
|
589 |
layout: (LayoutFrame 0 0 1 0.0 -220 1 1 1.0) |
|
590 |
level: -1 |
|
591 |
translateLabel: true |
|
592 |
labelChannel: notifyChannel |
|
593 |
adjust: left |
|
4018 | 594 |
) |
5528 | 595 |
(LabelSpec |
596 |
label: 'encoding' |
|
597 |
name: 'EncodingLabel' |
|
598 |
layout: (LayoutFrame -307 1 2 0.0 -221 1 0 1.0) |
|
599 |
level: 0 |
|
600 |
labelChannel: fileEncodingHolder |
|
601 |
adjust: right |
|
602 |
menu: encodingMenu |
|
603 |
) |
|
5331 | 604 |
(LabelSpec |
605 |
label: 'Shown Files' |
|
606 |
name: 'ShownFilesLabel' |
|
607 |
layout: (LayoutFrame -220 1 1 0.0 -60 1 1 1.0) |
|
608 |
level: -1 |
|
609 |
translateLabel: true |
|
610 |
labelChannel: shownFiles |
|
611 |
adjust: right |
|
5120 | 612 |
) |
6119 | 613 |
(ViewSpec |
614 |
name: 'ProgressIndicatorBox' |
|
615 |
layout: (LayoutFrame -220 1 1 0.0 -60 1 1 1.0) |
|
616 |
level: -1 |
|
617 |
visibilityChannel: activityVisibilityChannel |
|
618 |
component: |
|
619 |
(SpecCollection |
|
620 |
collection: ( |
|
621 |
(ProgressIndicatorSpec |
|
622 |
name: 'ProgressIndicator1' |
|
623 |
layout: (LayoutFrame 5 0.0 -7 0.5 -5 1.0 7 0.5) |
|
624 |
backgroundColor: (Color 0.0 66.666666666667 66.666666666667) |
|
625 |
isActivityIndicator: true |
|
626 |
) |
|
627 |
) |
|
628 |
||
629 |
) |
|
630 |
) |
|
5331 | 631 |
(LabelSpec |
632 |
label: 'M' |
|
633 |
name: 'ModeLabel' |
|
634 |
layout: (LayoutFrame -60 1 1 0.0 -50 1 1 1.0) |
|
635 |
level: -1 |
|
636 |
translateLabel: true |
|
637 |
labelChannel: modeLabelHolder |
|
638 |
adjust: right |
|
4647 | 639 |
) |
5331 | 640 |
(LabelSpec |
641 |
label: 'L' |
|
642 |
name: 'LineLabel' |
|
643 |
layout: (LayoutFrame -50 1 1 0.0 -20 1 1 1.0) |
|
644 |
level: -1 |
|
645 |
translateLabel: true |
|
646 |
labelChannel: cursorLineLabelHolder |
|
647 |
adjust: right |
|
5120 | 648 |
) |
5331 | 649 |
(LabelSpec |
650 |
label: 'C' |
|
651 |
name: 'ColLabel' |
|
652 |
layout: (LayoutFrame -20 1 1 0.0 0 1 1 1.0) |
|
653 |
level: -1 |
|
654 |
translateLabel: true |
|
655 |
labelChannel: cursorColLabelHolder |
|
656 |
adjust: right |
|
4647 | 657 |
) |
658 |
) |
|
659 |
||
660 |
) |
|
661 |
) |
|
5331 | 662 |
(LabelSpec |
663 |
label: 'Preview' |
|
664 |
name: 'PreviewLabel' |
|
665 |
layout: (LayoutFrame 0 0.5 39 0 100 0.5 61 0) |
|
666 |
level: 0 |
|
667 |
borderWidth: 1 |
|
668 |
visibilityChannel: previewVisibleHolder |
|
6079 | 669 |
backgroundColor: (Color 86.999313344015 86.999313344015 86.999313344015) |
5331 | 670 |
translateLabel: true |
4647 | 671 |
) |
5331 | 672 |
(ArbitraryComponentSpec |
673 |
name: 'Preview' |
|
674 |
layout: (LayoutFrame 0 0.5 63 0 -147 1 -319 1) |
|
675 |
level: 1 |
|
676 |
visibilityChannel: previewVisibleHolder |
|
677 |
hasBorder: false |
|
678 |
component: ImageView |
|
4647 | 679 |
) |
680 |
) |
|
681 |
||
682 |
) |
|
683 |
) |
|
3892 | 684 |
! ! |
685 |
||
686 |
!FileBrowserV2 class methodsFor:'menu specs'! |
|
687 |
||
5528 | 688 |
encodingMenu |
689 |
"This resource specification was automatically generated |
|
690 |
by the MenuEditor of ST/X." |
|
691 |
||
692 |
"Do not manually edit this!! If it is corrupted, |
|
693 |
the MenuEditor may not be able to read the specification." |
|
694 |
||
695 |
" |
|
696 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#encodingMenu |
|
697 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 encodingMenu)) startUp |
|
698 |
" |
|
699 |
||
700 |
<resource: #menu> |
|
701 |
||
702 |
^ |
|
703 |
#(Menu |
|
704 |
( |
|
705 |
(MenuItem |
|
706 |
label: 'Encoding...' |
|
707 |
itemValue: fileEncodingDialog |
|
708 |
translateLabel: true |
|
709 |
) |
|
710 |
) |
|
711 |
nil |
|
712 |
nil |
|
713 |
) |
|
714 |
! |
|
715 |
||
3892 | 716 |
mainMenu |
717 |
"This resource specification was automatically generated |
|
718 |
by the MenuEditor of ST/X." |
|
719 |
||
720 |
"Do not manually edit this!! If it is corrupted, |
|
721 |
the MenuEditor may not be able to read the specification." |
|
722 |
||
723 |
" |
|
724 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#mainMenu |
|
725 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 mainMenu)) startUp |
|
726 |
" |
|
727 |
||
728 |
<resource: #menu> |
|
729 |
||
730 |
^ |
|
5424 | 731 |
#(Menu |
732 |
( |
|
733 |
(MenuItem |
|
734 |
label: 'Browser' |
|
735 |
translateLabel: true |
|
736 |
submenuChannel: browserMenu |
|
737 |
keepLinkedMenu: true |
|
3892 | 738 |
) |
5424 | 739 |
(MenuItem |
740 |
label: 'Directory' |
|
741 |
translateLabel: true |
|
742 |
submenuChannel: directoryMenu |
|
743 |
keepLinkedMenu: true |
|
3892 | 744 |
) |
5424 | 745 |
(MenuItem |
746 |
label: 'File' |
|
747 |
translateLabel: true |
|
748 |
submenuChannel: fileMenu |
|
749 |
keepLinkedMenu: true |
|
3892 | 750 |
) |
5424 | 751 |
(MenuItem |
752 |
label: 'Edit' |
|
753 |
translateLabel: true |
|
754 |
submenuChannel: editMenu |
|
755 |
keepLinkedMenu: true |
|
756 |
) |
|
757 |
(MenuItem |
|
758 |
label: 'View' |
|
759 |
translateLabel: true |
|
760 |
submenu: |
|
761 |
(Menu |
|
762 |
( |
|
763 |
(MenuItem |
|
764 |
label: 'Details' |
|
765 |
translateLabel: true |
|
766 |
submenuChannel: viewInContentsBrowserMenu |
|
3892 | 767 |
) |
5424 | 768 |
(MenuItem |
769 |
label: 'Sort' |
|
770 |
translateLabel: true |
|
771 |
submenuChannel: sortMenu |
|
3892 | 772 |
) |
5424 | 773 |
(MenuItem |
774 |
label: 'Show' |
|
775 |
translateLabel: true |
|
776 |
submenuChannel: showMenuSpec |
|
3892 | 777 |
) |
5424 | 778 |
(MenuItem |
779 |
label: '-' |
|
3892 | 780 |
) |
5424 | 781 |
(MenuItem |
782 |
label: 'Toolbar' |
|
783 |
translateLabel: true |
|
784 |
hideMenuOnActivated: false |
|
785 |
indication: toolBarVisibleHolder |
|
3892 | 786 |
) |
5424 | 787 |
(MenuItem |
788 |
label: 'Path Entry && Filter' |
|
789 |
translateLabel: true |
|
790 |
hideMenuOnActivated: false |
|
791 |
indication: filenameEntryFieldVisibleHolder |
|
3892 | 792 |
) |
5424 | 793 |
(MenuItem |
794 |
label: 'Preview' |
|
795 |
translateLabel: true |
|
796 |
hideMenuOnActivated: false |
|
797 |
indication: previewVisibleHolder |
|
4252 | 798 |
) |
5424 | 799 |
(MenuItem |
800 |
label: '-' |
|
3892 | 801 |
) |
5424 | 802 |
(MenuItem |
803 |
label: 'Update' |
|
804 |
itemValue: updateCurrentDirectory |
|
805 |
translateLabel: true |
|
3892 | 806 |
) |
807 |
) |
|
808 |
nil |
|
809 |
nil |
|
810 |
) |
|
811 |
) |
|
5424 | 812 |
(MenuItem |
813 |
label: 'Tools' |
|
814 |
translateLabel: true |
|
815 |
submenuChannel: toolsMenuSpec |
|
816 |
keepLinkedMenu: true |
|
3892 | 817 |
) |
5424 | 818 |
(MenuItem |
819 |
label: 'CVS' |
|
820 |
translateLabel: true |
|
821 |
submenuChannel: cvsMenu |
|
822 |
keepLinkedMenu: true |
|
3892 | 823 |
) |
5424 | 824 |
(MenuItem |
825 |
label: 'Help' |
|
826 |
translateLabel: true |
|
827 |
startGroup: right |
|
828 |
submenu: |
|
829 |
(Menu |
|
830 |
( |
|
831 |
(MenuItem |
|
832 |
label: 'FileBrowser Documentation' |
|
833 |
itemValue: openHTMLDocument: |
|
834 |
translateLabel: true |
|
5750 | 835 |
argument: 'tools/fbrowserV2/TOP.html' |
3892 | 836 |
) |
5424 | 837 |
(MenuItem |
838 |
label: '-' |
|
3892 | 839 |
) |
5424 | 840 |
(MenuItem |
841 |
label: 'About FileBrowser...' |
|
842 |
itemValue: openAboutThisApplication |
|
843 |
translateLabel: true |
|
3892 | 844 |
) |
845 |
) |
|
846 |
nil |
|
847 |
nil |
|
848 |
) |
|
849 |
) |
|
850 |
) |
|
851 |
nil |
|
852 |
nil |
|
853 |
) |
|
5750 | 854 |
|
855 |
"Modified: / 17-03-2004 / 13:19:04 / cg" |
|
3892 | 856 |
! |
857 |
||
4257 | 858 |
previewLabelMenu |
859 |
"This resource specification was automatically generated |
|
860 |
by the MenuEditor of ST/X." |
|
861 |
||
862 |
"Do not manually edit this!! If it is corrupted, |
|
863 |
the MenuEditor may not be able to read the specification." |
|
864 |
||
865 |
" |
|
866 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#previewLabelMenu |
|
867 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 previewLabelMenu)) startUp |
|
868 |
" |
|
869 |
||
870 |
<resource: #menu> |
|
871 |
||
872 |
^ |
|
873 |
#(#Menu |
|
874 |
#( |
|
875 |
#(#MenuItem |
|
876 |
#label: 'Close Preview' |
|
877 |
#itemValue: #closePreview |
|
878 |
#translateLabel: true |
|
879 |
) |
|
880 |
) |
|
881 |
nil |
|
882 |
nil |
|
883 |
) |
|
884 |
! |
|
885 |
||
3892 | 886 |
toolBarMainMenu |
887 |
"This resource specification was automatically generated |
|
888 |
by the MenuEditor of ST/X." |
|
889 |
||
890 |
"Do not manually edit this!! If it is corrupted, |
|
891 |
the MenuEditor may not be able to read the specification." |
|
892 |
||
893 |
" |
|
894 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#toolBarMainMenu |
|
895 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 toolBarMainMenu)) startUp |
|
896 |
" |
|
897 |
||
898 |
<resource: #menu> |
|
899 |
||
900 |
^ |
|
5398 | 901 |
#(Menu |
902 |
( |
|
903 |
(MenuItem |
|
904 |
activeHelpKey: directoryUp |
|
905 |
enabled: enableDirectoryUp |
|
906 |
label: 'DirectoryUp' |
|
907 |
itemValue: doGoDirectoryUp |
|
908 |
translateLabel: true |
|
909 |
isButton: true |
|
6093 | 910 |
labelImage: (ResourceRetriever ToolbarIconLibrary directoryUpIcon) |
3892 | 911 |
) |
5398 | 912 |
(MenuItem |
913 |
activeHelpKey: directoryBack |
|
914 |
enabled: enableBack |
|
915 |
label: 'Back' |
|
916 |
itemValue: doBack |
|
917 |
translateLabel: true |
|
918 |
isButton: true |
|
919 |
submenuChannel: menuDirHistoryBack |
|
6093 | 920 |
labelImage: (ResourceRetriever ToolbarIconLibrary historyBackIcon) |
3892 | 921 |
) |
5398 | 922 |
(MenuItem |
923 |
label: '' |
|
3892 | 924 |
) |
5398 | 925 |
(MenuItem |
926 |
activeHelpKey: directoryForward |
|
927 |
enabled: enableForward |
|
928 |
label: 'Forward' |
|
929 |
itemValue: doForward |
|
930 |
translateLabel: true |
|
931 |
isButton: true |
|
932 |
submenuChannel: menuDirHistoryForward |
|
6093 | 933 |
labelImage: (ResourceRetriever ToolbarIconLibrary historyForwardIcon) |
3892 | 934 |
) |
5398 | 935 |
(MenuItem |
936 |
label: '' |
|
3892 | 937 |
) |
5398 | 938 |
(MenuItem |
939 |
activeHelpKey: fileHome |
|
940 |
enabled: enableHome |
|
941 |
label: 'Home' |
|
942 |
itemValue: doGotoHomeDirectory |
|
943 |
translateLabel: true |
|
944 |
isButton: true |
|
6096 | 945 |
labelImage: (ResourceRetriever ToolbarIconLibrary homeIcon) |
3892 | 946 |
) |
5398 | 947 |
(MenuItem |
948 |
activeHelpKey: fileGotoDefault |
|
949 |
enabled: enableGotoDefault |
|
950 |
label: 'ST/X Default' |
|
951 |
itemValue: doGotoDefaultDirectory |
|
952 |
translateLabel: true |
|
953 |
isButton: true |
|
6096 | 954 |
labelImage: (ResourceRetriever ToolbarIconLibrary stxHomeIcon) |
4593 | 955 |
) |
5398 | 956 |
(MenuItem |
6099 | 957 |
activeHelpKey: fileGotoBookmark |
958 |
label: 'Bookmarks' |
|
959 |
translateLabel: true |
|
960 |
isButton: true |
|
961 |
submenuChannel: gotoBookmarksMenuSpec |
|
962 |
labelImage: (ResourceRetriever ToolbarIconLibrary directoryBookmarksIcon) |
|
963 |
) |
|
964 |
(MenuItem |
|
5398 | 965 |
label: '' |
3892 | 966 |
) |
5398 | 967 |
(MenuItem |
968 |
activeHelpKey: fileHistory |
|
969 |
enabled: enableFileHistory |
|
970 |
label: 'File History' |
|
971 |
translateLabel: true |
|
972 |
isButton: true |
|
973 |
submenuChannel: menuFileHistory |
|
6093 | 974 |
labelImage: (ResourceRetriever ToolbarIconLibrary historyIcon) |
5398 | 975 |
) |
976 |
(MenuItem |
|
977 |
label: '-' |
|
3892 | 978 |
) |
5398 | 979 |
(MenuItem |
980 |
activeHelpKey: cutFile |
|
981 |
enabled: hasSelection |
|
982 |
label: 'Cut' |
|
983 |
itemValue: cutFiles |
|
984 |
translateLabel: true |
|
985 |
isButton: true |
|
6093 | 986 |
labelImage: (ResourceRetriever ToolbarIconLibrary cutFileIcon) |
3892 | 987 |
) |
5398 | 988 |
(MenuItem |
989 |
activeHelpKey: copyFile |
|
990 |
enabled: hasSelection |
|
991 |
label: 'Copy' |
|
992 |
itemValue: copyFiles |
|
993 |
translateLabel: true |
|
994 |
isButton: true |
|
6093 | 995 |
labelImage: (ResourceRetriever ToolbarIconLibrary copyFileIcon) |
4730 | 996 |
) |
5398 | 997 |
(MenuItem |
998 |
activeHelpKey: pasteFile |
|
999 |
enabled: canPaste |
|
1000 |
label: 'Paste' |
|
1001 |
itemValue: pasteFiles |
|
1002 |
translateLabel: true |
|
1003 |
isButton: true |
|
6093 | 1004 |
labelImage: (ResourceRetriever ToolbarIconLibrary pasteFileIcon) |
3892 | 1005 |
) |
5398 | 1006 |
(MenuItem |
1007 |
activeHelpKey: deleteFile |
|
1008 |
enabled: hasSelection |
|
1009 |
label: 'Delete' |
|
1010 |
itemValue: deleteFiles |
|
1011 |
translateLabel: true |
|
1012 |
isButton: true |
|
6093 | 1013 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteFileIcon) |
3892 | 1014 |
) |
5398 | 1015 |
(MenuItem |
1016 |
label: '-' |
|
1017 |
) |
|
1018 |
(MenuItem |
|
6116 | 1019 |
activeHelpKey: fileIn |
1020 |
label: 'File In' |
|
1021 |
itemValue: fileFileIn |
|
1022 |
translateLabel: true |
|
1023 |
isButton: true |
|
1024 |
labelImage: (ResourceRetriever ToolbarIconLibrary fileInIcon) |
|
1025 |
) |
|
1026 |
(MenuItem |
|
1027 |
activeHelpKey: openChangeBrowser |
|
1028 |
enabled: hasFileSelection |
|
1029 |
label: 'Changes Browser' |
|
1030 |
itemValue: openChangesBrowser |
|
1031 |
translateLabel: true |
|
1032 |
isButton: true |
|
1033 |
labelImage: (ResourceRetriever ToolbarIconLibrary changesBrowserIcon) |
|
1034 |
) |
|
1035 |
(MenuItem |
|
1036 |
label: '-' |
|
1037 |
) |
|
1038 |
(MenuItem |
|
6093 | 1039 |
activeHelpKey: editFile |
1040 |
label: 'Edit File' |
|
1041 |
itemValue: doShowFileContents |
|
1042 |
translateLabel: true |
|
1043 |
isButton: true |
|
1044 |
labelImage: (ResourceRetriever ToolbarIconLibrary editFileIcon) |
|
1045 |
) |
|
1046 |
(MenuItem |
|
5398 | 1047 |
activeHelpKey: searchFile |
1048 |
label: 'Search File' |
|
1049 |
itemValue: doOpenSearchFile |
|
1050 |
translateLabel: true |
|
1051 |
isButton: true |
|
6094 | 1052 |
labelImage: (ResourceRetriever ToolbarIconLibrary searchFileIcon) |
3892 | 1053 |
) |
5398 | 1054 |
(MenuItem |
1055 |
activeHelpKey: addTerminal |
|
1056 |
label: 'VT100' |
|
1057 |
itemValue: doAddTerminal |
|
1058 |
translateLabel: true |
|
1059 |
isButton: true |
|
6094 | 1060 |
labelImage: (ResourceRetriever ToolbarIconLibrary shellTerminalIcon) |
3892 | 1061 |
) |
5398 | 1062 |
(MenuItem |
1063 |
activeHelpKey: make |
|
1064 |
enabled: canMake |
|
1065 |
label: 'Make' |
|
1066 |
itemValue: doMake |
|
1067 |
translateLabel: true |
|
1068 |
isButton: true |
|
6095 | 1069 |
labelImage: (ResourceRetriever ToolbarIconLibrary makeIcon) |
4236 | 1070 |
) |
5398 | 1071 |
(MenuItem |
6116 | 1072 |
activeHelpKey: viewDetails |
5398 | 1073 |
label: 'viewDetails' |
1074 |
translateLabel: true |
|
1075 |
isButton: true |
|
1076 |
startGroup: right |
|
1077 |
hideMenuOnActivated: false |
|
1078 |
indication: viewDetails |
|
6096 | 1079 |
labelImage: (ResourceRetriever ToolbarIconLibrary viewDetailsIcon) |
4688 | 1080 |
) |
5398 | 1081 |
(MenuItem |
6096 | 1082 |
activeHelpKey: viewDetails |
5398 | 1083 |
label: 'viewDetails' |
1084 |
translateLabel: true |
|
1085 |
isButton: true |
|
1086 |
startGroup: right |
|
1087 |
isVisible: false |
|
1088 |
indication: viewDetails |
|
1089 |
submenuChannel: viewDetailsMenuSpec |
|
6096 | 1090 |
labelImage: (ResourceRetriever ToolbarIconLibrary viewDetailsIcon) |
3980 | 1091 |
) |
5398 | 1092 |
(MenuItem |
5686 | 1093 |
activeHelpKey: selectDetails |
5398 | 1094 |
label: '' |
1095 |
isButton: true |
|
1096 |
startGroup: right |
|
1097 |
submenuChannel: viewDetailsMenuSpec |
|
1098 |
labelImage: (ResourceRetriever ToolbarIconLibrary empty1x20Icon) |
|
4688 | 1099 |
) |
3892 | 1100 |
) |
1101 |
nil |
|
1102 |
nil |
|
1103 |
) |
|
1104 |
! ! |
|
1105 |
||
1106 |
!FileBrowserV2 methodsFor:'actions'! |
|
1107 |
||
1108 |
changeFileBrowserTitleTo:aString |
|
1109 |
||
1110 |
|string| |
|
1111 |
||
1112 |
string := 'FileBrowser ', aString. |
|
1113 |
self window label:string. |
|
1114 |
! |
|
1115 |
||
1116 |
doSpawn |
|
1117 |
||
1118 |
self saveRuntimeAspectValues. |
|
1119 |
self class openWithAspects:aspects withExtent:self builder window extent. |
|
1120 |
! |
|
1121 |
||
1122 |
hideFilenameEntryField |
|
1123 |
self filenameEntryFieldVisibleHolder value:false. |
|
1124 |
! |
|
1125 |
||
1126 |
hideToolbar |
|
1127 |
self toolBarVisibleHolder value:false. |
|
3980 | 1128 |
! |
1129 |
||
1130 |
toggleFileDetailsFor:anItem |
|
1131 |
|viewDetails| |
|
1132 |
||
1133 |
viewDetails := self viewDetails value not. |
|
1134 |
self viewDetails value:viewDetails. |
|
1135 |
||
1136 |
viewDetails ifTrue:[ |
|
1137 |
anItem activeHelpKey:#hideFileDetails. |
|
6096 | 1138 |
anItem label:(ToolbarIconLibrary viewNoDetailsIcon). |
3980 | 1139 |
] ifFalse:[ |
1140 |
anItem activeHelpKey:#showFileDetails. |
|
6096 | 1141 |
anItem label:(ToolbarIconLibrary viewDetailsIcon). |
3980 | 1142 |
]. |
3892 | 1143 |
! ! |
1144 |
||
1145 |
!FileBrowserV2 methodsFor:'aspects'! |
|
1146 |
||
5120 | 1147 |
cursorColLabelHolder |
1148 |
^ self |
|
1149 |
aspectFor:#cursorColLabelHolder |
|
1150 |
ifAbsent:[ |
|
1151 |
self |
|
1152 |
applicationNamed:#FileApplicationNoteBook |
|
1153 |
ifPresentDo:[:appl | appl cursorColLabelHolder]. |
|
1154 |
] |
|
1155 |
! |
|
1156 |
||
1157 |
cursorLineLabelHolder |
|
1158 |
^ self |
|
1159 |
aspectFor:#cursorLineLabelHolder |
|
1160 |
ifAbsent:[ |
|
1161 |
self |
|
1162 |
applicationNamed:#FileApplicationNoteBook |
|
1163 |
ifPresentDo:[:appl | appl cursorLineLabelHolder]. |
|
1164 |
] |
|
1165 |
! |
|
1166 |
||
3892 | 1167 |
fileEntryFieldHolder |
1168 |
||
1169 |
fileEntryFieldHolder isNil ifTrue:[ |
|
1170 |
fileEntryFieldHolder := ValueHolder new. |
|
1171 |
fileEntryFieldHolder addDependent:self. |
|
1172 |
]. |
|
1173 |
^ fileEntryFieldHolder. |
|
4647 | 1174 |
! |
1175 |
||
1176 |
listOfDeviceDrives |
|
1177 |
||
1178 |
listOfDeviceDrives isNil ifTrue:[ |
|
1179 |
listOfDeviceDrives := Filename volumes. |
|
1180 |
]. |
|
1181 |
^ listOfDeviceDrives |
|
1182 |
! |
|
1183 |
||
5120 | 1184 |
modeLabelHolder |
1185 |
^ self |
|
1186 |
aspectFor:#modeLabelHolder |
|
1187 |
ifAbsent:[ |
|
1188 |
self |
|
1189 |
applicationNamed:#FileApplicationNoteBook |
|
1190 |
ifPresentDo:[:appl | appl modeLabelHolder]. |
|
1191 |
] |
|
1192 |
! |
|
1193 |
||
4647 | 1194 |
selectedDeviceDrive |
1195 |
||
1196 |
selectedDeviceDrive isNil ifTrue:[ |
|
1197 |
selectedDeviceDrive := self listOfDeviceDrives first asValue. |
|
1198 |
selectedDeviceDrive addDependent:self. |
|
1199 |
]. |
|
1200 |
^ selectedDeviceDrive |
|
3892 | 1201 |
! ! |
1202 |
||
4252 | 1203 |
!FileBrowserV2 methodsFor:'aspects-visibility'! |
1204 |
||
5120 | 1205 |
driveSelectorVisible |
1206 |
^ self systemIsDOS |
|
1207 |
! |
|
1208 |
||
4252 | 1209 |
filenameEntryFieldVisibleHolder |
1210 |
" aspect for show FileEntryField " |
|
1211 |
||
1212 |
^ self aspectFor:#filenameEntryFieldVisibleHolder ifAbsent:[true asValue] |
|
1213 |
! |
|
1214 |
||
1215 |
previewVisibleHolder |
|
1216 |
" aspect for show preview" |
|
1217 |
||
1218 |
^ self aspectFor:#previewVisibleHolder ifAbsent:[false asValue] |
|
1219 |
! |
|
1220 |
||
1221 |
toolBarVisibleHolder |
|
1222 |
" aspect for show toolbar" |
|
1223 |
||
1224 |
^ self aspectFor:#toolBarVisibleHolder ifAbsent:[true asValue] |
|
1225 |
! ! |
|
1226 |
||
3892 | 1227 |
!FileBrowserV2 methodsFor:'change & update'! |
1228 |
||
4011 | 1229 |
currentFileNameHolderChanged |
4775 | 1230 |
|newEntryValue nSelected files volume| |
4011 | 1231 |
|
1232 |
files := self currentFileNameHolder value. |
|
4252 | 1233 |
nSelected := files size. |
4011 | 1234 |
|
4252 | 1235 |
nSelected == 0 ifTrue:[ |
4454
c85336c15975
cut and copy files in toolbarmenu goes not to contentsbrowser only
penk
parents:
4451
diff
changeset
|
1236 |
newEntryValue := ''. |
4011 | 1237 |
] ifFalse:[ |
4252 | 1238 |
nSelected == 1 ifTrue:[ |
4775 | 1239 |
newEntryValue := files first. |
4011 | 1240 |
] ifFalse:[ |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4750
diff
changeset
|
1241 |
newEntryValue := self commonPrefixOfSelectedFiles. |
4011 | 1242 |
]. |
1243 |
]. |
|
4390
e9e2343d5569
no expand on change filename holder for entry field anymore
penk
parents:
4380
diff
changeset
|
1244 |
self fileEntryFieldHolder value:(newEntryValue asString) withoutNotifying:self. |
4775 | 1245 |
|
5187
ce7e3132b012
supportsVolumes instead of OperatingSystem isWindowsLike for volume widget
james
parents:
5185
diff
changeset
|
1246 |
OperatingSystem supportsVolumes ifTrue:[ |
5185
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1247 |
volume := (nSelected >= 1) |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1248 |
ifTrue:[files first volume] |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1249 |
ifFalse:nil. |
4775 | 1250 |
self selectedDeviceDrive value:volume. |
5187
ce7e3132b012
supportsVolumes instead of OperatingSystem isWindowsLike for volume widget
james
parents:
5185
diff
changeset
|
1251 |
]. |
4252 | 1252 |
self updatePreview. |
4011 | 1253 |
! |
1254 |
||
1255 |
fileEntryFieldHolderChanged |
|
5185
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1256 |
|fileName fileNameString answer dir| |
4011 | 1257 |
|
4507
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1258 |
fileNameString := fileEntryFieldHolder value withoutSeparators. |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1259 |
fileName := fileNameString asFilename. |
5281 | 1260 |
fileNameString isEmpty ifTrue:[ |
1261 |
pathEntryField flash. |
|
1262 |
^ self |
|
1263 |
]. |
|
4507
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1264 |
|
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1265 |
(fileName exists) ifFalse:[ |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1266 |
pathEntryField flash. |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1267 |
|
5185
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1268 |
dir := fileName directory. |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1269 |
dir exists ifTrue:[ |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1270 |
self currentFileNameHolder |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1271 |
value:(OrderedCollection with:dir) |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1272 |
withoutNotifying:self. |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1273 |
]. |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1274 |
fileName baseName includesMatchCharacters ifTrue:[ |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1275 |
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
|
1276 |
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
|
1277 |
]. |
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1278 |
|
4531 | 1279 |
"/ answer := OptionBox |
1280 |
"/ request:(resources string:'No file or directory named "%1" exists.\\Create ?' with:fileNameString allBold) withCRs |
|
1281 |
"/ buttonLabels:#('Create as File' 'Create as Directory' 'Cancel') |
|
1282 |
"/ values:#(createFile createDirectory nil) |
|
1283 |
"/ default:nil. |
|
1284 |
"/ |
|
4507
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1285 |
answer isNil ifTrue:[ |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1286 |
^ self. |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1287 |
]. |
5185
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1288 |
|
4507
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1289 |
[ |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1290 |
answer == #createFile ifTrue:[ |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1291 |
fileName directory recursiveMakeDirectory. |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1292 |
fileName createAsEmptyFile. |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1293 |
] ifFalse:[ |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1294 |
answer == #createDirectory ifTrue:[ |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1295 |
fileName recursiveMakeDirectory. |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1296 |
] |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1297 |
]. |
4819 | 1298 |
] on:OperatingSystem accessDeniedErrorSignal do:[:ex | |
1299 |
Dialog warn:'Error: ' , ex description. |
|
1300 |
]. |
|
4507
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1301 |
^ self |
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1302 |
]. |
5959 | 1303 |
self setCurrentFileName:fileName. |
4011 | 1304 |
! |
1305 |
||
4647 | 1306 |
selectedDeviceDriveChanged |
1307 |
||
1308 |
| newDrive curSel newFile| |
|
1309 |
||
1310 |
newDrive := self selectedDeviceDrive value. |
|
1311 |
curSel := self currentFileNameHolder value. |
|
1312 |
curSel notEmpty ifTrue:[ |
|
1313 |
curSel first volume = newDrive ifTrue:[ ^self]. |
|
1314 |
]. |
|
5411
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1315 |
newDrive notNil ifTrue:[ |
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1316 |
newFile := newDrive asFilename. |
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1317 |
|
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1318 |
newFile isReadable ifTrue:[ |
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1319 |
self gotoFile:newFile. |
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1320 |
^self. |
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1321 |
]. |
4651 | 1322 |
]. |
1323 |
curSel notEmpty ifTrue:[ |
|
1324 |
self selectedDeviceDrive value:(curSel first volume). |
|
1325 |
] ifFalse:[ |
|
1326 |
self selectedDeviceDrive value:'C:'. |
|
1327 |
]. |
|
4647 | 1328 |
! |
1329 |
||
4252 | 1330 |
selectedImage |
1331 |
|files selectedFile mime img| |
|
1332 |
||
4451
6f06f760a64b
only open preview for selected files not for directories
penk
parents:
4390
diff
changeset
|
1333 |
files := self currentSelectedFiles. |
4259 | 1334 |
files size >= 1 ifFalse:[ |
4252 | 1335 |
^ nil |
1336 |
]. |
|
4259 | 1337 |
selectedFile := files last. |
4252 | 1338 |
|
1339 |
mime := MIMETypes mimeTypeForFilename:selectedFile. |
|
1340 |
(mime notNil and:[mime startsWith:'image/']) ifTrue:[ |
|
1341 |
img := Image fromFile:selectedFile. |
|
1342 |
^ img |
|
1343 |
]. |
|
1344 |
||
1345 |
^ nil. |
|
1346 |
! |
|
1347 |
||
4262 | 1348 |
showImagePreview:image |
4252 | 1349 |
|imgView| |
1350 |
||
4262 | 1351 |
imgView := builder componentAt:#Preview. |
4252 | 1352 |
|
1353 |
imgView adjust:#fitBig. |
|
1354 |
imgView image:image. |
|
1355 |
! |
|
1356 |
||
4262 | 1357 |
showPreview |
1358 |
|shownImage lbl previewLabel| |
|
1359 |
||
1360 |
shownImage := self selectedImage. |
|
4300 | 1361 |
lbl := shownImage isNil ifTrue:'Preview' ifFalse:[ shownImage fileName asFilename baseName ]. |
4262 | 1362 |
|
1363 |
previewLabel := builder componentAt:#PreviewLabel. |
|
1364 |
previewLabel label:lbl; forceResizeHorizontally. |
|
1365 |
self enqueueMessage:#'showImagePreview:' for:self arguments:(Array with:shownImage). |
|
1366 |
! |
|
1367 |
||
3892 | 1368 |
update:something with:aParameter from:changedObject |
1369 |
||
1370 |
||
4647 | 1371 |
changedObject == self selectedDeviceDrive ifTrue:[ |
1372 |
self selectedDeviceDriveChanged. |
|
1373 |
^ self. |
|
1374 |
]. |
|
3892 | 1375 |
changedObject == self fileEntryFieldHolder ifTrue:[ |
4011 | 1376 |
self fileEntryFieldHolderChanged. |
1377 |
^ self. |
|
3892 | 1378 |
]. |
1379 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4011 | 1380 |
super update:something with:aParameter from:changedObject. |
1381 |
self currentFileNameHolderChanged. |
|
1382 |
^ self. |
|
3892 | 1383 |
]. |
4252 | 1384 |
(changedObject == self previewVisibleHolder) ifTrue:[ |
1385 |
self updatePreview. |
|
1386 |
^ self. |
|
1387 |
]. |
|
3892 | 1388 |
(changedObject == self toolBarVisibleHolder |
1389 |
or:[changedObject == self filenameEntryFieldVisibleHolder]) ifTrue:[ |
|
1390 |
self updateToolVisibility. |
|
1391 |
^ self. |
|
1392 |
]. |
|
4085
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1393 |
(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
|
1394 |
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
|
1395 |
^ self. |
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1396 |
]. |
3892 | 1397 |
|
1398 |
^ super update:something with:aParameter from:changedObject. |
|
1399 |
! |
|
1400 |
||
4252 | 1401 |
updatePreview |
5477 | 1402 |
|previewLabel shownImage plug| |
4252 | 1403 |
|
1404 |
self previewVisibleHolder value ifTrue:[ |
|
5477 | 1405 |
shownImage := nil. |
1406 |
imgView := builder componentAt:#Preview. |
|
1407 |
previewLabel := builder componentAt:#PreviewLabel. |
|
4257 | 1408 |
plug := Plug new. |
1409 |
plug respondTo:#closePreview with:[ self previewVisibleHolder value:false ]. |
|
1410 |
||
1411 |
previewLabel menuHolder:(self class previewLabelMenu decodeAsLiteralArray). |
|
1412 |
previewLabel menuPerformer:plug asValue. |
|
1413 |
||
4252 | 1414 |
previewProcess notNil ifTrue:[ |
1415 |
previewProcess terminate |
|
1416 |
]. |
|
1417 |
previewProcess := [ |
|
1418 |
|imgView oldBg shownImage lbl| |
|
1419 |
||
1420 |
oldBg := previewLabel backgroundColor. |
|
1421 |
previewLabel backgroundColor:(Color red lightened lightened). |
|
1422 |
[ |
|
4262 | 1423 |
self showPreview. |
4252 | 1424 |
previewProcess := nil. |
1425 |
] ensure:[ |
|
1426 |
previewLabel backgroundColor:oldBg. |
|
1427 |
]. |
|
1428 |
] forkAt:7. |
|
1429 |
] ifFalse:[ |
|
4254 | 1430 |
imgView notNil ifTrue:[ |
1431 |
imgView image:nil. |
|
1432 |
] |
|
4252 | 1433 |
]. |
1434 |
! |
|
1435 |
||
3892 | 1436 |
updateToolVisibility |
1437 |
|builder toolBar filenameEntryField vPanel topOffset visible d| |
|
1438 |
||
1439 |
builder := self builder. |
|
1440 |
||
1441 |
topOffset := 0. |
|
1442 |
visible := self toolBarVisibleHolder value. |
|
1443 |
visible ifTrue:[ |
|
1444 |
toolBar := builder componentAt:#ToolbarBox. |
|
1445 |
topOffset := topOffset + toolBar height. |
|
1446 |
]. |
|
1447 |
||
1448 |
visible := self filenameEntryFieldVisibleHolder value. |
|
1449 |
visible ifTrue:[ |
|
1450 |
filenameEntryField := builder componentAt:#FilenameEntryFieldBox. |
|
1451 |
d := filenameEntryField layout bottomOffset - filenameEntryField layout topOffset. |
|
1452 |
filenameEntryField layout topOffset:topOffset bottomOffset:topOffset + d. |
|
1453 |
topOffset := topOffset + filenameEntryField height. |
|
1454 |
filenameEntryField container notNil ifTrue:[ |
|
1455 |
filenameEntryField containerChangedSize. |
|
1456 |
]. |
|
1457 |
]. |
|
1458 |
||
1459 |
vPanel := builder componentAt:#BrowserBox. |
|
1460 |
vPanel layout topOffset:topOffset+1. |
|
1461 |
vPanel container notNil ifTrue:[ |
|
1462 |
vPanel containerChangedSize. |
|
1463 |
]. |
|
1464 |
! ! |
|
1465 |
||
3957 | 1466 |
!FileBrowserV2 methodsFor:'event handling'! |
1467 |
||
4904 | 1468 |
crPressedInPathField |
1469 |
|path fn| |
|
1470 |
||
1471 |
path := fileEntryFieldHolder value. |
|
1472 |
fn := path asFilename. |
|
1473 |
(fn exists and:[ fn isDirectory not ]) ifTrue:[ |
|
1474 |
self openApplForFile:path. |
|
1475 |
] |
|
1476 |
! |
|
1477 |
||
3957 | 1478 |
processEvent:anEvent |
1479 |
"filter keyboard events. |
|
1480 |
Return true, if I have eaten the event" |
|
1481 |
||
1482 |
|focusView key rawKey fileName| |
|
1483 |
||
1484 |
anEvent isKeyPressEvent ifTrue:[ |
|
1485 |
focusView := anEvent targetView. |
|
1486 |
key := anEvent key. |
|
1487 |
rawKey := anEvent rawKey. |
|
1488 |
||
1489 |
(focusView isSameOrComponentOf:self window) ifTrue:[ |
|
1490 |
||
6145 | 1491 |
(focusView == pathEntryField) ifFalse:[ ^ false]. |
3957 | 1492 |
|
1493 |
(key == #Return) ifTrue:[ |
|
1494 |
fileName := pathEntryField list first asFilename. |
|
1495 |
(fileName exists and:[fileName isDirectory not]) ifTrue:[ |
|
4101 | 1496 |
self openApplForFile:fileName |
3957 | 1497 |
]. |
1498 |
]. |
|
1499 |
] |
|
1500 |
]. |
|
1501 |
^ false |
|
1502 |
! ! |
|
1503 |
||
6131 | 1504 |
!FileBrowserV2 methodsFor:'menu accessing'! |
1505 |
||
1506 |
menuFileHistory |
|
1507 |
"initialize the file history menu |
|
1508 |
" |
|
1509 |
<resource: #programMenu > |
|
1510 |
||
1511 |
|menu hist text removeItem removeCol| |
|
1512 |
||
1513 |
menu := Menu new. |
|
1514 |
menu findGuiResourcesIn:self. |
|
1515 |
menu receiver:self. |
|
1516 |
||
1517 |
hist := self fileHistory. |
|
1518 |
hist isEmpty ifTrue:[^ nil]. |
|
1519 |
||
1520 |
removeCol := OrderedCollection new. |
|
1521 |
hist do:[:aFileItem| |
|
1522 |
"aFileItem fileName exists" true ifTrue:[ |
|
1523 |
menu addItem:(MenuItem label: aFileItem fileName asString value:[ |
|
1524 |
self setCurrentFileName:(aFileItem fileName). |
|
1525 |
self openApplByFileItem:aFileItem |
|
1526 |
]). |
|
1527 |
] ifFalse:[ |
|
1528 |
removeCol add:aFileItem. |
|
1529 |
] |
|
1530 |
]. |
|
1531 |
"/ remove all not existing history entries |
|
1532 |
removeCol do:[ : el | |
|
1533 |
hist remove:el. |
|
1534 |
]. |
|
1535 |
removeItem := MenuItem new. |
|
1536 |
removeItem translateLabel:true. |
|
1537 |
text := resources string:'Clear History'. |
|
1538 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text. |
|
1539 |
removeItem label:text. |
|
1540 |
removeItem value:[ |
|
1541 |
self fileHistory removeAll. |
|
1542 |
self enableFileHistory value:false. |
|
1543 |
]. |
|
1544 |
menu addSeparator. |
|
1545 |
menu addItem:removeItem. |
|
1546 |
^ menu |
|
1547 |
! ! |
|
1548 |
||
3892 | 1549 |
!FileBrowserV2 methodsFor:'startup & release'! |
1550 |
||
3954 | 1551 |
closeRequest |
5010 | 1552 |
self |
1553 |
applicationNamed:#FileApplicationNoteBook |
|
1554 |
ifPresentDo:[:appl | appl tryCloseApplications ifFalse:[^ self] ]. |
|
1555 |
||
3954 | 1556 |
^ super closeRequest. |
1557 |
! |
|
1558 |
||
3892 | 1559 |
hideFilenameEntryFieldButtonCreated:aButton |
1560 |
||
1561 |
aButton passiveLevel:(MenuPanel defaultLevel). |
|
1562 |
aButton activeLevel:-1. |
|
1563 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
|
1564 |
! |
|
1565 |
||
1566 |
hideToolBarButtonCreated:aButton |
|
1567 |
||
1568 |
aButton passiveLevel:(MenuPanel defaultLevel). |
|
1569 |
aButton activeLevel:-1. |
|
1570 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
|
1571 |
! |
|
1572 |
||
1573 |
initialize |
|
1574 |
||
1575 |
self masterApplication:nil. |
|
4022 | 1576 |
self dirHistory resetForwardBackward. |
3892 | 1577 |
! |
1578 |
||
1579 |
makeDependent |
|
4008 | 1580 |
|
4004 | 1581 |
super makeDependent. |
4085
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1582 |
self sortBlockProperty addDependent:self. |
3892 | 1583 |
self filenameEntryFieldVisibleHolder addDependent:self. |
1584 |
self toolBarVisibleHolder addDependent:self. |
|
4255 | 1585 |
self previewVisibleHolder addDependent:self. |
3892 | 1586 |
! |
1587 |
||
4884 | 1588 |
postBuildDirectoryTree:aWidget |
1589 |
aWidget application multipleSelect:true. |
|
1590 |
! |
|
1591 |
||
4365 | 1592 |
postBuildEditField:aWidget |
1593 |
||
1594 |
pathEntryField := aWidget. |
|
1595 |
aWidget model:self fileEntryFieldHolder. |
|
1596 |
aWidget listHolder:self dirHistory. |
|
1597 |
aWidget level:-1. |
|
4904 | 1598 |
aWidget acceptIfUnchanged:true. |
1599 |
aWidget crAction:[ self crPressedInPathField ]. |
|
4365 | 1600 |
! |
1601 |
||
4018 | 1602 |
postBuildFilterBox:aWidget |
1603 |
||
1604 |
self filterValueBox value:aWidget. |
|
1605 |
self filterBackgroundColor value:aWidget backgroundColor. |
|
1606 |
! |
|
1607 |
||
3892 | 1608 |
postBuildPathViewBox:aWidget |
1609 |
||
1610 |
aWidget backgroundColor:(MenuPanel defaultBackgroundColor). |
|
1611 |
! |
|
1612 |
||
1613 |
postBuildWith:aBuilder |
|
1614 |
||
1615 |
super postBuildWith:aBuilder. |
|
3980 | 1616 |
self updateToolVisibility. |
3892 | 1617 |
! |
1618 |
||
1619 |
postOpenWith:aBuilder |
|
1620 |
||
4071 | 1621 |
super postOpenWith:aBuilder. |
4577 | 1622 |
self currentFileNameHolderChangedForCommon. |
4071 | 1623 |
self currentFileNameHolderChanged. |
4027 | 1624 |
|
3957 | 1625 |
self windowGroup addPreEventHook:self. |
3892 | 1626 |
! |
1627 |
||
1628 |
release |
|
1629 |
||
1630 |
self saveRuntimeAspectValues. |
|
1631 |
^ super release |
|
1632 |
! ! |
|
1633 |
||
1634 |
!FileBrowserV2 class methodsFor:'documentation'! |
|
1635 |
||
1636 |
version |
|
6241 | 1637 |
^ '$Header: /cvs/stx/stx/libtool/FileBrowserV2.st,v 1.135 2005-04-07 09:40:50 cg Exp $' |
3892 | 1638 |
! ! |
1639 |
||
1640 |
FileBrowserV2 initialize! |