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