author | Claus Gittinger <cg@exept.de> |
Wed, 20 May 1998 03:50:21 +0200 | |
changeset 841 | 03746970088f |
parent 828 | 12090f74be53 |
child 874 | ab93fcd829c5 |
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 |
||
823 | 73 |
windowSpec |
74 |
"This resource specification was automatically generated |
|
75 |
by the UIPainter of ST/X." |
|
76 |
||
77 |
"Do not manually edit this!! If it is corrupted, |
|
78 |
the UIPainter may not be able to read the specification." |
|
79 |
||
80 |
" |
|
81 |
UIPainter new openOnClass:DirectoryView andSelector:#windowSpec |
|
82 |
DirectoryView new openInterface:#windowSpec |
|
83 |
DirectoryView open |
|
84 |
" |
|
85 |
||
86 |
<resource: #canvas> |
|
87 |
||
88 |
^ |
|
89 |
||
90 |
#(#FullSpec |
|
91 |
#window: |
|
92 |
#(#WindowSpec |
|
93 |
#name: 'Directory View' |
|
94 |
#layout: #(#LayoutFrame 412 0 367 0 811 0 666 0) |
|
95 |
#label: 'Directory View' |
|
96 |
#min: #(#Point 10 10) |
|
97 |
#max: #(#Point 1152 900) |
|
98 |
#bounds: #(#Rectangle 412 367 812 667) |
|
99 |
#usePreferredExtent: false |
|
100 |
) |
|
101 |
#component: |
|
102 |
#(#SpecCollection |
|
103 |
#collection: |
|
104 |
#( |
|
105 |
#(#DataSetSpec |
|
106 |
#name: 'filesDataSetView' |
|
107 |
#layout: #(#LayoutFrame 0 0.0 24 0.0 -2 1.0 0 1.0) |
|
108 |
#model: #selectionOfFile |
|
109 |
#hasHorizontalScrollBar: true |
|
110 |
#hasVerticalScrollBar: true |
|
111 |
#miniScrollerHorizontal: true |
|
112 |
#dataList: #listOfFiles |
|
113 |
#useIndex: false |
|
114 |
#doubleClickSelector: #fileDoubleClicked |
|
115 |
#columnHolder: #fileAttributeColumns |
|
116 |
#valueChangeSelector: #fileSelected |
|
117 |
#verticalSpacing: 1 |
|
118 |
) |
|
119 |
#(#ComboBoxSpec |
|
120 |
#name: 'formatComboBox' |
|
121 |
#layout: #(#LayoutFrame 63 0.0 0 0 0 1.0 22 0) |
|
122 |
#model: #selectionOfFileFilter |
|
123 |
#immediateAccept: false |
|
124 |
#acceptOnTab: false |
|
125 |
#comboList: #listOfFileFilters |
|
126 |
) |
|
127 |
#(#LabelSpec |
|
128 |
#name: 'filterLabel' |
|
129 |
#layout: #(#LayoutFrame 0 0 0 0 62 0 22 0) |
|
130 |
#label: 'Filter: ' |
|
131 |
#adjust: #right |
|
132 |
) |
|
133 |
) |
|
134 |
) |
|
135 |
) |
|
136 |
! ! |
|
137 |
||
138 |
!DirectoryView class methodsFor:'list specs'! |
|
139 |
||
820 | 140 |
tableColumnsForFileAttributes |
141 |
"This resource specification was automatically generated |
|
142 |
by the DataSetBuilder of ST/X." |
|
143 |
||
144 |
"Do not manually edit this!! If it is corrupted, |
|
145 |
the DataSetBuilder may not be able to read the specification." |
|
146 |
||
147 |
" |
|
148 |
DataSetBuilder new openOnClass:DirectoryView andSelector:#tableColumnsForFileAttributes |
|
149 |
" |
|
150 |
||
151 |
<resource: #tableColumns> |
|
152 |
||
424 | 153 |
|
820 | 154 |
^ #( |
155 |
#(#DataSetColumnSpec |
|
156 |
#label: '' |
|
157 |
#width: 30 |
|
158 |
#height: 22 |
|
159 |
#printSelector: #iconOn: |
|
160 |
#canSelect: false |
|
161 |
) |
|
162 |
#(#DataSetColumnSpec |
|
163 |
#label: 'File name' |
|
164 |
#labelAlignment: #left |
|
165 |
#minWidth: 150 |
|
166 |
#model: #baseName |
|
167 |
#canSelect: false |
|
168 |
) |
|
169 |
#(#DataSetColumnSpec |
|
170 |
#label: 'Size' |
|
171 |
#labelAlignment: #left |
|
172 |
#width: 70 |
|
173 |
#model: #size |
|
174 |
#canSelect: false |
|
175 |
) |
|
176 |
#(#DataSetColumnSpec |
|
177 |
#label: 'Modified' |
|
178 |
#labelAlignment: #left |
|
179 |
#model: #modified |
|
180 |
#canSelect: false |
|
181 |
) |
|
182 |
#(#DataSetColumnSpec |
|
183 |
#label: 'Permissions' |
|
184 |
#labelAlignment: #left |
|
185 |
#width: 85 |
|
186 |
#model: #permissions |
|
187 |
#canSelect: false |
|
188 |
) |
|
189 |
#(#DataSetColumnSpec |
|
190 |
#label: 'Owner' |
|
191 |
#labelAlignment: #left |
|
192 |
#width: 50 |
|
193 |
#model: #owner |
|
194 |
#canSelect: false |
|
195 |
) |
|
196 |
#(#DataSetColumnSpec |
|
197 |
#label: 'Group' |
|
198 |
#labelAlignment: #left |
|
199 |
#width: 50 |
|
200 |
#model: #group |
|
201 |
#canSelect: false |
|
202 |
) |
|
203 |
) |
|
424 | 204 |
! ! |
205 |
||
206 |
!DirectoryView methodsFor:'accessing'! |
|
207 |
||
208 |
directory: aDirectory |
|
209 |
||
210 |
directory := aDirectory asFilename asAbsoluteFilename name |
|
211 |
! |
|
212 |
||
213 |
fileAttributes: anArray |
|
214 |
||
215 |
fileAttributes := anArray |
|
216 |
! |
|
217 |
||
218 |
fileDoubleClickAction: anActionBlock |
|
219 |
||
220 |
fileDoubleClickAction := anActionBlock |
|
221 |
! |
|
222 |
||
223 |
fileFilterSelectAction: anActionBlock |
|
224 |
||
225 |
fileFilterSelectAction := anActionBlock |
|
226 |
! |
|
227 |
||
228 |
fileSelectAction: anActionBlock |
|
229 |
||
230 |
fileSelectAction := anActionBlock |
|
231 |
! |
|
232 |
||
233 |
listOfFileFilters: aCollection |
|
234 |
||
235 |
self listOfFileFilters contents: aCollection. |
|
236 |
self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]). |
|
237 |
! |
|
238 |
||
239 |
monitoring: aBoolean |
|
240 |
||
241 |
aBoolean |
|
242 |
ifTrue: |
|
243 |
[ |
|
244 |
monitoringTimeBlock := [self readDirectory]. |
|
245 |
self readDirectory. |
|
246 |
] |
|
247 |
ifFalse: |
|
248 |
[ |
|
249 |
monitoring ifTrue: |
|
250 |
[ |
|
251 |
Processor removeTimedBlock:monitoringTimeBlock. |
|
252 |
monitoringTimeBlock := nil |
|
253 |
] |
|
254 |
]. |
|
255 |
||
256 |
monitoring := aBoolean. |
|
257 |
||
258 |
! ! |
|
259 |
||
260 |
!DirectoryView methodsFor:'aspects'! |
|
261 |
||
262 |
fileAttributeColumns |
|
263 |
||
264 |
|holder| |
|
265 |
(holder := builder bindingAt:#fileAttributeColumns) isNil ifTrue:[ |
|
266 |
|fileAttributeColumns| |
|
267 |
builder aspectAt:#fileAttributeColumns put:(holder := List new). |
|
820 | 268 |
fileAttributeColumns := self class tableColumnsForFileAttributes collect: [:i| i decodeAsLiteralArray]. |
424 | 269 |
holder add: fileAttributeColumns first. |
270 |
fileAttributeColumns do: |
|
271 |
[:col| |
|
272 |
(fileAttributes includes: col label) ifTrue: [holder add: col] |
|
273 |
]. |
|
591 | 274 |
holder do: [:col| col label: ' ', col label] |
424 | 275 |
]. |
276 |
^ holder |
|
277 |
! |
|
278 |
||
279 |
listOfFileFilters |
|
280 |
||
281 |
|holder| |
|
282 |
(holder := builder bindingAt:#listOfFileFilters) isNil ifTrue:[ |
|
283 |
builder aspectAt:#listOfFileFilters put:(holder := List with: '*'). |
|
284 |
]. |
|
285 |
^ holder |
|
286 |
! |
|
287 |
||
288 |
listOfFiles |
|
289 |
||
290 |
|holder| |
|
291 |
(holder := builder bindingAt:#listOfFiles) isNil ifTrue:[ |
|
292 |
builder aspectAt:#listOfFiles put:(holder := List new). |
|
293 |
]. |
|
294 |
^ holder |
|
295 |
! |
|
296 |
||
297 |
selectionOfFile |
|
298 |
||
299 |
|holder| |
|
300 |
(holder := builder bindingAt:#selectionOfFile) isNil ifTrue:[ |
|
301 |
builder aspectAt:#selectionOfFile put:(holder := ValueHolder new). |
|
302 |
]. |
|
303 |
^ holder |
|
304 |
||
305 |
! |
|
306 |
||
307 |
selectionOfFileFilter |
|
308 |
||
309 |
|holder| |
|
310 |
(holder := builder bindingAt:#selectionOfFileFilter) isNil ifTrue:[ |
|
311 |
builder aspectAt:#selectionOfFileFilter put: |
|
312 |
(holder := AspectAdaptor new subject:self; forAspect:#selectedFileFilter). |
|
313 |
selectedFileFilter := '*'. |
|
314 |
]. |
|
315 |
^ holder |
|
316 |
! ! |
|
317 |
||
318 |
!DirectoryView methodsFor:'callbacks'! |
|
319 |
||
320 |
fileDoubleClicked |
|
321 |
||
473 | 322 |
(fileDoubleClickAction notNil and: [self selectionOfFile value notNil]) |
424 | 323 |
ifTrue: |
324 |
[ |
|
325 |
fileDoubleClickAction numArgs = 0 |
|
326 |
ifTrue: |
|
327 |
[ |
|
328 |
fileDoubleClickAction value |
|
329 |
]. |
|
330 |
fileDoubleClickAction numArgs = 1 |
|
331 |
ifTrue: |
|
451 | 332 |
[ |
333 |
fileDoubleClickAction value: (directory asFilename construct: self selectionOfFile value baseName) name |
|
424 | 334 |
] |
335 |
] |
|
336 |
! |
|
337 |
||
338 |
fileSelected |
|
339 |
||
473 | 340 |
(fileSelectAction notNil and: [self selectionOfFile value notNil]) |
424 | 341 |
ifTrue: |
342 |
[ |
|
343 |
fileSelectAction numArgs = 0 |
|
344 |
ifTrue: |
|
345 |
[ |
|
346 |
fileSelectAction value |
|
347 |
]. |
|
348 |
fileSelectAction numArgs = 1 |
|
349 |
ifTrue: |
|
350 |
[ |
|
451 | 351 |
fileSelectAction value: (directory asFilename construct: self selectionOfFile value baseName) name |
424 | 352 |
] |
353 |
] |
|
354 |
! ! |
|
355 |
||
356 |
!DirectoryView methodsFor:'initialization'! |
|
357 |
||
358 |
initialize |
|
359 |
||
360 |
super initialize. |
|
361 |
||
362 |
directory := directory ? '.' asFilename asAbsoluteFilename directoryName. |
|
363 |
monitoring := false. |
|
593 | 364 |
fileAttributes := #('File name' 'Size' 'Modified'). |
424 | 365 |
self selectionOfFileFilter value: (self listOfFileFilters at: 1 ifAbsent: [nil]). |
366 |
||
367 |
! ! |
|
368 |
||
369 |
!DirectoryView methodsFor:'private'! |
|
370 |
||
371 |
readDirectory |
|
372 |
||
828
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
373 |
|foundFiles list dir| |
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
374 |
|
590 | 375 |
foundFiles := OrderedCollection new. |
614 | 376 |
list := self listOfFileFilters value. |
377 |
||
590 | 378 |
Cursor wait showWhile: |
379 |
[ |
|
828
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
380 |
(dir := DirectoryContents directoryNamed: directory) notNil ifTrue:[ |
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
381 |
dir filesAndBasenamesDo: |
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
382 |
[:file :name| |
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
383 |
list do: |
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
384 |
[:filter| |
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
385 |
((filter match: name) and: [(foundFiles includes: file) not]) |
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
386 |
ifTrue: |
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
387 |
[ |
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
388 |
foundFiles add: file |
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
389 |
]. |
590 | 390 |
]. |
391 |
]. |
|
828
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
392 |
self listOfFiles contents: (foundFiles collect: [:file| FileRow new fileName: file]) |
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
393 |
] |
590 | 394 |
] |
614 | 395 |
|
828
12090f74be53
care for non-existing directory
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
396 |
"Modified: / 18.5.1998 / 13:02:47 / cg" |
590 | 397 |
! |
398 |
||
399 |
readMonitoringDirectory |
|
400 |
||
424 | 401 |
|readBlock| |
402 |
readTask notNil ifTrue: [readTask terminate]. |
|
403 |
readBlock := |
|
404 |
[ |
|
405 |
|dir currentFilenames oldListOfFiles| |
|
406 |
dir := directory asFilename. |
|
407 |
currentFilenames := OrderedCollection new. |
|
408 |
(dir isReadable and:[dir isExecutable]) ifTrue: |
|
409 |
[ |
|
410 |
self listOfFileFilters value do: |
|
411 |
[:filter| |
|
412 |
(dir filesMatchingWithoutDotDirs: filter) do: |
|
413 |
[:aFileName| |
|
414 |
|file| |
|
415 |
(file := dir construct: aFileName) isDirectory |
|
416 |
ifFalse: |
|
417 |
[ |
|
418 |
currentFilenames add: file |
|
419 |
] |
|
420 |
]. |
|
421 |
]. |
|
422 |
]. |
|
423 |
oldListOfFiles := self listOfFiles copy. |
|
424 |
(currentFilenames asSortedCollection: [:f1 :f2| f1 baseName < f2 baseName]) asSet do: |
|
425 |
[:fileName| |
|
426 |
(oldListOfFiles detect: [:fileRow| fileRow fileName = fileName] ifNone: nil) isNil |
|
427 |
ifTrue: |
|
428 |
[ |
|
429 |
|nearestFileRow r| |
|
430 |
nearestFileRow := self listOfFiles indexOf: (self listOfFiles detect: [:fileRow| fileRow baseName > fileName baseName] ifNone: nil). |
|
431 |
nearestFileRow = 0 |
|
432 |
ifTrue: [self listOfFiles add: (r := FileRow new fileName: fileName asFilename)] |
|
433 |
ifFalse: [self listOfFiles add: (r := FileRow new fileName: fileName asFilename) beforeIndex: nearestFileRow]. |
|
434 |
monitoring ifTrue: [self selectionOfFile value: r]. |
|
435 |
] |
|
436 |
]. |
|
437 |
self listOfFiles reverseDo: |
|
438 |
[:fileRow| |
|
439 |
(currentFilenames includes: fileRow fileName) |
|
440 |
ifFalse: [self listOfFiles remove: fileRow] |
|
441 |
] |
|
442 |
]. |
|
443 |
||
444 |
monitoring |
|
445 |
ifTrue: |
|
446 |
[ |
|
447 |
readTask := readBlock forkAt: Processor userBackgroundPriority. |
|
448 |
Processor addTimedBlock: monitoringTimeBlock afterSeconds: 1 |
|
449 |
] |
|
450 |
ifFalse: |
|
451 |
[ |
|
452 |
Cursor wait showWhile: [readBlock value] |
|
453 |
] |
|
454 |
! ! |
|
455 |
||
456 |
!DirectoryView methodsFor:'selection'! |
|
457 |
||
458 |
selectedFileFilter |
|
459 |
||
460 |
^selectedFileFilter |
|
461 |
||
462 |
! |
|
463 |
||
464 |
selectedFileFilter: aString |
|
465 |
||
466 |
aString size = 0 ifTrue: [self listOfFileFilters remove: selectedFileFilter ifAbsent: nil]. |
|
467 |
selectedFileFilter := aString. |
|
468 |
(self listOfFileFilters includes: selectedFileFilter) not & |
|
469 |
selectedFileFilter notEmpty |
|
470 |
ifTrue: |
|
471 |
[ |
|
472 |
self listOfFileFilters addFirst: selectedFileFilter |
|
473 |
]. |
|
474 |
(self listOfFileFilters includes: selectedFileFilter) & |
|
475 |
fileFilterSelectAction notNil |
|
476 |
ifTrue: |
|
477 |
[ |
|
478 |
fileFilterSelectAction numArgs = 0 |
|
479 |
ifTrue: |
|
480 |
[ |
|
481 |
fileFilterSelectAction value |
|
482 |
]. |
|
483 |
fileFilterSelectAction numArgs = 1 |
|
484 |
ifTrue: |
|
485 |
[ |
|
486 |
fileFilterSelectAction value: selectedFileFilter |
|
487 |
] |
|
488 |
]. |
|
489 |
self readDirectory. |
|
490 |
! ! |
|
491 |
||
492 |
!DirectoryView methodsFor:'startup / release'! |
|
493 |
||
494 |
closeRequest |
|
495 |
||
496 |
self release. |
|
497 |
||
498 |
super closeRequest |
|
499 |
||
500 |
! |
|
501 |
||
502 |
release |
|
503 |
||
504 |
monitoring ifTrue: |
|
505 |
[ |
|
506 |
Processor removeTimedBlock:monitoringTimeBlock. |
|
507 |
monitoringTimeBlock := nil |
|
508 |
]. |
|
509 |
||
510 |
super release |
|
511 |
||
512 |
! ! |
|
513 |
||
514 |
!DirectoryView::FileRow class methodsFor:'resources'! |
|
515 |
||
516 |
HFileIcon |
|
517 |
||
518 |
^self hFileIcon |
|
519 |
! |
|
520 |
||
521 |
MakefileIcon |
|
590 | 522 |
"Generated by the Image Editor" |
523 |
" |
|
524 |
ImageEditor openOnClass:self andSelector:#MakefileIcon |
|
525 |
" |
|
424 | 526 |
|
527 |
<resource: #image> |
|
590 | 528 |
|
529 |
^Icon |
|
530 |
constantNamed:#'DirectoryView::FileRow MakefileIcon' |
|
531 |
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 | 532 |
|
533 |
binaryFileIcon |
|
590 | 534 |
"Generated by the Image Editor" |
535 |
" |
|
536 |
ImageEditor openOnClass:self andSelector:#binaryFileIcon |
|
537 |
" |
|
424 | 538 |
|
539 |
<resource: #image> |
|
590 | 540 |
|
541 |
^Icon |
|
542 |
constantNamed:#'DirectoryView::FileRow binaryFileIcon' |
|
543 |
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 | 544 |
|
545 |
cFileIcon |
|
590 | 546 |
"Generated by the Image Editor" |
547 |
" |
|
548 |
ImageEditor openOnClass:self andSelector:#cFileIcon |
|
549 |
" |
|
424 | 550 |
|
551 |
<resource: #image> |
|
590 | 552 |
|
553 |
^Icon |
|
554 |
constantNamed:#'DirectoryView::FileRow cFileIcon' |
|
555 |
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 | 556 |
|
557 |
exeFileIcon |
|
590 | 558 |
"Generated by the Image Editor" |
559 |
" |
|
560 |
ImageEditor openOnClass:self andSelector:#exeFileIcon |
|
561 |
" |
|
424 | 562 |
|
563 |
<resource: #image> |
|
590 | 564 |
|
565 |
^Icon |
|
566 |
constantNamed:#'DirectoryView::FileRow exeFileIcon' |
|
567 |
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 | 568 |
|
569 |
fileIcon |
|
590 | 570 |
"Generated by the Image Editor" |
571 |
" |
|
572 |
ImageEditor openOnClass:self andSelector:#fileIcon |
|
573 |
" |
|
424 | 574 |
|
575 |
<resource: #image> |
|
590 | 576 |
|
577 |
^Icon |
|
578 |
constantNamed:#'DirectoryView::FileRow fileIcon' |
|
644 | 579 |
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 | 580 |
|
581 |
hFileIcon |
|
590 | 582 |
"Generated by the Image Editor" |
583 |
" |
|
584 |
ImageEditor openOnClass:self andSelector:#hFileIcon |
|
585 |
" |
|
424 | 586 |
|
587 |
<resource: #image> |
|
590 | 588 |
|
589 |
^Icon |
|
590 |
constantNamed:#'DirectoryView::FileRow hFileIcon' |
|
591 |
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 | 592 |
|
644 | 593 |
htmlFileIcon |
594 |
"Generated by the Image Editor" |
|
595 |
" |
|
596 |
ImageEditor openOnClass:self andSelector:#htmlFileIcon |
|
597 |
" |
|
424 | 598 |
|
599 |
<resource: #image> |
|
644 | 600 |
|
601 |
^Icon |
|
602 |
constantNamed:#'DirectoryView::FileRow htmlFileIcon' |
|
603 |
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]! |
|
604 |
||
605 |
imageFileIcon |
|
606 |
"Generated by the Image Editor" |
|
607 |
" |
|
608 |
ImageEditor openOnClass:self andSelector:#imageFileIcon |
|
609 |
" |
|
610 |
||
611 |
<resource: #image> |
|
612 |
||
613 |
^Icon |
|
614 |
constantNamed:#'DirectoryView::FileRow imageFileIcon' |
|
615 |
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 | 616 |
|
617 |
imgFileIcon |
|
590 | 618 |
"Generated by the Image Editor" |
619 |
" |
|
620 |
ImageEditor openOnClass:self andSelector:#imgFileIcon |
|
621 |
" |
|
424 | 622 |
|
623 |
<resource: #image> |
|
590 | 624 |
|
625 |
^Icon |
|
626 |
constantNamed:#'DirectoryView::FileRow imgFileIcon' |
|
644 | 627 |
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] |
628 |
! |
|
424 | 629 |
|
630 |
linkedFileIcon |
|
644 | 631 |
"Generated by the Image Editor" |
632 |
" |
|
633 |
ImageEditor openOnClass:self andSelector:#linkedFileIcon |
|
634 |
" |
|
424 | 635 |
|
636 |
<resource: #image> |
|
644 | 637 |
|
638 |
^Icon |
|
639 |
constantNamed:#'DirectoryView::FileRow linkedFileIcon' |
|
640 |
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 | 641 |
|
642 |
lockedFileIcon |
|
644 | 643 |
"Generated by the Image Editor" |
644 |
" |
|
645 |
ImageEditor openOnClass:self andSelector:#lockedFileIcon |
|
646 |
" |
|
424 | 647 |
|
648 |
<resource: #image> |
|
644 | 649 |
|
650 |
^Icon |
|
651 |
constantNamed:#'DirectoryView::FileRow lockedFileIcon' |
|
652 |
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 | 653 |
|
654 |
protoFileIcon |
|
655 |
||
656 |
^self MakefileIcon |
|
657 |
! |
|
658 |
||
659 |
rcFileIcon |
|
644 | 660 |
"Generated by the Image Editor" |
661 |
" |
|
662 |
ImageEditor openOnClass:self andSelector:#rcFileIcon |
|
663 |
" |
|
424 | 664 |
|
665 |
<resource: #image> |
|
644 | 666 |
|
667 |
^Icon |
|
668 |
constantNamed:#'DirectoryView::FileRow rcFileIcon' |
|
669 |
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 | 670 |
|
671 |
sFileIcon |
|
644 | 672 |
"Generated by the Image Editor" |
673 |
" |
|
674 |
ImageEditor openOnClass:self andSelector:#sFileIcon |
|
675 |
" |
|
424 | 676 |
|
677 |
<resource: #image> |
|
644 | 678 |
|
679 |
^Icon |
|
680 |
constantNamed:#'DirectoryView::FileRow sFileIcon' |
|
681 |
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 | 682 |
|
683 |
stFileIcon |
|
590 | 684 |
"Generated by the Image Editor" |
685 |
" |
|
686 |
ImageEditor openOnClass:self andSelector:#stFileIcon |
|
687 |
" |
|
424 | 688 |
|
689 |
<resource: #image> |
|
590 | 690 |
|
691 |
^Icon |
|
692 |
constantNamed:#'DirectoryView::FileRow stFileIcon' |
|
693 |
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 | 694 |
|
695 |
stcFileIcon |
|
644 | 696 |
"Generated by the Image Editor" |
697 |
" |
|
698 |
ImageEditor openOnClass:self andSelector:#stcFileIcon |
|
699 |
" |
|
424 | 700 |
|
701 |
<resource: #image> |
|
644 | 702 |
|
703 |
^Icon |
|
704 |
constantNamed:#'DirectoryView::FileRow stcFileIcon' |
|
705 |
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 | 706 |
|
707 |
!DirectoryView::FileRow methodsFor:'accessing'! |
|
708 |
||
709 |
baseName |
|
710 |
||
711 |
^baseName ? (baseName := fileName baseName) |
|
712 |
||
713 |
||
714 |
||
715 |
||
716 |
||
717 |
||
718 |
||
719 |
! |
|
720 |
||
721 |
fileName |
|
722 |
||
723 |
^fileName |
|
724 |
! |
|
725 |
||
726 |
fileName: aFileName |
|
727 |
||
614 | 728 |
fileName := aFileName |
424 | 729 |
! |
730 |
||
731 |
group |
|
732 |
||
733 |
^group |
|
734 |
! |
|
735 |
||
736 |
iconOn:aGC |
|
737 |
||
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
738 |
|icon| |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
739 |
iconKey isNil |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
740 |
ifTrue: |
424 | 741 |
[ |
614 | 742 |
self validateAttributes. |
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
743 |
(imageFromFile isNil and: [iconKey == #imageFileIcon]) |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
744 |
ifTrue: [icon := self retrieveImageFromFileAndRegisterOn: aGC] |
424 | 745 |
]. |
645
9f422fbbd801
care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents:
644
diff
changeset
|
746 |
imageFromFile == true |
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
747 |
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
|
748 |
ifTrue: [icon := aGC registeredImageAt: iconKey]. |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
749 |
^icon |
645
9f422fbbd801
care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents:
644
diff
changeset
|
750 |
|
9f422fbbd801
care for imageFromFile being uninitialized
Claus Gittinger <cg@exept.de>
parents:
644
diff
changeset
|
751 |
"Modified: / 18.2.1998 / 18:01:52 / cg" |
424 | 752 |
! |
753 |
||
754 |
modified |
|
755 |
||
756 |
^modified |
|
757 |
! |
|
758 |
||
759 |
owner |
|
760 |
||
761 |
^owner |
|
762 |
! |
|
763 |
||
764 |
permissions |
|
765 |
||
766 |
^permissions |
|
767 |
! |
|
768 |
||
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
769 |
retrieveImageFromFileAndRegisterOn: aGC |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
770 |
|
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
771 |
|image| |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
772 |
imageFromFile := false. |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
773 |
(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
|
774 |
ifTrue: |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
775 |
[ |
820 | 776 |
size < 500000 |
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
777 |
ifTrue: |
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 |
Object errorSignal handle: [:ex|] |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
780 |
do: |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
781 |
[ |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
782 |
(image := Image fromFile: fileName name) notNil |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
783 |
ifTrue: |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
784 |
[ |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
785 |
image extent y > 22 |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
786 |
ifTrue: |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
787 |
[ |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
788 |
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
|
789 |
]. |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
790 |
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
|
791 |
] |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
792 |
] |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
793 |
]. |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
794 |
]. |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
795 |
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
|
796 |
^image |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
797 |
|
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
798 |
|
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
799 |
|
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
800 |
! |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
801 |
|
424 | 802 |
size |
607 | 803 |
size isNumber ifFalse:[^ size]. |
804 |
size < 1000 ifTrue: [^ size printString]. |
|
805 |
size < (100*1024) ifTrue: [^(((size/1024) * 10) asInteger/10) asFloat printString, ' Kb']. |
|
806 |
size < (1000*1024) ifTrue: [^(((size/1024)) asInteger) printString, ' Kb']. |
|
807 |
^(((size/1048576) * 10) asInteger/10) asFloat printString, ' Mb' |
|
424 | 808 |
|
607 | 809 |
"Modified: / 6.2.1998 / 03:38:45 / cg" |
424 | 810 |
! ! |
811 |
||
812 |
!DirectoryView::FileRow methodsFor:'private'! |
|
813 |
||
814 |
validateAttributes |
|
815 |
||
638
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
816 |
|info mode| |
a82372d61cf8
avoid rereading of file images + multiple listings of same filter matching files
tz
parents:
620
diff
changeset
|
817 |
|
424 | 818 |
permissions := String new:9 withAll:$-. |
819 |
||
820 |
(info := fileName info) isNil |
|
821 |
ifTrue: |
|
822 |
[ |
|
823 |
iconKey := #lockedFileIcon. |
|
824 |
size := owner := group := '?'. |
|
825 |
^ self |
|
826 |
]. |
|
827 |
size := info size. |
|
828 |
modified := info modified printString. |
|
829 |
owner := OperatingSystem getUserNameFromID: info uid. |
|
830 |
group := OperatingSystem getGroupNameFromID: info gid. |
|
831 |
mode := info mode. |
|
832 |
||
833 |
1 to:9 by:3 do:[:i| |
|
834 |
#((0 $x) (1 $w) (2 $r)) do: |
|
835 |
[:m| |
|
836 |
(mode bitAt:i + m first) == 1 ifTrue:[permissions at: 10 - m first - i put: m last] |
|
837 |
] |
|
838 |
]. |
|
839 |
||
840 |
fileName isReadable |
|
841 |
ifTrue: |
|
842 |
[ |
|
843 |
info type == #symbolicLink |
|
844 |
ifTrue: |
|
845 |
[ |
|
846 |
^iconKey := #linkedFileIcon |
|
847 |
] |
|
848 |
ifFalse: |
|
849 |
[ |
|
850 |
((DirectoryView::FileRow class implements: (iconKey := (fileName suffix, 'FileIcon') asSymbol)) |
|
851 |
or: |
|
852 |
[DirectoryView::FileRow class implements: (iconKey := (fileName baseName, 'Icon') asSymbol)]) |
|
853 |
ifFalse: |
|
854 |
[ |
|
855 |
iconKey := #fileIcon. |
|
856 |
(Image isImageFileSuffix:fileName suffix) |
|
857 |
ifTrue: |
|
858 |
[ |
|
859 |
^iconKey := #imageFileIcon |
|
860 |
]. |
|
861 |
(fileName suffix = 'o') | (fileName suffix = 'so') |
|
862 |
ifTrue: |
|
863 |
[ |
|
864 |
^iconKey := #binaryFileIcon |
|
865 |
]. |
|
866 |
||
867 |
fileName isExecutableProgram |
|
868 |
ifTrue: |
|
869 |
[ |
|
870 |
^iconKey := #exeFileIcon |
|
871 |
] |
|
872 |
] |
|
873 |
] |
|
874 |
] |
|
875 |
ifFalse: |
|
876 |
[ |
|
877 |
^iconKey := #lockedFileIcon |
|
878 |
]. |
|
879 |
||
880 |
||
881 |
! ! |
|
882 |
||
883 |
!DirectoryView class methodsFor:'documentation'! |
|
884 |
||
885 |
version |
|
886 |
^ '$Header$' |
|
887 |
! ! |