author | tz |
Thu, 19 Feb 1998 16:42:30 +0100 | |
changeset 651 | 4f3bbe0e547c |
parent 645 | 9f422fbbd801 |
child 652 | 75644c11d619 |
permissions | -rw-r--r-- |
424 | 1 |
" |
502 | 2 |
COPYRIGHT (c) 1997 by eXept Software AG |
424 | 3 |
All Rights Reserved |
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
||
14 |
ApplicationModel subclass:#DirectoryView |
|
15 |
instanceVariableNames:'directory selectedFileFilter readTask monitoring |
|
16 |
monitoringTimeBlock fileDoubleClickAction fileSelectAction |
|
17 |
fileFilterSelectAction fileAttributes' |
|
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
620 | 20 |
category:'Interface-Support' |
424 | 21 |
! |
22 |
||
23 |
Object subclass:#FileRow |
|
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
24 |
instanceVariableNames:'fileName size modified iconKey imageFromFile group owner |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
25 |
permissions baseName' |
424 | 26 |
classVariableNames:'' |
27 |
poolDictionaries:'' |
|
28 |
privateIn:DirectoryView |
|
29 |
! |
|
30 |
||
31 |
!DirectoryView class methodsFor:'documentation'! |
|
32 |
||
33 |
copyright |
|
34 |
" |
|
502 | 35 |
COPYRIGHT (c) 1997 by eXept Software AG |
424 | 36 |
All Rights Reserved |
37 |
||
38 |
This software is furnished under a license and may be used |
|
39 |
only in accordance with the terms of that license and with the |
|
40 |
inclusion of the above copyright notice. This software may not |
|
41 |
be provided or otherwise made available to, or used by, any |
|
42 |
other person. No title to or ownership of the software is |
|
43 |
hereby transferred. |
|
44 |
" |
|
45 |
||
46 |
! |
|
47 |
||
48 |
documentation |
|
49 |
" |
|
50 |
documentation to be added. |
|
502 | 51 |
|
52 |
[author:] |
|
53 |
Thomas Zwick |
|
424 | 54 |
" |
55 |
! ! |
|
56 |
||
57 |
!DirectoryView class methodsFor:'instance creation'! |
|
58 |
||
516
d336effde882
Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents:
502
diff
changeset
|
59 |
openOnDirectory: aDirectoryString |
d336effde882
Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents:
502
diff
changeset
|
60 |
"open a DirectoryView for a aDirectoryString" |
d336effde882
Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents:
502
diff
changeset
|
61 |
|
d336effde882
Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents:
502
diff
changeset
|
62 |
^ (self new directory: aDirectoryString) open |
424 | 63 |
|
516
d336effde882
Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents:
502
diff
changeset
|
64 |
" |
d336effde882
Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents:
502
diff
changeset
|
65 |
self openOnDirectory: '/etc' |
d336effde882
Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents:
502
diff
changeset
|
66 |
" |
424 | 67 |
|
516
d336effde882
Fix #openOnDirectory: and copyright.
Stefan Vogel <sv@exept.de>
parents:
502
diff
changeset
|
68 |
"Modified: / 28.1.1998 / 15:44:53 / stefan" |
424 | 69 |
! ! |
70 |
||
71 |
!DirectoryView class methodsFor:'interface specs'! |
|
72 |
||
73 |
windowSpec |
|
74 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
75 |
||
76 |
"do not manually edit this - the painter/builder may not be able to |
|
77 |
handle the specification if its corrupted." |
|
78 |
||
79 |
" |
|
80 |
UIPainter new openOnClass:DirectoryView andSelector:#windowSpec |
|
81 |
DirectoryView new openInterface:#windowSpec |
|
82 |
" |
|
83 |
"DirectoryView open" |
|
84 |
||
85 |
<resource: #canvas> |
|
86 |
||
87 |
^ |
|
88 |
||
89 |
#(#FullSpec |
|
90 |
#'window:' |
|
91 |
#(#WindowSpec |
|
92 |
#'name:' 'Directory View' |
|
607 | 93 |
#'layout:' #(#LayoutFrame 64 0 703 0 463 0 1002 0) |
424 | 94 |
#'label:' 'Directory View' |
95 |
#'min:' #(#Point 10 10) |
|
96 |
#'max:' #(#Point 1152 900) |
|
607 | 97 |
#'bounds:' #(#Rectangle 64 703 464 1003) |
424 | 98 |
#'usePreferredExtent:' false |
99 |
) |
|
100 |
#'component:' |
|
101 |
#(#SpecCollection |
|
102 |
#'collection:' |
|
103 |
#( |
|
104 |
#(#DataSetSpec |
|
105 |
#'name:' 'filesDataSetView' |
|
607 | 106 |
#'layout:' #(#LayoutFrame 0 0.0 24 0.0 -2 1.0 0 1.0) |
424 | 107 |
#'model:' #selectionOfFile |
108 |
#'hasHorizontalScrollBar:' true |
|
109 |
#'hasVerticalScrollBar:' true |
|
110 |
#'miniScrollerHorizontal:' true |
|
111 |
#'dataList:' #listOfFiles |
|
112 |
#'useIndex:' false |
|
113 |
#'doubleClickSelector:' #fileDoubleClicked |
|
114 |
#'columnHolder:' #fileAttributeColumns |
|
115 |
#'valueChangeSelector:' #fileSelected |
|
116 |
#'verticalSpacing:' 1 |
|
117 |
) |
|
118 |
#(#ComboBoxSpec |
|
119 |
#'name:' 'formatComboBox' |
|
120 |
#'layout:' #(#LayoutFrame 0 0.0 0 0 0 1.0 22 0) |
|
121 |
#'model:' #selectionOfFileFilter |
|
122 |
#'immediateAccept:' false |
|
123 |
#'acceptOnTab:' false |
|
124 |
#'comboList:' #listOfFileFilters |
|
125 |
) |
|
126 |
) |
|
127 |
) |
|
128 |
) |
|
607 | 129 |
|
130 |
"Modified: / 6.2.1998 / 03:42:15 / cg" |
|
424 | 131 |
! |
132 |
||
133 |
windowSpecOfFileAttributeColumns |
|
134 |
||
135 |
^ |
|
136 |
#( |
|
137 |
#(#DataSetColumnSpec |
|
138 |
#'label:' '' |
|
139 |
#'width:' 30 |
|
140 |
#'height:' 22 |
|
141 |
#'printSelector:' #'iconOn:' |
|
142 |
#'canSelect:' false |
|
143 |
) |
|
144 |
#(#DataSetColumnSpec |
|
145 |
#'label:' 'File name' |
|
590 | 146 |
#'labelAlignment:' #left |
607 | 147 |
#'minWidth:' 150 |
424 | 148 |
#'model:' #baseName |
149 |
#'canSelect:' false |
|
150 |
) |
|
151 |
#(#DataSetColumnSpec |
|
152 |
#'label:' 'Size' |
|
590 | 153 |
#'labelAlignment:' #left |
607 | 154 |
#'width:' 70 |
424 | 155 |
#'model:' #size |
156 |
#'canSelect:' false |
|
157 |
) |
|
158 |
#(#DataSetColumnSpec |
|
593 | 159 |
#'label:' 'Modified' |
590 | 160 |
#'labelAlignment:' #left |
424 | 161 |
#'model:' #modified |
162 |
#'canSelect:' false |
|
163 |
) |
|
164 |
#(#DataSetColumnSpec |
|
165 |
#'label:' 'Permissions' |
|
590 | 166 |
#'labelAlignment:' #left |
424 | 167 |
#'width:' 85 |
168 |
#'model:' #permissions |
|
169 |
#'canSelect:' false |
|
170 |
) |
|
171 |
#(#DataSetColumnSpec |
|
172 |
#'label:' 'Owner' |
|
590 | 173 |
#'labelAlignment:' #left |
424 | 174 |
#'width:' 50 |
175 |
#'model:' #owner |
|
176 |
#'canSelect:' false |
|
177 |
) |
|
178 |
#(#DataSetColumnSpec |
|
179 |
#'label:' 'Group' |
|
590 | 180 |
#'labelAlignment:' #left |
424 | 181 |
#'width:' 50 |
182 |
#'model:' #group |
|
183 |
#'canSelect:' false |
|
184 |
) |
|
185 |
) |
|
186 |
||
607 | 187 |
"Modified: / 6.2.1998 / 03:40:16 / cg" |
424 | 188 |
! ! |
189 |
||
190 |
!DirectoryView methodsFor:'accessing'! |
|
191 |
||
192 |
directory: aDirectory |
|
193 |
||
194 |
directory := aDirectory asFilename asAbsoluteFilename name |
|
195 |
! |
|
196 |
||
197 |
fileAttributes: anArray |
|
198 |
||
199 |
fileAttributes := anArray |
|
200 |
! |
|
201 |
||
202 |
fileDoubleClickAction: anActionBlock |
|
203 |
||
204 |
fileDoubleClickAction := anActionBlock |
|
205 |
! |
|
206 |
||
207 |
fileFilterSelectAction: anActionBlock |
|
208 |
||
209 |
fileFilterSelectAction := anActionBlock |
|
210 |
! |
|
211 |
||
212 |
fileSelectAction: anActionBlock |
|
213 |
||
214 |
fileSelectAction := anActionBlock |
|
215 |
! |
|
216 |
||
217 |
listOfFileFilters: aCollection |
|
218 |
||
219 |
self listOfFileFilters contents: aCollection. |
|
220 |
self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]). |
|
221 |
! |
|
222 |
||
223 |
monitoring: aBoolean |
|
224 |
||
225 |
aBoolean |
|
226 |
ifTrue: |
|
227 |
[ |
|
228 |
monitoringTimeBlock := [self readDirectory]. |
|
229 |
self readDirectory. |
|
230 |
] |
|
231 |
ifFalse: |
|
232 |
[ |
|
233 |
monitoring ifTrue: |
|
234 |
[ |
|
235 |
Processor removeTimedBlock:monitoringTimeBlock. |
|
236 |
monitoringTimeBlock := nil |
|
237 |
] |
|
238 |
]. |
|
239 |
||
240 |
monitoring := aBoolean. |
|
241 |
||
242 |
! ! |
|
243 |
||
244 |
!DirectoryView methodsFor:'aspects'! |
|
245 |
||
246 |
fileAttributeColumns |
|
247 |
||
248 |
|holder| |
|
249 |
(holder := builder bindingAt:#fileAttributeColumns) isNil ifTrue:[ |
|
250 |
|fileAttributeColumns| |
|
251 |
builder aspectAt:#fileAttributeColumns put:(holder := List new). |
|
252 |
fileAttributeColumns := self class windowSpecOfFileAttributeColumns collect: [:i| i decodeAsLiteralArray]. |
|
253 |
holder add: fileAttributeColumns first. |
|
254 |
fileAttributeColumns do: |
|
255 |
[:col| |
|
256 |
(fileAttributes includes: col label) ifTrue: [holder add: col] |
|
257 |
]. |
|
591 | 258 |
holder do: [:col| col label: ' ', col label] |
424 | 259 |
]. |
260 |
^ holder |
|
261 |
! |
|
262 |
||
263 |
listOfFileFilters |
|
264 |
||
265 |
|holder| |
|
266 |
(holder := builder bindingAt:#listOfFileFilters) isNil ifTrue:[ |
|
267 |
builder aspectAt:#listOfFileFilters put:(holder := List with: '*'). |
|
268 |
]. |
|
269 |
^ holder |
|
270 |
! |
|
271 |
||
272 |
listOfFiles |
|
273 |
||
274 |
|holder| |
|
275 |
(holder := builder bindingAt:#listOfFiles) isNil ifTrue:[ |
|
276 |
builder aspectAt:#listOfFiles put:(holder := List new). |
|
277 |
]. |
|
278 |
^ holder |
|
279 |
! |
|
280 |
||
281 |
selectionOfFile |
|
282 |
||
283 |
|holder| |
|
284 |
(holder := builder bindingAt:#selectionOfFile) isNil ifTrue:[ |
|
285 |
builder aspectAt:#selectionOfFile put:(holder := ValueHolder new). |
|
286 |
]. |
|
287 |
^ holder |
|
288 |
||
289 |
! |
|
290 |
||
291 |
selectionOfFileFilter |
|
292 |
||
293 |
|holder| |
|
294 |
(holder := builder bindingAt:#selectionOfFileFilter) isNil ifTrue:[ |
|
295 |
builder aspectAt:#selectionOfFileFilter put: |
|
296 |
(holder := AspectAdaptor new subject:self; forAspect:#selectedFileFilter). |
|
297 |
selectedFileFilter := '*'. |
|
298 |
]. |
|
299 |
^ holder |
|
300 |
! ! |
|
301 |
||
302 |
!DirectoryView methodsFor:'callbacks'! |
|
303 |
||
304 |
fileDoubleClicked |
|
305 |
||
473 | 306 |
(fileDoubleClickAction notNil and: [self selectionOfFile value notNil]) |
424 | 307 |
ifTrue: |
308 |
[ |
|
309 |
fileDoubleClickAction numArgs = 0 |
|
310 |
ifTrue: |
|
311 |
[ |
|
312 |
fileDoubleClickAction value |
|
313 |
]. |
|
314 |
fileDoubleClickAction numArgs = 1 |
|
315 |
ifTrue: |
|
451 | 316 |
[ |
317 |
fileDoubleClickAction value: (directory asFilename construct: self selectionOfFile value baseName) name |
|
424 | 318 |
] |
319 |
] |
|
320 |
! |
|
321 |
||
322 |
fileSelected |
|
323 |
||
473 | 324 |
(fileSelectAction notNil and: [self selectionOfFile value notNil]) |
424 | 325 |
ifTrue: |
326 |
[ |
|
327 |
fileSelectAction numArgs = 0 |
|
328 |
ifTrue: |
|
329 |
[ |
|
330 |
fileSelectAction value |
|
331 |
]. |
|
332 |
fileSelectAction numArgs = 1 |
|
333 |
ifTrue: |
|
334 |
[ |
|
451 | 335 |
fileSelectAction value: (directory asFilename construct: self selectionOfFile value baseName) name |
424 | 336 |
] |
337 |
] |
|
338 |
! ! |
|
339 |
||
340 |
!DirectoryView methodsFor:'initialization'! |
|
341 |
||
342 |
initialize |
|
343 |
||
344 |
super initialize. |
|
345 |
||
346 |
directory := directory ? '.' asFilename asAbsoluteFilename directoryName. |
|
347 |
monitoring := false. |
|
593 | 348 |
fileAttributes := #('File name' 'Size' 'Modified'). |
424 | 349 |
self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]). |
350 |
||
351 |
! ! |
|
352 |
||
353 |
!DirectoryView methodsFor:'private'! |
|
354 |
||
355 |
readDirectory |
|
356 |
||
614 | 357 |
|foundFiles list| |
590 | 358 |
foundFiles := OrderedCollection new. |
614 | 359 |
list := self listOfFileFilters value. |
360 |
||
590 | 361 |
Cursor wait showWhile: |
362 |
[ |
|
614 | 363 |
(DirectoryContents directoryNamed: directory) filesAndBasenamesDo: |
364 |
[:file :name| |
|
365 |
list do: |
|
590 | 366 |
[:filter| |
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
367 |
((filter match: name) and: [(foundFiles includes: file) not]) |
590 | 368 |
ifTrue: |
369 |
[ |
|
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
370 |
foundFiles add: file |
590 | 371 |
]. |
372 |
]. |
|
373 |
]. |
|
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
374 |
self listOfFiles contents: (foundFiles collect: [:file| FileRow new fileName: file]) |
590 | 375 |
] |
614 | 376 |
|
590 | 377 |
! |
378 |
||
379 |
readMonitoringDirectory |
|
380 |
||
424 | 381 |
|readBlock| |
382 |
readTask notNil ifTrue: [readTask terminate]. |
|
383 |
readBlock := |
|
384 |
[ |
|
385 |
|dir currentFilenames oldListOfFiles| |
|
386 |
dir := directory asFilename. |
|
387 |
currentFilenames := OrderedCollection new. |
|
388 |
(dir isReadable and:[dir isExecutable]) ifTrue: |
|
389 |
[ |
|
390 |
self listOfFileFilters value do: |
|
391 |
[:filter| |
|
392 |
(dir filesMatchingWithoutDotDirs: filter) do: |
|
393 |
[:aFileName| |
|
394 |
|file| |
|
395 |
(file := dir construct: aFileName) isDirectory |
|
396 |
ifFalse: |
|
397 |
[ |
|
398 |
currentFilenames add: file |
|
399 |
] |
|
400 |
]. |
|
401 |
]. |
|
402 |
]. |
|
403 |
oldListOfFiles := self listOfFiles copy. |
|
404 |
(currentFilenames asSortedCollection: [:f1 :f2| f1 baseName < f2 baseName]) asSet do: |
|
405 |
[:fileName| |
|
406 |
(oldListOfFiles detect: [:fileRow| fileRow fileName = fileName] ifNone: nil) isNil |
|
407 |
ifTrue: |
|
408 |
[ |
|
409 |
|nearestFileRow r| |
|
410 |
nearestFileRow := self listOfFiles indexOf: (self listOfFiles detect: [:fileRow| fileRow baseName > fileName baseName] ifNone: nil). |
|
411 |
nearestFileRow = 0 |
|
412 |
ifTrue: [self listOfFiles add: (r := FileRow new fileName: fileName asFilename)] |
|
413 |
ifFalse: [self listOfFiles add: (r := FileRow new fileName: fileName asFilename) beforeIndex: nearestFileRow]. |
|
414 |
monitoring ifTrue: [self selectionOfFile value: r]. |
|
415 |
] |
|
416 |
]. |
|
417 |
self listOfFiles reverseDo: |
|
418 |
[:fileRow| |
|
419 |
(currentFilenames includes: fileRow fileName) |
|
420 |
ifFalse: [self listOfFiles remove: fileRow] |
|
421 |
] |
|
422 |
]. |
|
423 |
||
424 |
monitoring |
|
425 |
ifTrue: |
|
426 |
[ |
|
427 |
readTask := readBlock forkAt: Processor userBackgroundPriority. |
|
428 |
Processor addTimedBlock: monitoringTimeBlock afterSeconds: 1 |
|
429 |
] |
|
430 |
ifFalse: |
|
431 |
[ |
|
432 |
Cursor wait showWhile: [readBlock value] |
|
433 |
] |
|
434 |
! ! |
|
435 |
||
436 |
!DirectoryView methodsFor:'selection'! |
|
437 |
||
438 |
selectedFileFilter |
|
439 |
||
440 |
^selectedFileFilter |
|
441 |
||
442 |
! |
|
443 |
||
444 |
selectedFileFilter: aString |
|
445 |
||
446 |
aString size = 0 ifTrue: [self listOfFileFilters remove: selectedFileFilter ifAbsent: nil]. |
|
447 |
selectedFileFilter := aString. |
|
448 |
(self listOfFileFilters includes: selectedFileFilter) not & |
|
449 |
selectedFileFilter notEmpty |
|
450 |
ifTrue: |
|
451 |
[ |
|
452 |
self listOfFileFilters addFirst: selectedFileFilter |
|
453 |
]. |
|
454 |
(self listOfFileFilters includes: selectedFileFilter) & |
|
455 |
fileFilterSelectAction notNil |
|
456 |
ifTrue: |
|
457 |
[ |
|
458 |
fileFilterSelectAction numArgs = 0 |
|
459 |
ifTrue: |
|
460 |
[ |
|
461 |
fileFilterSelectAction value |
|
462 |
]. |
|
463 |
fileFilterSelectAction numArgs = 1 |
|
464 |
ifTrue: |
|
465 |
[ |
|
466 |
fileFilterSelectAction value: selectedFileFilter |
|
467 |
] |
|
468 |
]. |
|
469 |
self readDirectory. |
|
470 |
! ! |
|
471 |
||
472 |
!DirectoryView methodsFor:'startup / release'! |
|
473 |
||
474 |
closeRequest |
|
475 |
||
476 |
self release. |
|
477 |
||
478 |
super closeRequest |
|
479 |
||
480 |
! |
|
481 |
||
482 |
release |
|
483 |
||
484 |
monitoring ifTrue: |
|
485 |
[ |
|
486 |
Processor removeTimedBlock:monitoringTimeBlock. |
|
487 |
monitoringTimeBlock := nil |
|
488 |
]. |
|
489 |
||
490 |
super release |
|
491 |
||
492 |
! ! |
|
493 |
||
494 |
!DirectoryView::FileRow class methodsFor:'resources'! |
|
495 |
||
496 |
HFileIcon |
|
497 |
||
498 |
^self hFileIcon |
|
499 |
! |
|
500 |
||
501 |
MakefileIcon |
|
590 | 502 |
"Generated by the Image Editor" |
503 |
" |
|
504 |
ImageEditor openOnClass:self andSelector:#MakefileIcon |
|
505 |
" |
|
424 | 506 |
|
507 |
<resource: #image> |
|
590 | 508 |
|
509 |
^Icon |
|
510 |
constantNamed:#'DirectoryView::FileRow MakefileIcon' |
|
511 |
ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @@0 @@0 @@0)IV0/U$0)]&0)UT;)UV4 @@0 @@0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]! |
|
424 | 512 |
|
513 |
binaryFileIcon |
|
590 | 514 |
"Generated by the Image Editor" |
515 |
" |
|
516 |
ImageEditor openOnClass:self andSelector:#binaryFileIcon |
|
517 |
" |
|
424 | 518 |
|
519 |
<resource: #image> |
|
590 | 520 |
|
521 |
^Icon |
|
522 |
constantNamed:#'DirectoryView::FileRow binaryFileIcon' |
|
523 |
ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???3 @_7 @W4#&S0&6Q0&6_3&6O5&6@0#&@9 @@0&\@2&6@0&6@0&6@1&6@8&\@0 @@0???0???1'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]! |
|
424 | 524 |
|
525 |
cFileIcon |
|
590 | 526 |
"Generated by the Image Editor" |
527 |
" |
|
528 |
ImageEditor openOnClass:self andSelector:#cFileIcon |
|
529 |
" |
|
424 | 530 |
|
531 |
<resource: #image> |
|
590 | 532 |
|
533 |
^Icon |
|
534 |
constantNamed:#'DirectoryView::FileRow cFileIcon' |
|
535 |
ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @@0 @@0 \@0 "@0 @0 @0&"@;&\@4 @@0 @@0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]! |
|
424 | 536 |
|
537 |
exeFileIcon |
|
590 | 538 |
"Generated by the Image Editor" |
539 |
" |
|
540 |
ImageEditor openOnClass:self andSelector:#exeFileIcon |
|
541 |
" |
|
424 | 542 |
|
543 |
<resource: #image> |
|
590 | 544 |
|
545 |
^Icon |
|
546 |
constantNamed:#'DirectoryView::FileRow exeFileIcon' |
|
547 |
ifAbsentPut:[(Depth2Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUU@@@@UUT@@@AEUP@@@DEU@@@@PETEUUUUUPZ**)UUAUUUUATG???4EP_???PUA???=ATG???4EP_???PUA???=ATEUUUTEP@@@@@U@@@@@AUUUUUUUUUUUUUTb'); colorMap:(((Array new:4) at:1 put:((Color white)); at:2 put:((Color black)); at:3 put:((Color red:0.0 green:49.9977 blue:49.9977)); at:4 put:((Color grey:66.9978)); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]! |
|
424 | 548 |
|
549 |
fileIcon |
|
590 | 550 |
"Generated by the Image Editor" |
551 |
" |
|
552 |
ImageEditor openOnClass:self andSelector:#fileIcon |
|
553 |
" |
|
424 | 554 |
|
555 |
<resource: #image> |
|
590 | 556 |
|
557 |
^Icon |
|
558 |
constantNamed:#'DirectoryView::FileRow fileIcon' |
|
644 | 559 |
ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @@0 @@0 @@0 @@0 @@0 @@0 @@; @@4 @@0 @@0???0???0') ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]! |
424 | 560 |
|
561 |
hFileIcon |
|
590 | 562 |
"Generated by the Image Editor" |
563 |
" |
|
564 |
ImageEditor openOnClass:self andSelector:#hFileIcon |
|
565 |
" |
|
424 | 566 |
|
567 |
<resource: #image> |
|
590 | 568 |
|
569 |
^Icon |
|
570 |
constantNamed:#'DirectoryView::FileRow hFileIcon' |
|
571 |
ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @0 @0 ,@0 2@0 "@0 "@0&"@;&"@4 @@0 @@0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]! |
|
424 | 572 |
|
644 | 573 |
htmlFileIcon |
574 |
"Generated by the Image Editor" |
|
575 |
" |
|
576 |
ImageEditor openOnClass:self andSelector:#htmlFileIcon |
|
577 |
" |
|
424 | 578 |
|
579 |
<resource: #image> |
|
644 | 580 |
|
581 |
^Icon |
|
582 |
constantNamed:#'DirectoryView::FileRow htmlFileIcon' |
|
583 |
ifAbsentPut:[(Depth4Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'DQDQDQDQDQDQDQ????????DQDQD_???????1@QDQG???L3L3<P@QDQ??L3ADL3D@@QD_?3L0P3L1DQDQG?L3MCP3L1DQDQ?3QCQCMCP??1D_<4P4QDL4O?<QG?L4QDL3MD??DQ?3L3QCL3PO?1D_<3L4QDL4O?<QG?<3QDQCMO??DQ??L4QDP4S??1D_??=D@@S???<QG???????????DQ???????????1DQDQDQDQDQDQDQDQDQDQDQDQDQDP@a') ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9977 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9977 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9977); add:(Color red:0.0 green:49.9977 blue:49.9977); add:(Color red:49.9977 green:49.9977 blue:0.0); add:(Color red:49.9977 green:0.0 blue:49.9977); add:(Color grey:49.9977); add:(Color grey:66.9978); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]! |
|
584 |
||
585 |
imageFileIcon |
|
586 |
"Generated by the Image Editor" |
|
587 |
" |
|
588 |
ImageEditor openOnClass:self andSelector:#imageFileIcon |
|
589 |
" |
|
590 |
||
591 |
<resource: #image> |
|
592 |
||
593 |
^Icon |
|
594 |
constantNamed:#'DirectoryView::FileRow imageFileIcon' |
|
595 |
ifAbsentPut:[(Depth4Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@DQDQDQDQ@@@@@ADQDQDQDPD@@@@QDQDQDQDAD@@@DQDQDQDQ@QD@@ADQDQDQDP@@@@@TQG]4)G50@@@@EDQ7^$+W4QDP@AQD]7R$_WDQD@@SL6Y#$61!!DQ@@D3M&ZS''F0QDP@AL3Y&NS[FDQD@@RH%UR %-QDQ@@D"IUVB"5,QDP@AH"UUJBV5DQD@@QDQDQDQDQDQ@@DQDQDQDQDQDP@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9977 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9977 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9977); add:(Color red:0.0 green:49.9977 blue:49.9977); add:(Color red:49.9977 green:49.9977 blue:0.0); add:(Color red:49.9977 green:0.0 blue:49.9977); add:(Color grey:49.9977); add:(Color grey:66.9978); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]! |
|
424 | 596 |
|
597 |
imgFileIcon |
|
590 | 598 |
"Generated by the Image Editor" |
599 |
" |
|
600 |
ImageEditor openOnClass:self andSelector:#imgFileIcon |
|
601 |
" |
|
424 | 602 |
|
603 |
<resource: #image> |
|
590 | 604 |
|
605 |
^Icon |
|
606 |
constantNamed:#'DirectoryView::FileRow imgFileIcon' |
|
644 | 607 |
ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @0 @@0!!-F0 **0 **0 **0&**;&*&4 @B0 @N0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself] |
608 |
! |
|
424 | 609 |
|
610 |
linkedFileIcon |
|
644 | 611 |
"Generated by the Image Editor" |
612 |
" |
|
613 |
ImageEditor openOnClass:self andSelector:#linkedFileIcon |
|
614 |
" |
|
424 | 615 |
|
616 |
<resource: #image> |
|
644 | 617 |
|
618 |
^Icon |
|
619 |
constantNamed:#'DirectoryView::FileRow linkedFileIcon' |
|
620 |
ifAbsentPut:[(Depth2Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUU@@@@UUT@@@AEUP@@@DEU@@@@PET@@@AUUP@@@AUU@@@@@AT@@@@ EP@@@B U@@@**!!T@@J**EP@B B UB*(@HATJ*@@@EP@@@@@U@@@@@AUUUUUUUUUUUUUTb') ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:100.0 green:0.0 blue:0.0); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]! |
|
424 | 621 |
|
622 |
lockedFileIcon |
|
644 | 623 |
"Generated by the Image Editor" |
624 |
" |
|
625 |
ImageEditor openOnClass:self andSelector:#lockedFileIcon |
|
626 |
" |
|
424 | 627 |
|
628 |
<resource: #image> |
|
644 | 629 |
|
630 |
^Icon |
|
631 |
constantNamed:#'DirectoryView::FileRow lockedFileIcon' |
|
632 |
ifAbsentPut:[(Depth2Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUU(@@@UUT(@@AEUP(@@DEU@(@@PET@(@IUUP@(B!!UU@@((@AT@@*@@EP@B(@@U@@((@AT@J@(@EPB @(@U@(@@(ATJ@@@(ER @@@(U(@@@@)UUUUUUUUUUUUUTb') ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]! |
|
424 | 633 |
|
634 |
protoFileIcon |
|
635 |
||
636 |
^self MakefileIcon |
|
637 |
! |
|
638 |
||
639 |
rcFileIcon |
|
644 | 640 |
"Generated by the Image Editor" |
641 |
" |
|
642 |
ImageEditor openOnClass:self andSelector:#rcFileIcon |
|
643 |
" |
|
424 | 644 |
|
645 |
<resource: #image> |
|
644 | 646 |
|
647 |
^Icon |
|
648 |
constantNamed:#'DirectoryView::FileRow rcFileIcon' |
|
649 |
ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @@0 @@0 ) 0 2P0 "@0 "@0&"P;&!! 4 @@0 @@0???0???0') ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]! |
|
424 | 650 |
|
651 |
sFileIcon |
|
644 | 652 |
"Generated by the Image Editor" |
653 |
" |
|
654 |
ImageEditor openOnClass:self andSelector:#sFileIcon |
|
655 |
" |
|
424 | 656 |
|
657 |
<resource: #image> |
|
644 | 658 |
|
659 |
^Icon |
|
660 |
constantNamed:#'DirectoryView::FileRow sFileIcon' |
|
661 |
ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 @@0 @@0 X@0 @0 0@0 X@0&H@;&0@4 @@0 @@0???0???0') ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]! |
|
424 | 662 |
|
663 |
stFileIcon |
|
590 | 664 |
"Generated by the Image Editor" |
665 |
" |
|
666 |
ImageEditor openOnClass:self andSelector:#stFileIcon |
|
667 |
" |
|
424 | 668 |
|
669 |
<resource: #image> |
|
590 | 670 |
|
671 |
^Icon |
|
672 |
constantNamed:#'DirectoryView::FileRow stFileIcon' |
|
673 |
ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 A@0 A@0 [00 !!@0 1@0 Y@0&I@;&004 @@0 @@0???0???0'); colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0'); yourself); yourself]! |
|
424 | 674 |
|
675 |
stcFileIcon |
|
644 | 676 |
"Generated by the Image Editor" |
677 |
" |
|
678 |
ImageEditor openOnClass:self andSelector:#stcFileIcon |
|
679 |
" |
|
424 | 680 |
|
681 |
<resource: #image> |
|
644 | 682 |
|
683 |
^Icon |
|
684 |
constantNamed:#'DirectoryView::FileRow stcFileIcon' |
|
685 |
ifAbsentPut:[(Depth1Image new) width: 20; height: 19; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???9 @_0 @W2 @S0 @Q0 @_0 @O8 B@0 B@0 _L0 "R0 2P0 ZP0&JR;&3L4 @@0 @@0???0???0') ; colorMap:((OrderedCollection new add:(Color white); add:(Color black); yourself)); mask:((ImageMask new) width: 20; height: 19; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@??8@??<@??>@???@??? ???0???0???0???0???0???0???0???0???0???0???0???0_??0') ; yourself); yourself]! ! |
|
424 | 686 |
|
687 |
!DirectoryView::FileRow methodsFor:'accessing'! |
|
688 |
||
689 |
baseName |
|
690 |
||
691 |
^baseName ? (baseName := fileName baseName) |
|
692 |
||
693 |
||
694 |
||
695 |
||
696 |
||
697 |
||
698 |
||
699 |
! |
|
700 |
||
701 |
fileName |
|
702 |
||
703 |
^fileName |
|
704 |
! |
|
705 |
||
706 |
fileName: aFileName |
|
707 |
||
614 | 708 |
fileName := aFileName |
424 | 709 |
! |
710 |
||
711 |
group |
|
712 |
||
713 |
^group |
|
714 |
! |
|
715 |
||
716 |
iconOn:aGC |
|
717 |
||
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
718 |
|icon| |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
719 |
iconKey isNil |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
720 |
ifTrue: |
424 | 721 |
[ |
614 | 722 |
self validateAttributes. |
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
723 |
(imageFromFile isNil and: [iconKey == #imageFileIcon]) |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
724 |
ifTrue: [icon := self retrieveImageFromFileAndRegisterOn: aGC] |
424 | 725 |
]. |
645
9f422fbbd801
care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents:
644
diff
changeset
|
726 |
imageFromFile == true |
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
727 |
ifFalse: [icon := aGC registerImage: (self class perform: iconKey) key: iconKey] |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
728 |
ifTrue: [icon := aGC registeredImageAt: iconKey]. |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
729 |
^icon |
645
9f422fbbd801
care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents:
644
diff
changeset
|
730 |
|
9f422fbbd801
care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents:
644
diff
changeset
|
731 |
"Modified: / 18.2.1998 / 18:01:52 / cg" |
424 | 732 |
! |
733 |
||
734 |
modified |
|
735 |
||
736 |
^modified |
|
737 |
! |
|
738 |
||
739 |
owner |
|
740 |
||
741 |
^owner |
|
742 |
! |
|
743 |
||
744 |
permissions |
|
745 |
||
746 |
^permissions |
|
747 |
! |
|
748 |
||
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
749 |
retrieveImageFromFileAndRegisterOn: aGC |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
750 |
|
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
751 |
|image| |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
752 |
imageFromFile := false. |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
753 |
(image := aGC registeredImageAt: fileName name asSymbol) isNil |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
754 |
ifTrue: |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
755 |
[ |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
756 |
size < 5000 |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
757 |
ifTrue: |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
758 |
[ |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
759 |
Object errorSignal handle: [:ex|] |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
760 |
do: |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
761 |
[ |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
762 |
(image := Image fromFile: fileName name) notNil |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
763 |
ifTrue: |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
764 |
[ |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
765 |
image extent y > 22 |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
766 |
ifTrue: |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
767 |
[ |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
768 |
image := image magnifiedBy: 22/image extent y |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
769 |
]. |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
770 |
image := aGC registerImage: image key: fileName name asSymbol. |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
771 |
] |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
772 |
] |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
773 |
]. |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
774 |
]. |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
775 |
image notNil ifTrue: [imageFromFile := true. iconKey := fileName name asSymbol]. |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
776 |
^image |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
777 |
|
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
778 |
|
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
779 |
|
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
780 |
! |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
781 |
|
424 | 782 |
size |
607 | 783 |
size isNumber ifFalse:[^ size]. |
784 |
size < 1000 ifTrue: [^ size printString]. |
|
785 |
size < (100*1024) ifTrue: [^(((size/1024) * 10) asInteger/10) asFloat printString, ' Kb']. |
|
786 |
size < (1000*1024) ifTrue: [^(((size/1024)) asInteger) printString, ' Kb']. |
|
787 |
^(((size/1048576) * 10) asInteger/10) asFloat printString, ' Mb' |
|
424 | 788 |
|
607 | 789 |
"Modified: / 6.2.1998 / 03:38:45 / cg" |
424 | 790 |
! ! |
791 |
||
792 |
!DirectoryView::FileRow methodsFor:'private'! |
|
793 |
||
794 |
validateAttributes |
|
795 |
||
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
796 |
|info mode| |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
797 |
|
424 | 798 |
permissions := String new:9 withAll:$-. |
799 |
||
800 |
(info := fileName info) isNil |
|
801 |
ifTrue: |
|
802 |
[ |
|
803 |
iconKey := #lockedFileIcon. |
|
804 |
size := owner := group := '?'. |
|
805 |
^ self |
|
806 |
]. |
|
807 |
size := info size. |
|
808 |
modified := info modified printString. |
|
809 |
owner := OperatingSystem getUserNameFromID: info uid. |
|
810 |
group := OperatingSystem getGroupNameFromID: info gid. |
|
811 |
mode := info mode. |
|
812 |
||
813 |
1 to:9 by:3 do:[:i| |
|
814 |
#((0 $x) (1 $w) (2 $r)) do: |
|
815 |
[:m| |
|
816 |
(mode bitAt:i + m first) == 1 ifTrue:[permissions at: 10 - m first - i put: m last] |
|
817 |
] |
|
818 |
]. |
|
819 |
||
820 |
fileName isReadable |
|
821 |
ifTrue: |
|
822 |
[ |
|
823 |
info type == #symbolicLink |
|
824 |
ifTrue: |
|
825 |
[ |
|
826 |
^iconKey := #linkedFileIcon |
|
827 |
] |
|
828 |
ifFalse: |
|
829 |
[ |
|
830 |
((DirectoryView::FileRow class implements: (iconKey := (fileName suffix, 'FileIcon') asSymbol)) |
|
831 |
or: |
|
832 |
[DirectoryView::FileRow class implements: (iconKey := (fileName baseName, 'Icon') asSymbol)]) |
|
833 |
ifFalse: |
|
834 |
[ |
|
835 |
iconKey := #fileIcon. |
|
836 |
(Image isImageFileSuffix:fileName suffix) |
|
837 |
ifTrue: |
|
838 |
[ |
|
839 |
^iconKey := #imageFileIcon |
|
840 |
]. |
|
841 |
(fileName suffix = 'o') | (fileName suffix = 'so') |
|
842 |
ifTrue: |
|
843 |
[ |
|
844 |
^iconKey := #binaryFileIcon |
|
845 |
]. |
|
846 |
||
847 |
fileName isExecutableProgram |
|
848 |
ifTrue: |
|
849 |
[ |
|
850 |
^iconKey := #exeFileIcon |
|
851 |
] |
|
852 |
] |
|
853 |
] |
|
854 |
] |
|
855 |
ifFalse: |
|
856 |
[ |
|
857 |
^iconKey := #lockedFileIcon |
|
858 |
]. |
|
859 |
||
860 |
||
861 |
! ! |
|
862 |
||
863 |
!DirectoryView class methodsFor:'documentation'! |
|
864 |
||
865 |
version |
|
866 |
^ '$Header$' |
|
867 |
! ! |