author | Claus Gittinger <cg@exept.de> |
Tue, 29 Oct 2002 16:15:55 +0100 | |
changeset 4101 | cc9cdc23b789 |
parent 4091 | e4fde524b22b |
child 4102 | 63d279dccc26 |
permissions | -rw-r--r-- |
3906 | 1 |
"{ Package: 'stx:libtool' }" |
3887 | 2 |
|
3888 | 3 |
AbstractFileBrowser subclass:#DirectoryContentsBrowser |
4072 | 4 |
instanceVariableNames:'updateColumnsTask modificationTime directory columnDescriptors |
5 |
iconIndex fileDescriptionIndex iconExtent tableColumns |
|
6 |
previewIndex allItemsList updateToExternFileHolderLock inDropMode |
|
7 |
draggedItem canDropItem viewBrowserMenu updateContentsSelection |
|
8 |
selectionInFileList contentsBrowser browserItemList matchBlock |
|
9 |
updateContentsTask' |
|
4019 | 10 |
classVariableNames:'' |
11 |
poolDictionaries:'' |
|
12 |
category:'Interface-Tools-File' |
|
3887 | 13 |
! |
14 |
||
15 |
Object subclass:#DirectoryContentsItem |
|
4019 | 16 |
instanceVariableNames:'fileName fileInfo icon fileType |
17 |
contentsBrowserChangeModificationTime suffix preview group owner |
|
18 |
timeAndDate mimeType iconKey mimeTypeForContents' |
|
19 |
classVariableNames:'LastUIDToUserNameMapping LastGIDToGroupNameMapping' |
|
20 |
poolDictionaries:'' |
|
21 |
privateIn:DirectoryContentsBrowser |
|
4017 | 22 |
! |
23 |
||
24 |
Object subclass:#DirectoryContentsUpdateTask |
|
4019 | 25 |
instanceVariableNames:'directoryBrowser updateProcess isBusy changeSema |
26 |
directoryChangeFlag directoryContentsChangeFlag filterChangeFlag |
|
27 |
sortBlockChangeFlag modificationTime filteredItems |
|
28 |
modificationTask directory' |
|
29 |
classVariableNames:'' |
|
30 |
poolDictionaries:'' |
|
31 |
privateIn:DirectoryContentsBrowser |
|
3887 | 32 |
! |
33 |
||
34 |
!DirectoryContentsBrowser class methodsFor:'documentation'! |
|
35 |
||
36 |
documentation |
|
37 |
||
38 |
" |
|
39 |
DirectoryContentsBrowser openIn:'/home/ca/work/stx/goodies/bitmaps/xpmBitmaps' |
|
40 |
DirectoryContentsBrowser openIn:'/home/ca/TEST' |
|
41 |
" |
|
42 |
! ! |
|
43 |
||
44 |
!DirectoryContentsBrowser class methodsFor:'instance creation'! |
|
45 |
||
46 |
openIn:aDirectory |
|
47 |
"opens a directory (standalone) for a directory |
|
48 |
" |
|
49 |
self openIn:aDirectory withDirectories:false |
|
50 |
||
51 |
" |
|
52 |
self openIn:(Filename currentDirectory construct:'.cvsignore') |
|
53 |
" |
|
54 |
! |
|
55 |
||
56 |
openIn:aDirectory withDirectories:withDirectoriesBoolean |
|
57 |
"opens a directory (standalone) for a directory |
|
58 |
" |
|
59 |
|browser| |
|
60 |
||
61 |
browser := DirectoryContentsBrowser new. |
|
62 |
browser open. |
|
63 |
aDirectory notNil ifTrue:[ |
|
64 |
browser currentFileNameHolder value:(OrderedCollection with:(aDirectory asFilename)) |
|
65 |
]. |
|
66 |
browser viewDirectoriesInDirectoryContentsBrowser value:withDirectoriesBoolean. |
|
67 |
^ browser |
|
68 |
||
69 |
" |
|
4007 | 70 |
self openIn:(Filename currentDirectory asAbsoluteFilename) withDirectories:true |
3887 | 71 |
" |
72 |
! ! |
|
73 |
||
74 |
!DirectoryContentsBrowser class methodsFor:'classAccess'! |
|
75 |
||
76 |
itemClass |
|
77 |
||
78 |
^ DirectoryContentsItem |
|
79 |
||
80 |
||
81 |
" |
|
82 |
self itemClass |
|
83 |
" |
|
84 |
! ! |
|
85 |
||
86 |
!DirectoryContentsBrowser class methodsFor:'constant'! |
|
87 |
||
88 |
updateTaskPriority |
|
89 |
"returns the priority of the update task |
|
90 |
" |
|
91 |
^ 8 |
|
92 |
! ! |
|
93 |
||
3980 | 94 |
!DirectoryContentsBrowser class methodsFor:'image specs'! |
95 |
||
4027 | 96 |
detailsMenuIconDown |
3980 | 97 |
"This resource specification was automatically generated |
98 |
by the ImageEditor of ST/X." |
|
99 |
||
100 |
"Do not manually edit this!! If it is corrupted, |
|
101 |
the ImageEditor may not be able to read the specification." |
|
102 |
||
103 |
" |
|
4027 | 104 |
self detailsMenuIconDown inspect |
105 |
ImageEditor openOnClass:self andSelector:#detailsMenuIconDown |
|
3980 | 106 |
Icon flushCachedIcons |
107 |
" |
|
108 |
||
109 |
<resource: #image> |
|
110 |
||
111 |
^Icon |
|
4027 | 112 |
constantNamed:#'DirectoryContentsBrowser class detailsMenuIconDown' |
113 |
ifAbsentPut:[(Depth1Image new) width: 7; height: 5; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 7; height: 5; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@A@(UJ(b') ; yourself); yourself] |
|
3980 | 114 |
! |
115 |
||
116 |
detailsMenuIconR |
|
117 |
"This resource specification was automatically generated |
|
118 |
by the ImageEditor of ST/X." |
|
119 |
||
120 |
"Do not manually edit this!! If it is corrupted, |
|
121 |
the ImageEditor may not be able to read the specification." |
|
122 |
||
123 |
" |
|
124 |
self detailsMenuIconR inspect |
|
125 |
ImageEditor openOnClass:self andSelector:#detailsMenuIconR |
|
126 |
Icon flushCachedIcons |
|
127 |
" |
|
128 |
||
129 |
<resource: #image> |
|
130 |
||
131 |
^Icon |
|
132 |
constantNamed:#'DirectoryContentsBrowser class detailsMenuIconR' |
|
133 |
ifAbsentPut:[(Depth1Image new) width: 5; height: 7; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 5; height: 7; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' DB TJA@ @@a') ; yourself); yourself] |
|
4027 | 134 |
! |
135 |
||
136 |
detailsMenuIconUp |
|
3980 | 137 |
"This resource specification was automatically generated |
138 |
by the ImageEditor of ST/X." |
|
139 |
||
140 |
"Do not manually edit this!! If it is corrupted, |
|
141 |
the ImageEditor may not be able to read the specification." |
|
142 |
||
143 |
" |
|
4027 | 144 |
self detailsMenuIconUp inspect |
145 |
ImageEditor openOnClass:self andSelector:#detailsMenuIconUp |
|
3980 | 146 |
Icon flushCachedIcons |
147 |
" |
|
148 |
||
149 |
<resource: #image> |
|
150 |
||
151 |
^Icon |
|
4027 | 152 |
constantNamed:#'DirectoryContentsBrowser class detailsMenuIconUp' |
153 |
ifAbsentPut:[(Depth1Image new) width: 7; height: 5; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 7; height: 5; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'*%P(D@@b') ; yourself); yourself] |
|
154 |
! ! |
|
155 |
||
156 |
!DirectoryContentsBrowser class methodsFor:'interface specs'! |
|
3980 | 157 |
|
3887 | 158 |
tableColumns |
159 |
"This resource specification was automatically generated |
|
160 |
by the DataSetBuilder of ST/X." |
|
161 |
||
162 |
"Do not manually edit this!! If it is corrupted, |
|
163 |
the DataSetBuilder may not be able to read the specification." |
|
164 |
||
165 |
" |
|
166 |
DataSetBuilder new openOnClass:DirectoryContentsBrowser andSelector:#tableColumns |
|
167 |
" |
|
168 |
||
169 |
<resource: #tableColumns> |
|
170 |
||
171 |
^#( |
|
172 |
#(#DataSetColumnSpec |
|
4027 | 173 |
#label: '' |
174 |
#id: #icon |
|
3887 | 175 |
#labelButtonType: #Group |
3980 | 176 |
#labelActionSelector: #showDetailMenu |
3887 | 177 |
#width: 22 |
178 |
#minWidth: 22 |
|
179 |
#height: 16 |
|
180 |
#model: #icon |
|
181 |
#canSelect: false |
|
182 |
#showRowSeparator: false |
|
183 |
#showColSeparator: false |
|
184 |
) |
|
185 |
#(#DataSetColumnSpec |
|
186 |
#label: 'Filename' |
|
187 |
#id: #filename |
|
188 |
#labelAlignment: #left |
|
189 |
#labelButtonType: #Button |
|
3989 | 190 |
#labelActionSelector: #sortFileListsBy: |
3887 | 191 |
#labelActionArgument: 'baseName' |
192 |
#minWidth: 150 |
|
193 |
#model: #baseName |
|
194 |
#canSelect: false |
|
195 |
#showRowSeparator: false |
|
196 |
#showColSeparator: false |
|
197 |
) |
|
198 |
#(#DataSetColumnSpec |
|
199 |
#label: 'Suffix' |
|
200 |
#id: #suffix |
|
201 |
#labelAlignment: #left |
|
202 |
#labelButtonType: #Button |
|
3989 | 203 |
#labelActionSelector: #sortFileListsBy: |
3887 | 204 |
#labelActionArgument: 'suffix' |
205 |
#width: 40 |
|
206 |
#model: #suffix |
|
207 |
#canSelect: false |
|
208 |
#isResizeable: false |
|
209 |
#showRowSeparator: false |
|
210 |
#showColSeparator: false |
|
211 |
) |
|
212 |
#(#DataSetColumnSpec |
|
213 |
#label: 'Perm' |
|
214 |
#id: #perm |
|
215 |
#labelAlignment: #left |
|
216 |
#labelButtonType: #Button |
|
3989 | 217 |
#labelActionSelector: #sortFileListsBy: |
3887 | 218 |
#labelActionArgument: 'permissions' |
219 |
#width: 75 |
|
220 |
#model: #permissions |
|
221 |
#canSelect: false |
|
222 |
#isResizeable: false |
|
223 |
#showRowSeparator: false |
|
224 |
#showColSeparator: false |
|
225 |
) |
|
226 |
#(#DataSetColumnSpec |
|
227 |
#label: 'Owner' |
|
228 |
#id: #owner |
|
229 |
#labelAlignment: #left |
|
230 |
#labelButtonType: #Button |
|
3989 | 231 |
#labelActionSelector: #sortFileListsBy: |
3887 | 232 |
#labelActionArgument: 'owner' |
233 |
#usePreferredWidth: true |
|
234 |
#width: 50 |
|
235 |
#model: #owner |
|
236 |
#canSelect: false |
|
237 |
#showRowSeparator: false |
|
238 |
#showColSeparator: false |
|
239 |
) |
|
240 |
#(#DataSetColumnSpec |
|
241 |
#label: 'Group' |
|
242 |
#id: #group |
|
243 |
#labelAlignment: #left |
|
244 |
#labelButtonType: #Button |
|
3989 | 245 |
#labelActionSelector: #sortFileListsBy: |
3887 | 246 |
#labelActionArgument: 'group' |
247 |
#usePreferredWidth: true |
|
248 |
#width: 40 |
|
249 |
#model: #group |
|
250 |
#canSelect: false |
|
251 |
#showRowSeparator: false |
|
252 |
#showColSeparator: false |
|
253 |
) |
|
254 |
#(#DataSetColumnSpec |
|
255 |
#label: 'Size' |
|
256 |
#id: #size |
|
257 |
#translateLabel: true |
|
258 |
#labelAlignment: #right |
|
259 |
#labelButtonType: #Button |
|
3989 | 260 |
#labelActionSelector: #sortFileListsBy: |
3983 | 261 |
#labelActionArgument: 'fileSize' |
3887 | 262 |
#columnAlignment: #right |
263 |
#usePreferredWidth: true |
|
264 |
#model: #sizeString |
|
265 |
#canSelect: false |
|
266 |
#showRowSeparator: false |
|
267 |
#showColSeparator: false |
|
268 |
) |
|
269 |
#(#DataSetColumnSpec |
|
270 |
#label: 'Date & Time' |
|
3964 | 271 |
#id: #time |
3887 | 272 |
#labelAlignment: #right |
273 |
#labelButtonType: #Button |
|
3989 | 274 |
#labelActionSelector: #sortFileListsBy: |
3887 | 275 |
#labelActionArgument: 'modificationTime' |
276 |
#columnAlignment: #right |
|
277 |
#usePreferredWidth: true |
|
278 |
#width: 140 |
|
279 |
#model: #timeAndDate |
|
280 |
#writeSelector: #date: |
|
281 |
#canSelect: false |
|
282 |
#showRowSeparator: false |
|
283 |
#showColSeparator: false |
|
284 |
) |
|
285 |
#(#DataSetColumnSpec |
|
286 |
#label: 'File Info' |
|
287 |
#id: #fileInfo |
|
288 |
#labelAlignment: #left |
|
289 |
#labelButtonType: #Button |
|
3989 | 290 |
#labelActionSelector: #sortFileListsBy: |
3887 | 291 |
#labelActionArgument: 'fileType' |
292 |
#width: 250 |
|
293 |
#model: #fileInfoString |
|
294 |
#canSelect: false |
|
295 |
#showRowSeparator: false |
|
296 |
#showColSeparator: false |
|
297 |
) |
|
298 |
#(#DataSetColumnSpec |
|
299 |
#label: 'Pre +/-' |
|
300 |
#id: #preview |
|
301 |
#labelButtonType: #Button |
|
302 |
#labelActionSelector: #doResizeImage |
|
303 |
#labelActionArgument: '' |
|
304 |
#columnAlignment: #center |
|
305 |
#width: 45 |
|
306 |
#height: 16 |
|
307 |
#model: #preview |
|
308 |
#canSelect: false |
|
309 |
#showRowSeparator: false |
|
310 |
#showColSeparator: false |
|
311 |
) |
|
312 |
) |
|
313 |
! |
|
314 |
||
315 |
windowSpec |
|
316 |
"This resource specification was automatically generated |
|
317 |
by the UIPainter of ST/X." |
|
318 |
||
319 |
"Do not manually edit this!! If it is corrupted, |
|
320 |
the UIPainter may not be able to read the specification." |
|
321 |
||
322 |
" |
|
323 |
UIPainter new openOnClass:DirectoryContentsBrowser andSelector:#windowSpec |
|
324 |
DirectoryContentsBrowser new openInterface:#windowSpec |
|
325 |
DirectoryContentsBrowser open |
|
326 |
" |
|
327 |
||
328 |
<resource: #canvas> |
|
329 |
||
330 |
^ |
|
331 |
#(#FullSpec |
|
332 |
#name: #windowSpec |
|
333 |
#window: |
|
334 |
#(#WindowSpec |
|
335 |
#label: 'Directory ContentsBrowser' |
|
336 |
#name: 'Directory ContentsBrowser' |
|
337 |
#min: #(#Point 10 10) |
|
338 |
#max: #(#Point 1152 900) |
|
3953 | 339 |
#bounds: #(#Rectangle 16 42 604 520) |
3887 | 340 |
#menu: #menu |
341 |
) |
|
342 |
#component: |
|
343 |
#(#SpecCollection |
|
344 |
#collection: #( |
|
345 |
#(#DataSetSpec |
|
346 |
#name: 'browser' |
|
347 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
348 |
#model: #selectionInFileList |
|
349 |
#menu: #directoryContentsBrowserMenu |
|
350 |
#hasHorizontalScrollBar: true |
|
351 |
#hasVerticalScrollBar: true |
|
352 |
#miniScrollerHorizontal: false |
|
353 |
#miniScrollerVertical: false |
|
3983 | 354 |
#dataList: #browserItemList |
355 |
#useIndex: false |
|
3887 | 356 |
#has3Dsepartors: false |
357 |
#doubleClickSelector: #doubleClickedAt: |
|
358 |
#columnHolder: #tableColumns |
|
359 |
#multipleSelectOk: true |
|
360 |
#verticalSpacing: 0 |
|
361 |
#columns: |
|
362 |
#(#OrderedCollection |
|
363 |
||
364 |
#(#DataSetColumnSpec |
|
365 |
#labelButtonType: #Group |
|
366 |
#width: 22 |
|
367 |
#minWidth: 22 |
|
368 |
#height: 16 |
|
369 |
#model: #icon |
|
370 |
#canSelect: false |
|
371 |
#showRowSeparator: false |
|
372 |
#showColSeparator: false |
|
373 |
) |
|
374 |
#(#DataSetColumnSpec |
|
375 |
#label: 'file name' |
|
376 |
#labelAlignment: #left |
|
377 |
#labelButtonType: #Button |
|
378 |
#model: #baseName |
|
379 |
#canSelect: false |
|
380 |
#showRowSeparator: false |
|
381 |
#showColSeparator: false |
|
382 |
) |
|
383 |
||
384 |
#(#DataSetColumnSpec |
|
385 |
#label: '+/-' |
|
386 |
#labelButtonType: #Button |
|
387 |
#labelActionSelector: #doResizeImage |
|
388 |
#labelActionArgument: '' |
|
389 |
#columnAlignment: #center |
|
390 |
#width: 30 |
|
391 |
#height: 16 |
|
392 |
#model: #preview |
|
393 |
#canSelect: false |
|
394 |
#showRowSeparator: false |
|
395 |
#showSelectionHighLighted: false |
|
396 |
#showColSeparator: false |
|
397 |
) |
|
398 |
) |
|
399 |
#viewClassName: 'DirectoryContentsBrowser::Widget' |
|
400 |
#postBuildCallback: #postBuildBrowser: |
|
401 |
#properties: |
|
402 |
#(#PropertyListDictionary |
|
3983 | 403 |
#dropSelector: #doDrop: |
3953 | 404 |
#dragArgument: #contentsbrowser |
3887 | 405 |
#startDragSelector: #doStartDrag:in: |
406 |
#displayObjectSelector: #getDisplayObjects: |
|
407 |
#dropObjectSelector: #getDropObjects: |
|
408 |
#dropArgument: #browser |
|
3953 | 409 |
#canDropSelector: #canDrop: |
3887 | 410 |
#leaveSelector: #dropLeave: |
3983 | 411 |
#enterSelector: #dropEnter: |
3953 | 412 |
#overSelector: #dropOver: |
3887 | 413 |
) |
414 |
) |
|
415 |
) |
|
416 |
||
417 |
) |
|
418 |
) |
|
419 |
! ! |
|
420 |
||
421 |
!DirectoryContentsBrowser class methodsFor:'menu specs'! |
|
422 |
||
423 |
directoryContentsBrowserMenu |
|
424 |
"This resource specification was automatically generated |
|
425 |
by the MenuEditor of ST/X." |
|
426 |
||
427 |
"Do not manually edit this!! If it is corrupted, |
|
428 |
the MenuEditor may not be able to read the specification." |
|
429 |
||
430 |
" |
|
431 |
MenuEditor new openOnClass:DirectoryContentsBrowser andSelector:#directoryContentsBrowserMenu |
|
432 |
(Menu new fromLiteralArrayEncoding:(DirectoryContentsBrowser directoryContentsBrowserMenu)) startUp |
|
433 |
" |
|
434 |
||
435 |
<resource: #menu> |
|
436 |
||
437 |
^ |
|
438 |
#(#Menu |
|
439 |
#( |
|
440 |
#(#MenuItem |
|
441 |
#label: 'Copy' |
|
442 |
#translateLabel: true |
|
443 |
#value: #doCopy |
|
444 |
#shortcutKeyCharacter: #Copy |
|
445 |
) |
|
446 |
#(#MenuItem |
|
447 |
#label: 'Cut' |
|
448 |
#translateLabel: true |
|
449 |
#value: #doCut |
|
450 |
#shortcutKeyCharacter: #Cut |
|
451 |
) |
|
452 |
#(#MenuItem |
|
453 |
#label: 'Paste' |
|
454 |
#translateLabel: true |
|
455 |
#value: #pasteFiles |
|
456 |
#enabled: #canPaste |
|
457 |
#shortcutKeyCharacter: #Paste |
|
458 |
) |
|
459 |
#(#MenuItem |
|
460 |
#label: 'Delete' |
|
461 |
#translateLabel: true |
|
462 |
#nameKey: #delete |
|
463 |
#value: #doDelete |
|
464 |
#shortcutKeyCharacter: #Delete |
|
465 |
) |
|
466 |
#(#MenuItem |
|
3911 | 467 |
#label: 'Rename...' |
3887 | 468 |
#translateLabel: true |
469 |
#value: #renameSelection |
|
470 |
#enabled: #hasSelection |
|
471 |
#shortcutKeyCharacter: #Replace |
|
472 |
) |
|
473 |
#(#MenuItem |
|
474 |
#label: '-' |
|
475 |
) |
|
476 |
#(#MenuItem |
|
477 |
#label: 'View' |
|
478 |
#translateLabel: true |
|
479 |
#nameKey: #View |
|
480 |
#submenuChannel: #viewBrowserMenu |
|
481 |
) |
|
482 |
#(#MenuItem |
|
483 |
#label: 'Sort' |
|
484 |
#translateLabel: true |
|
485 |
#nameKey: #Sort |
|
486 |
#submenuChannel: #sortMenu |
|
487 |
) |
|
488 |
#(#MenuItem |
|
489 |
#label: '-' |
|
490 |
) |
|
491 |
#(#MenuItem |
|
492 |
#label: 'New' |
|
493 |
#translateLabel: true |
|
494 |
#submenuChannel: #newMenu |
|
495 |
) |
|
496 |
#(#MenuItem |
|
497 |
#label: 'Properties...' |
|
498 |
#translateLabel: true |
|
499 |
#value: #doShowProperties |
|
500 |
#enabled: #hasSelection |
|
501 |
) |
|
502 |
#(#MenuItem |
|
3980 | 503 |
#label: 'More' |
3907 | 504 |
#submenu: |
505 |
#(#Menu |
|
506 |
#( |
|
507 |
#(#MenuItem |
|
508 |
#label: 'File In' |
|
509 |
#translateLabel: true |
|
510 |
#value: #fileFileIn |
|
511 |
#enabled: #hasSelection |
|
512 |
#shortcutKeyCharacter: #Accept |
|
513 |
) |
|
514 |
#(#MenuItem |
|
4083 | 515 |
#label: 'File in to Namespace...' |
3907 | 516 |
#translateLabel: true |
517 |
#value: #fileFileInToNameSpace |
|
518 |
#enabled: #hasSelection |
|
519 |
) |
|
520 |
#(#MenuItem |
|
3980 | 521 |
#label: '-' |
3907 | 522 |
) |
523 |
#(#MenuItem |
|
4083 | 524 |
#label: 'Open in Text Editor' |
3907 | 525 |
#translateLabel: true |
526 |
#value: #doShowFileContents |
|
527 |
#enabled: #hasSelection |
|
528 |
) |
|
529 |
#(#MenuItem |
|
3980 | 530 |
#label: '-' |
531 |
) |
|
532 |
#(#MenuItem |
|
3907 | 533 |
#label: 'Select All' |
534 |
#translateLabel: true |
|
3983 | 535 |
#value: #selectAll |
3907 | 536 |
) |
537 |
#(#MenuItem |
|
538 |
#label: 'Copy File List' |
|
539 |
#translateLabel: true |
|
540 |
#value: #copyFileList |
|
541 |
#enabled: #fileListIsNotEmpty |
|
542 |
) |
|
543 |
) |
|
544 |
nil |
|
545 |
nil |
|
546 |
) |
|
3887 | 547 |
) |
3980 | 548 |
#(#MenuItem |
549 |
#label: '-' |
|
550 |
) |
|
551 |
#(#MenuItem |
|
552 |
#label: 'Update' |
|
553 |
#translateLabel: true |
|
554 |
#value: #doUpdate |
|
555 |
) |
|
3887 | 556 |
) |
557 |
nil |
|
558 |
nil |
|
559 |
) |
|
560 |
! |
|
561 |
||
562 |
viewBrowserMenu |
|
563 |
"This resource specification was automatically generated |
|
564 |
by the MenuEditor of ST/X." |
|
565 |
||
566 |
"Do not manually edit this!! If it is corrupted, |
|
567 |
the MenuEditor may not be able to read the specification." |
|
568 |
||
569 |
" |
|
570 |
MenuEditor new openOnClass:DirectoryContentsBrowser andSelector:#viewBrowserMenu |
|
571 |
(Menu new fromLiteralArrayEncoding:(DirectoryContentsBrowser viewBrowserMenu)) startUp |
|
572 |
" |
|
573 |
||
574 |
<resource: #menu> |
|
575 |
||
3961 | 576 |
^ Menu new fromLiteralArrayEncoding:self viewBrowserMenuSpec |
577 |
! |
|
578 |
||
579 |
viewBrowserMenuSpec |
|
580 |
"This resource specification was automatically generated |
|
581 |
by the MenuEditor of ST/X." |
|
582 |
||
583 |
"Do not manually edit this!! If it is corrupted, |
|
584 |
the MenuEditor may not be able to read the specification." |
|
585 |
||
586 |
" |
|
587 |
MenuEditor new openOnClass:DirectoryContentsBrowser andSelector:#viewBrowserMenu |
|
588 |
(Menu new fromLiteralArrayEncoding:(DirectoryContentsBrowser viewBrowserMenu)) startUp |
|
589 |
" |
|
590 |
||
591 |
<resource: #menu> |
|
592 |
||
3887 | 593 |
^ |
594 |
#(#Menu |
|
595 |
#( |
|
596 |
#(#MenuItem |
|
597 |
#label: 'View Details' |
|
598 |
#translateLabel: true |
|
599 |
#hideMenuOnActivated: false |
|
600 |
#indication: #viewDetails |
|
601 |
) |
|
602 |
#(#MenuItem |
|
3984 | 603 |
#label: '-' |
604 |
) |
|
605 |
#(#MenuItem |
|
3887 | 606 |
#label: 'View Suffix' |
607 |
#translateLabel: true |
|
608 |
#hideMenuOnActivated: false |
|
609 |
#enabled: #viewDetails |
|
610 |
#indication: #viewType |
|
611 |
) |
|
612 |
#(#MenuItem |
|
613 |
#label: 'View Permissions' |
|
614 |
#translateLabel: true |
|
615 |
#hideMenuOnActivated: false |
|
616 |
#enabled: #viewDetails |
|
617 |
#indication: #viewPermissions |
|
618 |
) |
|
619 |
#(#MenuItem |
|
620 |
#label: 'View Owner' |
|
621 |
#translateLabel: true |
|
622 |
#hideMenuOnActivated: false |
|
623 |
#enabled: #viewDetails |
|
624 |
#indication: #viewOwner |
|
625 |
) |
|
626 |
#(#MenuItem |
|
627 |
#label: 'View Group' |
|
628 |
#translateLabel: true |
|
629 |
#hideMenuOnActivated: false |
|
630 |
#enabled: #viewDetails |
|
631 |
#indication: #viewGroup |
|
632 |
) |
|
633 |
#(#MenuItem |
|
634 |
#label: 'View Size' |
|
635 |
#translateLabel: true |
|
636 |
#hideMenuOnActivated: false |
|
637 |
#enabled: #viewDetails |
|
638 |
#indication: #viewSize |
|
639 |
) |
|
640 |
#(#MenuItem |
|
641 |
#label: 'View Date && Time' |
|
642 |
#translateLabel: true |
|
643 |
#hideMenuOnActivated: false |
|
644 |
#enabled: #viewDetails |
|
645 |
#indication: #viewTime |
|
646 |
) |
|
647 |
#(#MenuItem |
|
648 |
#label: 'View File Info' |
|
649 |
#translateLabel: true |
|
650 |
#hideMenuOnActivated: false |
|
651 |
#enabled: #viewDetails |
|
652 |
#indication: #viewDescription |
|
653 |
) |
|
654 |
#(#MenuItem |
|
655 |
#label: 'View Preview' |
|
656 |
#translateLabel: true |
|
657 |
#hideMenuOnActivated: false |
|
658 |
#enabled: #viewDetails |
|
659 |
#indication: #viewPreview |
|
660 |
) |
|
661 |
#(#MenuItem |
|
662 |
#label: '-' |
|
3980 | 663 |
#isVisible: false |
3887 | 664 |
) |
665 |
#(#MenuItem |
|
666 |
#label: 'Show Hidden Files' |
|
667 |
#translateLabel: true |
|
668 |
#indication: #showHiddenFiles |
|
3980 | 669 |
#isVisible: false |
670 |
) |
|
671 |
#(#MenuItem |
|
672 |
#label: 'Update' |
|
673 |
#translateLabel: true |
|
674 |
#value: #doUpdate |
|
675 |
#isVisible: false |
|
676 |
) |
|
677 |
) |
|
678 |
nil |
|
679 |
nil |
|
680 |
) |
|
3887 | 681 |
! ! |
682 |
||
683 |
!DirectoryContentsBrowser methodsFor:'accessing'! |
|
684 |
||
4017 | 685 |
allItemsList |
686 |
"return the value of the instance variable 'allItemsList' (automatically generated)" |
|
687 |
||
688 |
allItemsList isNil ifTrue:[ |
|
689 |
allItemsList := OrderedCollection new. |
|
690 |
]. |
|
691 |
^ allItemsList |
|
692 |
! |
|
693 |
||
694 |
allItemsList:something |
|
695 |
"set the value of the instance variable 'allItemsList' (automatically generated)" |
|
696 |
||
697 |
allItemsList := something. |
|
698 |
! |
|
699 |
||
3887 | 700 |
columnDescriptors |
701 |
"get the column description |
|
702 |
" |
|
703 |
^ columnDescriptors |
|
704 |
! |
|
705 |
||
706 |
columnDescriptors:aListOfColumns |
|
707 |
"set the column description |
|
708 |
" |
|
709 |
columnDescriptors = aListOfColumns ifTrue:[ |
|
710 |
^ self |
|
711 |
]. |
|
712 |
||
713 |
columnDescriptors := OrderedCollection new. |
|
714 |
previewIndex := 0. |
|
715 |
iconIndex := 0. |
|
716 |
fileDescriptionIndex := 0. |
|
717 |
iconExtent := nil. |
|
718 |
||
719 |
aListOfColumns keysAndValuesDo:[:anIndex :aDesc| |col| |
|
720 |
col := aDesc isSequenceable ifTrue:[DataSetColumnSpec new fromLiteralArrayEncoding:aDesc] |
|
721 |
ifFalse:[aDesc]. |
|
722 |
columnDescriptors add:col. |
|
723 |
||
724 |
col readSelector == #preview ifTrue:[ |
|
725 |
previewIndex := anIndex. |
|
726 |
iconExtent := Point x:(col width) y:(col height). |
|
727 |
] ifFalse:[ |
|
728 |
col readSelector == #fileInfoString ifTrue:[ |
|
729 |
fileDescriptionIndex := anIndex. |
|
730 |
] ifFalse:[ |
|
731 |
col readSelector == #icon ifTrue:[ |
|
732 |
iconIndex := anIndex. |
|
733 |
] |
|
734 |
] |
|
735 |
] |
|
736 |
]. |
|
737 |
||
738 |
! |
|
739 |
||
740 |
directory |
|
741 |
"returns the current directory or nil |
|
742 |
" |
|
743 |
^ directory |
|
744 |
||
745 |
! |
|
746 |
||
747 |
directory:aDirectory |
|
748 |
"change the current directory and read the items |
|
749 |
" |
|
750 |
directory := aDirectory. |
|
4071 | 751 |
updateContentsTask notNil ifTrue:[updateContentsTask wakeUpForDirectoryChanged:aDirectory.]. |
4017 | 752 |
! |
753 |
||
754 |
matchBlock |
|
755 |
"return the value of the instance variable 'matchBlock' (automatically generated)" |
|
756 |
||
757 |
^ matchBlock |
|
758 |
! |
|
759 |
||
760 |
matchBlock:filterBlock |
|
761 |
||
762 |
matchBlock := filterBlock. |
|
3887 | 763 |
! |
764 |
||
765 |
updateColumnsTask |
|
766 |
"return the value of the instance variable 'updateColumnsTask' (automatically generated)" |
|
767 |
||
768 |
^ updateColumnsTask |
|
769 |
! |
|
770 |
||
771 |
updateColumnsTask:something |
|
772 |
"set the value of the instance variable 'updateColumnsTask' (automatically generated)" |
|
773 |
||
774 |
updateColumnsTask := something. |
|
775 |
! |
|
776 |
||
3983 | 777 |
updateContentsSelection |
778 |
"return the value of the instance variable 'updateToExternFileHolder' (automatically generated)" |
|
779 |
||
780 |
updateContentsSelection isNil ifTrue:[ |
|
781 |
updateContentsSelection := self class newLock. |
|
782 |
]. |
|
783 |
^ updateContentsSelection |
|
784 |
! |
|
785 |
||
3887 | 786 |
updateToExternFileHolderLock |
787 |
"return the value of the instance variable 'updateToExternFileHolder' (automatically generated)" |
|
788 |
||
789 |
updateToExternFileHolderLock isNil ifTrue:[ |
|
790 |
updateToExternFileHolderLock := self class newLock. |
|
791 |
]. |
|
792 |
^ updateToExternFileHolderLock |
|
793 |
! ! |
|
794 |
||
795 |
!DirectoryContentsBrowser methodsFor:'actions'! |
|
796 |
||
4017 | 797 |
allItems:allItems browserItemListAdd:addItemCol remove:remItemCol |
798 |
| browserList| |
|
799 |
||
800 |
self updateColumnsTaskStop. |
|
801 |
self allItemsList:allItems. |
|
802 |
browserList := self browserItemList copy. |
|
803 |
remItemCol notEmpty ifTrue:[ |
|
804 |
browserList removeAll:remItemCol |
|
805 |
]. |
|
806 |
addItemCol notEmpty ifTrue:[ |
|
807 |
browserList addAll:addItemCol |
|
808 |
]. |
|
809 |
browserList sort:self sortBlockHolder value. |
|
810 |
self browserItemList contents:browserList asList. |
|
811 |
self selectCurrentFiles. |
|
812 |
self updateColumnsTaskStart. |
|
813 |
! |
|
814 |
||
4027 | 815 |
currentSortOrderChanged |
816 |
||
817 |
self viewedColumnsChanged. |
|
818 |
! |
|
819 |
||
3887 | 820 |
doResizeImage |
821 |
|column w h| |
|
822 |
||
823 |
previewIndex == 0 ifTrue:[^ self]. |
|
824 |
||
825 |
||
826 |
column := columnDescriptors at:previewIndex. |
|
827 |
w := iconExtent x. |
|
828 |
h := iconExtent y. |
|
829 |
||
830 |
w == column width ifTrue:[ |
|
831 |
w := w * 2. |
|
832 |
h := h * 2. |
|
833 |
]. |
|
834 |
column width:w. |
|
835 |
column height:h. |
|
836 |
||
3990 | 837 |
"/Processor activeProcess ~~ self windowGroup process ifTrue:[self halt]. |
3887 | 838 |
self updateColumnsTaskStop. |
3983 | 839 |
browserItemList do:[:el| el resetImageFile ]. |
840 |
contentsBrowser columnDescriptors:columnDescriptors. |
|
3887 | 841 |
self updateColumnsTaskStart. |
842 |
! |
|
843 |
||
844 |
doUpdate |
|
845 |
||
4017 | 846 |
updateContentsTask wakeUpForDirectoryContentsChanged. |
3887 | 847 |
! |
848 |
||
3984 | 849 |
doubleClickedAt:anItemIndex |
3983 | 850 |
|
3906 | 851 |
self withWaitCursorDo:[ |
4013 | 852 |
self enterActionFor:(self browserItemList at:anItemIndex). "/ anItemIndex. |
3906 | 853 |
] |
3887 | 854 |
! |
855 |
||
856 |
enterActionFor:anItem |
|
857 |
| filename| |
|
858 |
||
859 |
filename := anItem fileName. |
|
3906 | 860 |
|
4014 | 861 |
filename baseName = '..' ifTrue:[ |
3887 | 862 |
self currentFileNameHolder value:(OrderedCollection with:(self directory directory)). |
863 |
^ self. |
|
864 |
]. |
|
4017 | 865 |
(anItem isDirectory) ifTrue:[ |
3887 | 866 |
self currentFileNameHolder value:(OrderedCollection with:filename). |
867 |
^ self. |
|
868 |
]. |
|
869 |
self openApplByFileItem:anItem. |
|
4017 | 870 |
! |
871 |
||
872 |
noOfAddedFiles:noOfAddedFiles noOfFiles:noOfFiles |
|
873 |
||
874 |
| filterBox clr| |
|
875 |
||
876 |
self shownFiles value:noOfAddedFiles asString,'/',noOfFiles asString. |
|
877 |
filterBox := self filterValueBox value. |
|
878 |
filterBox isNil ifTrue:[^ self ]. |
|
879 |
noOfAddedFiles ~= noOfFiles ifTrue:[ |
|
880 |
clr := Color red lightened lightened lightened. |
|
881 |
[ filterBox flash] fork. |
|
882 |
] ifFalse:[ |
|
883 |
clr := self filterBackgroundColor value. |
|
884 |
]. |
|
885 |
filterBox backgroundColor:clr. |
|
886 |
! |
|
887 |
||
888 |
setBrowserItemList:filteredItems allItemsList:allItems |
|
889 |
||
890 |
|showDir directoryUpItem locItems| |
|
891 |
||
892 |
self updateColumnsTaskStop. |
|
893 |
locItems := filteredItems copy. |
|
894 |
allItems notNil ifTrue:[ |
|
895 |
self allItemsList:allItems. |
|
896 |
]. |
|
897 |
showDir := self viewDirectoriesInDirectoryContentsBrowser value. |
|
898 |
(showDir and:[self directory notNil and:[self directory isRootDirectory not]]) ifTrue:[ |
|
899 |
directoryUpItem := DirectoryContentsBrowser itemClass fileName:(self directory construct:'..'). |
|
900 |
locItems addFirst:directoryUpItem. |
|
901 |
]. |
|
4039 | 902 |
self updateToExternFileHolderLock doLocked:[ |
903 |
self browserItemList contents:locItems asList. |
|
904 |
]. |
|
4017 | 905 |
self updateColumnsTaskStart. |
906 |
self selectCurrentFiles. |
|
3887 | 907 |
! ! |
908 |
||
909 |
!DirectoryContentsBrowser methodsFor:'aspects'! |
|
910 |
||
3983 | 911 |
browserItemList |
912 |
||
913 |
browserItemList isNil ifTrue:[ |
|
914 |
browserItemList := List new. |
|
915 |
]. |
|
916 |
^ browserItemList |
|
3887 | 917 |
! |
918 |
||
3983 | 919 |
selectionInFileList |
920 |
||
921 |
selectionInFileList isNil ifTrue:[ |
|
922 |
selectionInFileList := ValueHolder new. |
|
923 |
selectionInFileList addDependent:self. |
|
3887 | 924 |
]. |
3983 | 925 |
^ selectionInFileList |
3887 | 926 |
! |
927 |
||
928 |
tableColumns |
|
929 |
"automatically generated by UIPainter ..." |
|
930 |
||
931 |
"*** the code below creates a default model when invoked." |
|
932 |
"*** (which may not be the one you wanted)" |
|
933 |
"*** Please change as required and accept it in the browser." |
|
934 |
"*** (and replace this comment by something more useful ;-)" |
|
935 |
||
936 |
tableColumns isNil ifTrue:[ |
|
937 |
tableColumns := self class tableColumns asValue. |
|
938 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
939 |
"/ tableColumns addDependent:self. |
|
940 |
"/ tableColumns onChangeSend:#tableColumnsChanged to:self. |
|
941 |
]. |
|
942 |
^ tableColumns. |
|
943 |
! ! |
|
944 |
||
945 |
!DirectoryContentsBrowser methodsFor:'change & update'! |
|
946 |
||
3983 | 947 |
currentFileNameHolderChanged |
3887 | 948 |
"filename changed |
949 |
" |
|
3983 | 950 |
| newDir currentDir aColOfFiles| |
951 |
||
952 |
||
953 |
aColOfFiles := self currentFileNameHolder value. |
|
954 |
(aColOfFiles isEmpty or:[self currentFilesAreInSameDirectory not]) ifTrue:[ |
|
3887 | 955 |
self directory:nil. |
956 |
^ self |
|
957 |
]. |
|
3983 | 958 |
newDir := self currentDirectories value first. |
3887 | 959 |
currentDir := self directory. |
960 |
newDir = currentDir ifTrue:[ |
|
3983 | 961 |
self selectFiles:aColOfFiles. |
3887 | 962 |
^ self. |
963 |
] ifFalse:[ |
|
964 |
"/ change of the directory filename |
|
965 |
self directory:newDir. |
|
966 |
]. |
|
967 |
! |
|
968 |
||
4071 | 969 |
filterBlockHolderChanged |
970 |
||
971 |
self matchBlock:self filterBlockHolder value. |
|
972 |
updateContentsTask notNil ifTrue:[updateContentsTask wakeUpForFilterChanged.]. |
|
973 |
! |
|
974 |
||
3983 | 975 |
selectionChanged |
976 |
||
4004 | 977 |
| selection newCurrentFilename | |
3983 | 978 |
|
979 |
self directory isNil ifTrue:[^ self]. |
|
980 |
selection := self selectedFiles. |
|
981 |
selection isEmpty ifTrue:[ |
|
4004 | 982 |
newCurrentFilename := OrderedCollection with:self directory. |
3983 | 983 |
] ifFalse:[ |
4004 | 984 |
newCurrentFilename := selection. |
3983 | 985 |
]. |
4004 | 986 |
self currentFileNameHolder value ~= newCurrentFilename ifTrue:[ |
987 |
self currentFileNameHolder value:newCurrentFilename withoutNotifying:self |
|
988 |
] |
|
3983 | 989 |
! |
990 |
||
3887 | 991 |
update:something with:aParameter from:aModel |
992 |
"one of my models changed |
|
993 |
" |
|
3983 | 994 |
|
995 |
aModel == self currentFileNameHolder ifTrue:[ |
|
4007 | 996 |
super update:something with:aParameter from:aModel. |
3983 | 997 |
self updateContentsSelection doIfUnLocked:[ |
4017 | 998 |
self currentFileNameHolderChanged. |
3983 | 999 |
]. |
4007 | 1000 |
^ self. |
3983 | 1001 |
]. |
1002 |
aModel == self selectionInFileList ifTrue:[ |
|
1003 |
self updateToExternFileHolderLock doIfUnLocked:[ |
|
1004 |
self updateContentsSelection doLocked:[ |
|
1005 |
self selectionChanged. |
|
1006 |
] |
|
1007 |
]. |
|
1008 |
^ self. |
|
1009 |
]. |
|
4027 | 1010 |
aModel == self currentSortOrder ifTrue:[ |
1011 |
self currentSortOrderChanged. |
|
1012 |
^ self. |
|
1013 |
]. |
|
4011 | 1014 |
aModel == self filterBlockHolder ifTrue:[ |
4071 | 1015 |
self filterBlockHolderChanged. |
3887 | 1016 |
^ self. |
1017 |
]. |
|
1018 |
aModel == self sortBlockHolder ifTrue:[ |
|
4017 | 1019 |
updateContentsTask wakeUpForSortBlockChanged. |
3887 | 1020 |
^ self. |
1021 |
]. |
|
1022 |
aModel == self viewDirectoriesInDirectoryContentsBrowser ifTrue:[ |
|
4017 | 1023 |
updateContentsTask wakeUpForFilterChanged. |
3887 | 1024 |
^ self |
1025 |
]. |
|
1026 |
||
1027 |
super update:something with:aParameter from:aModel |
|
1028 |
! |
|
1029 |
||
1030 |
viewedColumnsChanged |
|
1031 |
||
4027 | 1032 |
| columns buffer currentSortOrder currentSortOrderColumn currentSortOrderReverse| |
3887 | 1033 |
|
1034 |
columns := OrderedCollection new. |
|
1035 |
self class tableColumns do:[:el| |
|
1036 |
columns add:(DataSetColumnSpec new fromLiteralArrayEncoding:el). |
|
1037 |
]. |
|
1038 |
buffer := columns copy. |
|
1039 |
self viewDetails value = false ifTrue:[ |
|
3983 | 1040 |
contentsBrowser showLabels:false. |
3887 | 1041 |
buffer do:[:col | |
1042 |
(col readSelector = #baseName or:[col readSelector = #icon]) ifFalse:[ |
|
1043 |
columns remove:col. |
|
1044 |
] |
|
1045 |
] |
|
1046 |
] ifFalse:[ |
|
3983 | 1047 |
contentsBrowser showLabels:true. |
4027 | 1048 |
currentSortOrder := self currentSortOrder value. |
1049 |
currentSortOrderColumn := currentSortOrder at:#column ifAbsent:nil. |
|
1050 |
currentSortOrderReverse := currentSortOrder at:#reverse ifAbsent:nil. |
|
3887 | 1051 |
buffer do:[:col | |
1052 |
| id | |
|
1053 |
id := col id. |
|
1054 |
id notNil ifTrue:[ |
|
4027 | 1055 |
(col labelActionArgument notNil and:[col labelActionArgument asSymbol == currentSortOrderColumn]) ifTrue:[ |
1056 |
| label icon| |
|
1057 |
label := col label. |
|
1058 |
icon := currentSortOrderReverse ifTrue:[self class detailsMenuIconDown] ifFalse:[self class detailsMenuIconUp]. |
|
1059 |
col label:(LabelAndIcon label:label icon:icon). |
|
1060 |
]. |
|
3887 | 1061 |
(id == #filename) ifTrue:[ |
4027 | 1062 |
self viewType value ifTrue:[ |
1063 |
col readSelector:#baseNameWithOutSuffix |
|
3887 | 1064 |
] ifFalse:[ |
4027 | 1065 |
col readSelector:#baseName |
1066 |
]. |
|
1067 |
] ifFalse:[ |
|
1068 |
(id == #suffix and:[self viewType value not]) ifTrue:[ |
|
1069 |
columns remove:col. |
|
1070 |
] ifFalse:[ |
|
1071 |
(id == #group and:[self viewGroup value not]) ifTrue:[ |
|
1072 |
columns remove:col. |
|
3887 | 1073 |
] ifFalse:[ |
4027 | 1074 |
(id == #owner and:[self viewOwner value not]) ifTrue:[ |
1075 |
columns remove:col. |
|
3887 | 1076 |
] ifFalse:[ |
4027 | 1077 |
(id == #perm and:[self viewPermissions value not]) ifTrue:[ |
3887 | 1078 |
columns remove:col. |
1079 |
] ifFalse:[ |
|
4027 | 1080 |
(id == #preview and:[self viewPreview value not]) ifTrue:[ |
3887 | 1081 |
columns remove:col. |
1082 |
] ifFalse:[ |
|
4027 | 1083 |
(id == #size and:[self viewSize value not]) ifTrue:[ |
3887 | 1084 |
columns remove:col. |
1085 |
] ifFalse:[ |
|
4027 | 1086 |
(id == #time and:[self viewTime value not]) ifTrue:[ |
3887 | 1087 |
columns remove:col. |
1088 |
] ifFalse:[ |
|
4027 | 1089 |
(id == #fileInfo and:[self viewDescription value not]) ifTrue:[ |
3887 | 1090 |
columns remove:col. |
4027 | 1091 |
] |
1092 |
] |
|
3887 | 1093 |
] |
1094 |
] |
|
1095 |
] |
|
1096 |
] |
|
1097 |
] |
|
1098 |
] |
|
1099 |
] |
|
1100 |
] |
|
1101 |
] |
|
1102 |
]. |
|
4039 | 1103 |
self updateToExternFileHolderLock doLocked:[ |
1104 |
self tableColumns value:columns. |
|
1105 |
]. |
|
3887 | 1106 |
self columnDescriptors:(self tableColumns value). |
1107 |
! ! |
|
1108 |
||
1109 |
!DirectoryContentsBrowser methodsFor:'drag & drop'! |
|
1110 |
||
3953 | 1111 |
canDrop:aContext |
3887 | 1112 |
|
3953 | 1113 |
^ canDropItem |
3887 | 1114 |
! |
1115 |
||
3953 | 1116 |
doDrop:aContext |
3887 | 1117 |
|
3953 | 1118 |
|col destinationPath receiver| |
3887 | 1119 |
|
3953 | 1120 |
draggedItem isNil ifTrue:[ |
3887 | 1121 |
destinationPath := self directory. |
1122 |
] ifFalse:[ |
|
3953 | 1123 |
destinationPath := self getDirWithoutFileName:(draggedItem fileName). |
4014 | 1124 |
destinationPath baseName = '..' ifTrue:[ |
3953 | 1125 |
destinationPath := self directory directory. |
1126 |
] |
|
3887 | 1127 |
]. |
3953 | 1128 |
self dropLeave:aContext. |
1129 |
aContext dropSource argument == #archivApplication ifTrue:[ |
|
1130 |
receiver := aContext dropSource receiver. |
|
3887 | 1131 |
receiver extractSelectedFilesTo:destinationPath askForExtractOptions:true. |
1132 |
^ true. |
|
1133 |
]. |
|
1134 |
col := OrderedCollection new. |
|
1135 |
aContext dropObjects do:[:obj| |
|
1136 |
col add:(obj theObject). |
|
1137 |
]. |
|
3953 | 1138 |
self copyOrMoveFiles:col to:destinationPath. |
1139 |
^ true. |
|
3887 | 1140 |
! |
1141 |
||
1142 |
doStartDrag:aDropSource in:aView |
|
1143 |
"set the cursors before starting the drag & drop operation |
|
1144 |
" |
|
3983 | 1145 |
|selectedFiles| |
1146 |
||
1147 |
selectedFiles := self selectedFiles. |
|
4014 | 1148 |
(selectedFiles isEmpty) ifTrue:[ |
3887 | 1149 |
^ self. |
1150 |
]. |
|
3953 | 1151 |
^ super doStartDrag:aDropSource in:aView |
1152 |
! |
|
1153 |
||
1154 |
dropEnter:aContext |
|
1155 |
||
1156 |
|dropedObjects| |
|
1157 |
||
1158 |
self dropTargetItemChangedTo:nil in:aContext. |
|
1159 |
inDropMode := false. |
|
1160 |
||
1161 |
self directory isNil ifTrue:[^ self]. |
|
1162 |
dropedObjects := aContext dropObjects. |
|
1163 |
||
1164 |
dropedObjects do:[:aObject| |
|
1165 |
|checkObject checkObjectString| |
|
1166 |
aObject isFileObject ifFalse:[^ self]. |
|
1167 |
checkObject := aObject theObject. |
|
1168 |
checkObject isFilename not ifTrue:[^ self]. |
|
1169 |
((aContext dropSource argument == #archivApplication) not) ifTrue:[ |
|
1170 |
checkObject isSpecialFile ifTrue:[^ self]. |
|
1171 |
checkObject isReadable ifFalse:[^ self]. |
|
1172 |
]. |
|
1173 |
]. |
|
1174 |
inDropMode := true. |
|
3887 | 1175 |
! |
1176 |
||
1177 |
dropLeave:aDropContext |
|
1178 |
||
3953 | 1179 |
inDropMode ifTrue:[ |
1180 |
self dropTargetItemChangedTo:nil in:aDropContext. |
|
1181 |
inDropMode := false. |
|
1182 |
]. |
|
3887 | 1183 |
! |
1184 |
||
3953 | 1185 |
dropOver:aContext |
1186 |
"send the last time, when leaving the widget |
|
1187 |
" |
|
1188 |
|lineNr newDest destinationFile| |
|
1189 |
||
1190 |
inDropMode ifFalse:[^ self]. |
|
1191 |
||
1192 |
lineNr := self getLineNumberFor:aContext. |
|
1193 |
||
1194 |
lineNr notNil ifTrue:[ |
|
3983 | 1195 |
newDest := browserItemList at:lineNr. |
3953 | 1196 |
(newDest notNil and:[newDest isDirectory]) ifTrue:[ |
1197 |
destinationFile := newDest fileName. |
|
4014 | 1198 |
destinationFile baseName = '..' ifTrue:[ |
3953 | 1199 |
destinationFile := self directory directory. |
1200 |
] |
|
1201 |
]. |
|
1202 |
]. |
|
1203 |
newDest == draggedItem ifTrue:[^ self]. |
|
1204 |
||
1205 |
destinationFile isNil ifTrue:[ |
|
1206 |
destinationFile := self directory. |
|
1207 |
]. |
|
3887 | 1208 |
|
3953 | 1209 |
newDest ~~ draggedItem ifTrue:[ |
1210 |
aContext dropSource argument == #archivApplication ifTrue:[ |
|
1211 |
canDropItem := true. |
|
1212 |
] ifFalse:[ |
|
1213 |
canDropItem := self canDropFiles:(aContext dropObjects) for:destinationFile. |
|
1214 |
]. |
|
1215 |
]. |
|
1216 |
self dropTargetItemChangedTo:newDest in:aContext. |
|
1217 |
! |
|
1218 |
||
1219 |
dropTargetItemChangedTo:anItem in:aDropContext |
|
1220 |
||
1221 |
| current | |
|
1222 |
||
1223 |
||
1224 |
"/ (anItem notNil and:[anItem isDirectory]) ifTrue:[ self halt]. |
|
1225 |
current := draggedItem. |
|
3967 | 1226 |
"/ Transcript showCR:'current:', (current isNil ifTrue:['nil'] ifFalse:[current fileName baseName]). |
1227 |
"/ Transcript showCR:'anItem:', (anItem isNil ifTrue:['nil'] ifFalse:[anItem fileName baseName]). |
|
3953 | 1228 |
current == anItem ifTrue:[^ self]. |
1229 |
draggedItem := anItem. |
|
1230 |
||
1231 |
aDropContext contentsWillChange. |
|
1232 |
||
1233 |
current ifNotNil:[ |
|
1234 |
current isDirectory ifTrue:[ |
|
1235 |
current icon:(self getIconFor:current). |
|
1236 |
]. |
|
1237 |
]. |
|
1238 |
||
1239 |
anItem ifNotNil:[ |
|
1240 |
anItem isDirectory ifTrue:[ |
|
1241 |
anItem icon:(FileBrowser iconForKeyMatching:#directoryOpenGray). |
|
1242 |
]. |
|
1243 |
]. |
|
3983 | 1244 |
contentsBrowser shown ifTrue:[ |
1245 |
contentsBrowser invalidateVisibleRow:current colAt:iconIndex. |
|
1246 |
contentsBrowser invalidateVisibleRow:anItem colAt:iconIndex. |
|
1247 |
contentsBrowser repairDamage. |
|
3953 | 1248 |
]. |
3887 | 1249 |
! |
1250 |
||
1251 |
getDisplayObjects:anArgument |
|
1252 |
||
3983 | 1253 |
| selectedFiles string fnName stream| |
1254 |
selectedFiles := self selectedFiles. |
|
1255 |
selectedFiles isEmpty ifTrue:[ ^ '']. |
|
3887 | 1256 |
stream := WriteStream on:''. |
3983 | 1257 |
|
1258 |
stream nextPutAll:(selectedFiles first baseName). |
|
1259 |
selectedFiles size == 1 ifTrue:[ |
|
3887 | 1260 |
fnName := 'ui_menuitem.xpm'. |
1261 |
] ifFalse:[ |
|
1262 |
fnName := 'ui_submenu_open.xpm'. |
|
1263 |
stream nextPutAll:' ... '. |
|
3983 | 1264 |
stream nextPutAll:(selectedFiles last baseName). |
3887 | 1265 |
]. |
1266 |
string := stream contents. |
|
1267 |
stream close. |
|
1268 |
^ Array with:(LabelAndIcon icon:(Image fromFile:fnName) |
|
1269 |
string:(Text string:string emphasis:#bold) |
|
1270 |
) |
|
1271 |
! |
|
1272 |
||
1273 |
getDropObjects:anArgument |
|
1274 |
||
3983 | 1275 |
^ self selectedFiles collect:[:file| DropObject newFile:file]. |
3887 | 1276 |
! |
1277 |
||
1278 |
getLineNumberFor:aDropContext |
|
1279 |
| yVisible| |
|
1280 |
||
1281 |
yVisible := (aDropContext targetPoint y). |
|
3983 | 1282 |
^ contentsBrowser yVisibleToRowNr:yVisible. |
3887 | 1283 |
! ! |
1284 |
||
1285 |
!DirectoryContentsBrowser methodsFor:'event handling'! |
|
1286 |
||
1287 |
processEvent:anEvent |
|
1288 |
"filter keyboard events. |
|
1289 |
Return true, if I have eaten the event" |
|
1290 |
||
1291 |
|focusView key rawKey| |
|
1292 |
||
1293 |
anEvent isKeyPressEvent ifTrue:[ |
|
1294 |
focusView := anEvent targetView. |
|
1295 |
key := anEvent key. |
|
1296 |
rawKey := anEvent rawKey. |
|
1297 |
||
3983 | 1298 |
(focusView == contentsBrowser) ifTrue:[ |
3887 | 1299 |
"/ (key ~= #'Alt_L') ifTrue:[self halt.]. |
1300 |
key == #Paste ifTrue:[ |
|
1301 |
self pasteFiles. |
|
1302 |
^ true. |
|
1303 |
]. |
|
3983 | 1304 |
(key == #CursorLeft) ifTrue:[ |
1305 |
self doGoDirectoryUp. |
|
1306 |
^ true |
|
1307 |
]. |
|
1308 |
(key == #CursorRight) ifTrue:[ |
|
1309 |
self doBack. |
|
1310 |
^ true |
|
1311 |
]. |
|
1312 |
browserItemList size == 0 ifTrue:[ |
|
3887 | 1313 |
^ false |
1314 |
]. |
|
1315 |
key == #Copy ifTrue:[ |
|
1316 |
self doCopy. |
|
1317 |
^ true. |
|
1318 |
]. |
|
1319 |
(key == #Return) ifTrue:[ |
|
1320 |
self doOpenSelectedFile. |
|
1321 |
^ true. |
|
1322 |
]. |
|
1323 |
key == #Delete ifTrue:[ |
|
1324 |
self doDelete. |
|
1325 |
^ true. |
|
1326 |
]. |
|
1327 |
key == #Cut ifTrue:[ |
|
1328 |
self doCut. |
|
1329 |
^ true. |
|
1330 |
]. |
|
1331 |
] |
|
1332 |
]. |
|
1333 |
^ false |
|
1334 |
! ! |
|
1335 |
||
1336 |
!DirectoryContentsBrowser methodsFor:'file actions'! |
|
1337 |
||
1338 |
doCopy |
|
1339 |
"copy current selected files/directories |
|
1340 |
" |
|
1341 |
||
3983 | 1342 |
self copyFilesToClipBoard:(self selectedFiles). |
3887 | 1343 |
! |
1344 |
||
1345 |
doCut |
|
1346 |
"cut current selected files/directories |
|
1347 |
" |
|
1348 |
||
3983 | 1349 |
self cutFilesToClipBoard:(self selectedFiles). |
3887 | 1350 |
! |
1351 |
||
1352 |
doDelete |
|
1353 |
"delete current selected files/directories |
|
1354 |
" |
|
3983 | 1355 |
self deleteFiles:(self selectedFiles). |
3887 | 1356 |
! ! |
1357 |
||
1358 |
!DirectoryContentsBrowser methodsFor:'menu accessing'! |
|
1359 |
||
1360 |
viewBrowserMenu |
|
1361 |
||
1362 |
<resource: #programMenu > |
|
1363 |
||
1364 |
|menu| |
|
1365 |
||
3961 | 1366 |
viewBrowserMenu isNil ifTrue:[ |
1367 |
viewBrowserMenu := self class viewBrowserMenu. |
|
1368 |
]. |
|
1369 |
viewBrowserMenu ifNil:[ ^ nil ]. |
|
4080 | 1370 |
viewBrowserMenu findGuiResourcesIn:self. |
1371 |
||
3961 | 1372 |
menu := viewBrowserMenu. |
3887 | 1373 |
menu receiver:self. |
1374 |
^ menu |
|
1375 |
! ! |
|
1376 |
||
1377 |
!DirectoryContentsBrowser methodsFor:'menu actions'! |
|
1378 |
||
1379 |
doOpenSelectedFile |
|
1380 |
||
4017 | 1381 |
| selectedItems| |
1382 |
||
1383 |
selectedItems := self selectedItems. |
|
1384 |
(selectedItems size == 1) ifTrue:[ |
|
1385 |
self enterActionFor:(selectedItems first). |
|
3887 | 1386 |
]. |
1387 |
! |
|
1388 |
||
1389 |
doShowFileContents |
|
1390 |
||
3983 | 1391 |
| selectedFileItems| |
1392 |
||
1393 |
selectedFileItems := self selectedFileItems. |
|
1394 |
(selectedFileItems size == 1) ifTrue:[ |
|
1395 |
self openTextEditorOn:(selectedFileItems first). |
|
3887 | 1396 |
]. |
1397 |
! ! |
|
1398 |
||
1399 |
!DirectoryContentsBrowser methodsFor:'queries'! |
|
1400 |
||
1401 |
allItemsOfCurrentDirectory |
|
1402 |
||
3983 | 1403 |
| list | |
1404 |
list := browserItemList copy. |
|
1405 |
self viewDirectoriesInDirectoryContentsBrowser value ifTrue:[ |
|
1406 |
list removeIdentical:(browserItemList first) ifAbsent:[nil] |
|
1407 |
]. |
|
1408 |
^ list. |
|
3887 | 1409 |
! |
1410 |
||
1411 |
fileListIsEmpty |
|
1412 |
||
3983 | 1413 |
^ browserItemList isEmpty |
3887 | 1414 |
! |
1415 |
||
1416 |
getAllFilesAsStringCollection |
|
1417 |
|files items| |
|
1418 |
||
3983 | 1419 |
items := browserItemList. |
3887 | 1420 |
files := OrderedCollection new. |
1421 |
items isEmpty ifTrue:[ |
|
1422 |
^ files |
|
1423 |
]. |
|
1424 |
items do:[:aItem | |
|
1425 |
aItem isDirectory not ifTrue:[ |
|
1426 |
files add:aItem fileName asString |
|
1427 |
]. |
|
1428 |
]. |
|
1429 |
^ files. |
|
4004 | 1430 |
! |
1431 |
||
1432 |
hasFilesFiltered |
|
4017 | 1433 |
^ allItemsList size ~~ browserItemList size |
3983 | 1434 |
! ! |
1435 |
||
1436 |
!DirectoryContentsBrowser methodsFor:'selection'! |
|
1437 |
||
1438 |
selectAll |
|
1439 |
||
1440 |
| sel| |
|
1441 |
||
1442 |
sel := browserItemList copy. |
|
4013 | 1443 |
self viewDirectoriesInDirectoryContentsBrowser value ifTrue:[ |
1444 |
sel removeIdentical:(browserItemList first) ifAbsent:[nil] |
|
3887 | 1445 |
]. |
3983 | 1446 |
self selectionInFileList value:sel. |
3887 | 1447 |
! |
1448 |
||
4017 | 1449 |
selectCurrentFiles |
1450 |
||
1451 |
|currentSelection| |
|
1452 |
||
1453 |
((currentSelection := self currentFileNameHolder value select:[:file| file isDirectory not]) notEmpty) ifTrue:[ |
|
1454 |
self selectFiles:currentSelection. |
|
1455 |
]. |
|
1456 |
! |
|
1457 |
||
3983 | 1458 |
selectFiles:aColOfFilenames |
1459 |
| curSel newSel| |
|
1460 |
||
1461 |
curSel := self selectedFiles. |
|
1462 |
aColOfFilenames size = curSel size ifTrue:[ |
|
1463 |
| index | |
|
1464 |
index := curSel findFirst:[:file| (aColOfFilenames includes:file) not]. |
|
1465 |
index == 0 ifTrue:[ ^ self]. |
|
3887 | 1466 |
]. |
3983 | 1467 |
newSel := OrderedCollection new. |
1468 |
browserItemList do:[: item| |
|
1469 |
(aColOfFilenames includes:(item fileName)) ifTrue:[ |
|
1470 |
newSel add:item. |
|
1471 |
]. |
|
3887 | 1472 |
]. |
4017 | 1473 |
self updateToExternFileHolderLock doLocked:[ |
4071 | 1474 |
self selectionInFileList value:newSel withoutNotifying:self. |
4017 | 1475 |
]. |
3983 | 1476 |
! |
1477 |
||
1478 |
selectedFileItems |
|
1479 |
||
1480 |
| sel | |
|
1481 |
||
3985 | 1482 |
sel := self selectedItems select:[:item | item isDirectory not]. |
3987 | 1483 |
^ sel |
1484 |
! |
|
1485 |
||
1486 |
selectedFileNames |
|
1487 |
^ self selectedFileItems collect:[:item| item fileName]. |
|
3887 | 1488 |
! |
1489 |
||
3983 | 1490 |
selectedFiles |
1491 |
||
1492 |
^ self selectedItems collect:[: item| item fileName]. |
|
1493 |
! |
|
1494 |
||
1495 |
selectedItems |
|
1496 |
||
1497 |
| sel | |
|
1498 |
sel := self selectionInFileList value copy. |
|
1499 |
sel isNil ifTrue:[ ^ #()]. |
|
4017 | 1500 |
(self viewDirectoriesInDirectoryContentsBrowser value and:[browserItemList notEmpty]) ifTrue:[ |
3983 | 1501 |
sel removeIdentical:(browserItemList first) ifAbsent:[nil] |
3887 | 1502 |
]. |
4013 | 1503 |
^ sel. |
3887 | 1504 |
! ! |
1505 |
||
1506 |
!DirectoryContentsBrowser methodsFor:'startup / release'! |
|
1507 |
||
1508 |
makeDependent |
|
1509 |
||
4007 | 1510 |
super makeDependent. |
3887 | 1511 |
self currentFileNameHolder addDependent:self. |
4027 | 1512 |
self currentSortOrder addDependent:self. |
3887 | 1513 |
self viewDirectoriesInDirectoryContentsBrowser addDependent:self. |
4011 | 1514 |
self filterBlockHolder addDependent:self. |
3887 | 1515 |
self sortBlockHolder addDependent:self. |
1516 |
self viewDescription onChangeSend:#viewedColumnsChanged to:self. |
|
1517 |
self viewDetails onChangeSend:#viewedColumnsChanged to:self. |
|
1518 |
self viewGroup onChangeSend:#viewedColumnsChanged to:self. |
|
1519 |
self viewOwner onChangeSend:#viewedColumnsChanged to:self. |
|
1520 |
self viewPermissions onChangeSend:#viewedColumnsChanged to:self. |
|
1521 |
self viewPreview onChangeSend:#viewedColumnsChanged to:self. |
|
1522 |
self viewSize onChangeSend:#viewedColumnsChanged to:self. |
|
1523 |
self viewTime onChangeSend:#viewedColumnsChanged to:self. |
|
1524 |
self viewType onChangeSend:#viewedColumnsChanged to:self. |
|
1525 |
! |
|
1526 |
||
1527 |
postBuildBrowser:aWidget |
|
1528 |
||
3983 | 1529 |
contentsBrowser := aWidget scrolledView. |
1530 |
contentsBrowser wantsFocusWithPointerEnter. |
|
3887 | 1531 |
"/ dont register icons anymore |
1532 |
"/ FileBrowser icons keysAndValuesDo:[:aKey :anIcon| |
|
1533 |
"/ browser registerImage:anIcon key:aKey. |
|
1534 |
"/ ]. |
|
1535 |
self columnDescriptors:(self class tableColumns). |
|
1536 |
! |
|
1537 |
||
1538 |
postBuildWith:aBuilder |
|
4071 | 1539 |
^ super postBuildWith:aBuilder. |
1540 |
! |
|
1541 |
||
1542 |
postOpen |
|
1543 |
||
1544 |
self startUpdateContentsTask. |
|
1545 |
self abstractCurrentFileNameHolderChanged. |
|
1546 |
self matchBlock:self filterBlockHolder value. |
|
1547 |
self currentFileNameHolderChanged. |
|
3887 | 1548 |
self viewedColumnsChanged. |
4071 | 1549 |
self windowGroup addPreEventHook:self. |
3887 | 1550 |
! |
1551 |
||
1552 |
postOpenAsSubcanvasWith:aBuilder |
|
1553 |
||
4071 | 1554 |
super postOpenAsSubcanvasWith:aBuilder. |
1555 |
||
1556 |
self postOpen. |
|
3887 | 1557 |
! |
1558 |
||
1559 |
postOpenWith:aBuilder |
|
1560 |
||
1561 |
" |
|
1562 |
only invoked if the application not started from a master |
|
1563 |
" |
|
4071 | 1564 |
super postOpenWith:aBuilder. |
1565 |
self postOpen. |
|
3887 | 1566 |
! |
1567 |
||
1568 |
preBuildWith:aBuilder |
|
1569 |
||
1570 |
self masterApplication isNil ifTrue:[ |
|
1571 |
self masterApplication:nil. |
|
1572 |
]. |
|
1573 |
^ super preBuildWith:aBuilder. |
|
1574 |
! |
|
1575 |
||
1576 |
release |
|
1577 |
"release my resources |
|
1578 |
" |
|
1579 |
self updateColumnsTaskStop. |
|
4017 | 1580 |
updateContentsTask stop. |
3887 | 1581 |
super release. |
1582 |
! |
|
1583 |
||
1584 |
releaseAsSubCanvas |
|
1585 |
||
1586 |
self updateColumnsTaskStop. |
|
4072 | 1587 |
updateContentsTask stop. |
3887 | 1588 |
^ super releaseAsSubCanvas. |
4071 | 1589 |
! |
1590 |
||
1591 |
startUpdateContentsTask |
|
1592 |
updateContentsTask isNil ifTrue:[ |
|
1593 |
updateContentsTask := DirectoryContentsUpdateTask new startWith:self. |
|
1594 |
]. |
|
3887 | 1595 |
! ! |
1596 |
||
1597 |
!DirectoryContentsBrowser methodsFor:'task update columns'! |
|
1598 |
||
4017 | 1599 |
findNextItemFor:aBlock |
1600 |
||
1601 |
^ allItemsList detect:aBlock ifNone:[nil]. |
|
1602 |
! |
|
1603 |
||
1604 |
findNextVisibleItemFor:aConditionBlock |
|
3983 | 1605 |
|vis idx stillSearching | |
1606 |
||
1607 |
vis := contentsBrowser indexOfFirstRowShown. |
|
3887 | 1608 |
vis = 0 ifTrue:[vis := 1]. |
3983 | 1609 |
|
1610 |
idx := vis. |
|
1611 |
stillSearching := true. |
|
1612 |
[ stillSearching ] whileTrue:[ |
|
1613 |
((idx <= browserItemList size) and:[ (contentsBrowser isRowVisible:idx) ]) ifFalse:[ |
|
1614 |
stillSearching := false. |
|
1615 |
idx := nil. |
|
1616 |
] ifTrue:[ |
|
1617 |
(aConditionBlock value:(browserItemList at:idx)) ifTrue:[ |
|
1618 |
"/ found a one |
|
1619 |
stillSearching := false. |
|
1620 |
] ifFalse:[ |
|
1621 |
idx := idx + 1. |
|
1622 |
] |
|
1623 |
]. |
|
3887 | 1624 |
]. |
3983 | 1625 |
idx isNil ifTrue:[^ nil]. |
1626 |
^ browserItemList at:idx ifAbsent:nil |
|
3887 | 1627 |
! |
1628 |
||
1629 |
getFileInfoFor:aItem |
|
1630 |
||
1631 |
| type| |
|
1632 |
||
1633 |
type := aItem fileName fileType. |
|
1634 |
aItem fileType:type. |
|
1635 |
^ type |
|
1636 |
! |
|
1637 |
||
1638 |
getIconFor:aItem |
|
1639 |
||
1640 |
| key icon| |
|
3906 | 1641 |
|
3887 | 1642 |
key := aItem iconKey. |
1643 |
icon := FileBrowser iconForKeyMatching:key. |
|
3906 | 1644 |
aItem isRemoteDirectory ifTrue:[ |
1645 |
^ icon "/ do not query attributes |
|
1646 |
]. |
|
3887 | 1647 |
^ FileBrowser addOnIconsFor:(aItem fileName) to:icon. |
1648 |
! |
|
1649 |
||
1650 |
getIconForMimeTypeByContents:aItem |
|
1651 |
||
1652 |
| currentIcon newIcon icon| |
|
1653 |
newIcon := FileBrowser iconForKeyMatching:(aItem mimeTypeForContents). |
|
1654 |
currentIcon := aItem icon. |
|
1655 |
(currentIcon class == MultiImage) ifTrue:[ |
|
1656 |
| images | |
|
1657 |
images := currentIcon images. |
|
1658 |
images removeFirst. |
|
1659 |
images addFirst:newIcon. |
|
1660 |
icon := currentIcon. |
|
1661 |
] ifFalse:[ |
|
1662 |
icon := newIcon. |
|
1663 |
]. |
|
1664 |
^ icon |
|
1665 |
! |
|
1666 |
||
1667 |
getPreviewFor:aItem |
|
1668 |
||
1669 |
| column icon| |
|
1670 |
||
3983 | 1671 |
column := contentsBrowser columnAt:previewIndex. |
3887 | 1672 |
column isNil ifTrue:[ |
1673 |
previewIndex := 0. |
|
1674 |
] ifFalse:[ |
|
1675 |
(aItem hasMimeType and:[aItem mimeType isImage]) ifTrue:[ |
|
1676 |
Exception handle:[:ex| |
|
1677 |
icon := nil. |
|
1678 |
] do:[ |scale extent w h | |
|
3983 | 1679 |
icon := Image fromFile:(aItem fileName pathName). |
3887 | 1680 |
icon notNil ifTrue:[ |
1681 |
extent := icon extent. |
|
1682 |
w := column width - 4. |
|
1683 |
h := column height. |
|
1684 |
||
1685 |
(extent x > w or:[extent y > h]) ifTrue:[ |
|
1686 |
scale := extent / (w@h). |
|
1687 |
scale := scale x max:(scale y). |
|
1688 |
icon := icon magnifiedTo:((extent / scale max:8.0) asInteger). |
|
1689 |
]. |
|
3983 | 1690 |
icon := icon onDevice:(contentsBrowser device). |
3887 | 1691 |
icon clearMaskedPixels. |
1692 |
] |
|
1693 |
] |
|
1694 |
] ifFalse:[ icon := nil]. |
|
1695 |
aItem preview:(icon ? ''). |
|
1696 |
]. |
|
1697 |
^ icon |
|
1698 |
! |
|
1699 |
||
1700 |
updateChangesFor:aItem |
|
1701 |
||
3983 | 1702 |
aItem resetItemForChanges. |
3887 | 1703 |
! |
1704 |
||
1705 |
updateColumnsTaskCycle |
|
1706 |
||
1707 |
" update items in the foolowing order |
|
1708 |
- update item if item properties are changed |
|
1709 |
- update icon for visible items by suffix |
|
1710 |
- update icon for visible items by contents |
|
1711 |
- update file info for visible items if file info column is shown |
|
1712 |
- update preview for visible items if preview column is shown |
|
1713 |
||
1714 |
- update icon for invisible items by suffix |
|
1715 |
- update icon for invisible items by contents |
|
1716 |
- update file info for invisible items if file info column is shown |
|
1717 |
- update preview for invisible items if preview column is shown |
|
1718 |
- update file info for invisible items if file info column is not shown |
|
1719 |
" |
|
1720 |
||
1721 |
|desc icon type preview| |
|
1722 |
||
4017 | 1723 |
browserItemList notEmpty ifTrue:[ |
3887 | 1724 |
"/ update item if item properties are changed |
4017 | 1725 |
desc := self findNextVisibleItemFor:[:n| n hasBeenModified ]. |
3887 | 1726 |
|
1727 |
desc notNil ifTrue:[ |
|
4073 | 1728 |
self updateChangesFor:desc. |
3983 | 1729 |
contentsBrowser invalidateVisibleRow:desc. |
3887 | 1730 |
^ true. |
1731 |
]. |
|
1732 |
"/ update icon for visible items by suffix |
|
4017 | 1733 |
desc := self findNextVisibleItemFor:[:n| n icon isNil ]. |
3967 | 1734 |
desc notNil ifTrue:[ |
3887 | 1735 |
icon := self getIconFor:desc. |
1736 |
desc icon:icon. |
|
1737 |
(icon notNil and:[iconIndex ~~ 0]) ifTrue:[ |
|
3983 | 1738 |
contentsBrowser invalidateVisibleRow:desc colAt:iconIndex |
3887 | 1739 |
]. |
1740 |
^ true |
|
1741 |
]. |
|
1742 |
"/ update icon for visible items by contents |
|
4017 | 1743 |
desc := self findNextVisibleItemFor:[:n| |
3967 | 1744 |
(n iconKey == #file |
1745 |
and:[n mimeTypeForContents asSymbol ~= #unknown]) |
|
1746 |
]. |
|
1747 |
desc notNil ifTrue:[ |
|
1748 |
icon := self getIconForMimeTypeByContents:desc. |
|
1749 |
desc icon:icon. |
|
1750 |
(icon notNil and:[iconIndex ~~ 0]) ifTrue:[ |
|
3983 | 1751 |
contentsBrowser invalidateVisibleRow:desc colAt:iconIndex |
3967 | 1752 |
]. |
1753 |
^ true |
|
1754 |
]. |
|
3887 | 1755 |
"/ update file info for visible items if file info column is shown |
1756 |
fileDescriptionIndex ~~ 0 ifTrue:[ |
|
4017 | 1757 |
desc := self findNextVisibleItemFor:[:n| n fileType isNil ]. |
3887 | 1758 |
desc notNil ifTrue:[ |
1759 |
type := self getFileInfoFor:desc. |
|
3983 | 1760 |
type notNil ifTrue:[contentsBrowser invalidateVisibleRow:desc colAt:fileDescriptionIndex]. |
3887 | 1761 |
^ true |
1762 |
] |
|
1763 |
]. |
|
1764 |
"/ update preview for visible items if preview column is shown |
|
1765 |
previewIndex ~~ 0 ifTrue:[ |
|
4017 | 1766 |
desc := self findNextVisibleItemFor:[:n| n preview isNil ]. |
3887 | 1767 |
desc notNil ifTrue:[ |
1768 |
preview := self getPreviewFor:desc. |
|
1769 |
preview notNil ifTrue:[ |
|
3983 | 1770 |
contentsBrowser invalidateVisibleRow:desc colAt:previewIndex |
3887 | 1771 |
]. |
1772 |
^ true |
|
1773 |
] |
|
1774 |
]. |
|
1775 |
]. |
|
1776 |
||
1777 |
"/ may we want to see the other items later make this items to |
|
1778 |
allItemsList notEmpty ifTrue:[ |
|
1779 |
"/ update icon for invisible items by suffix |
|
1780 |
desc := self findNextItemFor:[:n| n icon isNil ]. |
|
1781 |
desc notNil ifTrue:[ |
|
1782 |
icon := self getIconFor:desc. |
|
1783 |
desc icon:icon. |
|
1784 |
^ true |
|
1785 |
]. |
|
1786 |
"/ update icon for invisible items by contents |
|
1787 |
desc := self findNextItemFor:[:n| (n iconKey == #file and:[n mimeTypeForContents ~= #unknown])]. |
|
1788 |
desc notNil ifTrue:[ |
|
1789 |
icon := self getIconForMimeTypeByContents:desc. |
|
1790 |
desc icon:icon. |
|
1791 |
^ true |
|
1792 |
]. |
|
1793 |
"/ update file info for invisible items if file info column is shown |
|
1794 |
fileDescriptionIndex ~~ 0 ifTrue:[ |
|
1795 |
desc := self findNextItemFor:[:n| n fileType isNil ]. |
|
1796 |
desc notNil ifTrue:[ |
|
1797 |
self getFileInfoFor:desc. |
|
1798 |
^ true |
|
1799 |
]. |
|
1800 |
]. |
|
1801 |
"/ update preview for invisible items if preview column is shown |
|
1802 |
previewIndex ~~ 0 ifTrue:[ |
|
1803 |
desc := self findNextItemFor:[:n| n preview isNil ]. |
|
1804 |
desc notNil ifTrue:[ |
|
1805 |
self getPreviewFor:desc. |
|
1806 |
^ true |
|
1807 |
]. |
|
1808 |
]. |
|
1809 |
"/ update file info for invisible items if file info column is not shown |
|
1810 |
desc := self findNextItemFor:[:n| n fileType isNil ]. |
|
1811 |
desc notNil ifTrue:[ |
|
1812 |
self getFileInfoFor:desc. |
|
1813 |
^ true |
|
1814 |
]. |
|
1815 |
]. |
|
1816 |
^ false |
|
1817 |
! |
|
1818 |
||
1819 |
updateColumnsTaskStart |
|
1820 |
||
4017 | 1821 |
| somethigToDo process| |
1822 |
||
3887 | 1823 |
self directory notNil ifTrue:[ |
4017 | 1824 |
process := [ |
3887 | 1825 |
[ |
1826 |
[true] whileTrue:[ |
|
1827 |
somethigToDo := false. |
|
4017 | 1828 |
(self directory notNil) ifTrue:[ |
3887 | 1829 |
somethigToDo := self updateColumnsTaskCycle. |
1830 |
Processor yield. |
|
1831 |
]. |
|
1832 |
somethigToDo ifFalse:[ |
|
1833 |
Delay waitForSeconds:1.0 |
|
4017 | 1834 |
]. |
3887 | 1835 |
] |
1836 |
] valueNowOrOnUnwindDo:[ |
|
1837 |
self updateColumnsTask:nil. |
|
1838 |
] |
|
1839 |
] newProcess. |
|
3983 | 1840 |
"/ p priority:(Processor systemBackgroundPriority). |
4017 | 1841 |
process priorityRange:(Processor userBackgroundPriority to:Processor activePriority). |
1842 |
||
1843 |
self updateColumnsTask: process. |
|
3887 | 1844 |
self updateColumnsTask name:('DirectoryContentsBrowser update columns[', self directory baseName, ']'). |
1845 |
self updateColumnsTask resume. |
|
1846 |
] |
|
1847 |
! |
|
1848 |
||
1849 |
updateColumnsTaskStop |
|
1850 |
|task| |
|
1851 |
||
1852 |
(task := self updateColumnsTask) notNil ifTrue:[ |
|
1853 |
self updateColumnsTask:nil. |
|
1854 |
||
1855 |
Object errorSignal handle:[:ex| |
|
1856 |
Dialog warn:ex description. |
|
1857 |
]do:[ |
|
1858 |
task isDead ifFalse:[ |
|
3919 | 1859 |
task terminateWithAllSubprocessesInGroup. |
3887 | 1860 |
task waitUntilTerminated. |
1861 |
] |
|
1862 |
] |
|
1863 |
]. |
|
1864 |
! ! |
|
1865 |
||
1866 |
!DirectoryContentsBrowser::DirectoryContentsItem class methodsFor:'instance creation'! |
|
1867 |
||
3983 | 1868 |
fileName:aFilename |
1869 |
||
3999
10b79980664c
get an item from dirContents
Claus Gittinger <cg@exept.de>
parents:
3996
diff
changeset
|
1870 |
| instance fileItem| |
3983 | 1871 |
instance := self new. |
1872 |
aFilename asString = '..' ifTrue:[ |
|
1873 |
instance fileName:aFilename. |
|
1874 |
^ instance. |
|
1875 |
]. |
|
3999
10b79980664c
get an item from dirContents
Claus Gittinger <cg@exept.de>
parents:
3996
diff
changeset
|
1876 |
fileItem := DirectoryContents contentsItemForFileName:aFilename. |
10b79980664c
get an item from dirContents
Claus Gittinger <cg@exept.de>
parents:
3996
diff
changeset
|
1877 |
fileItem notNil ifTrue:[^ self forInfoItem:fileItem]. |
3983 | 1878 |
^ nil |
3999
10b79980664c
get an item from dirContents
Claus Gittinger <cg@exept.de>
parents:
3996
diff
changeset
|
1879 |
|
10b79980664c
get an item from dirContents
Claus Gittinger <cg@exept.de>
parents:
3996
diff
changeset
|
1880 |
" |
10b79980664c
get an item from dirContents
Claus Gittinger <cg@exept.de>
parents:
3996
diff
changeset
|
1881 |
DirectoryContentsItem fileName:'..' |
10b79980664c
get an item from dirContents
Claus Gittinger <cg@exept.de>
parents:
3996
diff
changeset
|
1882 |
" |
3983 | 1883 |
! |
1884 |
||
1885 |
forInfoItem:anItem |
|
3887 | 1886 |
| instance | |
1887 |
instance := self new. |
|
3983 | 1888 |
instance fileName:anItem fileName. |
1889 |
anItem isRemoteDirectory ifTrue:[ |
|
1890 |
instance beRemoteDirectory. |
|
1891 |
] ifFalse:[ |
|
1892 |
instance fileInfo:anItem info. |
|
1893 |
]. |
|
3906 | 1894 |
^ instance |
3887 | 1895 |
! ! |
1896 |
||
1897 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'accessing'! |
|
1898 |
||
3983 | 1899 |
fileInfo:something |
1900 |
"set the value of the instance variable 'fileInfo' (automatically generated)" |
|
1901 |
||
1902 |
fileInfo := something. |
|
1903 |
! |
|
1904 |
||
3887 | 1905 |
fileName |
1906 |
"returns the fileName |
|
1907 |
" |
|
1908 |
^ fileName |
|
4023 | 1909 |
|
1910 |
||
3887 | 1911 |
! |
1912 |
||
1913 |
fileName:aFilename |
|
1914 |
"set fileName for instance |
|
1915 |
" |
|
4101 | 1916 |
fileName := aFilename asFilename. |
3887 | 1917 |
! |
1918 |
||
1919 |
fileType |
|
1920 |
"returns the type of the file |
|
1921 |
" |
|
1922 |
||
1923 |
^ fileType |
|
1924 |
! |
|
1925 |
||
1926 |
fileType:aType |
|
1927 |
"returns the type of the file |
|
1928 |
" |
|
1929 |
||
1930 |
fileType := aType. |
|
1931 |
! |
|
1932 |
||
1933 |
icon |
|
1934 |
"returns the icon assigned to the file |
|
1935 |
" |
|
1936 |
^ icon |
|
1937 |
||
1938 |
||
1939 |
! |
|
1940 |
||
1941 |
icon:anIcon |
|
1942 |
||
1943 |
icon := anIcon. |
|
1944 |
! |
|
1945 |
||
1946 |
iconKey |
|
1947 |
"return the value of the instance variable 'iconKey' (automatically generated)" |
|
1948 |
||
1949 |
iconKey isNil ifTrue:[ |
|
3906 | 1950 |
self isRemoteDirectory ifTrue:[ |
1951 |
iconKey := FileBrowser iconKeyForRemoteDirectory:fileName. |
|
1952 |
] ifFalse:[ |
|
1953 |
iconKey := FileBrowser iconKeyForFile:fileName. |
|
1954 |
] |
|
3887 | 1955 |
]. |
1956 |
^ iconKey |
|
1957 |
! |
|
1958 |
||
1959 |
isDirectory |
|
3967 | 1960 |
self isRemoteDirectory ifTrue:[^ true]. |
1961 |
||
1962 |
self getFileInfo. |
|
1963 |
fileInfo isNil ifTrue:[^ false]. |
|
1964 |
^ fileInfo isDirectory |
|
1965 |
! |
|
3887 | 1966 |
|
3967 | 1967 |
isSymbolicLink |
1968 |
self isRemoteDirectory ifTrue:[^ false]. |
|
1969 |
||
1970 |
self getFileInfo. |
|
1971 |
fileInfo isNil ifTrue:[^ false]. |
|
1972 |
^ fileInfo isSymbolicLink |
|
3887 | 1973 |
! |
1974 |
||
1975 |
lastButOneSuffix |
|
1976 |
"returns the suffix of the file |
|
1977 |
" |
|
1978 |
||
1979 |
^ self suffixes at:2 |
|
1980 |
! |
|
1981 |
||
1982 |
lastSuffix |
|
1983 |
"returns the suffix of the file |
|
1984 |
" |
|
1985 |
||
1986 |
^ self suffixes at:1 |
|
1987 |
! |
|
1988 |
||
1989 |
mimeType |
|
1990 |
"return the value of the instance variable 'mimeType' (automatically generated)" |
|
1991 |
||
1992 |
mimeType isNil ifTrue:[ |
|
1993 |
mimeType := MIMETypes mimeTypeForFilename:(self fileName). |
|
1994 |
mimeType isNil ifTrue:[ |
|
1995 |
mimeType := #unknown |
|
1996 |
] |
|
1997 |
]. |
|
1998 |
^ mimeType |
|
1999 |
! |
|
2000 |
||
2001 |
preview |
|
2002 |
||
2003 |
^ preview |
|
2004 |
! |
|
2005 |
||
2006 |
preview:aLabel |
|
2007 |
||
2008 |
preview := aLabel. |
|
2009 |
! |
|
2010 |
||
2011 |
suffix |
|
2012 |
"returns the suffix of the file |
|
2013 |
" |
|
4017 | 2014 |
self isDirectory ifTrue:[^'']. |
3887 | 2015 |
suffix isNil ifTrue:[ |
2016 |
(OperatingSystem isUNIXlike and:[(self baseName at:1) == $.]) ifTrue:[ |
|
2017 |
suffix := ''. |
|
2018 |
] ifFalse:[ |
|
2019 |
suffix := fileName suffix. |
|
2020 |
] |
|
2021 |
]. |
|
2022 |
^ suffix |
|
2023 |
! |
|
2024 |
||
2025 |
suffixes |
|
2026 |
||
2027 |
| lastSuff lastButOneSuff| |
|
2028 |
||
3967 | 2029 |
(fileName name occurrencesOf:$.) <= 1 ifTrue:[ |
2030 |
^ Array with:(self suffix) with:nil. |
|
2031 |
]. |
|
2032 |
(fileName baseName occurrencesOf:$.) <= 1 ifTrue:[ |
|
2033 |
^ Array with:(self suffix) with:nil. |
|
2034 |
]. |
|
3887 | 2035 |
|
3967 | 2036 |
((lastSuff := self suffix) isEmpty) ifTrue:[ |
2037 |
lastSuff := nil. |
|
2038 |
] ifFalse:[ |
|
2039 |
lastSuff := lastSuff asLowercase. |
|
2040 |
]. |
|
2041 |
||
2042 |
((lastButOneSuff := fileName withoutSuffix suffix) isEmpty) ifTrue:[ |
|
2043 |
lastButOneSuff := nil. |
|
2044 |
] ifFalse:[ |
|
2045 |
lastButOneSuff := lastButOneSuff asLowercase. |
|
2046 |
]. |
|
2047 |
||
2048 |
(lastSuff notNil and:[lastButOneSuff notNil]) ifTrue:[ |
|
2049 |
(lastSuff = 'bak' or:[lastSuff = 'sav']) ifTrue:[ |
|
2050 |
lastSuff := lastButOneSuff. |
|
3887 | 2051 |
lastButOneSuff := nil. |
3967 | 2052 |
] |
3887 | 2053 |
]. |
3967 | 2054 |
^ Array with:lastSuff with:lastButOneSuff |
3887 | 2055 |
! |
2056 |
||
2057 |
type |
|
2058 |
"returns the type of the file |
|
2059 |
" |
|
2060 |
^ self valueAt:#type |
|
2061 |
||
2062 |
! ! |
|
2063 |
||
2064 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'actions'! |
|
2065 |
||
2066 |
resetImageFile |
|
2067 |
||
2068 |
" if the image preview extent is changed the icon will set to nil to force the update task to reload the image " |
|
2069 |
||
2070 |
(mimeType notNil and:[ mimeType isImage]) ifTrue:[ |
|
2071 |
preview := nil |
|
2072 |
] |
|
2073 |
! |
|
2074 |
||
3983 | 2075 |
resetItemForChanges |
3887 | 2076 |
|
2077 |
" dont know what someone else is doing with the file - read all item properties new " |
|
2078 |
fileInfo := nil. |
|
2079 |
icon := nil. |
|
2080 |
fileType := nil. |
|
2081 |
preview := nil. |
|
2082 |
owner := nil. |
|
2083 |
group := nil. |
|
4073 | 2084 |
iconKey := nil. |
2085 |
mimeTypeForContents := nil. |
|
2086 |
mimeType := nil. |
|
3887 | 2087 |
! ! |
2088 |
||
2089 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'change queries'! |
|
2090 |
||
3967 | 2091 |
hasBeenModified |
3887 | 2092 |
|
2093 |
"check if item modification time is changed |
|
2094 |
" |
|
2095 |
| time info| |
|
2096 |
||
3906 | 2097 |
self isRemoteDirectory ifTrue:[^ false]. |
2098 |
||
3967 | 2099 |
info := fileName info. |
3887 | 2100 |
info isNil ifTrue:[ ^ false]. |
3962
3906b10c42fd
modified -> modificationTime
Claus Gittinger <cg@exept.de>
parents:
3961
diff
changeset
|
2101 |
time := info modificationTime. |
3967 | 2102 |
|
3887 | 2103 |
contentsBrowserChangeModificationTime isNil ifTrue:[ |
2104 |
contentsBrowserChangeModificationTime := time. |
|
3967 | 2105 |
fileInfo := nil. |
3887 | 2106 |
^ false. |
2107 |
]. |
|
2108 |
((contentsBrowserChangeModificationTime = time) not) ifTrue:[ |
|
2109 |
contentsBrowserChangeModificationTime := time. |
|
3967 | 2110 |
fileInfo := nil. |
3887 | 2111 |
^ true |
2112 |
]. |
|
2113 |
^ false |
|
2114 |
! ! |
|
2115 |
||
2116 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'compare'! |
|
2117 |
||
2118 |
= aItem |
|
2119 |
||
2120 |
"/ Transcript showCR:(aItem species == self species). |
|
2121 |
aItem species == self species ifFalse:[ ^ false]. |
|
2122 |
aItem isNil ifTrue:[ ^ false]. |
|
2123 |
^ (self fileName = aItem fileName) |
|
2124 |
! |
|
2125 |
||
2126 |
hash |
|
2127 |
^ fileName hash |
|
2128 |
! ! |
|
2129 |
||
2130 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'presentation'! |
|
2131 |
||
2132 |
baseName |
|
2133 |
"returns the baseName of the file |
|
2134 |
" |
|
3967 | 2135 |
^ fileName baseName. |
3887 | 2136 |
! |
2137 |
||
2138 |
baseNameWithOutSuffix |
|
2139 |
"returns the baseName of the file |
|
2140 |
" |
|
2141 |
| baseNameWithOutSuff | |
|
2142 |
||
4017 | 2143 |
self isDirectory ifTrue:[^ self baseName]. |
3887 | 2144 |
baseNameWithOutSuff := self baseName asFilename withoutSuffix asString. |
4017 | 2145 |
(baseNameWithOutSuff isEmpty or:[baseNameWithOutSuff = '.']) ifTrue:[ |
3887 | 2146 |
^ self baseName |
2147 |
]. |
|
2148 |
^ baseNameWithOutSuff. |
|
2149 |
! |
|
2150 |
||
2151 |
date |
|
3967 | 2152 |
"returns the modTimeString |
3887 | 2153 |
" |
2154 |
| modTime | |
|
2155 |
||
3967 | 2156 |
modTime := self modificationTime. |
2157 |
modTime isNil ifTrue:[ |
|
2158 |
^ '???' |
|
3887 | 2159 |
]. |
3967 | 2160 |
^ modTime asDate printString. |
3887 | 2161 |
! |
2162 |
||
2163 |
fileInfoString |
|
2164 |
"get stat info on selected file - return a string which can be |
|
2165 |
shown in a box" |
|
2166 |
||
2167 |
| afileType | |
|
2168 |
||
2169 |
fileName isNil ifTrue:[^ nil]. |
|
2170 |
afileType := self fileType. |
|
2171 |
afileType isNil ifTrue:[ |
|
2172 |
^ ''. |
|
2173 |
]. |
|
2174 |
^ afileType |
|
2175 |
! |
|
2176 |
||
3967 | 2177 |
fileSize |
2178 |
"returns the fileSize |
|
2179 |
" |
|
2180 |
self getFileInfo. |
|
2181 |
fileInfo isNil ifTrue:[^ nil]. |
|
2182 |
||
2183 |
^ fileInfo fileSize |
|
2184 |
! |
|
2185 |
||
3887 | 2186 |
group |
2187 |
"returns the printable group |
|
2188 |
" |
|
2189 |
|gid| |
|
2190 |
||
2191 |
group isNil ifTrue:[ |
|
3967 | 2192 |
self getFileInfo. |
2193 |
fileInfo isNil ifTrue:[^ '???']. |
|
2194 |
||
2195 |
gid := fileInfo gid. |
|
2196 |
(LastGIDToGroupNameMapping notNil and:[gid == LastGIDToGroupNameMapping key]) ifTrue:[ |
|
2197 |
group := LastGIDToGroupNameMapping value |
|
2198 |
] ifFalse:[ |
|
2199 |
group := OperatingSystem getGroupNameFromID:gid. |
|
2200 |
LastGIDToGroupNameMapping := gid -> group. |
|
2201 |
] |
|
3887 | 2202 |
]. |
2203 |
^ group |
|
2204 |
! |
|
2205 |
||
2206 |
modificationTime |
|
2207 |
"returns the absolute time of modification |
|
2208 |
" |
|
3967 | 2209 |
self getFileInfo. |
2210 |
fileInfo isNil ifTrue:[^ nil]. |
|
2211 |
||
2212 |
^ fileInfo modificationTime |
|
3887 | 2213 |
! |
2214 |
||
2215 |
owner |
|
2216 |
"returns the printable owner |
|
2217 |
" |
|
2218 |
|uid| |
|
2219 |
||
2220 |
owner isNil ifTrue:[ |
|
3967 | 2221 |
self getFileInfo. |
2222 |
fileInfo isNil ifTrue:[^ '???']. |
|
2223 |
||
2224 |
uid := fileInfo uid. |
|
2225 |
(LastUIDToUserNameMapping notNil and:[uid == LastUIDToUserNameMapping key]) ifTrue:[ |
|
2226 |
owner := LastUIDToUserNameMapping value |
|
2227 |
] ifFalse:[ |
|
2228 |
owner := OperatingSystem getUserNameFromID:uid. |
|
2229 |
LastUIDToUserNameMapping := uid -> owner. |
|
2230 |
] |
|
3887 | 2231 |
]. |
2232 |
^ owner |
|
2233 |
! |
|
2234 |
||
2235 |
permissions |
|
2236 |
"returns the permissions as printable string |
|
2237 |
" |
|
3967 | 2238 |
|mode permissionString| |
3887 | 2239 |
|
3967 | 2240 |
self getFileInfo. |
2241 |
fileInfo isNil ifTrue:[^ '???'.]. |
|
3887 | 2242 |
|
3967 | 2243 |
mode := fileInfo mode. |
2244 |
permissionString := String new:9 withAll:$-. |
|
2245 |
||
2246 |
1 to:9 by:3 do:[:i| |
|
2247 |
(mode bitAt:i ) == 1 ifTrue:[permissionString at:10 - i put:$x]. |
|
2248 |
(mode bitAt:i + 1) == 1 ifTrue:[permissionString at:9 - i put:$w]. |
|
2249 |
(mode bitAt:i + 2) == 1 ifTrue:[permissionString at:8 - i put:$r]. |
|
3887 | 2250 |
]. |
3967 | 2251 |
^ permissionString |
3887 | 2252 |
! |
2253 |
||
2254 |
printString |
|
3983 | 2255 |
|
2256 |
^ 'a DirectoryContentsItem [', fileName asString, ']' |
|
3887 | 2257 |
! |
2258 |
||
2259 |
sizeString |
|
2260 |
"returns the size of the file |
|
2261 |
" |
|
2262 |
| unitString n locSize| |
|
2263 |
||
3967 | 2264 |
unitString := ''. |
2265 |
locSize := self fileSize. |
|
2266 |
locSize isNil ifTrue:[^ '???']. |
|
2267 |
||
2268 |
locSize < (500 * 1024) ifTrue:[ |
|
2269 |
locSize < 1024 ifTrue:[ |
|
2270 |
n := locSize |
|
3887 | 2271 |
] ifFalse:[ |
3967 | 2272 |
n := (locSize * 10 // 1024 / 10.0). |
2273 |
unitString := ' Kb' |
|
2274 |
] |
|
2275 |
] ifFalse:[ |
|
2276 |
n := (locSize * 10 // 1024 // 1024 / 10.0). |
|
2277 |
unitString := ' Mb' |
|
3887 | 2278 |
]. |
3967 | 2279 |
^ (n printStringLeftPaddedTo:5) , unitString. |
3887 | 2280 |
! |
2281 |
||
2282 |
timeAndDate |
|
2283 |
"returns the date |
|
2284 |
" |
|
3967 | 2285 |
|modTime| |
3887 | 2286 |
|
3967 | 2287 |
modTime := self modificationTime. |
2288 |
modTime isNil ifTrue:[ |
|
2289 |
^ '???' |
|
3887 | 2290 |
]. |
3967 | 2291 |
Smalltalk languageTerritory == #us ifTrue:[ |
2292 |
^ modTime printStringFormat:'%(ShortMonthName), %(dayPadded) %(yearOrTime)'. |
|
2293 |
]. |
|
2294 |
^ modTime printStringFormat:'%(day)-%(ShortMonthName) %(yearOrTime)'. |
|
2295 |
||
2296 |
"/ ^ modTime printStringFormat:'%(year)-%(mon)-%(day) %h:%m:%s'. |
|
3887 | 2297 |
! ! |
2298 |
||
2299 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'private'! |
|
2300 |
||
3967 | 2301 |
getFileInfo |
3887 | 2302 |
fileInfo isNil ifTrue:[ |
3906 | 2303 |
self isRemoteDirectory ifTrue:[ |
2304 |
"/ do not access, to avoid automount |
|
3887 | 2305 |
] ifFalse:[ |
3967 | 2306 |
fileInfo := fileName linkInfo. |
2307 |
fileInfo isNil ifTrue:[ |
|
2308 |
fileInfo := fileName info. |
|
3906 | 2309 |
]. |
3967 | 2310 |
]. |
2311 |
]. |
|
2312 |
^ fileInfo |
|
3887 | 2313 |
! ! |
2314 |
||
2315 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'queries'! |
|
2316 |
||
3906 | 2317 |
beRemoteDirectory |
2318 |
fileType := #remoteDirectory. |
|
2319 |
! |
|
2320 |
||
3887 | 2321 |
exists |
2322 |
"returns the fileName |
|
2323 |
" |
|
2324 |
^ fileName exists |
|
2325 |
! |
|
2326 |
||
2327 |
hasMimeType |
|
2328 |
||
2329 |
^ (self mimeType ~= #unknown) |
|
2330 |
! |
|
2331 |
||
3906 | 2332 |
isRemoteDirectory |
2333 |
^ fileType == #remoteDirectory |
|
2334 |
! |
|
2335 |
||
3887 | 2336 |
mimeTypeForContents |
2337 |
||
2338 |
mimeTypeForContents isNil ifTrue:[ |
|
2339 |
mimeTypeForContents := MIMETypes mimeTypeOfContents:(self fileName). |
|
2340 |
mimeTypeForContents isNil ifTrue:[ |
|
2341 |
mimeTypeForContents := #unknown |
|
2342 |
] ifFalse:[ |
|
2343 |
" set mimeType to mimeType of contents if a better mimeType is found " |
|
2344 |
mimeType := mimeTypeForContents. |
|
2345 |
iconKey := mimeTypeForContents. |
|
2346 |
] |
|
2347 |
]. |
|
2348 |
^ mimeTypeForContents |
|
2349 |
! ! |
|
2350 |
||
4017 | 2351 |
!DirectoryContentsBrowser::DirectoryContentsUpdateTask class methodsFor:'defaults'! |
2352 |
||
2353 |
debug |
|
2354 |
||
4091 | 2355 |
^ false |
4017 | 2356 |
! ! |
2357 |
||
2358 |
!DirectoryContentsBrowser::DirectoryContentsUpdateTask methodsFor:'accessing'! |
|
2359 |
||
2360 |
changeSema |
|
2361 |
"return the value of the instance variable 'changeSema' (automatically generated)" |
|
2362 |
changeSema isNil ifTrue:[ |
|
2363 |
changeSema := Semaphore new. |
|
2364 |
]. |
|
2365 |
^ changeSema |
|
2366 |
! |
|
2367 |
||
2368 |
directoryChangeFlag |
|
2369 |
"return the value of the instance variable 'directoryChangeFlag' (automatically generated)" |
|
2370 |
||
2371 |
directoryChangeFlag isNil ifTrue:[ |
|
2372 |
directoryChangeFlag := false. |
|
2373 |
]. |
|
2374 |
^ directoryChangeFlag |
|
2375 |
! |
|
2376 |
||
2377 |
directoryChangeFlag:something |
|
2378 |
"set the value of the instance variable 'directoryChangeFlag' (automatically generated)" |
|
2379 |
||
2380 |
directoryChangeFlag := something. |
|
2381 |
! |
|
2382 |
||
2383 |
directoryContentsChangeFlag |
|
2384 |
"return the value of the instance variable 'directoryContentsChangeFlag' (automatically generated)" |
|
2385 |
||
2386 |
directoryContentsChangeFlag isNil ifTrue:[ |
|
2387 |
directoryContentsChangeFlag := false. |
|
2388 |
]. |
|
2389 |
^ directoryContentsChangeFlag |
|
2390 |
! |
|
2391 |
||
2392 |
directoryContentsChangeFlag:something |
|
2393 |
"set the value of the instance variable 'directoryContentsChangeFlag' (automatically generated)" |
|
2394 |
||
2395 |
directoryContentsChangeFlag := something. |
|
2396 |
! |
|
2397 |
||
2398 |
filterChangeFlag |
|
2399 |
"return the value of the instance variable 'filterChangeFlag' (automatically generated)" |
|
2400 |
||
2401 |
filterChangeFlag isNil ifTrue:[ |
|
2402 |
filterChangeFlag := false. |
|
2403 |
]. |
|
2404 |
^ filterChangeFlag |
|
2405 |
! |
|
2406 |
||
2407 |
filterChangeFlag:something |
|
2408 |
"set the value of the instance variable 'filterChangeFlag' (automatically generated)" |
|
2409 |
||
2410 |
filterChangeFlag := something. |
|
2411 |
! |
|
2412 |
||
2413 |
isBusy |
|
2414 |
"return the value of the instance variable 'isBusy' (automatically generated)" |
|
2415 |
||
2416 |
isBusy isNil ifTrue:[ |
|
2417 |
isBusy := false. |
|
2418 |
]. |
|
2419 |
^ isBusy |
|
2420 |
! |
|
2421 |
||
2422 |
isBusy:something |
|
2423 |
"set the value of the instance variable 'isBusy' (automatically generated)" |
|
2424 |
||
2425 |
isBusy := something. |
|
2426 |
! |
|
2427 |
||
2428 |
sortBlockChangeFlag |
|
2429 |
"return the value of the instance variable 'sortBlockChangeFlag' (automatically generated)" |
|
2430 |
||
2431 |
sortBlockChangeFlag isNil ifTrue:[ |
|
2432 |
sortBlockChangeFlag := false. |
|
2433 |
]. |
|
2434 |
^ sortBlockChangeFlag |
|
2435 |
! |
|
2436 |
||
2437 |
sortBlockChangeFlag:something |
|
2438 |
"set the value of the instance variable 'sortBlockChangeFlag' (automatically generated)" |
|
2439 |
||
2440 |
sortBlockChangeFlag := something. |
|
2441 |
! ! |
|
2442 |
||
2443 |
!DirectoryContentsBrowser::DirectoryContentsUpdateTask methodsFor:'actions'! |
|
2444 |
||
2445 |
debugMessage:aString |
|
2446 |
||
2447 |
self class debug ifTrue:[ |
|
2448 |
Transcript showCR:aString |
|
2449 |
]. |
|
2450 |
! |
|
2451 |
||
2452 |
wakeUpForDirectoryChanged:aDirectory |
|
2453 |
||
2454 |
self modificationTaskStop. |
|
2455 |
directory := aDirectory. |
|
2456 |
self isBusy ifTrue:[ |
|
2457 |
updateProcess interruptWith:[AbortSignal raise]. |
|
2458 |
]. |
|
2459 |
self directoryChangeFlag:true. |
|
2460 |
self changeSema signal. |
|
2461 |
! |
|
2462 |
||
2463 |
wakeUpForDirectoryContentsChanged |
|
2464 |
||
2465 |
self directoryContentsChangeFlag:true. |
|
2466 |
self changeSema signal. |
|
2467 |
! |
|
2468 |
||
2469 |
wakeUpForFilterChanged |
|
2470 |
||
2471 |
self filterChangeFlag:true. |
|
2472 |
self changeSema signal. |
|
2473 |
! |
|
2474 |
||
2475 |
wakeUpForSortBlockChanged |
|
2476 |
||
2477 |
self sortBlockChangeFlag:true. |
|
2478 |
self changeSema signal. |
|
2479 |
! ! |
|
2480 |
||
2481 |
!DirectoryContentsBrowser::DirectoryContentsUpdateTask methodsFor:'instance creation'! |
|
2482 |
||
2483 |
startWith:aDirectoryBrowser |
|
2484 |
||
2485 |
| processLoop | |
|
2486 |
||
2487 |
directoryBrowser := aDirectoryBrowser. |
|
2488 |
processLoop := self updateLoop. |
|
2489 |
updateProcess := processLoop newProcess. |
|
2490 |
updateProcess name:'DCB updateTask'. |
|
2491 |
updateProcess priorityRange:(Processor userBackgroundPriority to:Processor activePriority). |
|
2492 |
updateProcess resume. |
|
2493 |
! |
|
2494 |
||
2495 |
stop |
|
2496 |
||
2497 |
updateProcess terminate. |
|
2498 |
self modificationTaskStop. |
|
2499 |
! |
|
2500 |
||
2501 |
updateLoop |
|
2502 |
||
2503 |
^ [ |
|
2504 |
[true] whileTrue:[ |
|
2505 |
AbortSignal handle:[ |
|
2506 |
self debugMessage:'get an abort signal'. |
|
4071 | 2507 |
self directoryContentsChangeFlag:false. |
2508 |
self filterChangeFlag:false. |
|
2509 |
self sortBlockChangeFlag:false. |
|
4017 | 2510 |
] do:[ |
2511 |
self debugMessage:'sema wait'. |
|
2512 |
self changeSema wait. |
|
2513 |
self debugMessage:'sema signal'. |
|
2514 |
self isBusy:true. |
|
2515 |
[ |
|
2516 |
self directoryChangeFlag ifTrue:[ |
|
4026 | 2517 |
self directoryChangeFlag:false. |
2518 |
self debugMessage:'directoryChanged'. |
|
2519 |
self directoryChanged. |
|
4017 | 2520 |
]. |
2521 |
self directoryContentsChangeFlag ifTrue:[ |
|
4026 | 2522 |
self directoryContentsChangeFlag:false. |
2523 |
self debugMessage:'directoryContentsChanged'. |
|
2524 |
self directoryContentsChanged. |
|
4017 | 2525 |
]. |
2526 |
self filterChangeFlag ifTrue:[ |
|
4026 | 2527 |
self filterChangeFlag:false. |
2528 |
self debugMessage:'filterChanged'. |
|
2529 |
self filterChanged. |
|
4017 | 2530 |
]. |
2531 |
self sortBlockChangeFlag ifTrue:[ |
|
4026 | 2532 |
self sortBlockChangeFlag:false. |
2533 |
self debugMessage:'sortBlockChanged'. |
|
2534 |
self sortBlockChanged. |
|
4017 | 2535 |
] |
2536 |
] ensure:[ |
|
2537 |
self isBusy:false. |
|
2538 |
] |
|
2539 |
] |
|
2540 |
] |
|
2541 |
] |
|
2542 |
! ! |
|
2543 |
||
2544 |
!DirectoryContentsBrowser::DirectoryContentsUpdateTask methodsFor:'modification task'! |
|
2545 |
||
2546 |
modificationTaskStart |
|
2547 |
||
4072 | 2548 |
modificationTask notNil ifTrue:[^ self]. |
4017 | 2549 |
modificationTask := [ |
2550 |
[ |
|
4071 | 2551 |
[ true ] whileTrue:[ |
2552 |
| oldModificationTime | |
|
2553 |
(directory notNil) ifTrue:[ |
|
2554 |
oldModificationTime := modificationTime. |
|
2555 |
modificationTime := directory modificationTime. |
|
2556 |
[directory notNil and:[oldModificationTime = directory modificationTime]] whileTrue:[ |
|
2557 |
Processor yield. |
|
2558 |
Delay waitForSeconds:1.0 |
|
2559 |
]. |
|
4017 | 2560 |
]. |
4071 | 2561 |
self wakeUpForDirectoryContentsChanged. |
2562 |
] |
|
4017 | 2563 |
] valueNowOrOnUnwindDo:[ |
2564 |
modificationTask := nil. |
|
2565 |
] |
|
2566 |
] newProcess. |
|
2567 |
||
2568 |
"/ modificationTask priority:(Processor systemBackgroundPriority). |
|
2569 |
modificationTask priorityRange:(Processor userBackgroundPriority to:Processor activePriority). |
|
2570 |
||
2571 |
modificationTask name:('DirectoryContentsBrowser update contents[', directory baseName, ']'). |
|
2572 |
modificationTask resume. |
|
2573 |
! |
|
2574 |
||
2575 |
modificationTaskStop |
|
2576 |
||
2577 |
|task| |
|
2578 |
||
2579 |
(task := modificationTask) notNil ifTrue:[ |
|
2580 |
modificationTask := nil. |
|
2581 |
||
2582 |
Object errorSignal handle:[:ex| |
|
2583 |
Dialog warn:ex description. |
|
2584 |
]do:[ |
|
2585 |
task isDead ifFalse:[ |
|
2586 |
task terminate. |
|
2587 |
task waitUntilTerminated. |
|
2588 |
] |
|
2589 |
] |
|
2590 |
]. |
|
2591 |
! ! |
|
2592 |
||
2593 |
!DirectoryContentsBrowser::DirectoryContentsUpdateTask methodsFor:'private - actions'! |
|
2594 |
||
2595 |
directoryChanged |
|
2596 |
||
2597 |
| allItems | |
|
2598 |
||
2599 |
self modificationTaskStop. |
|
4023 | 2600 |
directory notNil ifTrue:[ |
2601 |
modificationTime := directory modificationTime. |
|
2602 |
allItems := self readDirectoryItems. |
|
2603 |
filteredItems := self evaluateFilter:allItems. |
|
2604 |
filteredItems sort:directoryBrowser sortBlockHolder value. |
|
2605 |
self modificationTaskStart. |
|
2606 |
] ifFalse:[ |
|
2607 |
allItems := OrderedCollection new. |
|
2608 |
filteredItems := OrderedCollection new. |
|
2609 |
]. |
|
4017 | 2610 |
directoryBrowser |
2611 |
enqueueMessage:#value |
|
2612 |
for:[ |
|
2613 |
directoryBrowser setBrowserItemList:filteredItems allItemsList:allItems |
|
2614 |
] |
|
2615 |
arguments:#(). |
|
2616 |
! |
|
2617 |
||
2618 |
directoryContentsChanged |
|
2619 |
||
2620 |
|allItems oldItems addItems remItems newItems| |
|
2621 |
||
2622 |
modificationTime := directory modificationTime. |
|
2623 |
allItems := self readDirectoryItems. |
|
2624 |
oldItems := filteredItems copy. |
|
2625 |
newItems := self evaluateFilter:allItems. |
|
2626 |
addItems := OrderedCollection new. |
|
2627 |
remItems := OrderedCollection new. |
|
2628 |
filteredItems size == 0 ifTrue:[ |
|
2629 |
remItems := oldItems. |
|
2630 |
] ifFalse:[ |
|
2631 |
"/ MERGE WITH CURRENT CONTENTS |
|
2632 |
oldItems reverseDo:[:anOldItem| |
|
2633 |
"/ remove no longer valid files |
|
2634 |
(newItems detectLast:[:aNewItem| aNewItem = anOldItem] ifNone:false) ifFalse:[ |
|
2635 |
remItems add:anOldItem. |
|
2636 |
oldItems removeIdentical:anOldItem |
|
2637 |
] |
|
2638 |
]. |
|
2639 |
"/ add new files |
|
2640 |
newItems do:[:aNewItem| |
|
2641 |
(oldItems detect:[:anOldItem| anOldItem = aNewItem] ifNone:false) ifFalse:[ |
|
2642 |
addItems add:aNewItem. |
|
2643 |
] |
|
2644 |
]. |
|
2645 |
]. |
|
2646 |
directoryBrowser |
|
2647 |
enqueueMessage:#value |
|
2648 |
for:[ |
|
2649 |
directoryBrowser allItems:allItems browserItemListAdd:addItems remove:remItems. |
|
2650 |
] |
|
2651 |
arguments:#(). |
|
2652 |
filteredItems := newItems. |
|
2653 |
! |
|
2654 |
||
2655 |
evaluateFilter:aItemsList |
|
2656 |
||
2657 |
|showDir filterBlock newItemList noOfAddedFiles noOfFiles| |
|
2658 |
||
2659 |
newItemList := OrderedCollection new. |
|
2660 |
noOfFiles := 0. |
|
2661 |
noOfAddedFiles := 0. |
|
2662 |
showDir := directoryBrowser viewDirectoriesInDirectoryContentsBrowser value. |
|
2663 |
filterBlock := directoryBrowser matchBlock. |
|
2664 |
aItemsList size ~~ 0 ifTrue:[ |
|
2665 |
aItemsList do:[:aItem | |isDir| |
|
2666 |
isDir := aItem isDirectory. |
|
2667 |
isDir not ifTrue:[noOfFiles := noOfFiles + 1]. |
|
2668 |
((isDir and:[showDir]) or:[isDir not and:[filterBlock value:aItem baseName]]) ifTrue:[ |
|
2669 |
isDir not ifTrue:[noOfAddedFiles := noOfAddedFiles + 1]. |
|
2670 |
newItemList add:aItem |
|
2671 |
] |
|
2672 |
]. |
|
2673 |
]. |
|
2674 |
directoryBrowser noOfAddedFiles:noOfAddedFiles noOfFiles:noOfFiles. |
|
2675 |
^ newItemList |
|
2676 |
! |
|
2677 |
||
2678 |
filterChanged |
|
2679 |
||
2680 |
filteredItems := self evaluateFilter:directoryBrowser allItemsList copy. |
|
2681 |
filteredItems sort:directoryBrowser sortBlockHolder value. |
|
2682 |
directoryBrowser |
|
2683 |
enqueueMessage:#value |
|
2684 |
for:[ |
|
2685 |
directoryBrowser setBrowserItemList:filteredItems allItemsList:nil |
|
2686 |
] |
|
2687 |
arguments:nil. |
|
2688 |
! |
|
2689 |
||
2690 |
mergeItems:newItems with:oldItems |
|
2691 |
||
2692 |
| changeDict | |
|
2693 |
||
2694 |
changeDict := Dictionary new. |
|
2695 |
changeDict at:#removeItems put:OrderedCollection new. |
|
2696 |
changeDict at:#addItems put:OrderedCollection new. |
|
2697 |
newItems size == 0 ifTrue:[ |
|
2698 |
changeDict at:#removeItems put:oldItems. |
|
2699 |
] ifFalse:[ |
|
2700 |
"/ MERGE WITH CURRENT CONTENTS |
|
2701 |
oldItems reverseDo:[:anOldItem| |
|
2702 |
"/ remove no longer valid files |
|
2703 |
(newItems detect:[:aNewItem| aNewItem = anOldItem] ifNone:nil) isNil ifTrue:[ |
|
2704 |
(changeDict at:#removeItems) add:anOldItem |
|
2705 |
] |
|
2706 |
]. |
|
2707 |
"/ add new files |
|
2708 |
newItems reverseDo:[:aNewItem| |
|
2709 |
(oldItems contains:[:anOldItem| anOldItem = aNewItem]) not ifTrue:[ |
|
2710 |
(changeDict at:#addItems) add:aNewItem. |
|
2711 |
] |
|
2712 |
]. |
|
2713 |
]. |
|
2714 |
^ changeDict |
|
2715 |
! |
|
2716 |
||
2717 |
readDirectoryItems |
|
2718 |
| list mountPoints contents| |
|
2719 |
||
2720 |
mountPoints := OperatingSystem mountPoints. |
|
2721 |
||
2722 |
list := OrderedCollection new. |
|
2723 |
directory notNil ifTrue:[ |
|
2724 |
contents := DirectoryContents directoryNamed:directory. |
|
2725 |
contents itemsDo:[:aItem| |
|
2726 |
list add:(DirectoryContentsBrowser itemClass forInfoItem:aItem). |
|
2727 |
]. |
|
2728 |
]. |
|
2729 |
^ list |
|
2730 |
! |
|
2731 |
||
2732 |
sortBlockChanged |
|
2733 |
||
4071 | 2734 |
filteredItems isNil ifTrue:[ ^ self]. |
4017 | 2735 |
filteredItems sort:directoryBrowser sortBlockHolder value. |
2736 |
directoryBrowser |
|
2737 |
enqueueMessage:#value |
|
2738 |
for:[ |
|
2739 |
directoryBrowser setBrowserItemList:filteredItems allItemsList:nil |
|
2740 |
] |
|
2741 |
arguments:nil. |
|
2742 |
! ! |
|
2743 |
||
3887 | 2744 |
!DirectoryContentsBrowser class methodsFor:'documentation'! |
2745 |
||
2746 |
version |
|
4101 | 2747 |
^ '$Header: /cvs/stx/stx/libtool/DirectoryContentsBrowser.st,v 1.46 2002-10-29 15:15:46 cg Exp $' |
3887 | 2748 |
! ! |