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