author | Claus Gittinger <cg@exept.de> |
Thu, 06 Feb 2014 13:51:30 +0100 | |
changeset 13908 | a996e6ca71d1 |
parent 13854 | 4b62c02ef738 |
child 13909 | eaabff86ec63 |
permissions | -rw-r--r-- |
3892 | 1 |
" |
5140 | 2 |
COPYRIGHT (c) 2002 by eXept Software AG |
12336 | 3 |
All Rights Reserved |
3892 | 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 |
"{ Package: 'stx:libtool' }" |
|
13 |
||
14 |
AbstractFileBrowser subclass:#FileBrowserV2 |
|
7670 | 15 |
instanceVariableNames:'fileEntryFieldHolder pathEntryField previewProcess |
13854 | 16 |
listOfDeviceDrives selectedDeviceDrive imgView lineLabel |
17 |
bookmarkBarVisibleHolder bookmarkHolder' |
|
7670 | 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 |
12336 | 28 |
All Rights Reserved |
3892 | 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) |
|
12336 | 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. |
|
3892 | 47 |
|
48 |
[instance variables]: |
|
49 |
||
12336 | 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. |
|
3892 | 56 |
|
12336 | 57 |
compressTabs <Boolean> if true, leading spaces will be |
58 |
replaced by tabs when saving text |
|
3892 | 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:] |
|
12336 | 64 |
Christian Penk |
3892 | 65 |
|
66 |
[start with:] |
|
12336 | 67 |
FileBrowserV2 open |
3892 | 68 |
" |
5354 | 69 |
! |
70 |
||
71 |
toDo |
|
72 |
" |
|
12336 | 73 |
- the tab for the directory description text editor is not changed if the |
6478 | 74 |
directory description changes to a normal text editor |
5354 | 75 |
- FileDialog should get a file history |
6478 | 76 |
- directorycontentsItem isDirectory fails if it is a symbolic link |
5354 | 77 |
- on sort order change in directory contents browser the columnspec shouldnt not reloaded |
78 |
- check all windowspecs with different font types |
|
5472 | 79 |
- multiple select with mouse moving is flickering (see bestFilename in FilenameEditField) |
80 |
- too many system calls on update cycle |
|
5532 | 81 |
- stop monitoring task for DirectoryTreebrowser and DirectoryContentsBrowser |
5354 | 82 |
" |
3892 | 83 |
! ! |
84 |
||
85 |
!FileBrowserV2 class methodsFor:'instance creation'! |
|
86 |
||
87 |
on:aDirectoryPath |
|
88 |
"return a new FileBrowserV2 in a pathname" |
|
89 |
||
8188 | 90 |
|instance| |
91 |
||
92 |
instance := self new. |
|
93 |
instance onDirectory:aDirectoryPath. |
|
3892 | 94 |
^ instance |
95 |
! |
|
96 |
||
97 |
open |
|
98 |
"start a new FileBrowserV2" |
|
99 |
||
100 |
| instance | |
|
101 |
instance := self new. |
|
102 |
instance open. |
|
103 |
^ instance |
|
5123 | 104 |
|
3892 | 105 |
" |
4626 | 106 |
FileBrowserV2 openOn:(OrderedCollection with:(Filename currentDirectory asAbsoluteFilename)) withExtent:800@600 |
3892 | 107 |
" |
108 |
! |
|
109 |
||
12336 | 110 |
openIn:aDirectoryPath |
9134 | 111 |
"backward compatibility" |
112 |
||
113 |
^ self openOn:aDirectoryPath |
|
114 |
! |
|
115 |
||
12336 | 116 |
openOn:aFileOrDirectoryPath |
3892 | 117 |
"start a new FileBrowserV2 in a pathname" |
118 |
||
11779 | 119 |
|fn| |
8265 | 120 |
|
11779 | 121 |
fn := aFileOrDirectoryPath asFilename. |
122 |
fn isDirectory ifFalse:[ |
|
12336 | 123 |
^ self openOnFileNamed:aFileOrDirectoryPath |
11779 | 124 |
] ifTrue:[ |
12336 | 125 |
^ self openOn:fn withExtent:nil |
8380 | 126 |
]. |
127 |
||
3892 | 128 |
" |
11779 | 129 |
FileBrowserV2 openOn:(Filename currentDirectory asAbsoluteFilename) |
130 |
FileBrowserV2 openOn:'Makefile' |
|
3892 | 131 |
" |
11779 | 132 |
|
133 |
"Modified (comment): / 06-09-2012 / 14:46:54 / cg" |
|
3892 | 134 |
! |
135 |
||
8531 | 136 |
openOn:aDirectoryPath withExtent:extentOrNil |
3892 | 137 |
"start a new FileBrowserV2 in a pathname" |
138 |
||
8265 | 139 |
|instance builder| |
140 |
||
3892 | 141 |
instance := self on:aDirectoryPath. |
142 |
builder := instance open. |
|
8531 | 143 |
extentOrNil notNil ifTrue:[ |
12336 | 144 |
builder window extent:extentOrNil. |
8531 | 145 |
]. |
3892 | 146 |
^ instance |
5123 | 147 |
|
3892 | 148 |
" |
4626 | 149 |
FileBrowserV2 openOn:(OrderedCollection with:(Filename currentDirectory asAbsoluteFilename)) withExtent:800@600 |
3892 | 150 |
" |
151 |
! |
|
152 |
||
12336 | 153 |
openOnDirectory:aDirectoryPath |
8531 | 154 |
"start a new FileBrowserV2 in a pathname" |
155 |
||
156 |
^ self openOn:aDirectoryPath withExtent:nil |
|
157 |
||
158 |
" |
|
159 |
FileBrowserV2 openOn:(OrderedCollection with:(Filename currentDirectory asAbsoluteFilename)) withExtent:800@600 |
|
160 |
" |
|
161 |
! |
|
162 |
||
5123 | 163 |
openOnFileNamed:aFilename |
5162 | 164 |
"start a new FileBrowserV2 on a aFilename. |
165 |
The browser looks for an appropriate viewer and uses that if one is found; |
|
166 |
otherwise, the file is opened for text editing." |
|
167 |
||
168 |
^ self openOnFileNamed:aFilename editing:true |
|
169 |
||
170 |
" |
|
171 |
FileBrowserV2 openOnFileNamed:'Makefile' |
|
172 |
" |
|
173 |
! |
|
174 |
||
175 |
openOnFileNamed:aFilename editing:editing |
|
176 |
"start a new FileBrowserV2 on a aFilename; |
|
177 |
If editing is true, the browser opens the document as text to be edited; |
|
178 |
if false, it looks for an appropriate viewer and uses that if one is found." |
|
5123 | 179 |
|
8188 | 180 |
|browser| |
5123 | 181 |
|
8188 | 182 |
browser := self new. |
183 |
browser openOnFileNamed:aFilename editing:editing. |
|
184 |
^ browser |
|
5123 | 185 |
|
186 |
" |
|
187 |
FileBrowserV2 openOnFileNamed:'Makefile' |
|
188 |
" |
|
189 |
! |
|
190 |
||
3892 | 191 |
openWithAspects:someAspects withExtent:extent |
192 |
"start a new FileBrowserV2 in a pathname" |
|
193 |
||
194 |
|dir clone| |
|
195 |
||
196 |
dir := someAspects at:#currentFileNameHolder ifAbsent:nil. |
|
197 |
clone := self openOn:(dir value) withExtent:extent. |
|
8188 | 198 |
^ clone |
3892 | 199 |
! ! |
200 |
||
201 |
!FileBrowserV2 class methodsFor:'class initialization'! |
|
202 |
||
203 |
initialize |
|
6078 | 204 |
"/ self installInLauncher. - now done in phase 2 |
205 |
ObjectMemory addDependent:self. |
|
3892 | 206 |
! |
207 |
||
208 |
installInLauncher |
|
209 |
"add myself to the launcher menu and toolBar" |
|
210 |
||
3914 | 211 |
|menuItem icon action currentLauncher| |
3892 | 212 |
|
213 |
FileBrowserV2 isNil ifTrue:[^ self]. |
|
214 |
||
13854 | 215 |
"JV@2012-04-03: Changed to reflect UserPreferences" |
216 |
"/action := (MessageSend receiver:(Smalltalk at:self name) selector:#open). |
|
217 |
action := [ UserPreferences current fileBrowserClass open]. |
|
3892 | 218 |
|
7642
7a736bd24cbd
masked pixels must be clear AND color at 0 must be black for
Claus Gittinger <cg@exept.de>
parents:
7630
diff
changeset
|
219 |
icon := [self defaultIcon]. "/ self defaultIcon magnifiedTo:28@28. |
3892 | 220 |
|
13276 | 221 |
"/ already there |
222 |
"/ menuItem := MenuItem new |
|
223 |
"/ translateLabel: true; |
|
224 |
"/ value: action; |
|
225 |
"/ isButton: false; |
|
226 |
"/ label:'File Browser' icon:icon; |
|
227 |
"/ nameKey: #fileBrowserV2; |
|
228 |
"/ activeHelpKey: #fileBrowserV2; |
|
229 |
"/ submenuChannel: #menuFileHistory; |
|
230 |
"/ showBusyCursorWhilePerforming:true. |
|
231 |
"/ |
|
232 |
"/ NewLauncher |
|
233 |
"/ addMenuItem:menuItem |
|
234 |
"/ from:self |
|
235 |
"/ in:'menu.file' |
|
236 |
"/ position:#( #before #fileBrowser) |
|
237 |
"/ space:true. |
|
238 |
||
12336 | 239 |
menuItem := MenuItem new |
13276 | 240 |
translateLabel: true; |
241 |
value: action; |
|
242 |
isButton: true; |
|
243 |
"label:'File Browser'" icon:icon; |
|
244 |
nameKey: #fileBrowserV2; |
|
245 |
activeHelpKey: #fileBrowserV2; |
|
246 |
submenuChannel: #menuFileHistory; |
|
247 |
showBusyCursorWhilePerforming:true. |
|
3892 | 248 |
|
12336 | 249 |
NewLauncher |
13276 | 250 |
addMenuItem:menuItem |
251 |
from:self |
|
252 |
in:'toolbar' |
|
253 |
position:#( #before #fileBrowser) |
|
254 |
space:false. |
|
3892 | 255 |
|
3918 | 256 |
currentLauncher := NewLauncher current. |
3914 | 257 |
currentLauncher notNil ifTrue:[ |
13276 | 258 |
currentLauncher fileBrowserItemVisible value:false |
3914 | 259 |
]. |
12336 | 260 |
NewLauncher addSettingsApplicationByClass:#'FileBrowserV2SettingsAppl' |
13276 | 261 |
withName:'Tools/FileBrowserV2' |
262 |
icon:nil. |
|
3908 | 263 |
|
3892 | 264 |
" |
265 |
self installInLauncher |
|
266 |
self removeFromLauncher |
|
267 |
" |
|
13854 | 268 |
|
269 |
"Modified: / 03-04-2012 / 11:06:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3892 | 270 |
! |
271 |
||
272 |
removeFromLauncher |
|
273 |
"/ |
|
274 |
"/ remove myself from the launcher menu |
|
275 |
"/ |
|
276 |
||
3914 | 277 |
|currentLauncher| |
278 |
||
3892 | 279 |
NewLauncher isNil ifTrue:[^ self]. |
3908 | 280 |
NewLauncher removeUserTool:#fileBrowserV2. |
3918 | 281 |
currentLauncher := NewLauncher current. |
3914 | 282 |
currentLauncher notNil ifTrue:[ |
12336 | 283 |
currentLauncher fileBrowserItemVisible value:false |
3914 | 284 |
]. |
4380
0987d10ae2ba
install and remove from Launcher install in settings application changed
penk
parents:
4377
diff
changeset
|
285 |
NewLauncher removeSettingsApplicationByClass:#'FileBrowserV2SettingsAppl'. |
3892 | 286 |
|
287 |
" |
|
288 |
self removeFromLauncher |
|
289 |
" |
|
6078 | 290 |
! |
291 |
||
292 |
update:something with:aParameter from:changedObject |
|
293 |
something == #initialized ifTrue:[ |
|
12336 | 294 |
changedObject == ObjectMemory ifTrue:[ |
295 |
self installInLauncher. |
|
296 |
ObjectMemory removeDependent:self. |
|
297 |
] |
|
6078 | 298 |
]. |
3892 | 299 |
! ! |
300 |
||
301 |
!FileBrowserV2 class methodsFor:'defaults'! |
|
302 |
||
303 |
entryFieldEndStringForMultipleSelection |
|
304 |
||
305 |
^ ('[*]') |
|
306 |
! ! |
|
307 |
||
308 |
!FileBrowserV2 class methodsFor:'help specs'! |
|
309 |
||
6334 | 310 |
flyByHelpSpec |
311 |
"This resource specification was automatically generated |
|
312 |
by the UIHelpTool of ST/X." |
|
313 |
||
314 |
"Do not manually edit this!! If it is corrupted, |
|
315 |
the UIHelpTool may not be able to read the specification." |
|
316 |
||
317 |
" |
|
12336 | 318 |
UIHelpTool openOnClass:FileBrowserV2 |
6334 | 319 |
" |
320 |
||
321 |
<resource: #help> |
|
322 |
||
323 |
^ super flyByHelpSpec addPairsFrom:#( |
|
324 |
||
325 |
#columnLabel |
|
326 |
'The text-cursor''s column number' |
|
327 |
||
328 |
#encodingLabel |
|
13005 | 329 |
'The file''s encoding (Right-click to change)' |
6334 | 330 |
|
331 |
#encodingLockedLabel |
|
332 |
'Lock the file-encoding (do not try to guess from the file''s contents)' |
|
333 |
||
12761 | 334 |
#fileFilter |
335 |
'Only show files matching the pattern.\Separate multiple patterns by ";".\Patterns starting with "~" are excluding.' |
|
336 |
||
6334 | 337 |
#lineLabel |
13005 | 338 |
'The text-cursor''s line number. Double-click to change' |
6334 | 339 |
|
340 |
#modeLabel |
|
13005 | 341 |
'The editing mode (Insert vs. overwrite)' |
6334 | 342 |
|
343 |
#numberOfFiles |
|
344 |
'Number of files shown (Total number of files in directory)' |
|
345 |
||
4688 | 346 |
|
347 |
) |
|
10770 | 348 |
|
349 |
"Modified: / 06-10-2011 / 14:37:12 / cg" |
|
13854 | 350 |
! |
351 |
||
352 |
helpSpec |
|
353 |
"This resource specification was automatically generated |
|
354 |
by the UIHelpTool of ST/X." |
|
355 |
||
356 |
"Do not manually edit this!! If it is corrupted, |
|
357 |
the UIHelpTool may not be able to read the specification." |
|
358 |
||
359 |
" |
|
360 |
UIHelpTool openOnClass:FileBrowserV2 |
|
361 |
" |
|
362 |
||
363 |
<resource: #help> |
|
364 |
||
365 |
^ super helpSpec addPairsFrom:#( |
|
366 |
||
367 |
#addTerminal |
|
368 |
'' |
|
369 |
||
370 |
#make |
|
371 |
'' |
|
372 |
||
373 |
) |
|
3892 | 374 |
! ! |
375 |
||
6338 | 376 |
!FileBrowserV2 class methodsFor:'image specs'! |
3892 | 377 |
|
8762 | 378 |
applicationIcon |
379 |
||
380 |
^ self defaultIcon |
|
381 |
! |
|
382 |
||
6525 | 383 |
closePreviewButtonImage |
384 |
^ ToolbarIconLibrary removeTabIcon |
|
385 |
! |
|
386 |
||
3892 | 387 |
defaultIcon |
7630 | 388 |
<resource: #programImage> |
3892 | 389 |
|
7630 | 390 |
^ ToolbarIconLibrary startNewFileBrowserIcon |
3892 | 391 |
! |
392 |
||
6339 | 393 |
encodingLockIcon |
394 |
<resource: #programImage> |
|
395 |
||
396 |
^ ToolbarIconLibrary encodingLockIcon |
|
397 |
! |
|
398 |
||
3892 | 399 |
hideFilenameEntryFieldIcon |
400 |
<resource: #programImage> |
|
401 |
||
402 |
^ ToolbarIconLibrary hideToolbarIconH14 |
|
403 |
! |
|
404 |
||
405 |
hideToolBarIcon |
|
406 |
<resource: #programImage> |
|
407 |
||
408 |
^ ToolbarIconLibrary hideToolbarIconH26 |
|
409 |
! ! |
|
410 |
||
411 |
!FileBrowserV2 class methodsFor:'interface specs'! |
|
412 |
||
413 |
windowSpec |
|
414 |
"This resource specification was automatically generated |
|
415 |
by the UIPainter of ST/X." |
|
416 |
||
417 |
"Do not manually edit this!! If it is corrupted, |
|
418 |
the UIPainter may not be able to read the specification." |
|
419 |
||
420 |
" |
|
13854 | 421 |
UIPainter new openOnClass:FileBrowserV3 andSelector:#windowSpec |
422 |
FileBrowserV3 new openInterface:#windowSpec |
|
423 |
FileBrowserV3 open |
|
3892 | 424 |
" |
425 |
||
426 |
<resource: #canvas> |
|
427 |
||
12670 | 428 |
^ |
5331 | 429 |
#(FullSpec |
12670 | 430 |
name: windowSpec |
431 |
window: |
|
5331 | 432 |
(WindowSpec |
12670 | 433 |
label: FileBrowser |
434 |
name: FileBrowser |
|
435 |
min: (Point 10 10) |
|
13854 | 436 |
bounds: (Rectangle 0 0 800 600) |
12670 | 437 |
menu: mainMenu |
438 |
icon: defaultIcon |
|
439 |
) |
|
440 |
component: |
|
5331 | 441 |
(SpecCollection |
12670 | 442 |
collection: ( |
443 |
(ViewSpec |
|
444 |
name: 'ToolbarBox' |
|
445 |
layout: (LayoutFrame 0 0 0 0 0 1 40 0) |
|
446 |
level: 0 |
|
447 |
visibilityChannel: toolBarVisibleHolder |
|
448 |
component: |
|
449 |
(SpecCollection |
|
450 |
collection: ( |
|
451 |
(ActionButtonSpec |
|
452 |
label: 'hideToolBarIcon' |
|
453 |
name: 'HideToolBarButton' |
|
454 |
layout: (LayoutFrame 0 0 0 0 13 0 40 0) |
|
455 |
activeHelpKey: hideToolBar |
|
456 |
hasCharacterOrientedLabel: false |
|
457 |
translateLabel: true |
|
458 |
model: hideToolbar |
|
459 |
postBuildCallback: hideToolBarButtonCreated: |
|
460 |
) |
|
461 |
(MenuPanelSpec |
|
462 |
name: 'ToolBar' |
|
463 |
layout: (LayoutFrame 13 0 0 0 0 1 40 0) |
|
464 |
menu: toolBarMainMenu |
|
465 |
textDefault: true |
|
466 |
) |
|
467 |
) |
|
468 |
||
469 |
) |
|
470 |
) |
|
471 |
(ViewSpec |
|
13854 | 472 |
name: 'BookmarkBar' |
473 |
layout: (LayoutFrame 0 0 40 0 0 1 66 0) |
|
474 |
visibilityChannel: bookmarkBarVisibleHolder |
|
475 |
component: |
|
476 |
(SpecCollection |
|
477 |
collection: ( |
|
478 |
(ActionButtonSpec |
|
479 |
label: 'hideToolBarIcon' |
|
480 |
name: 'Button1' |
|
481 |
layout: (LayoutFrame 0 0 0 0 13 0 0 1) |
|
482 |
activeHelpKey: hideToolBar |
|
483 |
hasCharacterOrientedLabel: false |
|
484 |
translateLabel: true |
|
485 |
model: hideBookmarkBar |
|
13908 | 486 |
postBuildCallback: hideToolBarButtonCreated: |
13854 | 487 |
) |
488 |
(SubCanvasSpec |
|
489 |
name: 'Bookmarks' |
|
490 |
layout: (LayoutFrame 13 0 0 0 0 1 0 1) |
|
491 |
level: 1 |
|
492 |
hasHorizontalScrollBar: false |
|
493 |
hasVerticalScrollBar: false |
|
494 |
miniScrollerHorizontal: false |
|
495 |
majorKey: BookmarkBar |
|
496 |
subAspectHolders: |
|
497 |
(Array |
|
498 |
||
499 |
(SubChannelInfoSpec |
|
500 |
subAspect: bookmarkHolder |
|
501 |
aspect: bookmarkHolder |
|
502 |
) |
|
503 |
(SubChannelInfoSpec |
|
504 |
subAspect: bookmarksHolder |
|
505 |
aspect: bookmarkListHolder |
|
506 |
) |
|
507 |
) |
|
508 |
createNewApplication: true |
|
509 |
createNewBuilder: true |
|
510 |
) |
|
511 |
) |
|
512 |
||
513 |
) |
|
514 |
) |
|
515 |
(ViewSpec |
|
12670 | 516 |
name: 'FilenameEntryFieldBox' |
13854 | 517 |
layout: (LayoutFrame 0 0 67 0 0 1 92 0) |
13908 | 518 |
"/ level: 0 |
12670 | 519 |
visibilityChannel: filenameEntryFieldVisibleHolder |
520 |
component: |
|
521 |
(SpecCollection |
|
522 |
collection: ( |
|
523 |
(ActionButtonSpec |
|
524 |
label: 'hideFilenameEntryFieldIcon' |
|
525 |
name: 'HideFilenameEntryFieldButton' |
|
526 |
layout: (LayoutFrame 0 0 0 0 13 0 0 1) |
|
527 |
activeHelpKey: hideFilenameEntryField |
|
528 |
hasCharacterOrientedLabel: false |
|
529 |
translateLabel: true |
|
530 |
model: hideFilenameEntryField |
|
531 |
postBuildCallback: hideFilenameEntryFieldButtonCreated: |
|
532 |
) |
|
533 |
(HorizontalPanelViewSpec |
|
534 |
name: 'HorizontalPanel1' |
|
535 |
layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0) |
|
536 |
level: 1 |
|
537 |
horizontalLayout: leftFit |
|
538 |
verticalLayout: fit |
|
539 |
horizontalSpace: 3 |
|
540 |
verticalSpace: 3 |
|
541 |
component: |
|
542 |
(SpecCollection |
|
543 |
collection: ( |
|
544 |
(ComboListSpec |
|
545 |
name: 'ComboList1' |
|
546 |
visibilityChannel: driveSelectorVisible |
|
547 |
model: selectedDeviceDrive |
|
548 |
comboList: listOfDeviceDrives |
|
549 |
useIndex: false |
|
550 |
hidePullDownMenuButton: false |
|
551 |
extent: (Point 53 23) |
|
552 |
) |
|
553 |
(VariableHorizontalPanelSpec |
|
554 |
name: 'VariableHorizontalPanel1' |
|
555 |
level: 0 |
|
556 |
showHandle: true |
|
557 |
component: |
|
558 |
(SpecCollection |
|
559 |
collection: ( |
|
560 |
(NonScrollableArbitraryComponentSpec |
|
561 |
name: 'NonScrollableArbitraryComponent1' |
|
562 |
component: FilenameEditFieldV2 |
|
563 |
postBuildCallback: postBuildEditField: |
|
564 |
) |
|
565 |
(ViewSpec |
|
566 |
name: 'FilterBox' |
|
567 |
component: |
|
568 |
(SpecCollection |
|
569 |
collection: ( |
|
570 |
(LabelSpec |
|
571 |
label: 'Filter:' |
|
572 |
name: 'Filter' |
|
573 |
layout: (LayoutFrame 0 0 0 0 40 0 0 1) |
|
574 |
translateLabel: true |
|
575 |
adjust: left |
|
576 |
postBuildCallback: postBuildPathViewBox: |
|
577 |
) |
|
578 |
(ComboBoxSpec |
|
579 |
name: 'FilterSelectionBox' |
|
580 |
layout: (LayoutFrame 40 0 0 0 0 1 0 1) |
|
581 |
model: filterModel |
|
582 |
immediateAccept: true |
|
583 |
acceptOnPointerLeave: false |
|
584 |
comboList: filterListModel |
|
585 |
) |
|
586 |
) |
|
587 |
||
588 |
) |
|
589 |
postBuildCallback: postBuildPathViewBox: |
|
590 |
) |
|
591 |
) |
|
592 |
||
593 |
) |
|
594 |
handles: (Any 0.774936 1.0) |
|
595 |
postBuildCallback: postBuildPathViewBox: |
|
596 |
useDefaultExtent: true |
|
597 |
) |
|
598 |
) |
|
599 |
||
600 |
) |
|
601 |
postBuildCallback: postBuildPathViewBox: |
|
602 |
) |
|
603 |
) |
|
604 |
||
605 |
) |
|
606 |
) |
|
607 |
(#'FileBrowserV2UISpecifications::PanelSpec' |
|
608 |
name: 'BrowserBox' |
|
13854 | 609 |
layout: (LayoutFrame 0 0.0 92 0.0 0 1.0 -26 1.0) |
12670 | 610 |
level: 0 |
611 |
showHandle: true |
|
612 |
snapMode: both |
|
613 |
whichView: last |
|
614 |
orientation: vertical |
|
615 |
visibility: viewNoteBookApplicationHolder |
|
616 |
component: |
|
617 |
(SpecCollection |
|
618 |
collection: ( |
|
619 |
(#'FileBrowserV2UISpecifications::PanelSpec' |
|
620 |
name: 'HorizontalPanel' |
|
621 |
level: 0 |
|
622 |
snapMode: both |
|
623 |
whichView: first |
|
624 |
orientation: horizontal |
|
625 |
visibility: showDirectoryTree |
|
626 |
component: |
|
627 |
(SpecCollection |
|
628 |
collection: ( |
|
629 |
(SubCanvasSpec |
|
630 |
name: 'DirectoryTreeBrowser' |
|
631 |
hasHorizontalScrollBar: false |
|
632 |
hasVerticalScrollBar: false |
|
633 |
majorKey: DirectoryTreeBrowser |
|
634 |
createNewApplication: true |
|
635 |
createNewBuilder: true |
|
636 |
postBuildCallback: postBuildDirectoryTree: |
|
637 |
) |
|
638 |
(SubCanvasSpec |
|
639 |
name: 'DirectoryContentsBrowser' |
|
640 |
hasHorizontalScrollBar: false |
|
641 |
hasVerticalScrollBar: false |
|
642 |
majorKey: DirectoryContentsBrowser |
|
643 |
createNewApplication: true |
|
644 |
createNewBuilder: true |
|
645 |
) |
|
646 |
) |
|
647 |
||
648 |
) |
|
649 |
handles: (Any 0.225 1.0) |
|
650 |
) |
|
651 |
(SubCanvasSpec |
|
652 |
name: 'FileApplicationNoteBook' |
|
653 |
tabable: false |
|
654 |
hasHorizontalScrollBar: false |
|
655 |
hasVerticalScrollBar: false |
|
656 |
majorKey: FileApplicationNoteBook |
|
657 |
createNewApplication: true |
|
658 |
createNewBuilder: true |
|
659 |
) |
|
660 |
) |
|
661 |
||
662 |
) |
|
663 |
handles: (Any 0.5 1.0) |
|
664 |
) |
|
665 |
(ViewSpec |
|
666 |
name: 'InfoBox' |
|
13854 | 667 |
layout: (LayoutFrame 0 0 -26 1 0 1 0 1) |
12670 | 668 |
level: 0 |
669 |
visibilityChannel: infoBarVisibleHolder |
|
670 |
component: |
|
671 |
(SpecCollection |
|
672 |
collection: ( |
|
673 |
(LabelSpec |
|
674 |
label: 'NotifyLabel' |
|
675 |
name: 'NotifyLabel' |
|
676 |
layout: (LayoutFrame 0 0 1 0.0 -220 1 1 1.0) |
|
677 |
level: -1 |
|
678 |
translateLabel: true |
|
679 |
labelChannel: notifyChannel |
|
680 |
adjust: left |
|
681 |
) |
|
682 |
(LabelSpec |
|
683 |
label: 'encoding' |
|
684 |
name: 'EncodingLabel' |
|
685 |
layout: (LayoutFrame -318 1 2 0.0 -235 1 0 1.0) |
|
686 |
activeHelpKey: encodingLabel |
|
687 |
level: 0 |
|
688 |
labelChannel: fileEncodingHolder |
|
689 |
adjust: right |
|
690 |
menu: encodingMenu |
|
691 |
) |
|
692 |
(LabelSpec |
|
693 |
name: 'FileEncodingLockedLabel' |
|
694 |
layout: (LayoutFrame -235 1 2 0.0 -220 1 20 0.0) |
|
695 |
activeHelpKey: encodingLockedLabel |
|
696 |
level: 0 |
|
697 |
labelChannel: fileEncodingLockImageHolder |
|
698 |
adjust: right |
|
699 |
menu: encodingMenu |
|
700 |
) |
|
701 |
(LabelSpec |
|
702 |
label: 'Shown Files' |
|
703 |
name: 'ShownFilesLabel' |
|
704 |
layout: (LayoutFrame -220 1 1 0.0 -65 1 1 1.0) |
|
705 |
activeHelpKey: numberOfFiles |
|
706 |
level: -1 |
|
707 |
translateLabel: true |
|
708 |
labelChannel: shownFiles |
|
709 |
adjust: right |
|
710 |
) |
|
711 |
(ViewSpec |
|
712 |
name: 'ProgressIndicatorBox' |
|
713 |
layout: (LayoutFrame -220 1 1 0.0 -65 1 1 1.0) |
|
714 |
level: -1 |
|
715 |
visibilityChannel: activityVisibilityChannel |
|
716 |
component: |
|
717 |
(SpecCollection |
|
718 |
collection: ( |
|
719 |
(ProgressIndicatorSpec |
|
720 |
name: 'ProgressIndicator1' |
|
721 |
layout: (LayoutFrame 5 0.0 -7 0.5 -5 1.0 7 0.5) |
|
722 |
backgroundColor: (Color 0.0 66.6666666666667 66.6666666666667) |
|
723 |
isActivityIndicator: true |
|
724 |
) |
|
725 |
) |
|
726 |
||
727 |
) |
|
728 |
) |
|
729 |
(LabelSpec |
|
730 |
name: 'BusyLabel' |
|
731 |
layout: (LayoutFrame -220 1 1 0.0 -65 1 1 1.0) |
|
732 |
activeHelpKey: modeLabel |
|
733 |
level: -1 |
|
734 |
visibilityChannel: busyLabelVisibleHolder |
|
735 |
translateLabel: true |
|
736 |
labelChannel: busyLabelHolder |
|
737 |
adjust: right |
|
738 |
) |
|
739 |
(LabelSpec |
|
740 |
label: 'M' |
|
741 |
name: 'ModeLabel' |
|
742 |
layout: (LayoutFrame -65 1 1 0.0 -55 1 1 1.0) |
|
743 |
activeHelpKey: modeLabel |
|
744 |
level: -1 |
|
745 |
translateLabel: true |
|
746 |
labelChannel: modeLabelHolder |
|
747 |
adjust: right |
|
748 |
postBuildCallback: postBuildEditModeInfoLabel: |
|
749 |
) |
|
750 |
(LabelSpec |
|
751 |
label: 'L' |
|
752 |
name: 'LineLabel' |
|
753 |
layout: (LayoutFrame -55 1 1 0.0 -20 1 1 1.0) |
|
754 |
activeHelpKey: lineLabel |
|
755 |
level: -1 |
|
756 |
translateLabel: true |
|
757 |
labelChannel: cursorLineLabelHolder |
|
758 |
adjust: right |
|
759 |
) |
|
760 |
(LabelSpec |
|
761 |
label: 'C' |
|
762 |
name: 'ColLabel' |
|
763 |
layout: (LayoutFrame -20 1 1 0.0 0 1 1 1.0) |
|
764 |
activeHelpKey: columnLabel |
|
765 |
level: -1 |
|
766 |
translateLabel: true |
|
767 |
labelChannel: cursorColLabelHolder |
|
768 |
adjust: right |
|
769 |
) |
|
770 |
) |
|
771 |
||
772 |
) |
|
773 |
) |
|
774 |
(LabelSpec |
|
775 |
label: 'Preview' |
|
776 |
name: 'PreviewLabel' |
|
13854 | 777 |
layout: (LayoutFrame 0 0.5 93 0 100 0.5 115 0) |
12670 | 778 |
level: 0 |
779 |
borderWidth: 1 |
|
780 |
visibilityChannel: previewVisibleHolder |
|
781 |
backgroundColor: (Color 86.9993133440147 86.9993133440147 86.9993133440147) |
|
782 |
translateLabel: true |
|
783 |
) |
|
784 |
(ArbitraryComponentSpec |
|
785 |
name: 'Preview' |
|
13854 | 786 |
layout: (LayoutFrame 0 0.5 116 0 -147 1 -266 1) |
12670 | 787 |
level: 1 |
788 |
visibilityChannel: previewVisibleHolder |
|
789 |
hasBorder: false |
|
790 |
component: ImageView |
|
791 |
) |
|
792 |
(ActionButtonSpec |
|
793 |
label: 'closePreviewButtonImage' |
|
794 |
name: 'ClosePreviewButton' |
|
13854 | 795 |
layout: (LayoutFrame -169 1 94 0 -147 1 116 0) |
12670 | 796 |
visibilityChannel: previewVisibleHolder |
797 |
hasCharacterOrientedLabel: false |
|
798 |
translateLabel: true |
|
799 |
) |
|
800 |
) |
|
801 |
||
802 |
) |
|
4647 | 803 |
) |
3892 | 804 |
! ! |
805 |
||
806 |
!FileBrowserV2 class methodsFor:'menu specs'! |
|
807 |
||
7102 | 808 |
editModeInfoLabelMenu |
809 |
"This resource specification was automatically generated |
|
810 |
by the MenuEditor of ST/X." |
|
811 |
||
812 |
"Do not manually edit this!! If it is corrupted, |
|
813 |
the MenuEditor may not be able to read the specification." |
|
814 |
||
815 |
" |
|
816 |
MenuEditor new openOnClass:Tools::NewSystemBrowser andSelector:#editModeInfoLabelMenu |
|
817 |
(Menu new fromLiteralArrayEncoding:(Tools::NewSystemBrowser editModeInfoLabelMenu)) startUp |
|
818 |
" |
|
819 |
||
820 |
<resource: #menu> |
|
821 |
||
12336 | 822 |
^ |
7102 | 823 |
#(Menu |
12336 | 824 |
( |
825 |
(MenuItem |
|
826 |
label: 'Insert' |
|
827 |
itemValue: editModeInsert |
|
828 |
translateLabel: true |
|
829 |
) |
|
830 |
(MenuItem |
|
831 |
label: 'Overwrite' |
|
832 |
itemValue: editModeOverwrite |
|
833 |
translateLabel: true |
|
834 |
) |
|
835 |
(MenuItem |
|
836 |
label: 'Insert Selecting' |
|
837 |
itemValue: editModeInsertAndSelect |
|
838 |
translateLabel: true |
|
839 |
) |
|
840 |
) |
|
841 |
nil |
|
842 |
nil |
|
7102 | 843 |
) |
844 |
||
845 |
"Created: / 11-09-2006 / 12:23:59 / cg" |
|
846 |
! |
|
847 |
||
5528 | 848 |
encodingMenu |
849 |
"This resource specification was automatically generated |
|
850 |
by the MenuEditor of ST/X." |
|
851 |
||
852 |
"Do not manually edit this!! If it is corrupted, |
|
853 |
the MenuEditor may not be able to read the specification." |
|
854 |
||
855 |
" |
|
856 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#encodingMenu |
|
857 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 encodingMenu)) startUp |
|
858 |
" |
|
859 |
||
860 |
<resource: #menu> |
|
861 |
||
12336 | 862 |
^ |
5528 | 863 |
#(Menu |
12336 | 864 |
( |
865 |
(MenuItem |
|
866 |
label: 'Encoding...' |
|
867 |
itemValue: fileEncodingDialog |
|
868 |
translateLabel: true |
|
869 |
) |
|
870 |
(MenuItem |
|
871 |
label: '-' |
|
872 |
) |
|
873 |
(MenuItem |
|
874 |
label: 'Locked' |
|
875 |
translateLabel: true |
|
876 |
indication: lockFileEncodingHolder |
|
877 |
) |
|
878 |
) |
|
879 |
nil |
|
880 |
nil |
|
5528 | 881 |
) |
882 |
! |
|
883 |
||
3892 | 884 |
mainMenu |
885 |
"This resource specification was automatically generated |
|
886 |
by the MenuEditor of ST/X." |
|
887 |
||
888 |
"Do not manually edit this!! If it is corrupted, |
|
889 |
the MenuEditor may not be able to read the specification." |
|
890 |
||
11136 | 891 |
|
3892 | 892 |
" |
893 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#mainMenu |
|
894 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 mainMenu)) startUp |
|
895 |
" |
|
896 |
||
897 |
<resource: #menu> |
|
898 |
||
13854 | 899 |
^ |
5424 | 900 |
#(Menu |
13854 | 901 |
( |
902 |
(MenuItem |
|
903 |
label: 'Browser' |
|
904 |
submenuChannel: browserMenu |
|
905 |
) |
|
906 |
(MenuItem |
|
907 |
label: 'Directory' |
|
908 |
submenuChannel: directoryMenu |
|
909 |
) |
|
910 |
(MenuItem |
|
911 |
label: 'File' |
|
912 |
submenuChannel: fileMenu |
|
913 |
) |
|
914 |
(MenuItem |
|
915 |
label: 'Edit' |
|
916 |
submenuChannel: editMenu |
|
917 |
) |
|
918 |
(MenuItem |
|
919 |
label: 'View' |
|
920 |
submenu: |
|
921 |
(Menu |
|
922 |
( |
|
923 |
(MenuItem |
|
924 |
label: 'Details' |
|
925 |
submenuChannel: viewInContentsBrowserMenu |
|
926 |
) |
|
927 |
(MenuItem |
|
928 |
label: 'Sort' |
|
929 |
submenuChannel: sortMenu |
|
930 |
) |
|
931 |
(MenuItem |
|
932 |
label: 'Show' |
|
933 |
submenuChannel: showMenuSpec |
|
934 |
) |
|
935 |
(MenuItem |
|
936 |
label: '-' |
|
937 |
) |
|
938 |
(MenuItem |
|
939 |
label: 'Toolbar' |
|
940 |
hideMenuOnActivated: false |
|
941 |
indication: toolBarVisibleHolder |
|
942 |
) |
|
943 |
(MenuItem |
|
13908 | 944 |
label: 'Bookmarks' |
945 |
hideMenuOnActivated: false |
|
946 |
indication: bookmarkBarVisibleHolder |
|
947 |
) |
|
948 |
(MenuItem |
|
13854 | 949 |
label: 'Path Entry && Filter' |
950 |
hideMenuOnActivated: false |
|
951 |
indication: filenameEntryFieldVisibleHolder |
|
952 |
) |
|
953 |
(MenuItem |
|
954 |
label: 'Info' |
|
955 |
hideMenuOnActivated: false |
|
956 |
indication: infoBarVisibleHolder |
|
957 |
) |
|
958 |
(MenuItem |
|
959 |
label: 'Tags' |
|
13908 | 960 |
hideMenuOnActivated: false |
13854 | 961 |
indication: tagsBrowserVisibleHolder |
962 |
) |
|
963 |
(MenuItem |
|
964 |
label: 'Preview' |
|
965 |
hideMenuOnActivated: false |
|
966 |
indication: previewVisibleHolder |
|
967 |
) |
|
968 |
(MenuItem |
|
969 |
label: '-' |
|
970 |
) |
|
971 |
(MenuItem |
|
972 |
label: 'Update' |
|
973 |
itemValue: updateCurrentDirectory |
|
974 |
) |
|
975 |
) |
|
976 |
nil |
|
977 |
nil |
|
978 |
) |
|
979 |
) |
|
980 |
(MenuItem |
|
981 |
label: 'Tools' |
|
982 |
submenuChannel: toolsMenuSpec |
|
983 |
) |
|
984 |
(MenuItem |
|
985 |
label: 'Source Code Management' |
|
986 |
submenuChannel: scmMenuSlice |
|
987 |
isMenuSlice: true |
|
988 |
) |
|
989 |
(MenuItem |
|
990 |
label: 'Extras' |
|
991 |
submenuChannel: extraMenu |
|
992 |
) |
|
993 |
(MenuItem |
|
994 |
label: 'MENU_Help' |
|
995 |
startGroup: conditionalRight |
|
996 |
submenu: |
|
997 |
(Menu |
|
998 |
( |
|
999 |
(MenuItem |
|
1000 |
label: 'FileBrowser Documentation' |
|
1001 |
itemValue: openHTMLDocument: |
|
1002 |
argument: 'tools/fbrowserV2/TOP.html' |
|
1003 |
) |
|
1004 |
(MenuItem |
|
1005 |
label: '-' |
|
1006 |
) |
|
1007 |
(MenuItem |
|
1008 |
label: 'About FileBrowser...' |
|
1009 |
itemValue: openAboutThisApplication |
|
1010 |
) |
|
1011 |
) |
|
1012 |
nil |
|
1013 |
nil |
|
1014 |
) |
|
1015 |
) |
|
1016 |
) |
|
1017 |
nil |
|
1018 |
nil |
|
3892 | 1019 |
) |
1020 |
! |
|
1021 |
||
4257 | 1022 |
previewLabelMenu |
1023 |
"This resource specification was automatically generated |
|
1024 |
by the MenuEditor of ST/X." |
|
1025 |
||
1026 |
"Do not manually edit this!! If it is corrupted, |
|
1027 |
the MenuEditor may not be able to read the specification." |
|
1028 |
||
1029 |
" |
|
1030 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#previewLabelMenu |
|
1031 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 previewLabelMenu)) startUp |
|
1032 |
" |
|
1033 |
||
1034 |
<resource: #menu> |
|
1035 |
||
12336 | 1036 |
^ |
4257 | 1037 |
#(#Menu |
12336 | 1038 |
#( |
1039 |
#(#MenuItem |
|
1040 |
#label: 'Close Preview' |
|
1041 |
#itemValue: #closePreview |
|
1042 |
#translateLabel: true |
|
1043 |
) |
|
1044 |
) |
|
1045 |
nil |
|
1046 |
nil |
|
4257 | 1047 |
) |
1048 |
! |
|
1049 |
||
3892 | 1050 |
toolBarMainMenu |
13854 | 1051 |
<resource: #menu> |
1052 |
||
1053 |
^ self toolBarMainMenu_new |
|
1054 |
||
1055 |
"Modified: / 05-02-2014 / 11:43:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1056 |
! |
|
1057 |
||
1058 |
toolBarMainMenu_new |
|
3892 | 1059 |
"This resource specification was automatically generated |
1060 |
by the MenuEditor of ST/X." |
|
1061 |
||
1062 |
"Do not manually edit this!! If it is corrupted, |
|
1063 |
the MenuEditor may not be able to read the specification." |
|
1064 |
||
13854 | 1065 |
|
1066 |
" |
|
1067 |
MenuEditor new openOnClass:FileBrowserV3 andSelector:#toolBarMainMenu |
|
1068 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV3 toolBarMainMenu)) startUp |
|
1069 |
" |
|
1070 |
||
1071 |
<resource: #menu> |
|
1072 |
||
1073 |
^ |
|
1074 |
#(Menu |
|
1075 |
( |
|
1076 |
(MenuItem |
|
1077 |
activeHelpKey: directoryBack |
|
1078 |
enabled: enableBack |
|
1079 |
label: 'Back' |
|
1080 |
itemValue: doBack |
|
1081 |
translateLabel: true |
|
1082 |
isButton: true |
|
1083 |
submenuChannel: menuDirHistoryBack |
|
1084 |
labelImage: (ResourceRetriever ToolbarIconLibrary historyBackIcon) |
|
1085 |
) |
|
1086 |
(MenuItem |
|
1087 |
label: '' |
|
1088 |
) |
|
1089 |
(MenuItem |
|
1090 |
activeHelpKey: directoryForward |
|
1091 |
enabled: enableForward |
|
1092 |
label: 'Forward' |
|
1093 |
itemValue: doForward |
|
1094 |
translateLabel: true |
|
1095 |
isButton: true |
|
1096 |
submenuChannel: menuDirHistoryForward |
|
1097 |
labelImage: (ResourceRetriever ToolbarIconLibrary historyForwardIcon) |
|
1098 |
) |
|
1099 |
(MenuItem |
|
1100 |
label: '-' |
|
1101 |
) |
|
1102 |
(MenuItem |
|
1103 |
activeHelpKey: directoryUp |
|
1104 |
enabled: enableDirectoryUp |
|
1105 |
label: 'DirectoryUp' |
|
1106 |
itemValue: doGoDirectoryUp |
|
1107 |
translateLabel: true |
|
1108 |
isButton: true |
|
1109 |
labelImage: (ResourceRetriever ToolbarIconLibrary directoryUpIcon) |
|
1110 |
) |
|
1111 |
(MenuItem |
|
1112 |
activeHelpKey: fileHome |
|
1113 |
enabled: enableHome |
|
1114 |
label: 'Home' |
|
1115 |
itemValue: doGotoHomeDirectory |
|
1116 |
translateLabel: true |
|
1117 |
isButton: true |
|
1118 |
labelImage: (ResourceRetriever ToolbarIconLibrary homeIcon) |
|
1119 |
) |
|
1120 |
(MenuItem |
|
1121 |
activeHelpKey: fileGotoDefaultDirectory |
|
1122 |
enabled: enableGotoDefaultDirectory |
|
1123 |
label: 'Current' |
|
1124 |
itemValue: doGotoDefaultDirectory |
|
1125 |
translateLabel: true |
|
1126 |
isButton: true |
|
1127 |
isVisible: false |
|
1128 |
labelImage: (ResourceRetriever ToolbarIconLibrary currentDirectoryIcon) |
|
1129 |
) |
|
1130 |
(MenuItem |
|
1131 |
activeHelpKey: fileGotoSmalltalkDirectory |
|
1132 |
enabled: enableGotoSmalltalkDirectory |
|
1133 |
label: 'ST/X Default' |
|
1134 |
itemValue: doGotoSmalltalkDirectory |
|
1135 |
translateLabel: true |
|
1136 |
isButton: true |
|
1137 |
labelImage: (ResourceRetriever ToolbarIconLibrary stxHomeIcon) |
|
1138 |
) |
|
1139 |
(MenuItem |
|
1140 |
activeHelpKey: fileGotoBookmark |
|
1141 |
label: 'Bookmarks' |
|
1142 |
translateLabel: true |
|
1143 |
isButton: true |
|
1144 |
isVisible: false |
|
1145 |
submenuChannel: gotoBookmarksMenu |
|
1146 |
labelImage: (ResourceRetriever ToolbarIconLibrary directoryBookmarksIcon) |
|
1147 |
) |
|
1148 |
(MenuItem |
|
1149 |
activeHelpKey: fileHistory |
|
1150 |
enabled: enableFileHistory |
|
1151 |
label: 'File History' |
|
1152 |
translateLabel: true |
|
1153 |
isButton: true |
|
1154 |
isVisible: false |
|
1155 |
submenuChannel: menuFileHistory |
|
1156 |
labelImage: (ResourceRetriever ToolbarIconLibrary historyIcon) |
|
1157 |
) |
|
1158 |
(MenuItem |
|
1159 |
label: '-' |
|
1160 |
) |
|
1161 |
(MenuItem |
|
1162 |
activeHelpKey: searchFile |
|
1163 |
label: 'Search File' |
|
1164 |
itemValue: doOpenSearchFile |
|
1165 |
translateLabel: true |
|
1166 |
isButton: true |
|
1167 |
labelImage: (ResourceRetriever ToolbarIconLibrary searchFileIcon) |
|
1168 |
) |
|
1169 |
(MenuItem |
|
1170 |
label: '-' |
|
1171 |
) |
|
1172 |
(MenuItem |
|
1173 |
activeHelpKey: cutFile |
|
1174 |
enabled: hasSelection |
|
1175 |
label: 'Cut' |
|
1176 |
itemValue: cutFiles |
|
1177 |
translateLabel: true |
|
1178 |
isButton: true |
|
1179 |
isVisible: false |
|
1180 |
labelImage: (ResourceRetriever ToolbarIconLibrary cutFileIcon) |
|
1181 |
) |
|
1182 |
(MenuItem |
|
1183 |
activeHelpKey: copyFile |
|
1184 |
enabled: hasSelection |
|
1185 |
label: 'Copy' |
|
1186 |
itemValue: copyFiles |
|
1187 |
translateLabel: true |
|
1188 |
isButton: true |
|
1189 |
isVisible: false |
|
1190 |
labelImage: (ResourceRetriever ToolbarIconLibrary copyFileIcon) |
|
1191 |
) |
|
1192 |
(MenuItem |
|
1193 |
activeHelpKey: pasteFile |
|
1194 |
enabled: canPaste |
|
1195 |
label: 'Paste' |
|
1196 |
itemValue: pasteFiles |
|
1197 |
translateLabel: true |
|
1198 |
isButton: true |
|
1199 |
isVisible: false |
|
1200 |
labelImage: (ResourceRetriever ToolbarIconLibrary pasteFileIcon) |
|
1201 |
) |
|
1202 |
(MenuItem |
|
1203 |
activeHelpKey: deleteFile |
|
1204 |
enabled: hasSelection |
|
1205 |
label: 'Delete' |
|
1206 |
itemValue: deleteFiles |
|
1207 |
translateLabel: true |
|
1208 |
isButton: true |
|
1209 |
isVisible: false |
|
1210 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteFileIcon) |
|
1211 |
) |
|
1212 |
(MenuItem |
|
1213 |
label: '-' |
|
1214 |
isVisible: false |
|
1215 |
) |
|
1216 |
(MenuItem |
|
1217 |
activeHelpKey: editFile |
|
1218 |
label: 'Edit File' |
|
1219 |
itemValue: doShowFileContents |
|
1220 |
translateLabel: true |
|
1221 |
isButton: true |
|
1222 |
isVisible: false |
|
1223 |
labelImage: (ResourceRetriever ToolbarIconLibrary editFileIcon) |
|
1224 |
) |
|
1225 |
(MenuItem |
|
1226 |
activeHelpKey: fileIn |
|
1227 |
label: 'File In' |
|
1228 |
itemValue: fileFileIn |
|
1229 |
translateLabel: true |
|
1230 |
isButton: true |
|
1231 |
isVisible: false |
|
1232 |
labelImage: (ResourceRetriever ToolbarIconLibrary fileInIcon) |
|
1233 |
) |
|
1234 |
(MenuItem |
|
1235 |
activeHelpKey: openChangeBrowser |
|
1236 |
enabled: hasFileSelection |
|
1237 |
label: 'Changes Browser' |
|
1238 |
itemValue: openChangesBrowser |
|
1239 |
translateLabel: true |
|
1240 |
isButton: true |
|
1241 |
labelImage: (ResourceRetriever ToolbarIconLibrary startChangesBrowserIcon) |
|
1242 |
) |
|
1243 |
(MenuItem |
|
1244 |
label: '-' |
|
1245 |
isVisible: false |
|
1246 |
) |
|
1247 |
(MenuItem |
|
1248 |
activeHelpKey: addTerminal |
|
1249 |
label: 'VT100' |
|
1250 |
itemValue: doAddTerminal |
|
1251 |
translateLabel: true |
|
1252 |
isButton: true |
|
1253 |
labelImage: (ResourceRetriever ToolbarIconLibrary shellTerminalIcon) |
|
1254 |
) |
|
1255 |
(MenuItem |
|
1256 |
activeHelpKey: make |
|
1257 |
enabled: canMake |
|
1258 |
label: 'Make' |
|
1259 |
itemValue: doMake |
|
1260 |
translateLabel: true |
|
1261 |
isButton: true |
|
1262 |
labelImage: (ResourceRetriever ToolbarIconLibrary make24x24Icon3) |
|
1263 |
) |
|
1264 |
(MenuItem |
|
1265 |
activeHelpKey: viewDetails |
|
1266 |
label: 'viewDetails' |
|
1267 |
translateLabel: true |
|
1268 |
isButton: true |
|
1269 |
startGroup: right |
|
1270 |
hideMenuOnActivated: false |
|
1271 |
indication: viewDetails |
|
1272 |
labelImage: (ResourceRetriever ToolbarIconLibrary viewDetailsIcon) |
|
1273 |
) |
|
1274 |
(MenuItem |
|
1275 |
activeHelpKey: viewDetails |
|
1276 |
label: 'viewDetails' |
|
1277 |
translateLabel: true |
|
1278 |
isButton: true |
|
1279 |
startGroup: right |
|
1280 |
isVisible: false |
|
1281 |
indication: viewDetails |
|
1282 |
submenuChannel: viewDetailsMenuSpec |
|
1283 |
labelImage: (ResourceRetriever ToolbarIconLibrary viewDetailsIcon) |
|
1284 |
) |
|
1285 |
(MenuItem |
|
1286 |
activeHelpKey: selectDetails |
|
1287 |
label: '' |
|
1288 |
isButton: true |
|
1289 |
startGroup: right |
|
1290 |
submenuChannel: viewDetailsMenuSpec |
|
1291 |
labelImage: (ResourceRetriever ToolbarIconLibrary empty1x20Icon) |
|
1292 |
) |
|
1293 |
) |
|
1294 |
nil |
|
1295 |
nil |
|
1296 |
) |
|
1297 |
||
1298 |
"Created: / 05-02-2014 / 11:42:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1299 |
! |
|
1300 |
||
1301 |
toolBarMainMenu_old |
|
1302 |
"This resource specification was automatically generated |
|
1303 |
by the MenuEditor of ST/X." |
|
1304 |
||
1305 |
"Do not manually edit this!! If it is corrupted, |
|
1306 |
the MenuEditor may not be able to read the specification." |
|
1307 |
||
1308 |
||
3892 | 1309 |
" |
1310 |
MenuEditor new openOnClass:FileBrowserV2 andSelector:#toolBarMainMenu |
|
1311 |
(Menu new fromLiteralArrayEncoding:(FileBrowserV2 toolBarMainMenu)) startUp |
|
1312 |
" |
|
1313 |
||
1314 |
<resource: #menu> |
|
1315 |
||
12336 | 1316 |
^ |
5398 | 1317 |
#(Menu |
13854 | 1318 |
( |
1319 |
(MenuItem |
|
1320 |
activeHelpKey: directoryBack |
|
1321 |
enabled: enableBack |
|
1322 |
label: 'Back' |
|
1323 |
itemValue: doBack |
|
1324 |
translateLabel: true |
|
1325 |
isButton: true |
|
1326 |
submenuChannel: menuDirHistoryBack |
|
1327 |
labelImage: (ResourceRetriever ToolbarIconLibrary historyBackIcon) |
|
1328 |
) |
|
1329 |
(MenuItem |
|
1330 |
label: '' |
|
1331 |
) |
|
1332 |
(MenuItem |
|
1333 |
activeHelpKey: directoryForward |
|
1334 |
enabled: enableForward |
|
1335 |
label: 'Forward' |
|
1336 |
itemValue: doForward |
|
1337 |
translateLabel: true |
|
1338 |
isButton: true |
|
1339 |
submenuChannel: menuDirHistoryForward |
|
1340 |
labelImage: (ResourceRetriever ToolbarIconLibrary historyForwardIcon) |
|
1341 |
) |
|
1342 |
(MenuItem |
|
1343 |
label: '-' |
|
1344 |
) |
|
1345 |
(MenuItem |
|
1346 |
activeHelpKey: directoryUp |
|
1347 |
enabled: enableDirectoryUp |
|
1348 |
label: 'DirectoryUp' |
|
1349 |
itemValue: doGoDirectoryUp |
|
1350 |
translateLabel: true |
|
1351 |
isButton: true |
|
1352 |
labelImage: (ResourceRetriever ToolbarIconLibrary directoryUpIcon) |
|
1353 |
) |
|
1354 |
(MenuItem |
|
1355 |
activeHelpKey: fileHome |
|
1356 |
enabled: enableHome |
|
1357 |
label: 'Home' |
|
1358 |
itemValue: doGotoHomeDirectory |
|
1359 |
translateLabel: true |
|
1360 |
isButton: true |
|
1361 |
labelImage: (ResourceRetriever ToolbarIconLibrary homeIcon) |
|
1362 |
) |
|
1363 |
(MenuItem |
|
1364 |
activeHelpKey: fileGotoDefaultDirectory |
|
1365 |
enabled: enableGotoDefaultDirectory |
|
1366 |
label: 'Current' |
|
1367 |
itemValue: doGotoDefaultDirectory |
|
1368 |
translateLabel: true |
|
1369 |
isButton: true |
|
1370 |
isVisible: false |
|
1371 |
labelImage: (ResourceRetriever ToolbarIconLibrary currentDirectoryIcon) |
|
1372 |
) |
|
1373 |
(MenuItem |
|
1374 |
activeHelpKey: fileGotoSmalltalkDirectory |
|
1375 |
enabled: enableGotoSmalltalkDirectory |
|
1376 |
label: 'ST/X Default' |
|
1377 |
itemValue: doGotoSmalltalkDirectory |
|
1378 |
translateLabel: true |
|
1379 |
isButton: true |
|
1380 |
labelImage: (ResourceRetriever ToolbarIconLibrary stxHomeIcon) |
|
1381 |
) |
|
1382 |
(MenuItem |
|
1383 |
activeHelpKey: fileGotoBookmark |
|
1384 |
label: 'Bookmarks' |
|
1385 |
translateLabel: true |
|
1386 |
isButton: true |
|
1387 |
submenuChannel: gotoBookmarksMenu |
|
1388 |
labelImage: (ResourceRetriever ToolbarIconLibrary directoryBookmarksIcon) |
|
1389 |
) |
|
1390 |
(MenuItem |
|
1391 |
activeHelpKey: fileHistory |
|
1392 |
enabled: enableFileHistory |
|
1393 |
label: 'File History' |
|
1394 |
translateLabel: true |
|
1395 |
isButton: true |
|
1396 |
submenuChannel: menuFileHistory |
|
1397 |
labelImage: (ResourceRetriever ToolbarIconLibrary historyIcon) |
|
1398 |
) |
|
1399 |
(MenuItem |
|
1400 |
label: '-' |
|
1401 |
) |
|
1402 |
(MenuItem |
|
1403 |
activeHelpKey: searchFile |
|
1404 |
label: 'Search File' |
|
1405 |
itemValue: doOpenSearchFile |
|
1406 |
translateLabel: true |
|
1407 |
isButton: true |
|
1408 |
labelImage: (ResourceRetriever ToolbarIconLibrary searchFileIcon) |
|
1409 |
) |
|
1410 |
(MenuItem |
|
1411 |
label: '-' |
|
1412 |
) |
|
1413 |
(MenuItem |
|
1414 |
activeHelpKey: cutFile |
|
1415 |
enabled: hasSelection |
|
1416 |
label: 'Cut' |
|
1417 |
itemValue: cutFiles |
|
1418 |
translateLabel: true |
|
1419 |
isButton: true |
|
1420 |
labelImage: (ResourceRetriever ToolbarIconLibrary cutFileIcon) |
|
1421 |
) |
|
1422 |
(MenuItem |
|
1423 |
activeHelpKey: copyFile |
|
1424 |
enabled: hasSelection |
|
1425 |
label: 'Copy' |
|
1426 |
itemValue: copyFiles |
|
1427 |
translateLabel: true |
|
1428 |
isButton: true |
|
1429 |
labelImage: (ResourceRetriever ToolbarIconLibrary copyFileIcon) |
|
1430 |
) |
|
1431 |
(MenuItem |
|
1432 |
activeHelpKey: pasteFile |
|
1433 |
enabled: canPaste |
|
1434 |
label: 'Paste' |
|
1435 |
itemValue: pasteFiles |
|
1436 |
translateLabel: true |
|
1437 |
isButton: true |
|
1438 |
labelImage: (ResourceRetriever ToolbarIconLibrary pasteFileIcon) |
|
1439 |
) |
|
1440 |
(MenuItem |
|
1441 |
activeHelpKey: deleteFile |
|
1442 |
enabled: hasSelection |
|
1443 |
label: 'Delete' |
|
1444 |
itemValue: deleteFiles |
|
1445 |
translateLabel: true |
|
1446 |
isButton: true |
|
1447 |
labelImage: (ResourceRetriever ToolbarIconLibrary deleteFileIcon) |
|
1448 |
) |
|
1449 |
(MenuItem |
|
1450 |
label: '-' |
|
1451 |
) |
|
1452 |
(MenuItem |
|
1453 |
activeHelpKey: editFile |
|
1454 |
label: 'Edit File' |
|
1455 |
itemValue: doShowFileContents |
|
1456 |
translateLabel: true |
|
1457 |
isButton: true |
|
1458 |
labelImage: (ResourceRetriever ToolbarIconLibrary editFileIcon) |
|
1459 |
) |
|
1460 |
(MenuItem |
|
1461 |
activeHelpKey: fileIn |
|
1462 |
label: 'File In' |
|
1463 |
itemValue: fileFileIn |
|
1464 |
translateLabel: true |
|
1465 |
isButton: true |
|
1466 |
labelImage: (ResourceRetriever ToolbarIconLibrary fileInIcon) |
|
1467 |
) |
|
1468 |
(MenuItem |
|
1469 |
activeHelpKey: openChangeBrowser |
|
1470 |
enabled: hasFileSelection |
|
1471 |
label: 'Changes Browser' |
|
1472 |
itemValue: openChangesBrowser |
|
1473 |
translateLabel: true |
|
1474 |
isButton: true |
|
1475 |
labelImage: (ResourceRetriever ToolbarIconLibrary startChangesBrowserIcon) |
|
1476 |
) |
|
1477 |
(MenuItem |
|
1478 |
label: '-' |
|
1479 |
isVisible: false |
|
1480 |
) |
|
1481 |
(MenuItem |
|
1482 |
activeHelpKey: addTerminal |
|
1483 |
label: 'VT100' |
|
1484 |
itemValue: doAddTerminal |
|
1485 |
translateLabel: true |
|
1486 |
isButton: true |
|
1487 |
isVisible: false |
|
1488 |
labelImage: (ResourceRetriever ToolbarIconLibrary shellTerminalIcon) |
|
1489 |
) |
|
1490 |
(MenuItem |
|
1491 |
activeHelpKey: make |
|
1492 |
enabled: canMake |
|
1493 |
label: 'Make' |
|
1494 |
itemValue: doMake |
|
1495 |
translateLabel: true |
|
1496 |
isButton: true |
|
1497 |
isVisible: false |
|
1498 |
labelImage: (ResourceRetriever ToolbarIconLibrary makeIcon) |
|
1499 |
) |
|
1500 |
(MenuItem |
|
1501 |
activeHelpKey: viewDetails |
|
1502 |
label: 'viewDetails' |
|
1503 |
translateLabel: true |
|
1504 |
isButton: true |
|
1505 |
startGroup: right |
|
1506 |
hideMenuOnActivated: false |
|
1507 |
indication: viewDetails |
|
1508 |
labelImage: (ResourceRetriever ToolbarIconLibrary viewDetailsIcon) |
|
1509 |
) |
|
1510 |
(MenuItem |
|
1511 |
activeHelpKey: viewDetails |
|
1512 |
label: 'viewDetails' |
|
1513 |
translateLabel: true |
|
1514 |
isButton: true |
|
1515 |
startGroup: right |
|
1516 |
isVisible: false |
|
1517 |
indication: viewDetails |
|
1518 |
submenuChannel: viewDetailsMenuSpec |
|
1519 |
labelImage: (ResourceRetriever ToolbarIconLibrary viewDetailsIcon) |
|
1520 |
) |
|
1521 |
(MenuItem |
|
1522 |
activeHelpKey: selectDetails |
|
1523 |
label: '' |
|
1524 |
isButton: true |
|
1525 |
startGroup: right |
|
1526 |
submenuChannel: viewDetailsMenuSpec |
|
1527 |
labelImage: (ResourceRetriever ToolbarIconLibrary empty1x20Icon) |
|
1528 |
) |
|
1529 |
) |
|
1530 |
nil |
|
1531 |
nil |
|
3892 | 1532 |
) |
13854 | 1533 |
|
1534 |
"Created: / 05-02-2014 / 11:42:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3892 | 1535 |
! ! |
1536 |
||
1537 |
!FileBrowserV2 methodsFor:'actions'! |
|
1538 |
||
1539 |
changeFileBrowserTitleTo:aString |
|
1540 |
||
1541 |
|string| |
|
1542 |
||
1543 |
string := 'FileBrowser ', aString. |
|
1544 |
self window label:string. |
|
1545 |
! |
|
1546 |
||
1547 |
doSpawn |
|
1548 |
||
1549 |
self saveRuntimeAspectValues. |
|
6864 | 1550 |
self class openWithAspects:aspects withExtent:(self builder window extent). |
3892 | 1551 |
! |
1552 |
||
13854 | 1553 |
hideBookmarkBar |
1554 |
||
1555 |
self bookmarkBarVisibleHolder value |
|
1556 |
||
1557 |
"Created: / 04-04-2012 / 12:08:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1558 |
! |
|
1559 |
||
3892 | 1560 |
hideFilenameEntryField |
1561 |
self filenameEntryFieldVisibleHolder value:false. |
|
1562 |
! |
|
1563 |
||
1564 |
hideToolbar |
|
1565 |
self toolBarVisibleHolder value:false. |
|
3980 | 1566 |
! |
1567 |
||
13854 | 1568 |
switchToBookmarkEntry: bookmark |
1569 |
||
1570 |
self gotoFile: bookmark path asFilename |
|
1571 |
||
1572 |
"Created: / 20-04-2012 / 18:07:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1573 |
! |
|
1574 |
||
3980 | 1575 |
toggleFileDetailsFor:anItem |
1576 |
|viewDetails| |
|
1577 |
||
1578 |
viewDetails := self viewDetails value not. |
|
1579 |
self viewDetails value:viewDetails. |
|
1580 |
||
1581 |
viewDetails ifTrue:[ |
|
12336 | 1582 |
anItem activeHelpKey:#hideFileDetails. |
1583 |
anItem label:(ToolbarIconLibrary viewNoDetailsIcon). |
|
3980 | 1584 |
] ifFalse:[ |
12336 | 1585 |
anItem activeHelpKey:#showFileDetails. |
1586 |
anItem label:(ToolbarIconLibrary viewDetailsIcon). |
|
3980 | 1587 |
]. |
3892 | 1588 |
! ! |
1589 |
||
1590 |
!FileBrowserV2 methodsFor:'aspects'! |
|
1591 |
||
13854 | 1592 |
bookmarkBarVisibleHolder |
1593 |
"return/create the 'bookmarkBarVisibleHolder' value holder (automatically generated)" |
|
1594 |
||
1595 |
bookmarkBarVisibleHolder isNil ifTrue:[ |
|
1596 |
bookmarkBarVisibleHolder := true asValue. |
|
1597 |
bookmarkBarVisibleHolder addDependent:self. |
|
1598 |
]. |
|
1599 |
^ bookmarkBarVisibleHolder |
|
1600 |
||
1601 |
"Modified: / 10-06-2011 / 23:56:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1602 |
! |
|
1603 |
||
1604 |
bookmarkBarVisibleHolder:something |
|
1605 |
"set the 'bookmarkBarVisibleHolder' value holder (automatically generated)" |
|
1606 |
||
1607 |
|oldValue newValue| |
|
1608 |
||
1609 |
bookmarkBarVisibleHolder notNil ifTrue:[ |
|
1610 |
oldValue := bookmarkBarVisibleHolder value. |
|
1611 |
bookmarkBarVisibleHolder removeDependent:self. |
|
1612 |
]. |
|
1613 |
bookmarkBarVisibleHolder := something. |
|
1614 |
bookmarkBarVisibleHolder notNil ifTrue:[ |
|
1615 |
bookmarkBarVisibleHolder addDependent:self. |
|
1616 |
]. |
|
1617 |
newValue := bookmarkBarVisibleHolder value. |
|
1618 |
oldValue ~~ newValue ifTrue:[ |
|
1619 |
self update:#value with:newValue from:bookmarkBarVisibleHolder. |
|
1620 |
]. |
|
1621 |
! |
|
1622 |
||
1623 |
bookmarkHolder |
|
1624 |
"return/create the 'bookmarkHolder' value holder (automatically generated)" |
|
1625 |
||
1626 |
bookmarkHolder isNil ifTrue:[ |
|
1627 |
bookmarkHolder := ValueHolder new. |
|
1628 |
]. |
|
1629 |
^ bookmarkHolder |
|
1630 |
! |
|
1631 |
||
1632 |
bookmarkListHolder |
|
1633 |
||
1634 |
^BookmarkList forFileBrowser |
|
1635 |
||
1636 |
"Created: / 08-06-2011 / 12:16:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1637 |
! |
|
1638 |
||
6834
f42cab67e211
preparations for busy indicator
Claus Gittinger <cg@exept.de>
parents:
6827
diff
changeset
|
1639 |
busyLabelHolder |
12336 | 1640 |
^ self |
1641 |
aspectFor:#busyLabelHolder |
|
1642 |
ifAbsent:[ ' ' asValue ]. |
|
6834
f42cab67e211
preparations for busy indicator
Claus Gittinger <cg@exept.de>
parents:
6827
diff
changeset
|
1643 |
|
f42cab67e211
preparations for busy indicator
Claus Gittinger <cg@exept.de>
parents:
6827
diff
changeset
|
1644 |
"Created: / 25-07-2006 / 09:06:00 / cg" |
f42cab67e211
preparations for busy indicator
Claus Gittinger <cg@exept.de>
parents:
6827
diff
changeset
|
1645 |
! |
f42cab67e211
preparations for busy indicator
Claus Gittinger <cg@exept.de>
parents:
6827
diff
changeset
|
1646 |
|
8010
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1647 |
canAddToClassPath |
12336 | 1648 |
^ [ |
1649 |
|f| |
|
8010
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1650 |
|
12336 | 1651 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
1652 |
false |
|
1653 |
] ifFalse:[ |
|
1654 |
f := self currentFileNameHolder value. |
|
1655 |
f size == 1 |
|
1656 |
and:[ f:= f first. (Java classPath includes:f pathName not) |
|
1657 |
and:[f isDirectory |
|
1658 |
or:[(f hasSuffix:'jar') |
|
1659 |
or:[(f hasSuffix:'zip')]]]] |
|
1660 |
] |
|
8010
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1661 |
] |
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1662 |
! |
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1663 |
|
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1664 |
canAddToSourcePath |
12336 | 1665 |
^ [ |
1666 |
|f| |
|
8010
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1667 |
|
12336 | 1668 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
1669 |
false |
|
1670 |
] ifFalse:[ |
|
1671 |
f := self currentFileNameHolder value. |
|
1672 |
f size == 1 |
|
1673 |
and:[ f:= f first. (Java sourcePath isNil |
|
1674 |
or:[(Java sourcePath includes:f pathName) not]) |
|
1675 |
and:[f isDirectory |
|
1676 |
or:[(f hasSuffix:'jar') |
|
1677 |
or:[(f hasSuffix:'zip')]]]]. |
|
1678 |
] |
|
8010
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1679 |
] |
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1680 |
! |
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1681 |
|
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1682 |
canRemoveFromClassPath |
12336 | 1683 |
^ [ |
1684 |
|f| |
|
8010
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1685 |
|
12336 | 1686 |
(Java isNil or:[Java isLoaded not]) ifTrue:[ |
1687 |
false |
|
1688 |
] ifFalse:[ |
|
1689 |
f := self currentFileNameHolder value. |
|
1690 |
f size == 1 |
|
1691 |
and:[f:= f first. (Java classPath includes:f pathName) |
|
1692 |
and:[f isDirectory |
|
1693 |
or:[(f hasSuffix:'jar') |
|
1694 |
or:[(f hasSuffix:'zip')]]]] |
|
1695 |
] |
|
8010
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1696 |
] |
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1697 |
! |
a4dfc3167ae2
Add missing aspect methods (canAddToClassPath etc.)
Stefan Vogel <sv@exept.de>
parents:
7855
diff
changeset
|
1698 |
|
13854 | 1699 |
currentDirectoryDisplayed |
1700 |
"Return a directory that is currently displayed in the browser" |
|
1701 |
||
1702 |
^self fileEntryFieldHolder value asFilename |
|
1703 |
||
1704 |
"Modified: / 14-01-2013 / 11:58:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1705 |
! |
|
1706 |
||
5120 | 1707 |
cursorColLabelHolder |
12336 | 1708 |
^ self |
1709 |
aspectFor:#cursorColLabelHolder |
|
1710 |
ifAbsent:[ |
|
1711 |
self |
|
1712 |
applicationNamed:#FileApplicationNoteBook |
|
1713 |
ifPresentDo:[:appl | appl cursorColLabelHolder]. |
|
1714 |
] |
|
5120 | 1715 |
! |
1716 |
||
1717 |
cursorLineLabelHolder |
|
12336 | 1718 |
^ self |
1719 |
aspectFor:#cursorLineLabelHolder |
|
1720 |
ifAbsent:[ |
|
1721 |
self |
|
1722 |
applicationNamed:#FileApplicationNoteBook |
|
1723 |
ifPresentDo:[:appl | appl cursorLineLabelHolder]. |
|
1724 |
] |
|
5120 | 1725 |
! |
1726 |
||
6334 | 1727 |
fileEncodingLockImageHolder |
12336 | 1728 |
^ self |
1729 |
aspectFor:#fileEncodingLockImageHolder |
|
1730 |
ifAbsent:[ |
|
1731 |
BlockValue |
|
1732 |
with:[:m | m == true ifTrue:[self class encodingLockIcon] ifFalse:[nil] ] |
|
1733 |
argument:(self lockFileEncodingHolder) |
|
1734 |
] |
|
7727 | 1735 |
|
1736 |
"Modified: / 08-03-2007 / 22:59:12 / cg" |
|
6334 | 1737 |
! |
1738 |
||
3892 | 1739 |
fileEntryFieldHolder |
1740 |
||
1741 |
fileEntryFieldHolder isNil ifTrue:[ |
|
12336 | 1742 |
fileEntryFieldHolder := ValueHolder new. |
1743 |
fileEntryFieldHolder addDependent:self. |
|
3892 | 1744 |
]. |
1745 |
^ fileEntryFieldHolder. |
|
4647 | 1746 |
! |
1747 |
||
1748 |
listOfDeviceDrives |
|
1749 |
||
1750 |
listOfDeviceDrives isNil ifTrue:[ |
|
12336 | 1751 |
listOfDeviceDrives := Filename volumes. |
4647 | 1752 |
]. |
1753 |
^ listOfDeviceDrives |
|
1754 |
! |
|
1755 |
||
5120 | 1756 |
modeLabelHolder |
12336 | 1757 |
^ self |
1758 |
aspectFor:#modeLabelHolder |
|
1759 |
ifAbsent:[ |
|
1760 |
self |
|
1761 |
applicationNamed:#FileApplicationNoteBook |
|
1762 |
ifPresentDo:[:appl | appl modeLabelHolder]. |
|
1763 |
] |
|
5120 | 1764 |
! |
1765 |
||
7102 | 1766 |
modeLabelMenuHolder |
12336 | 1767 |
^ self |
1768 |
applicationNamed:#FileApplicationNoteBook |
|
1769 |
ifPresentDo:[:appl | appl modeLabelMenu]. |
|
7102 | 1770 |
|
1771 |
"Created: / 11-09-2006 / 12:26:44 / cg" |
|
1772 |
! |
|
1773 |
||
4647 | 1774 |
selectedDeviceDrive |
1775 |
||
1776 |
selectedDeviceDrive isNil ifTrue:[ |
|
12336 | 1777 |
selectedDeviceDrive := self listOfDeviceDrives first asValue. |
1778 |
selectedDeviceDrive addDependent:self. |
|
4647 | 1779 |
]. |
1780 |
^ selectedDeviceDrive |
|
3892 | 1781 |
! ! |
1782 |
||
4252 | 1783 |
!FileBrowserV2 methodsFor:'aspects-visibility'! |
1784 |
||
6834
f42cab67e211
preparations for busy indicator
Claus Gittinger <cg@exept.de>
parents:
6827
diff
changeset
|
1785 |
busyLabelVisibleHolder |
f42cab67e211
preparations for busy indicator
Claus Gittinger <cg@exept.de>
parents:
6827
diff
changeset
|
1786 |
^ self aspectFor:#busyLabelVisibleHolder ifAbsent:[false asValue] |
f42cab67e211
preparations for busy indicator
Claus Gittinger <cg@exept.de>
parents:
6827
diff
changeset
|
1787 |
|
f42cab67e211
preparations for busy indicator
Claus Gittinger <cg@exept.de>
parents:
6827
diff
changeset
|
1788 |
"Created: / 25-07-2006 / 09:06:22 / cg" |
f42cab67e211
preparations for busy indicator
Claus Gittinger <cg@exept.de>
parents:
6827
diff
changeset
|
1789 |
! |
f42cab67e211
preparations for busy indicator
Claus Gittinger <cg@exept.de>
parents:
6827
diff
changeset
|
1790 |
|
5120 | 1791 |
driveSelectorVisible |
1792 |
^ self systemIsDOS |
|
1793 |
! |
|
1794 |
||
4252 | 1795 |
filenameEntryFieldVisibleHolder |
1796 |
" aspect for show FileEntryField " |
|
1797 |
||
1798 |
^ self aspectFor:#filenameEntryFieldVisibleHolder ifAbsent:[true asValue] |
|
1799 |
! |
|
1800 |
||
6595
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
1801 |
infoBarVisibleHolder |
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
1802 |
" aspect for show infoBar " |
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
1803 |
|
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
1804 |
^ self aspectFor:#infoBarVisibleHolder ifAbsent:[true asValue] |
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
1805 |
! |
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
1806 |
|
4252 | 1807 |
previewVisibleHolder |
1808 |
" aspect for show preview" |
|
1809 |
||
1810 |
^ self aspectFor:#previewVisibleHolder ifAbsent:[false asValue] |
|
1811 |
! |
|
1812 |
||
1813 |
toolBarVisibleHolder |
|
1814 |
" aspect for show toolbar" |
|
1815 |
||
1816 |
^ self aspectFor:#toolBarVisibleHolder ifAbsent:[true asValue] |
|
1817 |
! ! |
|
1818 |
||
3892 | 1819 |
!FileBrowserV2 methodsFor:'change & update'! |
1820 |
||
4011 | 1821 |
currentFileNameHolderChanged |
12728 | 1822 |
|newEntryValue nSelected files volume dir| |
4011 | 1823 |
|
7561 | 1824 |
files := self currentSelectedObjects. |
4252 | 1825 |
nSelected := files size. |
4011 | 1826 |
|
4252 | 1827 |
nSelected == 0 ifTrue:[ |
12728 | 1828 |
newEntryValue := ''. |
4011 | 1829 |
] ifFalse:[ |
12728 | 1830 |
nSelected == 1 ifTrue:[ |
1831 |
newEntryValue := files first. |
|
1832 |
] ifFalse:[ |
|
1833 |
newEntryValue := self commonPrefixOfSelectedFiles. |
|
1834 |
]. |
|
4011 | 1835 |
]. |
4390
e9e2343d5569
no expand on change filename holder for entry field anymore
penk
parents:
4380
diff
changeset
|
1836 |
self fileEntryFieldHolder value:(newEntryValue asString) withoutNotifying:self. |
4775 | 1837 |
|
5187
ce7e3132b012
supportsVolumes instead of OperatingSystem isWindowsLike for volume widget
james
parents:
5185
diff
changeset
|
1838 |
OperatingSystem supportsVolumes ifTrue:[ |
12728 | 1839 |
volume := (nSelected >= 1) |
1840 |
ifTrue:[files first volume] |
|
1841 |
ifFalse:[nil]. |
|
1842 |
self selectedDeviceDrive value:volume. |
|
5187
ce7e3132b012
supportsVolumes instead of OperatingSystem isWindowsLike for volume widget
james
parents:
5185
diff
changeset
|
1843 |
]. |
4252 | 1844 |
self updatePreview. |
7561 | 1845 |
|
7855
d8c06d41b20b
show the current directory in the label
Claus Gittinger <cg@exept.de>
parents:
7842
diff
changeset
|
1846 |
nSelected == 1 ifTrue:[ |
12728 | 1847 |
(dir := self currentDirectory) notNil ifTrue:[ |
1848 |
self window label:(dir baseName) |
|
1849 |
] |
|
7855
d8c06d41b20b
show the current directory in the label
Claus Gittinger <cg@exept.de>
parents:
7842
diff
changeset
|
1850 |
]. |
13854 | 1851 |
self updateBookmark |
7855
d8c06d41b20b
show the current directory in the label
Claus Gittinger <cg@exept.de>
parents:
7842
diff
changeset
|
1852 |
|
10183
c4ce7324eb06
changed: #currentFileNameHolderChanged
Claus Gittinger <cg@exept.de>
parents:
9944
diff
changeset
|
1853 |
"Modified: / 06-07-2011 / 09:41:50 / cg" |
13854 | 1854 |
"Modified: / 05-02-2014 / 11:45:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4011 | 1855 |
! |
1856 |
||
1857 |
fileEntryFieldHolderChanged |
|
13026 | 1858 |
|fileName fileNameString dir| |
4011 | 1859 |
|
4507
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1860 |
fileNameString := fileEntryFieldHolder value withoutSeparators. |
12336 | 1861 |
fileNameString isEmpty ifTrue:[ |
13026 | 1862 |
pathEntryField flash. |
1863 |
^ self |
|
5281 | 1864 |
]. |
4507
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1865 |
|
13026 | 1866 |
fileName := fileNameString asFilename. |
1867 |
fileName exists ifFalse:[ |
|
1868 |
pathEntryField flash. |
|
4507
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1869 |
|
13026 | 1870 |
dir := fileName directory. |
1871 |
dir exists ifTrue:[ |
|
1872 |
self currentFileNameHolder |
|
1873 |
value:(OrderedCollection with:dir) |
|
1874 |
withoutNotifying:self. |
|
1875 |
]. |
|
1876 |
fileName baseName includesMatchCharacters ifTrue:[ |
|
1877 |
self fileEntryFieldHolder value:(fileName directoryName) withoutNotifying:self. |
|
1878 |
self filterModel value:fileName baseName. |
|
1879 |
]. |
|
5185
c1768b26d5f4
set fileName-entryField and pattern, if a name with matchPattern
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1880 |
|
12336 | 1881 |
"/ answer := OptionBox |
4531 | 1882 |
"/ request:(resources string:'No file or directory named "%1" exists.\\Create ?' with:fileNameString allBold) withCRs |
1883 |
"/ buttonLabels:#('Create as File' 'Create as Directory' 'Cancel') |
|
1884 |
"/ values:#(createFile createDirectory nil) |
|
1885 |
"/ default:nil. |
|
1886 |
"/ |
|
13026 | 1887 |
"/ answer isNil ifTrue:[ |
1888 |
"/ ^ self. |
|
1889 |
"/ ]. |
|
1890 |
"/ |
|
1891 |
"/ [ |
|
1892 |
"/ answer == #createFile ifTrue:[ |
|
1893 |
"/ fileName directory recursiveMakeDirectory. |
|
1894 |
"/ fileName createAsEmptyFile. |
|
1895 |
"/ ] ifFalse:[ |
|
1896 |
"/ answer == #createDirectory ifTrue:[ |
|
1897 |
"/ fileName recursiveMakeDirectory. |
|
1898 |
"/ ] |
|
1899 |
"/ ]. |
|
1900 |
"/ ] on:OperatingSystem accessDeniedErrorSignal do:[:ex | |
|
1901 |
"/ Dialog warn:'Error: ' , ex description. |
|
1902 |
"/ ]. |
|
1903 |
^ self |
|
4507
7aeed604c4db
added createFile/directory option from entryField
Claus Gittinger <cg@exept.de>
parents:
4454
diff
changeset
|
1904 |
]. |
5959 | 1905 |
self setCurrentFileName:fileName. |
4011 | 1906 |
! |
1907 |
||
4647 | 1908 |
selectedDeviceDriveChanged |
1909 |
| newDrive curSel newFile| |
|
1910 |
||
1911 |
newDrive := self selectedDeviceDrive value. |
|
7561 | 1912 |
curSel := self currentSelectedObjects. |
7842 | 1913 |
curSel notEmptyOrNil ifTrue:[ |
12336 | 1914 |
curSel first volume = newDrive ifTrue:[ ^self]. |
4647 | 1915 |
]. |
6591 | 1916 |
|
5411
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1917 |
newDrive notNil ifTrue:[ |
12336 | 1918 |
newFile := newDrive asFilename. |
5411
198e8a5c3700
bugfix WIN: check whether newDrive isNil in #selectedDeviceDriveChanged
ca
parents:
5400
diff
changeset
|
1919 |
|
12336 | 1920 |
newFile isReadable ifTrue:[ |
1921 |
self gotoFile:newFile. |
|
1922 |
^self. |
|
1923 |
]. |
|
4651 | 1924 |
]. |
12336 | 1925 |
self selectedDeviceDrive |
1926 |
value:(curSel notEmptyOrNil |
|
1927 |
ifTrue:[curSel first volume] |
|
1928 |
ifFalse:['C:']). |
|
7561 | 1929 |
|
7842 | 1930 |
"Modified: / 18-09-2007 / 09:41:30 / cg" |
4647 | 1931 |
! |
1932 |
||
4252 | 1933 |
selectedImage |
1934 |
|files selectedFile mime img| |
|
1935 |
||
4451
6f06f760a64b
only open preview for selected files not for directories
penk
parents:
4390
diff
changeset
|
1936 |
files := self currentSelectedFiles. |
4259 | 1937 |
files size >= 1 ifFalse:[ |
12336 | 1938 |
^ nil |
4252 | 1939 |
]. |
12336 | 1940 |
selectedFile := files last. |
4252 | 1941 |
|
1942 |
mime := MIMETypes mimeTypeForFilename:selectedFile. |
|
1943 |
(mime notNil and:[mime startsWith:'image/']) ifTrue:[ |
|
12336 | 1944 |
img := Image fromFile:selectedFile. |
1945 |
^ img |
|
4252 | 1946 |
]. |
1947 |
||
1948 |
^ nil. |
|
1949 |
! |
|
1950 |
||
4262 | 1951 |
showImagePreview:image |
4252 | 1952 |
|imgView| |
1953 |
||
4262 | 1954 |
imgView := builder componentAt:#Preview. |
11844
e8bed7c810d6
changed: #showImagePreview:
Claus Gittinger <cg@exept.de>
parents:
11782
diff
changeset
|
1955 |
(imgView isNil or:[imgView scrolledView isNil]) ifTrue:[^ self]. |
4252 | 1956 |
imgView adjust:#fitBig. |
1957 |
imgView image:image. |
|
7614 | 1958 |
|
1959 |
"Modified: / 05-02-2007 / 10:52:03 / cg" |
|
4252 | 1960 |
! |
1961 |
||
4262 | 1962 |
showPreview |
1963 |
|shownImage lbl previewLabel| |
|
1964 |
||
1965 |
shownImage := self selectedImage. |
|
4300 | 1966 |
lbl := shownImage isNil ifTrue:'Preview' ifFalse:[ shownImage fileName asFilename baseName ]. |
4262 | 1967 |
|
1968 |
previewLabel := builder componentAt:#PreviewLabel. |
|
12336 | 1969 |
previewLabel label:lbl; forceResizeHorizontally. |
1970 |
self enqueueMessage:#'showImagePreview:' for:self arguments:(Array with:shownImage). |
|
4262 | 1971 |
! |
1972 |
||
3892 | 1973 |
update:something with:aParameter from:changedObject |
4647 | 1974 |
changedObject == self selectedDeviceDrive ifTrue:[ |
13908 | 1975 |
self selectedDeviceDriveChanged. |
1976 |
^ self. |
|
4647 | 1977 |
]. |
3892 | 1978 |
changedObject == self fileEntryFieldHolder ifTrue:[ |
13908 | 1979 |
self fileEntryFieldHolderChanged. |
1980 |
^ self. |
|
3892 | 1981 |
]. |
1982 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
13908 | 1983 |
super update:something with:aParameter from:changedObject. |
1984 |
self currentFileNameHolderChanged. |
|
1985 |
^ self. |
|
3892 | 1986 |
]. |
4252 | 1987 |
(changedObject == self previewVisibleHolder) ifTrue:[ |
13908 | 1988 |
self updatePreview. |
1989 |
^ self. |
|
4252 | 1990 |
]. |
12336 | 1991 |
(changedObject == self toolBarVisibleHolder |
13908 | 1992 |
or:[changedObject == self bookmarkBarVisibleHolder |
6595
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
1993 |
or:[changedObject == self filenameEntryFieldVisibleHolder |
13908 | 1994 |
or:[changedObject == self infoBarVisibleHolder]]]) ifTrue:[ |
1995 |
self updateToolVisibility. |
|
1996 |
^ self. |
|
3892 | 1997 |
]. |
4085
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
1998 |
(changedObject == self sortBlockProperty or:[changedObject == self sortDirectoriesBeforeFiles]) ifTrue:[ |
13908 | 1999 |
self sortFileListsBy:(self sortBlockProperty value) withReverse:false. |
2000 |
^ self. |
|
12336 | 2001 |
]. |
3892 | 2002 |
|
2003 |
^ super update:something with:aParameter from:changedObject. |
|
7855
d8c06d41b20b
show the current directory in the label
Claus Gittinger <cg@exept.de>
parents:
7842
diff
changeset
|
2004 |
|
d8c06d41b20b
show the current directory in the label
Claus Gittinger <cg@exept.de>
parents:
7842
diff
changeset
|
2005 |
"Modified: / 01-10-2007 / 19:21:35 / cg" |
3892 | 2006 |
! |
2007 |
||
13854 | 2008 |
updateBookmark |
2009 |
||
2010 |
| file bookmark | |
|
2011 |
file := fileEntryFieldHolder value. |
|
2012 |
file notEmptyOrNil ifTrue:[ |
|
2013 |
bookmark := Bookmark forFile: file. |
|
2014 |
]. |
|
2015 |
self bookmarkHolder value: bookmark. |
|
2016 |
||
2017 |
"Created: / 13-04-2012 / 12:37:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2018 |
! |
|
2019 |
||
4252 | 2020 |
updatePreview |
6524 | 2021 |
|previewLabel shownImage plug closePreviewButton| |
4252 | 2022 |
|
2023 |
self previewVisibleHolder value ifTrue:[ |
|
12336 | 2024 |
shownImage := nil. |
2025 |
imgView := builder componentAt:#Preview. |
|
2026 |
previewLabel := builder componentAt:#PreviewLabel. |
|
2027 |
closePreviewButton := builder componentAt:#ClosePreviewButton. |
|
6524 | 2028 |
|
12336 | 2029 |
plug := Plug new. |
2030 |
plug respondTo:#closePreview with:[ self previewVisibleHolder value:false ]. |
|
4257 | 2031 |
|
12336 | 2032 |
previewLabel menuHolder:(self class previewLabelMenu decodeAsLiteralArray). |
2033 |
previewLabel menuPerformer:plug asValue. |
|
4257 | 2034 |
|
12336 | 2035 |
closePreviewButton action:[ self previewVisibleHolder value:false ]. |
6524 | 2036 |
|
12336 | 2037 |
previewProcess notNil ifTrue:[ |
2038 |
previewProcess terminate |
|
2039 |
]. |
|
2040 |
previewProcess := [ |
|
2041 |
|imgView oldBg shownImage lbl| |
|
4252 | 2042 |
|
12336 | 2043 |
oldBg := previewLabel backgroundColor. |
2044 |
previewLabel backgroundColor:(Color red lightened lightened). |
|
2045 |
[ |
|
2046 |
self showPreview. |
|
2047 |
previewProcess := nil. |
|
2048 |
] ensure:[ |
|
2049 |
previewLabel backgroundColor:oldBg. |
|
2050 |
]. |
|
2051 |
] forkAt:7. |
|
4252 | 2052 |
] ifFalse:[ |
12336 | 2053 |
imgView notNil ifTrue:[ |
2054 |
imgView image:nil. |
|
2055 |
] |
|
4252 | 2056 |
]. |
2057 |
! |
|
2058 |
||
3892 | 2059 |
updateToolVisibility |
13854 | 2060 |
|bldr toolBar bookmarkBar infoBar filenameEntryField vPanel topOffset bottomOffset |
2061 |
toolBarVisible bookmarkBarVisible filenameEntryFieldVisible infoBarVisible d| |
|
3892 | 2062 |
|
13854 | 2063 |
bldr := self builder. |
3892 | 2064 |
|
2065 |
topOffset := 0. |
|
6595
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
2066 |
bottomOffset := 0. |
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
2067 |
|
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
2068 |
toolBarVisible := self toolBarVisibleHolder value. |
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
2069 |
toolBarVisible ifTrue:[ |
13854 | 2070 |
toolBar := bldr componentAt:#ToolbarBox. |
12728 | 2071 |
topOffset := topOffset + toolBar height. |
3892 | 2072 |
]. |
2073 |
||
13854 | 2074 |
bookmarkBarVisible := self bookmarkBarVisibleHolder value. |
2075 |
bookmarkBarVisible ifTrue:[ |
|
13908 | 2076 |
bookmarkBar := bldr componentAt:#BookmarkBar. |
2077 |
d := bookmarkBar height. "/ layout bottomOffset - bookmarkBar layout topOffset. |
|
2078 |
bookmarkBar layout topOffset:topOffset bottomOffset:topOffset + d. |
|
2079 |
"/ that's the consequence of modifying the layout, instead of sending #layout: |
|
2080 |
"/ we have to tell the component that it changed here!! |
|
2081 |
bookmarkBar layoutChanged. |
|
2082 |
topOffset := topOffset + d |
|
13854 | 2083 |
]. |
2084 |
||
6595
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
2085 |
filenameEntryFieldVisible := self filenameEntryFieldVisibleHolder value. |
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
2086 |
filenameEntryFieldVisible ifTrue:[ |
13854 | 2087 |
filenameEntryField := bldr componentAt:#FilenameEntryFieldBox. |
12728 | 2088 |
d := filenameEntryField layout bottomOffset - filenameEntryField layout topOffset. |
2089 |
filenameEntryField layout topOffset:topOffset bottomOffset:topOffset + d. |
|
13908 | 2090 |
"/ that's the consequence of modifying the layout, instead of sending #layout: |
2091 |
"/ we have to tell the component that it changed here!! |
|
2092 |
filenameEntryField layoutChanged. |
|
12728 | 2093 |
topOffset := topOffset + filenameEntryField height. |
3892 | 2094 |
]. |
2095 |
||
6595
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
2096 |
infoBarVisible := self infoBarVisibleHolder value. |
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
2097 |
infoBarVisible ifTrue:[ |
13854 | 2098 |
infoBar := bldr componentAt:#InfoBox. |
12728 | 2099 |
bottomOffset := bottomOffset - infoBar height. |
6595
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
2100 |
]. |
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
2101 |
|
13854 | 2102 |
vPanel := bldr componentAt:#BrowserBox. |
2103 |
vPanel layout topOffset:topOffset+1. |
|
2104 |
vPanel layout bottomOffset:bottomOffset-1. |
|
3892 | 2105 |
vPanel container notNil ifTrue:[ |
12728 | 2106 |
vPanel containerChangedSize. |
3892 | 2107 |
]. |
13854 | 2108 |
|
2109 |
"Modified: / 03-04-2012 / 22:23:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3892 | 2110 |
! ! |
2111 |
||
3957 | 2112 |
!FileBrowserV2 methodsFor:'event handling'! |
2113 |
||
4904 | 2114 |
crPressedInPathField |
2115 |
|path fn| |
|
2116 |
||
2117 |
path := fileEntryFieldHolder value. |
|
2118 |
fn := path asFilename. |
|
2119 |
(fn exists and:[ fn isDirectory not ]) ifTrue:[ |
|
12336 | 2120 |
self openApplForFile:path. |
4904 | 2121 |
] |
2122 |
! |
|
2123 |
||
3957 | 2124 |
processEvent:anEvent |
2125 |
"filter keyboard events. |
|
2126 |
Return true, if I have eaten the event" |
|
2127 |
||
12116 | 2128 |
<resource: #keyboard (#Return )> |
2129 |
||
3957 | 2130 |
|focusView key rawKey fileName| |
2131 |
||
2132 |
anEvent isKeyPressEvent ifTrue:[ |
|
13681 | 2133 |
focusView := anEvent targetView. |
2134 |
key := anEvent key. |
|
2135 |
rawKey := anEvent rawKey. |
|
3957 | 2136 |
|
13681 | 2137 |
(focusView isSameOrComponentOf:self window) ifTrue:[ |
3957 | 2138 |
|
13681 | 2139 |
(focusView == pathEntryField) ifFalse:[ ^ false]. |
3957 | 2140 |
|
13681 | 2141 |
(key == #Return) ifTrue:[ |
2142 |
fileName := pathEntryField list first asFilename. |
|
2143 |
(fileName exists and:[fileName isDirectory not]) ifTrue:[ |
|
2144 |
self openApplForFile:fileName |
|
2145 |
]. |
|
2146 |
]. |
|
2147 |
] |
|
3957 | 2148 |
]. |
7798 | 2149 |
|
2150 |
(anEvent isButtonPressEvent or:[anEvent isButtonMultiPressEvent]) ifTrue:[ |
|
13681 | 2151 |
self |
2152 |
applicationNamed:#FileApplicationNoteBook |
|
2153 |
ifPresentDo:[:appl | |
|
2154 |
|subApp editor eventView viewsName| |
|
7798 | 2155 |
|
13681 | 2156 |
subApp := appl selectedApplication. |
2157 |
subApp notNil ifTrue:[ |
|
2158 |
eventView := anEvent view. |
|
2159 |
viewsName := eventView name. |
|
7595
171c7e762935
gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents:
7561
diff
changeset
|
2160 |
|
13681 | 2161 |
anEvent isButtonMultiPressEvent ifTrue:[ |
2162 |
viewsName = 'LineLabel' ifTrue:[ |
|
2163 |
editor := subApp perform:#editView ifNotUnderstood:nil. |
|
2164 |
editor notNil ifTrue:[ |
|
2165 |
editor gotoLine |
|
2166 |
]. |
|
2167 |
]. |
|
2168 |
viewsName = 'ModeLabel' ifTrue:[ |
|
2169 |
eventView activateMenu |
|
2170 |
]. |
|
2171 |
viewsName = 'EncodingLabel' ifTrue:[ |
|
2172 |
eventView activateMenu |
|
2173 |
]. |
|
2174 |
] ifFalse:[ |
|
2175 |
anEvent button == 2 ifTrue:[ |
|
2176 |
eventView name = 'LineLabel' ifTrue:[ |
|
2177 |
subApp editView gotoLine |
|
2178 |
]. |
|
2179 |
]. |
|
2180 |
]. |
|
2181 |
]. |
|
2182 |
]. |
|
7595
171c7e762935
gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents:
7561
diff
changeset
|
2183 |
]. |
171c7e762935
gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents:
7561
diff
changeset
|
2184 |
|
3957 | 2185 |
^ false |
7798 | 2186 |
|
2187 |
"Modified: / 17-05-2007 / 09:12:53 / cg" |
|
3957 | 2188 |
! ! |
2189 |
||
6131 | 2190 |
!FileBrowserV2 methodsFor:'menu accessing'! |
2191 |
||
2192 |
menuFileHistory |
|
2193 |
"initialize the file history menu |
|
2194 |
" |
|
2195 |
<resource: #programMenu > |
|
2196 |
||
2197 |
|menu hist text removeItem removeCol| |
|
2198 |
||
2199 |
menu := Menu new. |
|
2200 |
menu findGuiResourcesIn:self. |
|
2201 |
menu receiver:self. |
|
2202 |
||
2203 |
hist := self fileHistory. |
|
2204 |
hist isEmpty ifTrue:[^ nil]. |
|
2205 |
||
2206 |
removeCol := OrderedCollection new. |
|
2207 |
hist do:[:aFileItem| |
|
12961 | 2208 |
"aFileItem fileName exists" true ifTrue:[ |
2209 |
menu addItem:(MenuItem |
|
2210 |
label: aFileItem fileName asString |
|
2211 |
itemValue:[ |
|
2212 |
self setCurrentFileName:(aFileItem fileName). |
|
2213 |
self openApplByFileItem:aFileItem |
|
2214 |
]). |
|
2215 |
] ifFalse:[ |
|
2216 |
removeCol add:aFileItem. |
|
2217 |
] |
|
6131 | 2218 |
]. |
2219 |
"/ remove all not existing history entries |
|
2220 |
removeCol do:[ : el | |
|
12961 | 2221 |
hist remove:el. |
6131 | 2222 |
]. |
2223 |
removeItem := MenuItem new. |
|
2224 |
removeItem translateLabel:true. |
|
2225 |
text := resources string:'Clear History'. |
|
2226 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text. |
|
2227 |
removeItem label:text. |
|
12336 | 2228 |
removeItem |
12961 | 2229 |
itemValue:[ |
2230 |
self fileHistory removeAll. |
|
2231 |
self enableFileHistory value:false. |
|
2232 |
]. |
|
6131 | 2233 |
menu addSeparator. |
2234 |
menu addItem:removeItem. |
|
2235 |
^ menu |
|
11782 | 2236 |
|
2237 |
"Modified: / 09-09-2012 / 13:08:42 / cg" |
|
6131 | 2238 |
! ! |
2239 |
||
6460 | 2240 |
!FileBrowserV2 methodsFor:'queries'! |
2241 |
||
12670 | 2242 |
defaultWindowExtent |
2243 |
"use nearly the full screen height, but at least 768px if available. |
|
2244 |
Keep the width as defined in the windowSpec" |
|
2245 |
||
12728 | 2246 |
|w maxHeight| |
12670 | 2247 |
|
12728 | 2248 |
w := self window. |
2249 |
maxHeight := w device usableHeightAt:w origin. |
|
2250 |
^ Point x:nil y:(((maxHeight - 200) max:w extent y) min:maxHeight). |
|
12670 | 2251 |
! |
2252 |
||
6460 | 2253 |
getAllFilesAsStrings |
2254 |
^ self directoryContentsBrowser getAllFilesAsStrings |
|
2255 |
! ! |
|
2256 |
||
3892 | 2257 |
!FileBrowserV2 methodsFor:'startup & release'! |
2258 |
||
3954 | 2259 |
closeRequest |
6631 | 2260 |
"asks for permission before closing" |
2261 |
||
12336 | 2262 |
self |
2263 |
applicationNamed:#FileApplicationNoteBook |
|
2264 |
ifPresentDo:[:appl | appl tryCloseApplications ifFalse:[^ self] ]. |
|
5010 | 2265 |
|
6631 | 2266 |
super closeRequest. |
3954 | 2267 |
! |
2268 |
||
3892 | 2269 |
hideFilenameEntryFieldButtonCreated:aButton |
2270 |
||
12336 | 2271 |
aButton passiveLevel:(MenuPanel defaultLevel). |
3892 | 2272 |
aButton activeLevel:-1. |
2273 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
|
2274 |
! |
|
2275 |
||
2276 |
hideToolBarButtonCreated:aButton |
|
2277 |
||
12336 | 2278 |
aButton passiveLevel:(MenuPanel defaultLevel). |
3892 | 2279 |
aButton activeLevel:-1. |
2280 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
|
2281 |
! |
|
2282 |
||
2283 |
initialize |
|
2284 |
||
2285 |
self masterApplication:nil. |
|
6370 | 2286 |
self directoryHistory resetForwardBackward. |
3892 | 2287 |
! |
2288 |
||
2289 |
makeDependent |
|
4008 | 2290 |
|
4004 | 2291 |
super makeDependent. |
4085
9e58ddfa6969
sort will be triggered from the FileBrowserV2 instance not from AbstractFileBrowser anymore
penk
parents:
4084
diff
changeset
|
2292 |
self sortBlockProperty addDependent:self. |
3892 | 2293 |
self filenameEntryFieldVisibleHolder addDependent:self. |
2294 |
self toolBarVisibleHolder addDependent:self. |
|
6595
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
2295 |
self infoBarVisibleHolder addDependent:self. |
4255 | 2296 |
self previewVisibleHolder addDependent:self. |
3892 | 2297 |
! |
2298 |
||
8254 | 2299 |
onDirectory:aDirectoryPathOrNil |
8188 | 2300 |
|files| |
2301 |
||
2302 |
self createBuilder. |
|
8254 | 2303 |
aDirectoryPathOrNil notNil ifTrue:[ |
12336 | 2304 |
aDirectoryPathOrNil isCollection ifTrue:[ |
2305 |
files := aDirectoryPathOrNil |
|
2306 |
] ifFalse:[ |
|
2307 |
files := Array with:aDirectoryPathOrNil. |
|
2308 |
]. |
|
2309 |
self currentFileNameHolder value:files. |
|
8188 | 2310 |
]. |
2311 |
! |
|
2312 |
||
2313 |
openOnDirectory:aDirectoryPath |
|
2314 |
self onDirectory:aDirectoryPath. |
|
2315 |
self open |
|
2316 |
! |
|
2317 |
||
2318 |
openOnFileNamed:aFilename editing:editing |
|
2319 |
"start a new FileBrowserV2 on a aFilename; |
|
2320 |
If editing is true, the browser opens the document as text to be edited; |
|
2321 |
if false, it looks for an appropriate viewer and uses that if one is found." |
|
2322 |
||
2323 |
|f| |
|
2324 |
||
2325 |
f := aFilename asFilename asAbsoluteFilename. |
|
2326 |
f isDirectory ifTrue:[ |
|
12336 | 2327 |
self onDirectory:aFilename. |
2328 |
self open. |
|
2329 |
^ self. |
|
8188 | 2330 |
]. |
2331 |
||
2332 |
self onDirectory:(f directory). |
|
2333 |
self currentFileNameHolder setValue:(Array with:f). |
|
2334 |
self open. |
|
9886 | 2335 |
self enqueueDelayedAction:[ |
12336 | 2336 |
editing ifTrue:[ |
2337 |
self openTextEditorForFile:f. |
|
2338 |
] ifFalse:[ |
|
2339 |
self openApplForFile:f. |
|
2340 |
]. |
|
8188 | 2341 |
]. |
2342 |
||
2343 |
" |
|
2344 |
FileBrowserV2 openOnFileNamed:'Makefile' |
|
2345 |
" |
|
2346 |
! |
|
2347 |
||
4884 | 2348 |
postBuildDirectoryTree:aWidget |
2349 |
aWidget application multipleSelect:true. |
|
2350 |
! |
|
2351 |
||
4365 | 2352 |
postBuildEditField:aWidget |
2353 |
||
2354 |
pathEntryField := aWidget. |
|
2355 |
aWidget model:self fileEntryFieldHolder. |
|
6370 | 2356 |
aWidget listHolder:self directoryHistory. |
4365 | 2357 |
aWidget level:-1. |
4904 | 2358 |
aWidget acceptIfUnchanged:true. |
2359 |
aWidget crAction:[ self crPressedInPathField ]. |
|
4365 | 2360 |
! |
2361 |
||
7102 | 2362 |
postBuildEditModeInfoLabel:aLabel |
2363 |
aLabel menuHolder:self; menuMessage:#modeLabelMenuHolder. |
|
2364 |
||
2365 |
"Created: / 11-09-2006 / 12:24:54 / cg" |
|
2366 |
! |
|
2367 |
||
4018 | 2368 |
postBuildFilterBox:aWidget |
2369 |
||
2370 |
self filterValueBox value:aWidget. |
|
2371 |
self filterBackgroundColor value:aWidget backgroundColor. |
|
2372 |
! |
|
2373 |
||
3892 | 2374 |
postBuildPathViewBox:aWidget |
2375 |
||
2376 |
aWidget backgroundColor:(MenuPanel defaultBackgroundColor). |
|
2377 |
! |
|
2378 |
||
2379 |
postBuildWith:aBuilder |
|
2380 |
||
10787
637d7e03d602
changed: #postBuildWith: - read settings from user preferences
vrany
parents:
10770
diff
changeset
|
2381 |
| prefs | |
637d7e03d602
changed: #postBuildWith: - read settings from user preferences
vrany
parents:
10770
diff
changeset
|
2382 |
|
3892 | 2383 |
super postBuildWith:aBuilder. |
3980 | 2384 |
self updateToolVisibility. |
10787
637d7e03d602
changed: #postBuildWith: - read settings from user preferences
vrany
parents:
10770
diff
changeset
|
2385 |
|
637d7e03d602
changed: #postBuildWith: - read settings from user preferences
vrany
parents:
10770
diff
changeset
|
2386 |
"Load user settings" |
637d7e03d602
changed: #postBuildWith: - read settings from user preferences
vrany
parents:
10770
diff
changeset
|
2387 |
prefs := UserPreferences current. |
637d7e03d602
changed: #postBuildWith: - read settings from user preferences
vrany
parents:
10770
diff
changeset
|
2388 |
AbstractFileBrowser userPreferencesAspectList keysAndValuesDo:[:aspect :default| |
12336 | 2389 |
| value | |
10790 | 2390 |
|
12336 | 2391 |
(prefs respondsTo: aspect) ifTrue:[ |
2392 |
value := prefs perform: aspect |
|
2393 |
] ifFalse:[ |
|
2394 |
value := prefs at: aspect ifAbsent:[default]. |
|
2395 |
]. |
|
2396 |
(self perform: aspect) value: value |
|
10787
637d7e03d602
changed: #postBuildWith: - read settings from user preferences
vrany
parents:
10770
diff
changeset
|
2397 |
] |
637d7e03d602
changed: #postBuildWith: - read settings from user preferences
vrany
parents:
10770
diff
changeset
|
2398 |
|
10790 | 2399 |
"Modified: / 10-10-2011 / 10:54:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3892 | 2400 |
! |
2401 |
||
2402 |
postOpenWith:aBuilder |
|
2403 |
||
4071 | 2404 |
super postOpenWith:aBuilder. |
6595
17b6232d30ef
menu reorganized; infoBar hidable
Claus Gittinger <cg@exept.de>
parents:
6591
diff
changeset
|
2405 |
|
4577 | 2406 |
self currentFileNameHolderChangedForCommon. |
4071 | 2407 |
self currentFileNameHolderChanged. |
4027 | 2408 |
|
3957 | 2409 |
self windowGroup addPreEventHook:self. |
3892 | 2410 |
! |
2411 |
||
2412 |
release |
|
2413 |
||
2414 |
self saveRuntimeAspectValues. |
|
2415 |
^ super release |
|
2416 |
! ! |
|
2417 |
||
2418 |
!FileBrowserV2 class methodsFor:'documentation'! |
|
2419 |
||
8831 | 2420 |
version_CVS |
13908 | 2421 |
^ '$Header: /cvs/stx/stx/libtool/FileBrowserV2.st,v 1.215 2014-02-06 12:51:30 cg Exp $' |
3892 | 2422 |
! ! |
2423 |
||
12116 | 2424 |
|
3892 | 2425 |
FileBrowserV2 initialize! |