author | Merge Script |
Thu, 23 Apr 2015 06:49:03 +0200 | |
branch | jv |
changeset 15596 | c11cc9c2974d |
parent 15566 | 184cea584be5 |
parent 15592 | cdeaf8307c45 |
child 15620 | 8f25029eb991 |
permissions | -rw-r--r-- |
15466
a62dd831dbb8
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
15284
diff
changeset
|
1 |
"{ Encoding: utf8 }" |
a62dd831dbb8
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
15284
diff
changeset
|
2 |
|
5140 | 3 |
" |
4 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
3906 | 14 |
"{ Package: 'stx:libtool' }" |
3887 | 15 |
|
15283
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
16 |
"{ NameSpace: Smalltalk }" |
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
17 |
|
4713 | 18 |
AbstractDirectoryBrowser subclass:#DirectoryContentsBrowser |
11448 | 19 |
instanceVariableNames:'modificationTime directory columnDescriptors iconIndex |
20 |
fileDescriptionIndex iconExtent tableColumns previewIndex |
|
21 |
draggedItem viewBrowserMenu updateContentsSelection |
|
22 |
selectionInFileList browserItemList matchBlock updateTask |
|
23 |
directoryChangeFlag directoryContentsChangeFlag filterChangeFlag |
|
24 |
sortBlockChangeFlag isBusy changeSema filteredItems allItems |
|
25 |
diskUsageInfo diskUsageUpdateProcess multipleSelect |
|
15283
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
26 |
doubleClickAction updateCycleSemaphore updatingColumns accessLock |
15284
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
27 |
enterActionBlock updateCurrentFileNameHolderWhenSelectionChanges' |
11448 | 28 |
classVariableNames:'Debug' |
29 |
poolDictionaries:'' |
|
30 |
category:'Interface-Tools-File' |
|
3887 | 31 |
! |
32 |
||
33 |
Object subclass:#DirectoryContentsItem |
|
11448 | 34 |
instanceVariableNames:'fileName fileInfo icon fileType |
35 |
contentsBrowserChangeModificationTime suffix preview group owner |
|
36 |
timeAndDate mimeType iconKey mimeTypeForContents baseName' |
|
37 |
classVariableNames:'LastUIDToUserNameMapping LastGIDToGroupNameMapping' |
|
38 |
poolDictionaries:'' |
|
39 |
privateIn:DirectoryContentsBrowser |
|
4017 | 40 |
! |
41 |
||
3887 | 42 |
!DirectoryContentsBrowser class methodsFor:'documentation'! |
43 |
||
5140 | 44 |
copyright |
45 |
" |
|
46 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
47 |
All Rights Reserved |
|
48 |
||
49 |
This software is furnished under a license and may be used |
|
50 |
only in accordance with the terms of that license and with the |
|
51 |
inclusion of the above copyright notice. This software may not |
|
52 |
be provided or otherwise made available to, or used by, any |
|
53 |
other person. No title to or ownership of the software is |
|
54 |
hereby transferred. |
|
55 |
" |
|
56 |
! |
|
57 |
||
3887 | 58 |
documentation |
59 |
" |
|
4713 | 60 |
An application for displaying a directories' contents flat (or as a tree, alternatively). |
61 |
To be used as a building block in file browsers and fileSelection dialogs. |
|
62 |
This is used as the top-right component in the new fileBrowser. |
|
63 |
||
64 |
[author:] |
|
65 |
Christian Penk (penk@bierfix) |
|
66 |
||
67 |
[see also:] |
|
68 |
FileBrowserV2 |
|
69 |
" |
|
70 |
! |
|
71 |
||
72 |
examples |
|
73 |
" |
|
74 |
[exBegin] |
|
5377 | 75 |
DirectoryContentsBrowser openIn:Filename currentDirectory |
4713 | 76 |
[exEnd] |
3887 | 77 |
" |
78 |
! ! |
|
79 |
||
80 |
!DirectoryContentsBrowser class methodsFor:'instance creation'! |
|
81 |
||
82 |
openIn:aDirectory |
|
5377 | 83 |
"open a standalone broser for a directory" |
84 |
||
3887 | 85 |
self openIn:aDirectory withDirectories:false |
86 |
||
5377 | 87 |
" |
88 |
self openIn:'.cvsignore' asFilename |
|
89 |
" |
|
3887 | 90 |
! |
91 |
||
92 |
openIn:aDirectory withDirectories:withDirectoriesBoolean |
|
5377 | 93 |
"open a broswer (standalone) for a directory" |
94 |
||
3887 | 95 |
|browser| |
96 |
||
5377 | 97 |
browser := self new. |
3887 | 98 |
browser open. |
99 |
aDirectory notNil ifTrue:[ |
|
5377 | 100 |
browser currentFileNameHolder value:(OrderedCollection with:aDirectory asFilename) |
3887 | 101 |
]. |
4202 | 102 |
browser viewDirsInContentsBrowser value:withDirectoriesBoolean. |
103 |
^ browser |
|
3887 | 104 |
|
5377 | 105 |
" |
106 |
self openIn:Filename currentDirectory withDirectories:true |
|
107 |
" |
|
3887 | 108 |
! ! |
109 |
||
110 |
!DirectoryContentsBrowser class methodsFor:'classAccess'! |
|
111 |
||
112 |
itemClass |
|
113 |
||
114 |
^ DirectoryContentsItem |
|
115 |
||
116 |
||
117 |
" |
|
118 |
self itemClass |
|
119 |
" |
|
120 |
! ! |
|
121 |
||
122 |
!DirectoryContentsBrowser class methodsFor:'constant'! |
|
123 |
||
4342 | 124 |
updateTaskCyleTime |
11445 | 125 |
"time to check for changed directories or changed columns |
126 |
(unless triggered by an action)" |
|
127 |
||
128 |
^ 10 seconds |
|
129 |
||
130 |
"Modified (comment): / 20-03-2012 / 12:26:40 / cg" |
|
4342 | 131 |
! |
132 |
||
3887 | 133 |
updateTaskPriority |
5377 | 134 |
"priority of the update task" |
135 |
||
15466
a62dd831dbb8
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
15284
diff
changeset
|
136 |
^ Processor userSchedulingPriority |
3887 | 137 |
! ! |
138 |
||
3980 | 139 |
!DirectoryContentsBrowser class methodsFor:'image specs'! |
140 |
||
4027 | 141 |
detailsMenuIconDown |
8998 | 142 |
<resource: #programImage> |
143 |
||
144 |
^ DataSetLabel sortReverseIndicator |
|
3980 | 145 |
! |
146 |
||
147 |
detailsMenuIconR |
|
14414
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
148 |
<resource: #image> |
3980 | 149 |
"This resource specification was automatically generated |
150 |
by the ImageEditor of ST/X." |
|
151 |
"Do not manually edit this!! If it is corrupted, |
|
152 |
the ImageEditor may not be able to read the specification." |
|
153 |
" |
|
154 |
self detailsMenuIconR inspect |
|
155 |
ImageEditor openOnClass:self andSelector:#detailsMenuIconR |
|
14414
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
156 |
Icon flushCachedIcons" |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
157 |
|
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
158 |
^ Icon constantNamed:#'DirectoryContentsBrowser class detailsMenuIconR' |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
159 |
ifAbsentPut:[ |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
160 |
(Depth1Image new) |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
161 |
width:5; |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
162 |
height:7; |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
163 |
photometric:(#palette); |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
164 |
bitsPerSample:(#( 1 )); |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
165 |
samplesPerPixel:(1); |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
166 |
bits:(ByteArray fromPackedString:'@@@@@@@@@@@a'); |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
167 |
colorMapFromArray:#[ 0 0 0 255 255 255 ]; |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
168 |
mask:((ImageMask new) |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
169 |
width:5; |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
170 |
height:7; |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
171 |
bits:(ByteArray fromPackedString:' DB TJA@ @@a'); |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
172 |
yourself); |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
173 |
yourself |
5a6057e72b16
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14191
diff
changeset
|
174 |
] |
4027 | 175 |
! |
176 |
||
177 |
detailsMenuIconUp |
|
8998 | 178 |
<resource: #programImage> |
179 |
||
180 |
^ DataSetLabel sortIndicator |
|
4027 | 181 |
! ! |
182 |
||
183 |
!DirectoryContentsBrowser class methodsFor:'interface specs'! |
|
3980 | 184 |
|
3887 | 185 |
tableColumns |
186 |
"This resource specification was automatically generated |
|
187 |
by the DataSetBuilder of ST/X." |
|
188 |
||
189 |
"Do not manually edit this!! If it is corrupted, |
|
190 |
the DataSetBuilder may not be able to read the specification." |
|
191 |
||
192 |
" |
|
193 |
DataSetBuilder new openOnClass:DirectoryContentsBrowser andSelector:#tableColumns |
|
194 |
" |
|
195 |
||
196 |
<resource: #tableColumns> |
|
197 |
||
198 |
^#( |
|
5312 | 199 |
(DataSetColumnSpec |
200 |
label: '' |
|
13797 | 201 |
labelIsImage: true |
5312 | 202 |
labelButtonType: Group |
203 |
width: 22 |
|
204 |
minWidth: 22 |
|
205 |
height: 16 |
|
206 |
model: icon |
|
13797 | 207 |
menuFromApplication: false |
208 |
printSelector: icon |
|
5312 | 209 |
canSelect: false |
210 |
showRowSeparator: false |
|
211 |
showColSeparator: false |
|
3887 | 212 |
) |
5312 | 213 |
(DataSetColumnSpec |
214 |
label: 'Filename' |
|
215 |
labelAlignment: left |
|
216 |
labelButtonType: Button |
|
217 |
labelActionSelector: sortFileListsBy: |
|
218 |
labelActionArgument: 'baseName' |
|
219 |
minWidth: 150 |
|
220 |
model: baseName |
|
221 |
canSelect: false |
|
222 |
showRowSeparator: false |
|
223 |
showColSeparator: false |
|
3887 | 224 |
) |
5312 | 225 |
(DataSetColumnSpec |
226 |
label: 'Suffix' |
|
227 |
labelAlignment: left |
|
228 |
labelButtonType: Button |
|
229 |
labelActionSelector: sortFileListsBy: |
|
230 |
labelActionArgument: 'suffix' |
|
231 |
usePreferredWidth: true |
|
232 |
width: 40 |
|
233 |
model: suffix |
|
234 |
canSelect: false |
|
235 |
isResizeable: false |
|
236 |
showRowSeparator: false |
|
237 |
showColSeparator: false |
|
3887 | 238 |
) |
5312 | 239 |
(DataSetColumnSpec |
240 |
label: 'Inode' |
|
241 |
labelAlignment: left |
|
242 |
labelButtonType: Button |
|
243 |
labelActionSelector: sortFileListsBy: |
|
244 |
labelActionArgument: 'inodeNumber' |
|
245 |
usePreferredWidth: true |
|
246 |
width: 75 |
|
247 |
model: inodeNumber |
|
248 |
canSelect: false |
|
249 |
isResizeable: false |
|
250 |
showRowSeparator: false |
|
251 |
showColSeparator: false |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
252 |
) |
5312 | 253 |
(DataSetColumnSpec |
254 |
label: 'Perm' |
|
255 |
labelAlignment: left |
|
256 |
labelButtonType: Button |
|
257 |
labelActionSelector: sortFileListsBy: |
|
258 |
labelActionArgument: 'permissions' |
|
259 |
usePreferredWidth: true |
|
260 |
width: 75 |
|
261 |
model: permissions |
|
262 |
canSelect: false |
|
263 |
isResizeable: false |
|
264 |
showRowSeparator: false |
|
265 |
showColSeparator: false |
|
3887 | 266 |
) |
5312 | 267 |
(DataSetColumnSpec |
268 |
label: 'Owner' |
|
269 |
labelAlignment: left |
|
270 |
labelButtonType: Button |
|
271 |
labelActionSelector: sortFileListsBy: |
|
272 |
labelActionArgument: 'owner' |
|
273 |
usePreferredWidth: true |
|
274 |
width: 50 |
|
275 |
model: owner |
|
276 |
canSelect: false |
|
277 |
showRowSeparator: false |
|
278 |
showColSeparator: false |
|
3887 | 279 |
) |
5312 | 280 |
(DataSetColumnSpec |
281 |
label: 'Group' |
|
282 |
labelAlignment: left |
|
283 |
labelButtonType: Button |
|
284 |
labelActionSelector: sortFileListsBy: |
|
285 |
labelActionArgument: 'group' |
|
286 |
usePreferredWidth: true |
|
287 |
width: 40 |
|
288 |
model: group |
|
289 |
canSelect: false |
|
290 |
showRowSeparator: false |
|
291 |
showColSeparator: false |
|
3887 | 292 |
) |
5312 | 293 |
(DataSetColumnSpec |
294 |
label: 'Size' |
|
295 |
labelAlignment: right |
|
296 |
labelButtonType: Button |
|
297 |
labelActionSelector: sortFileListsBy: |
|
298 |
labelActionArgument: 'fileSize' |
|
299 |
columnAlignment: decimal |
|
300 |
usePreferredWidth: true |
|
301 |
minWidth: 45 |
|
302 |
model: sizeString |
|
303 |
canSelect: false |
|
304 |
showRowSeparator: false |
|
305 |
showColSeparator: false |
|
306 |
) |
|
307 |
(DataSetColumnSpec |
|
308 |
label: 'KB' |
|
309 |
labelAlignment: right |
|
310 |
labelButtonType: Button |
|
311 |
labelActionSelector: sortFileListsBy: |
|
312 |
labelActionArgument: 'fileSize' |
|
313 |
columnAlignment: right |
|
314 |
usePreferredWidth: true |
|
5338 | 315 |
minWidth: 50 |
5312 | 316 |
model: sizeInKiloBytesString |
317 |
canSelect: false |
|
318 |
showRowSeparator: false |
|
319 |
showColSeparator: false |
|
3887 | 320 |
) |
5312 | 321 |
(DataSetColumnSpec |
322 |
label: 'Bytes' |
|
323 |
labelAlignment: right |
|
324 |
labelButtonType: Button |
|
325 |
labelActionSelector: sortFileListsBy: |
|
326 |
labelActionArgument: 'fileSize' |
|
327 |
columnAlignment: right |
|
328 |
usePreferredWidth: true |
|
5338 | 329 |
minWidth: 60 |
5312 | 330 |
model: sizeInBytesString |
331 |
canSelect: false |
|
332 |
showRowSeparator: false |
|
333 |
showColSeparator: false |
|
4970 | 334 |
) |
5312 | 335 |
(DataSetColumnSpec |
336 |
label: 'Date & Time' |
|
337 |
labelAlignment: right |
|
338 |
labelButtonType: Button |
|
339 |
labelActionSelector: sortFileListsBy: |
|
340 |
labelActionArgument: 'modificationTime' |
|
341 |
columnAlignment: right |
|
342 |
usePreferredWidth: true |
|
343 |
width: 140 |
|
344 |
model: timeAndDate |
|
345 |
writeSelector: date: |
|
346 |
canSelect: false |
|
347 |
showRowSeparator: false |
|
348 |
showColSeparator: false |
|
3887 | 349 |
) |
5312 | 350 |
(DataSetColumnSpec |
351 |
label: 'File Info' |
|
352 |
labelAlignment: left |
|
353 |
labelButtonType: Button |
|
354 |
labelActionSelector: sortFileListsBy: |
|
355 |
labelActionArgument: 'fileType' |
|
356 |
width: 250 |
|
357 |
model: fileInfoString |
|
358 |
canSelect: false |
|
359 |
showRowSeparator: false |
|
360 |
showColSeparator: false |
|
3887 | 361 |
) |
5312 | 362 |
(DataSetColumnSpec |
363 |
label: 'Pre +/-' |
|
364 |
labelButtonType: Button |
|
365 |
labelActionSelector: doResizeImage |
|
366 |
labelActionArgument: '' |
|
367 |
columnAlignment: center |
|
368 |
width: 45 |
|
369 |
height: 16 |
|
370 |
model: preview |
|
371 |
canSelect: false |
|
372 |
showRowSeparator: false |
|
373 |
showColSeparator: false |
|
3887 | 374 |
) |
375 |
) |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
376 |
|
3887 | 377 |
! |
378 |
||
379 |
windowSpec |
|
380 |
"This resource specification was automatically generated |
|
381 |
by the UIPainter of ST/X." |
|
382 |
||
383 |
"Do not manually edit this!! If it is corrupted, |
|
384 |
the UIPainter may not be able to read the specification." |
|
385 |
||
386 |
" |
|
387 |
UIPainter new openOnClass:DirectoryContentsBrowser andSelector:#windowSpec |
|
388 |
DirectoryContentsBrowser new openInterface:#windowSpec |
|
389 |
DirectoryContentsBrowser open |
|
390 |
" |
|
391 |
||
392 |
<resource: #canvas> |
|
393 |
||
394 |
^ |
|
5152
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
395 |
#(FullSpec |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
396 |
name: windowSpec |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
397 |
window: |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
398 |
(WindowSpec |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
399 |
label: 'Directory ContentsBrowser' |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
400 |
name: 'Directory ContentsBrowser' |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
401 |
min: (Point 10 10) |
5868 | 402 |
bounds: (Rectangle 0 0 588 478) |
5152
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
403 |
menu: menu |
3887 | 404 |
) |
5152
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
405 |
component: |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
406 |
(SpecCollection |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
407 |
collection: ( |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
408 |
(DataSetSpec |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
409 |
name: 'browser' |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
410 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
411 |
model: selectionInFileList |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
412 |
menu: directoryContentsBrowserMenu |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
413 |
hasHorizontalScrollBar: true |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
414 |
hasVerticalScrollBar: true |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
415 |
miniScrollerHorizontal: false |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
416 |
miniScrollerVertical: false |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
417 |
dataList: browserItemList |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
418 |
useIndex: false |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
419 |
has3Dsepartors: false |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
420 |
doubleClickSelector: doubleClickedAt: |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
421 |
columnHolder: tableColumns |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
422 |
multipleSelectOk: true |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
423 |
verticalSpacing: 0 |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
424 |
columns: |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
425 |
(OrderedCollection |
3887 | 426 |
|
5152
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
427 |
(DataSetColumnSpec |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
428 |
labelButtonType: Group |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
429 |
width: 22 |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
430 |
minWidth: 22 |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
431 |
height: 16 |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
432 |
model: icon |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
433 |
canSelect: false |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
434 |
showRowSeparator: false |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
435 |
showColSeparator: false |
3887 | 436 |
) |
5152
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
437 |
(DataSetColumnSpec |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
438 |
label: 'file name' |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
439 |
labelAlignment: left |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
440 |
labelButtonType: Button |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
441 |
model: baseName |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
442 |
canSelect: false |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
443 |
showRowSeparator: false |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
444 |
showColSeparator: false |
3887 | 445 |
) |
446 |
||
5152
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
447 |
(DataSetColumnSpec |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
448 |
label: '+/-' |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
449 |
labelButtonType: Button |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
450 |
labelActionSelector: doResizeImage |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
451 |
labelActionArgument: '' |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
452 |
columnAlignment: center |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
453 |
width: 30 |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
454 |
height: 16 |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
455 |
model: preview |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
456 |
canSelect: false |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
457 |
showRowSeparator: false |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
458 |
showSelectionHighLighted: false |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
459 |
showColSeparator: false |
3887 | 460 |
) |
461 |
) |
|
5868 | 462 |
doubleClickChannel: doDoubleClick: |
5152
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
463 |
postBuildCallback: postBuildBrowser: |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
464 |
properties: |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
465 |
(PropertyListDictionary |
5868 | 466 |
dropSelector: doDrop: |
5152
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
467 |
dragArgument: contentsbrowser |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
468 |
startDragSelector: doStartDrag:in: |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
469 |
displayObjectSelector: getDisplayObjects: |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
470 |
dropObjectSelector: getDropObjects: |
5868 | 471 |
overSelector: dropOver: |
5152
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
472 |
dropArgument: browser |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
473 |
canDropSelector: canDrop: |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
474 |
leaveSelector: dropLeave: |
6c6716dd6642
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
5140
diff
changeset
|
475 |
enterSelector: dropEnter: |
3887 | 476 |
) |
477 |
) |
|
478 |
) |
|
479 |
||
480 |
) |
|
481 |
) |
|
482 |
! ! |
|
483 |
||
484 |
!DirectoryContentsBrowser class methodsFor:'menu specs'! |
|
485 |
||
486 |
directoryContentsBrowserMenu |
|
487 |
"This resource specification was automatically generated |
|
488 |
by the MenuEditor of ST/X." |
|
489 |
||
490 |
"Do not manually edit this!! If it is corrupted, |
|
491 |
the MenuEditor may not be able to read the specification." |
|
492 |
||
13797 | 493 |
|
3887 | 494 |
" |
495 |
MenuEditor new openOnClass:DirectoryContentsBrowser andSelector:#directoryContentsBrowserMenu |
|
496 |
(Menu new fromLiteralArrayEncoding:(DirectoryContentsBrowser directoryContentsBrowserMenu)) startUp |
|
497 |
" |
|
498 |
||
499 |
<resource: #menu> |
|
500 |
||
501 |
^ |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
502 |
#(Menu |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
503 |
( |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
504 |
(MenuItem |
6594 | 505 |
enabled: hasSelection |
506 |
label: 'Open' |
|
507 |
itemValue: doShowFileContents |
|
508 |
translateLabel: true |
|
509 |
) |
|
510 |
(MenuItem |
|
511 |
enabled: hasSelection |
|
512 |
label: 'FileIn' |
|
513 |
itemValue: fileFileIn |
|
514 |
translateLabel: true |
|
515 |
) |
|
516 |
(MenuItem |
|
517 |
label: '-' |
|
518 |
) |
|
519 |
(MenuItem |
|
13797 | 520 |
label: 'SourceCodeManagement' |
521 |
translateLabel: true |
|
522 |
submenuChannel: scmMenuSlice |
|
523 |
isMenuSlice: true |
|
524 |
) |
|
525 |
(MenuItem |
|
526 |
label: '-' |
|
527 |
) |
|
528 |
(MenuItem |
|
5945 | 529 |
label: 'New' |
530 |
translateLabel: true |
|
531 |
submenuChannel: newMenu |
|
532 |
keepLinkedMenu: true |
|
533 |
) |
|
534 |
(MenuItem |
|
535 |
label: '-' |
|
536 |
) |
|
537 |
(MenuItem |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
538 |
label: 'Cut' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
539 |
itemValue: doCut |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
540 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
541 |
shortcutKey: Cut |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
542 |
) |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
543 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
544 |
label: 'Copy' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
545 |
itemValue: doCopy |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
546 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
547 |
shortcutKey: Copy |
4615
cc32f33b6b60
cut-copy-paste is the correct order
Claus Gittinger <cg@exept.de>
parents:
4611
diff
changeset
|
548 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
549 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
550 |
enabled: canPaste |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
551 |
label: 'Paste' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
552 |
itemValue: pasteFiles |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
553 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
554 |
shortcutKey: Paste |
3887 | 555 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
556 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
557 |
label: 'Delete' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
558 |
itemValue: doDelete |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
559 |
nameKey: delete |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
560 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
561 |
shortcutKey: Delete |
3887 | 562 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
563 |
(MenuItem |
6286 | 564 |
label: 'Erase' |
565 |
itemValue: doErase |
|
566 |
nameKey: erase |
|
567 |
translateLabel: true |
|
568 |
) |
|
569 |
(MenuItem |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
570 |
label: '-' |
3887 | 571 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
572 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
573 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
574 |
label: 'Rename...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
575 |
itemValue: renameSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
576 |
translateLabel: true |
8715 | 577 |
shortcutKey: Rename |
4534 | 578 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
579 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
580 |
enabled: hasSelection |
6107 | 581 |
label: 'Move To...' |
582 |
itemValue: moveSelectionTo |
|
583 |
translateLabel: true |
|
584 |
) |
|
585 |
(MenuItem |
|
586 |
enabled: hasSelection |
|
587 |
label: 'Copy To...' |
|
588 |
itemValue: copySelectionTo |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
589 |
translateLabel: true |
3887 | 590 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
591 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
592 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
593 |
label: 'Properties...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
594 |
itemValue: doShowProperties |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
595 |
translateLabel: true |
4376 | 596 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
597 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
598 |
label: '-' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
599 |
) |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
600 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
601 |
label: 'More' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
602 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
603 |
submenu: |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
604 |
(Menu |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
605 |
( |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
606 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
607 |
label: 'Select All' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
608 |
itemValue: selectAll |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
609 |
translateLabel: true |
4477 | 610 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
611 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
612 |
label: '-' |
4477 | 613 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
614 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
615 |
enabled: fileListIsNotEmpty |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
616 |
label: 'Copy Filenames' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
617 |
itemValue: copyFileList |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
618 |
translateLabel: true |
3907 | 619 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
620 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
621 |
label: '-' |
3907 | 622 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
623 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
624 |
enabled: hasFileSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
625 |
label: 'FileIn to Namespace...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
626 |
itemValue: fileFileInToNameSpace |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
627 |
translateLabel: true |
3907 | 628 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
629 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
630 |
label: '-' |
3980 | 631 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
632 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
633 |
enabled: hasTwoFilesSelected |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
634 |
label: 'Compare with Each Other' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
635 |
itemValue: doCompareTwoFiles |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
636 |
translateLabel: true |
4415 | 637 |
) |
4376 | 638 |
) |
639 |
nil |
|
640 |
nil |
|
641 |
) |
|
642 |
) |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
643 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
644 |
label: 'Tools' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
645 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
646 |
submenuChannel: toolsMenuSpec |
5425 | 647 |
keepLinkedMenu: true |
4850 | 648 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
649 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
650 |
label: '-' |
4376 | 651 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
652 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
653 |
label: 'View' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
654 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
655 |
submenu: |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
656 |
(Menu |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
657 |
( |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
658 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
659 |
label: 'Details' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
660 |
nameKey: View |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
661 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
662 |
submenuChannel: viewBrowserMenu |
4376 | 663 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
664 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
665 |
label: 'Sort' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
666 |
nameKey: Sort |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
667 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
668 |
submenuChannel: sortMenu |
3907 | 669 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
670 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
671 |
label: 'Show' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
672 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
673 |
submenu: |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
674 |
(Menu |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
675 |
( |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
676 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
677 |
label: 'Hidden Files' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
678 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
679 |
indication: showHiddenFiles |
4415 | 680 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
681 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
682 |
label: 'Directories' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
683 |
translateLabel: true |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
684 |
indication: viewDirsInContentsBrowser |
4415 | 685 |
) |
4410 | 686 |
) |
687 |
nil |
|
688 |
nil |
|
689 |
) |
|
690 |
) |
|
3907 | 691 |
) |
692 |
nil |
|
693 |
nil |
|
694 |
) |
|
3887 | 695 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
696 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
697 |
label: '-' |
3980 | 698 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
699 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
700 |
label: 'Update' |
5740 | 701 |
itemValue: updateCurrentDirectoryWithReread |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5321
diff
changeset
|
702 |
translateLabel: true |
3980 | 703 |
) |
3887 | 704 |
) |
705 |
nil |
|
706 |
nil |
|
707 |
) |
|
708 |
! |
|
709 |
||
710 |
viewBrowserMenu |
|
711 |
"This resource specification was automatically generated |
|
712 |
by the MenuEditor of ST/X." |
|
713 |
||
714 |
"Do not manually edit this!! If it is corrupted, |
|
715 |
the MenuEditor may not be able to read the specification." |
|
716 |
||
717 |
" |
|
718 |
MenuEditor new openOnClass:DirectoryContentsBrowser andSelector:#viewBrowserMenu |
|
719 |
(Menu new fromLiteralArrayEncoding:(DirectoryContentsBrowser viewBrowserMenu)) startUp |
|
720 |
" |
|
721 |
||
4415 | 722 |
<resource: #programMenu> |
3887 | 723 |
|
7764 | 724 |
^ Menu decodeFromLiteralArray:self viewBrowserMenuSpec |
725 |
||
726 |
"Modified: / 27-03-2007 / 08:46:24 / cg" |
|
3961 | 727 |
! |
728 |
||
729 |
viewBrowserMenuSpec |
|
730 |
"This resource specification was automatically generated |
|
731 |
by the MenuEditor of ST/X." |
|
732 |
||
733 |
"Do not manually edit this!! If it is corrupted, |
|
734 |
the MenuEditor may not be able to read the specification." |
|
735 |
||
736 |
" |
|
4421 | 737 |
MenuEditor new openOnClass:DirectoryContentsBrowser andSelector:#viewBrowserMenuSpec |
738 |
(Menu new fromLiteralArrayEncoding:(DirectoryContentsBrowser viewBrowserMenuSpec)) startUp |
|
3961 | 739 |
" |
740 |
||
741 |
<resource: #menu> |
|
742 |
||
3887 | 743 |
^ |
5740 | 744 |
#(Menu |
745 |
( |
|
746 |
(MenuItem |
|
747 |
label: 'Show Details' |
|
748 |
translateLabel: true |
|
749 |
hideMenuOnActivated: false |
|
750 |
indication: viewDetails |
|
3887 | 751 |
) |
5740 | 752 |
(MenuItem |
753 |
label: '-' |
|
3984 | 754 |
) |
5740 | 755 |
(MenuItem |
756 |
label: 'Icon' |
|
757 |
translateLabel: true |
|
758 |
hideMenuOnActivated: false |
|
759 |
indication: viewIcon |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
760 |
) |
5740 | 761 |
(MenuItem |
762 |
enabled: viewDetails |
|
763 |
label: 'Suffix' |
|
764 |
translateLabel: true |
|
765 |
hideMenuOnActivated: false |
|
766 |
indication: viewType |
|
3887 | 767 |
) |
5740 | 768 |
(MenuItem |
769 |
enabled: viewDetails |
|
770 |
label: 'Inode' |
|
771 |
translateLabel: true |
|
772 |
hideMenuOnActivated: false |
|
773 |
indication: viewInodeNumber |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
774 |
) |
5740 | 775 |
(MenuItem |
776 |
enabled: viewDetails |
|
777 |
label: 'Permissions' |
|
778 |
translateLabel: true |
|
779 |
hideMenuOnActivated: false |
|
780 |
indication: viewPermissions |
|
3887 | 781 |
) |
5740 | 782 |
(MenuItem |
783 |
enabled: viewDetails |
|
784 |
label: 'Owner' |
|
785 |
translateLabel: true |
|
786 |
isVisible: userContextAvailable |
|
787 |
hideMenuOnActivated: false |
|
788 |
indication: viewOwner |
|
3887 | 789 |
) |
5740 | 790 |
(MenuItem |
791 |
enabled: viewDetails |
|
792 |
label: 'Group' |
|
793 |
translateLabel: true |
|
794 |
isVisible: userContextAvailable |
|
795 |
hideMenuOnActivated: false |
|
796 |
indication: viewGroup |
|
3887 | 797 |
) |
5740 | 798 |
(MenuItem |
799 |
enabled: viewDetails |
|
800 |
label: 'Size' |
|
801 |
translateLabel: true |
|
802 |
hideMenuOnActivated: false |
|
803 |
indication: viewSize |
|
3887 | 804 |
) |
5740 | 805 |
(MenuItem |
806 |
enabled: viewDetails |
|
807 |
label: 'Size (KByte)' |
|
808 |
translateLabel: true |
|
809 |
hideMenuOnActivated: false |
|
810 |
indication: viewSizeInKiloBytes |
|
5312 | 811 |
) |
5740 | 812 |
(MenuItem |
813 |
enabled: viewDetails |
|
814 |
label: 'Size (Byte)' |
|
815 |
translateLabel: true |
|
816 |
hideMenuOnActivated: false |
|
817 |
indication: viewSizeInBytes |
|
4970 | 818 |
) |
5740 | 819 |
(MenuItem |
820 |
enabled: viewDetails |
|
821 |
label: 'Date && Time' |
|
822 |
translateLabel: true |
|
823 |
hideMenuOnActivated: false |
|
824 |
indication: viewTime |
|
3887 | 825 |
) |
5740 | 826 |
(MenuItem |
827 |
enabled: viewDetails |
|
828 |
label: 'File Info' |
|
829 |
translateLabel: true |
|
830 |
hideMenuOnActivated: false |
|
831 |
indication: viewDescription |
|
3887 | 832 |
) |
5740 | 833 |
(MenuItem |
834 |
enabled: viewDetails |
|
835 |
label: 'Preview' |
|
836 |
translateLabel: true |
|
837 |
hideMenuOnActivated: false |
|
838 |
indication: viewPreview |
|
3887 | 839 |
) |
5740 | 840 |
(MenuItem |
841 |
label: '-' |
|
842 |
isVisible: false |
|
3887 | 843 |
) |
5740 | 844 |
(MenuItem |
845 |
label: 'Show Hidden Files' |
|
846 |
translateLabel: true |
|
847 |
isVisible: false |
|
848 |
indication: showHiddenFiles |
|
3980 | 849 |
) |
5740 | 850 |
(MenuItem |
851 |
label: 'Update' |
|
852 |
itemValue: updateCurrentDirectoryWithReread |
|
853 |
translateLabel: true |
|
854 |
isVisible: false |
|
3980 | 855 |
) |
856 |
) |
|
857 |
nil |
|
858 |
nil |
|
859 |
) |
|
3887 | 860 |
! ! |
861 |
||
862 |
!DirectoryContentsBrowser methodsFor:'accessing'! |
|
863 |
||
4342 | 864 |
allItems |
11448 | 865 |
allItems isNil ifTrue:[ |
866 |
^ OrderedCollection new. |
|
867 |
]. |
|
868 |
^ allItems |
|
869 |
||
870 |
"Modified: / 20-03-2012 / 14:31:02 / cg" |
|
4342 | 871 |
! |
872 |
||
873 |
allItems:something |
|
874 |
allItems := something. |
|
875 |
! |
|
876 |
||
5105
849d4430b492
bug fix (copy filenames/selected filenames)
Claus Gittinger <cg@exept.de>
parents:
5010
diff
changeset
|
877 |
browserFileList |
849d4430b492
bug fix (copy filenames/selected filenames)
Claus Gittinger <cg@exept.de>
parents:
5010
diff
changeset
|
878 |
^ self browserItemList collect:[:item | item fileName] |
849d4430b492
bug fix (copy filenames/selected filenames)
Claus Gittinger <cg@exept.de>
parents:
5010
diff
changeset
|
879 |
! |
849d4430b492
bug fix (copy filenames/selected filenames)
Claus Gittinger <cg@exept.de>
parents:
5010
diff
changeset
|
880 |
|
3887 | 881 |
columnDescriptors |
882 |
"get the column description |
|
883 |
" |
|
884 |
^ columnDescriptors |
|
885 |
! |
|
886 |
||
887 |
columnDescriptors:aListOfColumns |
|
888 |
"set the column description |
|
889 |
" |
|
890 |
columnDescriptors = aListOfColumns ifTrue:[ |
|
891 |
^ self |
|
892 |
]. |
|
893 |
||
894 |
columnDescriptors := OrderedCollection new. |
|
4970 | 895 |
previewIndex := 0. |
3887 | 896 |
iconIndex := 0. |
897 |
fileDescriptionIndex := 0. |
|
898 |
iconExtent := nil. |
|
899 |
||
4970 | 900 |
aListOfColumns keysAndValuesDo:[:anIndex :aDesc| |
901 |
|col readSelector| |
|
902 |
||
903 |
col := aDesc isSequenceable |
|
7764 | 904 |
ifTrue:[DataSetColumnSpec decodeFromLiteralArray:aDesc] |
4970 | 905 |
ifFalse:[aDesc]. |
3887 | 906 |
columnDescriptors add:col. |
907 |
||
4970 | 908 |
"/ cg: UGLY CODE NOTIFICATION |
909 |
readSelector := col readSelector. |
|
910 |
readSelector == #preview ifTrue:[ |
|
3887 | 911 |
previewIndex := anIndex. |
912 |
iconExtent := Point x:(col width) y:(col height). |
|
913 |
] ifFalse:[ |
|
4970 | 914 |
readSelector == #fileInfoString ifTrue:[ |
3887 | 915 |
fileDescriptionIndex := anIndex. |
916 |
] ifFalse:[ |
|
4970 | 917 |
readSelector == #icon ifTrue:[ |
3887 | 918 |
iconIndex := anIndex. |
919 |
] |
|
920 |
] |
|
921 |
] |
|
922 |
]. |
|
7764 | 923 |
|
924 |
"Modified: / 27-03-2007 / 08:46:33 / cg" |
|
3887 | 925 |
! |
926 |
||
927 |
directory |
|
928 |
"returns the current directory or nil |
|
929 |
" |
|
930 |
^ directory |
|
931 |
||
932 |
! |
|
933 |
||
934 |
directory:aDirectory |
|
935 |
"change the current directory and read the items |
|
936 |
" |
|
5935
72f0c8866406
attempt to preserve scroll-position as per directory
Claus Gittinger <cg@exept.de>
parents:
5870
diff
changeset
|
937 |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
938 |
aDirectory ~= directory ifTrue:[ |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
939 |
directory notNil ifTrue:[ |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
940 |
AbstractFileBrowser directoryHistory setPosition:(browser firstLineShown) for:(directory pathName). |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
941 |
]. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
942 |
directory := aDirectory. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
943 |
self wakeUpForDirectoryChanged. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
944 |
] |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
945 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
946 |
"Modified: / 07-01-2012 / 16:41:20 / cg" |
4342 | 947 |
! |
948 |
||
949 |
directoryChangeFlag |
|
950 |
^ directoryChangeFlag |
|
7856 | 951 |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
952 |
"Modified: / 07-01-2012 / 16:34:39 / cg" |
4342 | 953 |
! |
954 |
||
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
955 |
directoryChangeFlag:aBoolean |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
956 |
directoryChangeFlag := aBoolean. |
7856 | 957 |
|
958 |
"Modified: / 01-10-2007 / 19:22:35 / cg" |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
959 |
"Modified (format): / 07-01-2012 / 16:34:46 / cg" |
4342 | 960 |
! |
961 |
||
962 |
directoryContentsChangeFlag |
|
963 |
"return the value of the instance variable 'directoryContentsChangeFlag' (automatically generated)" |
|
964 |
||
965 |
^ directoryContentsChangeFlag |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
966 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
967 |
"Modified: / 07-01-2012 / 16:34:51 / cg" |
4342 | 968 |
! |
969 |
||
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
970 |
directoryContentsChangeFlag:aBoolean |
4342 | 971 |
"set the value of the instance variable 'directoryContentsChangeFlag' (automatically generated)" |
972 |
||
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
973 |
directoryContentsChangeFlag := aBoolean. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
974 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
975 |
"Modified (format): / 07-01-2012 / 16:35:01 / cg" |
4342 | 976 |
! |
977 |
||
5868 | 978 |
doubleClickAction |
979 |
||
980 |
^ doubleClickAction |
|
981 |
! |
|
982 |
||
983 |
doubleClickAction:aBlock |
|
984 |
||
985 |
" aBlock is a one arg block with selected index as argument " |
|
986 |
||
987 |
doubleClickAction := aBlock |
|
988 |
! |
|
989 |
||
15283
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
990 |
enterActionBlock |
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
991 |
^ enterActionBlock |
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
992 |
! |
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
993 |
|
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
994 |
enterActionBlock:aBlock |
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
995 |
enterActionBlock := aBlock. |
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
996 |
! |
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
997 |
|
4342 | 998 |
filterChangeFlag |
999 |
"return the value of the instance variable 'filterChangeFlag' (automatically generated)" |
|
1000 |
||
1001 |
^ filterChangeFlag |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1002 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1003 |
"Modified: / 07-01-2012 / 16:35:07 / cg" |
4342 | 1004 |
! |
1005 |
||
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1006 |
filterChangeFlag:aBoolean |
4342 | 1007 |
"set the value of the instance variable 'filterChangeFlag' (automatically generated)" |
1008 |
||
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1009 |
filterChangeFlag := aBoolean. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1010 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1011 |
"Modified (format): / 07-01-2012 / 16:35:12 / cg" |
4342 | 1012 |
! |
1013 |
||
1014 |
isBusy |
|
1015 |
"return the value of the instance variable 'isBusy' (automatically generated)" |
|
1016 |
||
1017 |
isBusy isNil ifTrue:[ |
|
1018 |
isBusy := false. |
|
1019 |
]. |
|
1020 |
^ isBusy |
|
1021 |
! |
|
1022 |
||
1023 |
isBusy:something |
|
1024 |
"set the value of the instance variable 'isBusy' (automatically generated)" |
|
1025 |
||
1026 |
isBusy := something. |
|
4017 | 1027 |
! |
1028 |
||
1029 |
matchBlock |
|
1030 |
"return the value of the instance variable 'matchBlock' (automatically generated)" |
|
1031 |
||
1032 |
^ matchBlock |
|
1033 |
! |
|
1034 |
||
1035 |
matchBlock:filterBlock |
|
1036 |
||
1037 |
matchBlock := filterBlock. |
|
3887 | 1038 |
! |
1039 |
||
5868 | 1040 |
multipleSelect |
1041 |
^ multipleSelect ? false |
|
1042 |
! |
|
1043 |
||
1044 |
multipleSelect:aBoolean |
|
1045 |
||
1046 |
multipleSelect := aBoolean. |
|
1047 |
browser notNil ifTrue:[ |
|
1048 |
browser multipleSelectOk:aBoolean. |
|
1049 |
]. |
|
1050 |
! |
|
1051 |
||
4342 | 1052 |
sortBlockChangeFlag |
1053 |
"return the value of the instance variable 'sortBlockChangeFlag' (automatically generated)" |
|
1054 |
||
1055 |
^ sortBlockChangeFlag |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1056 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1057 |
"Modified: / 07-01-2012 / 16:35:20 / cg" |
4298 | 1058 |
! |
1059 |
||
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1060 |
sortBlockChangeFlag:aBoolean |
4342 | 1061 |
"set the value of the instance variable 'sortBlockChangeFlag' (automatically generated)" |
1062 |
||
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1063 |
sortBlockChangeFlag := aBoolean. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1064 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1065 |
"Modified (format): / 07-01-2012 / 16:35:25 / cg" |
3887 | 1066 |
! |
1067 |
||
3983 | 1068 |
updateContentsSelection |
1069 |
"return the value of the instance variable 'updateToExternFileHolder' (automatically generated)" |
|
1070 |
||
1071 |
updateContentsSelection isNil ifTrue:[ |
|
1072 |
updateContentsSelection := self class newLock. |
|
1073 |
]. |
|
1074 |
^ updateContentsSelection |
|
15284
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1075 |
! |
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1076 |
|
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1077 |
updateCurrentFileNameHolderWhenSelectionChanges |
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1078 |
^ updateCurrentFileNameHolderWhenSelectionChanges |
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1079 |
! |
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1080 |
|
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1081 |
updateCurrentFileNameHolderWhenSelectionChanges:aBoolean |
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1082 |
updateCurrentFileNameHolderWhenSelectionChanges := aBoolean. |
3887 | 1083 |
! ! |
1084 |
||
1085 |
!DirectoryContentsBrowser methodsFor:'actions'! |
|
1086 |
||
4342 | 1087 |
browserItemListAdd:addItemCol remove:remItemCol |
4335
b56935032115
keep selection on update and insert new lines smarter in displayed list
penk
parents:
4298
diff
changeset
|
1088 |
| browserList selection| |
b56935032115
keep selection on update and insert new lines smarter in displayed list
penk
parents:
4298
diff
changeset
|
1089 |
|
b56935032115
keep selection on update and insert new lines smarter in displayed list
penk
parents:
4298
diff
changeset
|
1090 |
(addItemCol isEmpty and:[remItemCol isEmpty]) ifTrue:[ ^ self]. |
4972 | 1091 |
selection := self selectedItemsWithoutDotDotDirectory. |
4017 | 1092 |
remItemCol notEmpty ifTrue:[ |
4462
b14fcc67ff8e
removeAll: changed to removeAllFoundIn:
Michael Beyl <mb@exept.de>
parents:
4421
diff
changeset
|
1093 |
self browserItemList removeAllFoundIn:remItemCol |
4017 | 1094 |
]. |
1095 |
addItemCol notEmpty ifTrue:[ |
|
4335
b56935032115
keep selection on update and insert new lines smarter in displayed list
penk
parents:
4298
diff
changeset
|
1096 |
browserList := self browserItemList copy. |
b56935032115
keep selection on update and insert new lines smarter in displayed list
penk
parents:
4298
diff
changeset
|
1097 |
addItemCol do:[: aNewItem | |
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6226
diff
changeset
|
1098 |
(browserList includes:aNewItem) ifFalse:[ |
4335
b56935032115
keep selection on update and insert new lines smarter in displayed list
penk
parents:
4298
diff
changeset
|
1099 |
browserList add:aNewItem. |
5383 | 1100 |
browserList := self sortBlockHolder value sortItemList:browserList. |
4335
b56935032115
keep selection on update and insert new lines smarter in displayed list
penk
parents:
4298
diff
changeset
|
1101 |
self browserItemList add:aNewItem beforeIndex:(browserList indexOf:aNewItem). |
b56935032115
keep selection on update and insert new lines smarter in displayed list
penk
parents:
4298
diff
changeset
|
1102 |
] |
b56935032115
keep selection on update and insert new lines smarter in displayed list
penk
parents:
4298
diff
changeset
|
1103 |
]. |
4017 | 1104 |
]. |
4335
b56935032115
keep selection on update and insert new lines smarter in displayed list
penk
parents:
4298
diff
changeset
|
1105 |
self selectItems:selection. |
4017 | 1106 |
! |
1107 |
||
4027 | 1108 |
currentSortOrderChanged |
1109 |
||
4652 | 1110 |
"/ self wakeUpForSortBlockChanged. |
6225 | 1111 |
|
1112 |
"/ have to reread the columns to set the icon for sort direction |
|
1113 |
"/ very expensive. Need to change table label directly |
|
4027 | 1114 |
self viewedColumnsChanged. |
1115 |
! |
|
1116 |
||
3887 | 1117 |
doResizeImage |
4342 | 1118 |
|column w h selection| |
3887 | 1119 |
|
1120 |
previewIndex == 0 ifTrue:[^ self]. |
|
1121 |
||
1122 |
column := columnDescriptors at:previewIndex. |
|
4342 | 1123 |
w := iconExtent x. |
3887 | 1124 |
h := iconExtent y. |
1125 |
||
1126 |
w == column width ifTrue:[ |
|
1127 |
w := w * 2. |
|
1128 |
h := h * 2. |
|
1129 |
]. |
|
1130 |
column width:w. |
|
1131 |
column height:h. |
|
1132 |
||
3990 | 1133 |
"/Processor activeProcess ~~ self windowGroup process ifTrue:[self halt]. |
4342 | 1134 |
selection := self selectedItems. |
3983 | 1135 |
browserItemList do:[:el| el resetImageFile ]. |
4713 | 1136 |
browser columnDescriptors:(self tableColumns value). |
4342 | 1137 |
self selectItems:selection. |
1138 |
self wakeUp. |
|
3887 | 1139 |
! |
1140 |
||
1141 |
doUpdate |
|
4421 | 1142 |
"/ DirectoryContents flushCache. |
5738 | 1143 |
self wakeUpForDirectoryChanged. |
7714 | 1144 |
self updateDiskUsage. |
1145 |
"/ updateCycleSemaphore wait. |
|
3887 | 1146 |
! |
1147 |
||
5740 | 1148 |
doUpdateDirectoryContents |
1149 |
"/ DirectoryContents flushCache. |
|
1150 |
self wakeUpForDirectoryContentsChanged. |
|
7714 | 1151 |
self updateDiskUsage. |
1152 |
"/ updateCycleSemaphore wait. |
|
5740 | 1153 |
! |
1154 |
||
3984 | 1155 |
doubleClickedAt:anItemIndex |
5959 | 1156 |
|action| |
3983 | 1157 |
|
6831
56061d3bcbf0
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6826
diff
changeset
|
1158 |
"/ self withWaitCursorDo:[ |
5959 | 1159 |
(action := self doubleClickAction) notNil ifTrue:[ |
1160 |
action value:anItemIndex. |
|
5868 | 1161 |
]. |
4013 | 1162 |
self enterActionFor:(self browserItemList at:anItemIndex). "/ anItemIndex. |
6831
56061d3bcbf0
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6826
diff
changeset
|
1163 |
"/ ] |
56061d3bcbf0
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6826
diff
changeset
|
1164 |
|
56061d3bcbf0
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6826
diff
changeset
|
1165 |
"Modified: / 25-07-2006 / 09:07:55 / cg" |
3887 | 1166 |
! |
1167 |
||
1168 |
enterActionFor:anItem |
|
10300 | 1169 |
| filename info targetItem linkFile targetFile| |
3887 | 1170 |
|
15283
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
1171 |
enterActionBlock notNil ifTrue:[ |
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
1172 |
enterActionBlock value: anItem. |
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
1173 |
^ self. |
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
1174 |
]. |
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
1175 |
|
3887 | 1176 |
filename := anItem fileName. |
3906 | 1177 |
|
4014 | 1178 |
filename baseName = '..' ifTrue:[ |
5959 | 1179 |
self setCurrentFileName:(self directory directory). |
3887 | 1180 |
^ self. |
1181 |
]. |
|
8375 | 1182 |
targetItem := anItem. |
9883 | 1183 |
targetFile := filename. |
8375 | 1184 |
|
1185 |
[ |
|
9883 | 1186 |
(info := targetFile linkInfo) notNil |
1187 |
and:[ info isSymbolicLink ] |
|
8375 | 1188 |
] whileTrue:[ |
1189 |
targetItem := nil. |
|
9883 | 1190 |
info path isNil ifTrue:[^ self]. |
10300 | 1191 |
linkFile := info path asFilename. |
1192 |
linkFile isRelative ifTrue:[ |
|
1193 |
targetFile := filename directory construct:info path. |
|
1194 |
] ifFalse:[ |
|
1195 |
targetFile := linkFile |
|
1196 |
] |
|
8375 | 1197 |
]. |
1198 |
||
9883 | 1199 |
filename := targetFile. |
1200 |
||
5321 | 1201 |
(filename isDirectory) ifTrue:[ |
5959 | 1202 |
self setCurrentFileName:filename. |
3887 | 1203 |
^ self. |
1204 |
]. |
|
8375 | 1205 |
|
1206 |
targetItem isNil ifTrue:[ |
|
1207 |
targetItem := anItem class fileName:filename. |
|
1208 |
]. |
|
1209 |
||
6831
56061d3bcbf0
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6826
diff
changeset
|
1210 |
"/ self withWaitCursorDo:[ |
8375 | 1211 |
self openApplByFileItem:targetItem. |
6831
56061d3bcbf0
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6826
diff
changeset
|
1212 |
"/ ] |
56061d3bcbf0
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6826
diff
changeset
|
1213 |
|
56061d3bcbf0
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6826
diff
changeset
|
1214 |
"Modified: / 25-07-2006 / 09:08:00 / cg" |
15283
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
1215 |
"Modified: / 27-08-2014 / 20:22:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4017 | 1216 |
! |
1217 |
||
11445 | 1218 |
noOfShownFiles:noOfShownFiles noOfFiles:noOfFiles |
4017 | 1219 |
|
4263 | 1220 |
|info filterBox clr| |
1221 |
||
11445 | 1222 |
info := (noOfShownFiles == 1 ifTrue:['%1 file'] ifFalse:['%1 files']). |
1223 |
noOfShownFiles = noOfFiles ifFalse:[ |
|
7672 | 1224 |
info := info,' (%2 total)'. |
4263 | 1225 |
]. |
5120 | 1226 |
self shownFiles |
1227 |
value:(resources |
|
1228 |
string:info |
|
11445 | 1229 |
with:noOfShownFiles |
7672 | 1230 |
with:noOfFiles). |
4263 | 1231 |
|
4017 | 1232 |
filterBox := self filterValueBox value. |
1233 |
filterBox isNil ifTrue:[^ self ]. |
|
9103
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
1234 |
|
11445 | 1235 |
noOfShownFiles ~= noOfFiles ifTrue:[ |
4017 | 1236 |
clr := Color red lightened lightened lightened. |
9103
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
1237 |
[ |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
1238 |
View drawingOnClosedDrawableSignal catch:[ |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
1239 |
filterBox flash |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
1240 |
] |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
1241 |
] fork. |
4017 | 1242 |
] ifFalse:[ |
1243 |
clr := self filterBackgroundColor value. |
|
1244 |
]. |
|
1245 |
filterBox backgroundColor:clr. |
|
11445 | 1246 |
|
1247 |
"Created: / 20-03-2012 / 12:08:57 / cg" |
|
4017 | 1248 |
! |
1249 |
||
8407 | 1250 |
setBrowserItemList:aFilteredItems |
1251 |
||
14707
3c6471ac9f14
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14574
diff
changeset
|
1252 |
|showDir showDirsOnTop directoryUpItem locItems browserList| |
4017 | 1253 |
|
4202 | 1254 |
showDir := self viewDirsInContentsBrowser value. |
14707
3c6471ac9f14
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14574
diff
changeset
|
1255 |
showDirsOnTop := self showDirectoriesOnTop value. |
8407 | 1256 |
|
4017 | 1257 |
(showDir and:[self directory notNil and:[self directory isRootDirectory not]]) ifTrue:[ |
5249 | 1258 |
locItems := OrderedCollection new. |
4017 | 1259 |
directoryUpItem := DirectoryContentsBrowser itemClass fileName:(self directory construct:'..'). |
5249 | 1260 |
directoryUpItem notNil ifTrue:[ |
1261 |
locItems add:directoryUpItem. |
|
1262 |
]. |
|
12093
900b133ef74c
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12061
diff
changeset
|
1263 |
locItems addAll:(aFilteredItems ? #()). |
4346 | 1264 |
] ifFalse:[ |
8407 | 1265 |
locItems := aFilteredItems. |
4017 | 1266 |
]. |
14707
3c6471ac9f14
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14574
diff
changeset
|
1267 |
(showDir and:[showDirsOnTop]) ifTrue:[ |
3c6471ac9f14
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14574
diff
changeset
|
1268 |
locItems := (locItems select:[ :e | e isDirectory ]) , (locItems reject:[ :e | e isDirectory]) |
3c6471ac9f14
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14574
diff
changeset
|
1269 |
]. |
4039 | 1270 |
self updateToExternFileHolderLock doLocked:[ |
8407 | 1271 |
browserList := self browserItemList. |
11445 | 1272 |
|
1273 |
(browserList sameContentsAs: locItems) ifTrue:[ |
|
1274 |
"/ same |
|
1275 |
] ifFalse:[ |
|
1276 |
"/ bugfix - first remove all entries in list |
|
1277 |
browserList removeAll. |
|
1278 |
browserList contents:locItems. |
|
1279 |
]. |
|
4039 | 1280 |
]. |
4017 | 1281 |
self selectCurrentFiles. |
11177 | 1282 |
|
11445 | 1283 |
"Modified: / 20-03-2012 / 12:17:14 / cg" |
14707
3c6471ac9f14
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14574
diff
changeset
|
1284 |
"Modified: / 12-08-2014 / 13:14:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7714 | 1285 |
! |
1286 |
||
1287 |
updateDiskUsage |
|
1288 |
directory notNil ifTrue:[ |
|
1289 |
self flushRememberedDiskUsageInfoFor:directory. |
|
1290 |
] ifFalse:[ |
|
1291 |
self flushRememberedDiskUsageInfo. |
|
1292 |
]. |
|
1293 |
self startDiskUsageInfoProcess. |
|
3887 | 1294 |
! ! |
1295 |
||
1296 |
!DirectoryContentsBrowser methodsFor:'aspects'! |
|
1297 |
||
3983 | 1298 |
browserItemList |
1299 |
||
1300 |
browserItemList isNil ifTrue:[ |
|
1301 |
browserItemList := List new. |
|
1302 |
]. |
|
1303 |
^ browserItemList |
|
3887 | 1304 |
! |
1305 |
||
13797 | 1306 |
currentDirectoryDisplayed |
1307 |
"Return a directory as Filename that is currently displayed in the browser" |
|
1308 |
||
1309 |
^ directory |
|
1310 |
||
1311 |
"Modified: / 15-01-2013 / 11:42:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1312 |
! |
|
1313 |
||
3983 | 1314 |
selectionInFileList |
1315 |
||
1316 |
selectionInFileList isNil ifTrue:[ |
|
1317 |
selectionInFileList := ValueHolder new. |
|
1318 |
selectionInFileList addDependent:self. |
|
3887 | 1319 |
]. |
3983 | 1320 |
^ selectionInFileList |
3887 | 1321 |
! |
1322 |
||
1323 |
tableColumns |
|
1324 |
||
1325 |
tableColumns isNil ifTrue:[ |
|
1326 |
tableColumns := self class tableColumns asValue. |
|
1327 |
]. |
|
1328 |
^ tableColumns. |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1329 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1330 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1331 |
valueHolderForColumn:id |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1332 |
"xlate #suffix -> viewType, etc... |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1333 |
i.e. for a columns readSelector, return my valueHolder" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1334 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1335 |
^ self perform:('view' , id asUppercaseFirst) asSymbol |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1336 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1337 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1338 |
viewFileInfoString |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1339 |
^ self viewDescription |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1340 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1341 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1342 |
viewSizeInBytesString |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1343 |
^ self viewSizeInBytes |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1344 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1345 |
|
5312 | 1346 |
viewSizeInKiloBytesString |
1347 |
^ self viewSizeInKiloBytes |
|
1348 |
! |
|
1349 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1350 |
viewSizeString |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1351 |
^ self viewSize |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1352 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1353 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1354 |
viewSuffix |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1355 |
^ self viewType |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1356 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1357 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1358 |
viewTimeAndDate |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1359 |
^ self viewTime |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1360 |
! ! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1361 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1362 |
!DirectoryContentsBrowser methodsFor:'aspects-visibility'! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1363 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1364 |
colVisibilityAspectFor:aKey ifAbsent:absentBlock |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1365 |
"aspect for a columns visibility" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1366 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1367 |
|holder| |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1368 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1369 |
holder := self aspectFor:aKey ifAbsent:absentBlock. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1370 |
holder onChangeSend:#viewedColumnsChanged to:self. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1371 |
^ holder |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1372 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1373 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1374 |
viewDescription |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1375 |
"aspect for show file description" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1376 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1377 |
^ self colVisibilityAspectFor:#viewDescription ifAbsent:[ false asValue ]. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1378 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1379 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1380 |
viewDetails |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1381 |
"aspect for show more file properties |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1382 |
" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1383 |
|
6359 | 1384 |
^ self colVisibilityAspectFor:#viewDetails ifAbsent:[ true asValue ]. |
7079 | 1385 |
|
1386 |
"Modified: / 04-09-2006 / 09:46:43 / cg" |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1387 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1388 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1389 |
viewGroup |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1390 |
" aspect for show group information " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1391 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1392 |
^ self colVisibilityAspectFor:#viewGroup ifAbsent:[ false asValue ]. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1393 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1394 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1395 |
viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1396 |
" aspect for show file-type icon" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1397 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1398 |
^ self colVisibilityAspectFor:#viewIcon ifAbsent:[ true asValue ]. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1399 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1400 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1401 |
viewInodeNumber |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1402 |
" aspect for show inode number " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1403 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1404 |
^ self colVisibilityAspectFor:#viewInodeNumber ifAbsent:[ false asValue ]. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1405 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1406 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1407 |
viewOwner |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1408 |
" aspect for show owner information " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1409 |
|
6359 | 1410 |
^ self colVisibilityAspectFor:#viewOwner ifAbsent:[ true asValue ]. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1411 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1412 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1413 |
viewPermissions |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1414 |
" aspect for show permission information " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1415 |
|
7079 | 1416 |
^ self colVisibilityAspectFor:#viewPermissions ifAbsent:[ false asValue ]. |
1417 |
||
1418 |
"Modified: / 04-09-2006 / 09:46:12 / cg" |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1419 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1420 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1421 |
viewPreview |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1422 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1423 |
" aspect for show image previev " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1424 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1425 |
^ self colVisibilityAspectFor:#viewPreview ifAbsent:[ false asValue ]. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1426 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1427 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1428 |
viewSize |
6463 | 1429 |
" aspect for show-size information " |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1430 |
|
6359 | 1431 |
^ self colVisibilityAspectFor:#viewSize ifAbsent:[ true asValue ]. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1432 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1433 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1434 |
viewSizeInBytes |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1435 |
" aspect for show size-in-bytes information " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1436 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1437 |
^ self colVisibilityAspectFor:#viewSizeInBytes ifAbsent:[ false asValue ]. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1438 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1439 |
|
5312 | 1440 |
viewSizeInKiloBytes |
1441 |
" aspect for show size-in-kilobytes information " |
|
1442 |
||
1443 |
^ self colVisibilityAspectFor:#viewSizeInKiloBytes ifAbsent:[ false asValue ]. |
|
1444 |
! |
|
1445 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1446 |
viewTime |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1447 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1448 |
" aspect for show time information " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1449 |
|
6359 | 1450 |
^ self colVisibilityAspectFor:#viewTime ifAbsent:[ true asValue ]. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1451 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1452 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1453 |
viewType |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1454 |
" aspect for show suffix (type) information " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1455 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1456 |
^ self colVisibilityAspectFor:#viewType ifAbsent:[ false asValue ]. |
3887 | 1457 |
! ! |
1458 |
||
1459 |
!DirectoryContentsBrowser methodsFor:'change & update'! |
|
1460 |
||
3983 | 1461 |
currentFileNameHolderChanged |
3887 | 1462 |
"filename changed |
1463 |
" |
|
4889 | 1464 |
|newDir currentDir aColOfFiles| |
3983 | 1465 |
|
7563 | 1466 |
aColOfFiles := self currentSelectedObjects. |
4978
9ca1ae265211
selectedFiles for directoryContentsBrowser without the .. dir
penk
parents:
4976
diff
changeset
|
1467 |
aColOfFiles isEmpty ifTrue:[ |
9ca1ae265211
selectedFiles for directoryContentsBrowser without the .. dir
penk
parents:
4976
diff
changeset
|
1468 |
"/ selection is gone keep the current directory list |
9ca1ae265211
selectedFiles for directoryContentsBrowser without the .. dir
penk
parents:
4976
diff
changeset
|
1469 |
^ self |
9ca1ae265211
selectedFiles for directoryContentsBrowser without the .. dir
penk
parents:
4976
diff
changeset
|
1470 |
]. |
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6226
diff
changeset
|
1471 |
(self currentFilesAreInSameDirectory) ifFalse:[ |
3887 | 1472 |
self directory:nil. |
1473 |
^ self |
|
1474 |
]. |
|
6726 | 1475 |
self currentSelectedDirectories size > 1 ifTrue:[ |
4889 | 1476 |
self directory:nil. |
1477 |
^ self |
|
1478 |
]. |
|
4536 | 1479 |
aColOfFiles size == 1 ifTrue:[ |
4781 | 1480 |
self startDiskUsageInfoProcess. |
4536 | 1481 |
]. |
4900 | 1482 |
newDir := (self directoriesForFiles:aColOfFiles) first asCanonicalizedFilename. |
4901 | 1483 |
currentDir := self directory. |
4906
5f632635a291
oops - bad checkin (cvs conflict)
Claus Gittinger <cg@exept.de>
parents:
4903
diff
changeset
|
1484 |
(currentDir notNil and:[newDir = currentDir asCanonicalizedFilename]) ifTrue:[ |
5f632635a291
oops - bad checkin (cvs conflict)
Claus Gittinger <cg@exept.de>
parents:
4903
diff
changeset
|
1485 |
self selectFiles:aColOfFiles. |
5f632635a291
oops - bad checkin (cvs conflict)
Claus Gittinger <cg@exept.de>
parents:
4903
diff
changeset
|
1486 |
^ self. |
5f632635a291
oops - bad checkin (cvs conflict)
Claus Gittinger <cg@exept.de>
parents:
4903
diff
changeset
|
1487 |
]. |
4536 | 1488 |
"/ change of the directory filename |
1489 |
self directory:newDir. |
|
7563 | 1490 |
|
1491 |
"Modified: / 04-12-2006 / 13:15:32 / cg" |
|
3887 | 1492 |
! |
1493 |
||
4071 | 1494 |
filterBlockHolderChanged |
1495 |
||
7714 | 1496 |
self matchBlock:(self filterBlockHolder value). |
4342 | 1497 |
self wakeUpForFilterChanged. |
4071 | 1498 |
! |
1499 |
||
3983 | 1500 |
selectionChanged |
1501 |
||
4004 | 1502 |
| selection newCurrentFilename | |
3983 | 1503 |
|
1504 |
self directory isNil ifTrue:[^ self]. |
|
4781 | 1505 |
|
3983 | 1506 |
selection := self selectedFiles. |
1507 |
selection isEmpty ifTrue:[ |
|
4004 | 1508 |
newCurrentFilename := OrderedCollection with:self directory. |
3983 | 1509 |
] ifFalse:[ |
4004 | 1510 |
newCurrentFilename := selection. |
3983 | 1511 |
]. |
15284
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1512 |
updateCurrentFileNameHolderWhenSelectionChanges ifTrue:[ |
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1513 |
self currentSelectedObjects ~= newCurrentFilename ifTrue:[ |
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1514 |
self currentFileNameHolder value:newCurrentFilename withoutNotifying:self |
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1515 |
]. |
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1516 |
] |
7563 | 1517 |
|
1518 |
"Modified: / 04-12-2006 / 13:15:37 / cg" |
|
15284
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1519 |
"Modified: / 13-02-2015 / 20:57:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3983 | 1520 |
! |
1521 |
||
4781 | 1522 |
update:something with:aParameter from:changedObject |
3887 | 1523 |
"one of my models changed |
1524 |
" |
|
3983 | 1525 |
|
4781 | 1526 |
changedObject == self currentFileNameHolder ifTrue:[ |
1527 |
super update:something with:aParameter from:changedObject. |
|
3983 | 1528 |
self updateContentsSelection doIfUnLocked:[ |
4017 | 1529 |
self currentFileNameHolderChanged. |
3983 | 1530 |
]. |
4007 | 1531 |
^ self. |
3983 | 1532 |
]. |
4781 | 1533 |
changedObject == self selectionInFileList ifTrue:[ |
3983 | 1534 |
self updateToExternFileHolderLock doIfUnLocked:[ |
1535 |
self updateContentsSelection doLocked:[ |
|
1536 |
self selectionChanged. |
|
1537 |
] |
|
1538 |
]. |
|
1539 |
^ self. |
|
1540 |
]. |
|
4781 | 1541 |
changedObject == self currentSortOrder ifTrue:[ |
4027 | 1542 |
self currentSortOrderChanged. |
1543 |
^ self. |
|
1544 |
]. |
|
4781 | 1545 |
changedObject == self filterBlockHolder ifTrue:[ |
4071 | 1546 |
self filterBlockHolderChanged. |
3887 | 1547 |
^ self. |
1548 |
]. |
|
4781 | 1549 |
changedObject == self sortBlockHolder ifTrue:[ |
4342 | 1550 |
self wakeUpForSortBlockChanged. |
3887 | 1551 |
^ self. |
1552 |
]. |
|
4781 | 1553 |
changedObject == self viewDirsInContentsBrowser ifTrue:[ |
5869 | 1554 |
self sortBlockHolder value directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]). |
4342 | 1555 |
self wakeUpForFilterChanged. |
3887 | 1556 |
^ self |
1557 |
]. |
|
5869 | 1558 |
changedObject == self sortDirectoriesBeforeFiles ifTrue:[ |
1559 |
self sortBlockHolder value directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]). |
|
1560 |
^ self |
|
1561 |
]. |
|
4781 | 1562 |
changedObject == self showDiskUsageHolder ifTrue:[ |
1563 |
self notify:''. |
|
1564 |
changedObject value ifTrue:[ |
|
1565 |
self startDiskUsageInfoProcess. |
|
1566 |
] ifFalse:[ |
|
1567 |
self flushRememberedDiskUsageInfo |
|
1568 |
]. |
|
1569 |
^ self |
|
1570 |
]. |
|
1571 |
||
1572 |
super update:something with:aParameter from:changedObject |
|
3887 | 1573 |
! |
1574 |
||
7563 | 1575 |
updateListAfterDelete:collectionOfFiles |
7572 | 1576 |
|indices firstIndex lastIndex nextIndex nextItem| |
7563 | 1577 |
|
1578 |
collectionOfFiles size > 100 ifTrue:[ |
|
1579 |
super updateListAfterDelete:collectionOfFiles. |
|
1580 |
^ self |
|
1581 |
]. |
|
1582 |
||
1583 |
indices := collectionOfFiles collect:[:eachFile | browserItemList findFirst:[:item | item fileName = eachFile]]. |
|
1584 |
lastIndex := indices max. |
|
7572 | 1585 |
firstIndex := indices min. |
1586 |
nextIndex := lastIndex+1. |
|
1587 |
nextIndex > browserItemList size ifTrue:[ nextIndex := firstIndex-1]. |
|
1588 |
nextItem := browserItemList at:nextIndex ifAbsent:nil. |
|
1589 |
||
1590 |
accessLock critical:[ |
|
1591 |
indices asSortedCollection |
|
1592 |
reverseDo:[:eachIndexToRemove | |
|
1593 |
eachIndexToRemove ~~ 0 ifTrue:[ |
|
1594 |
browserItemList removeIndex:eachIndexToRemove |
|
1595 |
] |
|
1596 |
]. |
|
1597 |
]. |
|
1598 |
||
11446 | 1599 |
self directoryContentsChanged. "/ to force update of the numberOfShown files. |
7563 | 1600 |
nextItem notNil ifTrue:[ |
7572 | 1601 |
self |
1602 |
enqueueMessage:#value |
|
1603 |
for:[ self selectionInFileList value:(OrderedCollection with:nextItem). |
|
1604 |
self selectItems:(OrderedCollection with:nextItem) ] |
|
1605 |
arguments:#(). |
|
1606 |
"/ self selectionInFileList value:(OrderedCollection with:nextItem). |
|
1607 |
"/ self selectItems:(OrderedCollection with:nextItem). |
|
7563 | 1608 |
]. |
1609 |
||
11446 | 1610 |
"Modified: / 20-03-2012 / 13:22:48 / cg" |
5544 | 1611 |
! |
1612 |
||
4342 | 1613 |
viewPreviewChanged |
1614 |
||
1615 |
browserItemList do:[:el| el resetImageFile ]. |
|
1616 |
self viewedColumnsChanged. |
|
1617 |
! |
|
1618 |
||
3887 | 1619 |
viewedColumnsChanged |
1620 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1621 |
|columns buffer currentSortOrder currentSortOrderColumn currentSortOrderReverse selection holder| |
4342 | 1622 |
|
1623 |
selection := self selectedItems. |
|
4778
e1c81c22bf36
Avoid slow grow operations on Array.
Stefan Vogel <sv@exept.de>
parents:
4768
diff
changeset
|
1624 |
buffer := self class tableColumns |
7764 | 1625 |
collect:[:col| (DataSetColumnSpec decodeFromLiteralArray:col)]. |
4768 | 1626 |
|
4778
e1c81c22bf36
Avoid slow grow operations on Array.
Stefan Vogel <sv@exept.de>
parents:
4768
diff
changeset
|
1627 |
columns := buffer asOrderedCollection. |
3887 | 1628 |
self viewDetails value = false ifTrue:[ |
4713 | 1629 |
browser showLabels:false. |
3887 | 1630 |
buffer do:[:col | |
1631 |
(col readSelector = #baseName or:[col readSelector = #icon]) ifFalse:[ |
|
1632 |
columns remove:col. |
|
1633 |
] |
|
1634 |
] |
|
1635 |
] ifFalse:[ |
|
4713 | 1636 |
browser showLabels:true. |
4027 | 1637 |
currentSortOrder := self currentSortOrder value. |
1638 |
currentSortOrderColumn := currentSortOrder at:#column ifAbsent:nil. |
|
1639 |
currentSortOrderReverse := currentSortOrder at:#reverse ifAbsent:nil. |
|
3887 | 1640 |
buffer do:[:col | |
8998 | 1641 |
| id label icon | |
4970 | 1642 |
|
1643 |
id := col readSelector. |
|
3887 | 1644 |
id notNil ifTrue:[ |
4027 | 1645 |
(col labelActionArgument notNil and:[col labelActionArgument asSymbol == currentSortOrderColumn]) ifTrue:[ |
1646 |
label := col label. |
|
8998 | 1647 |
icon := currentSortOrderReverse |
1648 |
ifTrue:[ self class detailsMenuIconDown] |
|
1649 |
ifFalse:[ self class detailsMenuIconUp]. |
|
4027 | 1650 |
col label:(LabelAndIcon label:label icon:icon). |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1651 |
]. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1652 |
|
4970 | 1653 |
((id == #baseName) or:[id == #baseNameWithOutSuffix]) ifTrue:[ |
4027 | 1654 |
self viewType value ifTrue:[ |
1655 |
col readSelector:#baseNameWithOutSuffix |
|
3887 | 1656 |
] ifFalse:[ |
4027 | 1657 |
col readSelector:#baseName |
1658 |
]. |
|
1659 |
] ifFalse:[ |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1660 |
holder := self valueHolderForColumn:id. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1661 |
holder value ifFalse:[ |
4970 | 1662 |
columns remove:col. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
1663 |
]. |
3887 | 1664 |
] |
1665 |
] |
|
1666 |
] |
|
1667 |
]. |
|
4039 | 1668 |
self updateToExternFileHolderLock doLocked:[ |
1669 |
self tableColumns value:columns. |
|
1670 |
]. |
|
3887 | 1671 |
self columnDescriptors:(self tableColumns value). |
4342 | 1672 |
self selectItems:selection. |
1673 |
self wakeUp. |
|
7764 | 1674 |
|
1675 |
"Modified: / 27-03-2007 / 08:46:28 / cg" |
|
3887 | 1676 |
! ! |
1677 |
||
1678 |
!DirectoryContentsBrowser methodsFor:'drag & drop'! |
|
1679 |
||
1680 |
doStartDrag:aDropSource in:aView |
|
9360
442d863efe2a
comment/format in: #doStartDrag:in:
Claus Gittinger <cg@exept.de>
parents:
9323
diff
changeset
|
1681 |
"set the cursors before starting the drag & drop operation" |
442d863efe2a
comment/format in: #doStartDrag:in:
Claus Gittinger <cg@exept.de>
parents:
9323
diff
changeset
|
1682 |
|
3983 | 1683 |
|selectedFiles| |
1684 |
||
1685 |
selectedFiles := self selectedFiles. |
|
4014 | 1686 |
(selectedFiles isEmpty) ifTrue:[ |
3887 | 1687 |
^ self. |
1688 |
]. |
|
3953 | 1689 |
^ super doStartDrag:aDropSource in:aView |
1690 |
! |
|
1691 |
||
4746 | 1692 |
dropDestinationPath |
1693 |
|destinationPath| |
|
1694 |
||
1695 |
draggedItem isNil ifTrue:[ |
|
1696 |
destinationPath := self directory. |
|
1697 |
] ifFalse:[ |
|
1698 |
destinationPath := self getDirWithoutFileName:(draggedItem fileName). |
|
1699 |
destinationPath baseName = '..' ifTrue:[ |
|
1700 |
destinationPath := self directory directory. |
|
1701 |
] |
|
1702 |
]. |
|
1703 |
||
1704 |
^ destinationPath |
|
1705 |
! |
|
1706 |
||
13797 | 1707 |
dropObjects:aCollectionOfDropObjects |
1708 |
"drop manager wants to drop. |
|
1709 |
This is ony sent, if #canDrop: returned true. |
|
1710 |
Must be redefined in order for drop to work." |
|
1711 |
||
1712 |
^ self shouldImplement |
|
1713 |
! |
|
1714 |
||
4683 | 1715 |
dropOver:aDropContext |
4611 | 1716 |
"called during drag & drop while moving over the widget." |
1717 |
||
3953 | 1718 |
|lineNr newDest destinationFile| |
1719 |
||
1720 |
inDropMode ifFalse:[^ self]. |
|
1721 |
||
4683 | 1722 |
lineNr := self getLineNumberFor:aDropContext. |
3953 | 1723 |
lineNr notNil ifTrue:[ |
3983 | 1724 |
newDest := browserItemList at:lineNr. |
3953 | 1725 |
(newDest notNil and:[newDest isDirectory]) ifTrue:[ |
1726 |
destinationFile := newDest fileName. |
|
4014 | 1727 |
destinationFile baseName = '..' ifTrue:[ |
3953 | 1728 |
destinationFile := self directory directory. |
1729 |
] |
|
1730 |
]. |
|
1731 |
]. |
|
4683 | 1732 |
|
1733 |
newDest == draggedItem ifTrue:[ |
|
1734 |
"/ beyond last contents-line |
|
1735 |
newDest isNil ifTrue:[ |
|
1736 |
canDropItem := self canDropFiles:(aDropContext dropObjects) for:self directory. |
|
1737 |
]. |
|
1738 |
^ self |
|
1739 |
]. |
|
3953 | 1740 |
|
1741 |
destinationFile isNil ifTrue:[ |
|
1742 |
destinationFile := self directory. |
|
1743 |
]. |
|
3887 | 1744 |
|
3953 | 1745 |
newDest ~~ draggedItem ifTrue:[ |
4683 | 1746 |
aDropContext dropSource argument == #archivApplication ifTrue:[ |
3953 | 1747 |
canDropItem := true. |
1748 |
] ifFalse:[ |
|
4683 | 1749 |
canDropItem := self canDropFiles:(aDropContext dropObjects) for:destinationFile. |
3953 | 1750 |
]. |
1751 |
]. |
|
4683 | 1752 |
self dropTargetItemChangedTo:newDest in:aDropContext. |
3953 | 1753 |
! |
1754 |
||
1755 |
dropTargetItemChangedTo:anItem in:aDropContext |
|
1756 |
||
1757 |
| current | |
|
1758 |
||
1759 |
||
1760 |
"/ (anItem notNil and:[anItem isDirectory]) ifTrue:[ self halt]. |
|
1761 |
current := draggedItem. |
|
3967 | 1762 |
"/ Transcript showCR:'current:', (current isNil ifTrue:['nil'] ifFalse:[current fileName baseName]). |
1763 |
"/ Transcript showCR:'anItem:', (anItem isNil ifTrue:['nil'] ifFalse:[anItem fileName baseName]). |
|
3953 | 1764 |
current == anItem ifTrue:[^ self]. |
1765 |
draggedItem := anItem. |
|
1766 |
||
1767 |
aDropContext contentsWillChange. |
|
1768 |
||
9534
aabf8d5125a5
changed: #dropTargetItemChangedTo:in:
Claus Gittinger <cg@exept.de>
parents:
9513
diff
changeset
|
1769 |
current notNil ifTrue:[ |
3953 | 1770 |
current isDirectory ifTrue:[ |
1771 |
current icon:(self getIconFor:current). |
|
1772 |
]. |
|
1773 |
]. |
|
1774 |
||
9534
aabf8d5125a5
changed: #dropTargetItemChangedTo:in:
Claus Gittinger <cg@exept.de>
parents:
9513
diff
changeset
|
1775 |
anItem notNil ifTrue:[ |
3953 | 1776 |
anItem isDirectory ifTrue:[ |
14424
64e4e2a24b46
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14414
diff
changeset
|
1777 |
anItem icon:(MIMETypeIconLibrary iconForKeyMatching:#directoryOpenGray) |
64e4e2a24b46
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14414
diff
changeset
|
1778 |
"/ (self class iconForKeyMatching:#directoryOpenGray). |
3953 | 1779 |
]. |
1780 |
]. |
|
4713 | 1781 |
browser shown ifTrue:[ |
1782 |
browser invalidateVisibleRow:current colAt:iconIndex. |
|
1783 |
browser invalidateVisibleRow:anItem colAt:iconIndex. |
|
1784 |
browser repairDamage. |
|
3953 | 1785 |
]. |
9534
aabf8d5125a5
changed: #dropTargetItemChangedTo:in:
Claus Gittinger <cg@exept.de>
parents:
9513
diff
changeset
|
1786 |
|
aabf8d5125a5
changed: #dropTargetItemChangedTo:in:
Claus Gittinger <cg@exept.de>
parents:
9513
diff
changeset
|
1787 |
"Modified: / 08-08-2010 / 14:41:53 / cg" |
3887 | 1788 |
! |
1789 |
||
1790 |
getDisplayObjects:anArgument |
|
4713 | 1791 |
|selectedItems string fnName stream| |
1792 |
||
1793 |
selectedItems := self selectedFiles. |
|
1794 |
selectedItems isEmpty ifTrue:[ ^ '']. |
|
1795 |
||
15592
cdeaf8307c45
class: DirectoryContentsBrowser
Stefan Vogel <sv@exept.de>
parents:
15466
diff
changeset
|
1796 |
stream := CharacterWriteStream with:(selectedItems first baseName). |
4713 | 1797 |
selectedItems size == 1 ifTrue:[ |
3887 | 1798 |
fnName := 'ui_menuitem.xpm'. |
1799 |
] ifFalse:[ |
|
1800 |
fnName := 'ui_submenu_open.xpm'. |
|
1801 |
stream nextPutAll:' ... '. |
|
4713 | 1802 |
stream nextPutAll:(selectedItems last baseName). |
3887 | 1803 |
]. |
1804 |
string := stream contents. |
|
1805 |
stream close. |
|
4713 | 1806 |
|
3887 | 1807 |
^ Array with:(LabelAndIcon icon:(Image fromFile:fnName) |
1808 |
string:(Text string:string emphasis:#bold) |
|
1809 |
) |
|
1810 |
! ! |
|
1811 |
||
1812 |
!DirectoryContentsBrowser methodsFor:'event handling'! |
|
1813 |
||
1814 |
processEvent:anEvent |
|
1815 |
"filter keyboard events. |
|
1816 |
Return true, if I have eaten the event" |
|
1817 |
||
12113 | 1818 |
<resource: #keyboard (#Accept #Paste #CursorLeft #Cut #Copy #Delete |
1819 |
#Return #Rename)> |
|
1820 |
||
3887 | 1821 |
|focusView key rawKey| |
1822 |
||
4713 | 1823 |
anEvent isKeyPressEvent ifFalse:[^ false]. |
1824 |
||
1825 |
focusView := anEvent targetView. |
|
1826 |
(focusView isNil or:[focusView ~~ browser]) ifTrue:[ ^ false]. |
|
1827 |
||
1828 |
key := anEvent key. |
|
1829 |
rawKey := anEvent rawKey. |
|
1830 |
||
1831 |
"/ (key ~= #'Alt_L') ifTrue:[self halt.]. |
|
1832 |
key == #Accept ifTrue:[ |
|
6831
56061d3bcbf0
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6826
diff
changeset
|
1833 |
self withActivityIndicationDo:[ |
5260 | 1834 |
self fileFileIn. |
1835 |
]. |
|
4713 | 1836 |
^ true. |
1837 |
]. |
|
1838 |
key == #Paste ifTrue:[ |
|
1839 |
self pasteFiles. |
|
1840 |
^ true. |
|
3887 | 1841 |
]. |
4970 | 1842 |
"/ strange feeling, because behavior is different depending on |
1843 |
"/ where the mouse pointer is (treeView vs. contentsView) |
|
1844 |
"/ |
|
5404 | 1845 |
(key == #CursorLeft) ifTrue:[ |
1846 |
self doGoDirectoryUp. |
|
1847 |
^ true |
|
1848 |
]. |
|
4713 | 1849 |
"/ (key == #CursorRight) ifTrue:[ |
1850 |
"/ self doBack. |
|
1851 |
"/ ^ true |
|
1852 |
"/ ]. |
|
1853 |
browserItemList size == 0 ifTrue:[ |
|
1854 |
^ false |
|
1855 |
]. |
|
1856 |
||
1857 |
key == #Cut ifTrue:[ |
|
1858 |
self doCut. |
|
1859 |
^ true. |
|
1860 |
]. |
|
1861 |
key == #Copy ifTrue:[ |
|
1862 |
self doCopy. |
|
1863 |
^ true. |
|
1864 |
]. |
|
12113 | 1865 |
((key == #Delete) or:[key == #BackSpace]) ifTrue:[ |
4713 | 1866 |
self doDelete. |
1867 |
^ true. |
|
1868 |
]. |
|
1869 |
(key == #Return) ifTrue:[ |
|
4972 | 1870 |
self enterAction. |
4713 | 1871 |
^ true. |
1872 |
]. |
|
8715 | 1873 |
key == #Rename ifTrue:[ |
4828 | 1874 |
self renameSelection. |
1875 |
^ true. |
|
1876 |
]. |
|
4713 | 1877 |
|
3887 | 1878 |
^ false |
6831
56061d3bcbf0
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6826
diff
changeset
|
1879 |
|
56061d3bcbf0
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6826
diff
changeset
|
1880 |
"Modified: / 25-07-2006 / 09:08:16 / cg" |
3887 | 1881 |
! ! |
1882 |
||
6298 | 1883 |
!DirectoryContentsBrowser methodsFor:'initialization'! |
6226 | 1884 |
|
1885 |
initialize |
|
1886 |
changeSema := Semaphore new. |
|
7572 | 1887 |
updateCycleSemaphore := Semaphore new. |
1888 |
accessLock := RecursionLock new. |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1889 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1890 |
filterChangeFlag := false. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1891 |
sortBlockChangeFlag := false. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1892 |
directoryChangeFlag := false. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1893 |
directoryContentsChangeFlag := false. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1894 |
|
15283
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
1895 |
enterActionBlock := nil. |
15284
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1896 |
updateCurrentFileNameHolderWhenSelectionChanges := true. |
15283
f054c39953c2
DirectoryContentsBrowser: added hook that's called when an item is "entered" (i.e., double-clicked or return pressed)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14896
diff
changeset
|
1897 |
|
6226 | 1898 |
super initialize. |
7572 | 1899 |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
1900 |
"Modified: / 07-01-2012 / 16:34:25 / cg" |
15284
3546aaf738d5
DirectoryContentsBrowser: added flag whether to update or not currentFileNameHolder when selection changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15283
diff
changeset
|
1901 |
"Modified: / 13-02-2015 / 20:56:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6226 | 1902 |
! ! |
1903 |
||
3887 | 1904 |
!DirectoryContentsBrowser methodsFor:'menu accessing'! |
1905 |
||
1906 |
viewBrowserMenu |
|
1907 |
||
1908 |
<resource: #programMenu > |
|
1909 |
||
1910 |
|menu| |
|
1911 |
||
3961 | 1912 |
viewBrowserMenu isNil ifTrue:[ |
1913 |
viewBrowserMenu := self class viewBrowserMenu. |
|
1914 |
]. |
|
7584 | 1915 |
viewBrowserMenu isNil ifTrue:[ ^ nil ]. |
4080 | 1916 |
viewBrowserMenu findGuiResourcesIn:self. |
1917 |
||
3961 | 1918 |
menu := viewBrowserMenu. |
3887 | 1919 |
menu receiver:self. |
1920 |
^ menu |
|
1921 |
! ! |
|
1922 |
||
1923 |
!DirectoryContentsBrowser methodsFor:'menu actions'! |
|
1924 |
||
1925 |
doShowFileContents |
|
1926 |
||
3983 | 1927 |
| selectedFileItems| |
1928 |
||
1929 |
selectedFileItems := self selectedFileItems. |
|
1930 |
(selectedFileItems size == 1) ifTrue:[ |
|
4880
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4862
diff
changeset
|
1931 |
self openNewTextEditorOn:(selectedFileItems first). |
3887 | 1932 |
]. |
4972 | 1933 |
! |
1934 |
||
1935 |
enterAction |
|
1936 |
||
1937 |
| selectedItems| |
|
1938 |
||
1939 |
selectedItems := self selectedItems. |
|
1940 |
(selectedItems size == 1) ifTrue:[ |
|
1941 |
self enterActionFor:(selectedItems first). |
|
1942 |
]. |
|
3887 | 1943 |
! ! |
1944 |
||
1945 |
!DirectoryContentsBrowser methodsFor:'queries'! |
|
1946 |
||
1947 |
allItemsOfCurrentDirectory |
|
4202 | 1948 |
self viewDirsInContentsBrowser value ifTrue:[ |
4768 | 1949 |
^ browserItemList copyFrom:2. "/ remove the '..' item |
3983 | 1950 |
]. |
4768 | 1951 |
^ browserItemList. |
3887 | 1952 |
! |
1953 |
||
1954 |
fileListIsEmpty |
|
1955 |
||
3983 | 1956 |
^ browserItemList isEmpty |
3887 | 1957 |
! |
1958 |
||
4768 | 1959 |
getAllFilesAsStrings |
1960 |
browserItemList isEmpty ifTrue:[ |
|
1961 |
^ #() |
|
3887 | 1962 |
]. |
4768 | 1963 |
^ browserItemList |
1964 |
select:[:anItem | anItem isDirectory not] |
|
1965 |
thenCollect:[:eachItem | eachItem fileName asString]. |
|
4004 | 1966 |
! |
1967 |
||
1968 |
hasFilesFiltered |
|
4342 | 1969 |
|
1970 |
^ self allItems size ~~ browserItemList size |
|
3983 | 1971 |
! ! |
1972 |
||
1973 |
!DirectoryContentsBrowser methodsFor:'selection'! |
|
1974 |
||
1975 |
selectAll |
|
1976 |
||
1977 |
| sel| |
|
1978 |
||
1979 |
sel := browserItemList copy. |
|
4202 | 1980 |
self viewDirsInContentsBrowser value ifTrue:[ |
4013 | 1981 |
sel removeIdentical:(browserItemList first) ifAbsent:[nil] |
3887 | 1982 |
]. |
3983 | 1983 |
self selectionInFileList value:sel. |
3887 | 1984 |
! |
1985 |
||
4017 | 1986 |
selectCurrentFiles |
1987 |
||
1988 |
|currentSelection| |
|
1989 |
||
12826
efcb58c3ca55
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12605
diff
changeset
|
1990 |
((currentSelection := self currentSelectedObjects reject:[:file| file isDirectory]) notEmpty) ifTrue:[ |
4017 | 1991 |
self selectFiles:currentSelection. |
1992 |
]. |
|
7563 | 1993 |
|
1994 |
"Modified: / 04-12-2006 / 13:15:34 / cg" |
|
4017 | 1995 |
! |
1996 |
||
3983 | 1997 |
selectFiles:aColOfFilenames |
1998 |
| curSel newSel| |
|
1999 |
||
2000 |
curSel := self selectedFiles. |
|
2001 |
aColOfFilenames size = curSel size ifTrue:[ |
|
9105 | 2002 |
"/ anything changed ? |
2003 |
(curSel contains:[:file| (aColOfFilenames includes:file) not]) ifFalse:[^ self]. |
|
3887 | 2004 |
]. |
3983 | 2005 |
newSel := OrderedCollection new. |
2006 |
browserItemList do:[: item| |
|
2007 |
(aColOfFilenames includes:(item fileName)) ifTrue:[ |
|
2008 |
newSel add:item. |
|
2009 |
]. |
|
3887 | 2010 |
]. |
4017 | 2011 |
self updateToExternFileHolderLock doLocked:[ |
4071 | 2012 |
self selectionInFileList value:newSel withoutNotifying:self. |
4017 | 2013 |
]. |
3983 | 2014 |
! |
2015 |
||
4335
b56935032115
keep selection on update and insert new lines smarter in displayed list
penk
parents:
4298
diff
changeset
|
2016 |
selectItems:aColOfItems |
4768 | 2017 |
self selectFiles:(aColOfItems collect:[:eachItem | eachItem fileName]). |
2018 |
||
2019 |
"/ | curSel newSel| |
|
2020 |
"/ |
|
2021 |
"/ curSel := self selectedItems. |
|
2022 |
"/ aColOfItems size = curSel size ifTrue:[ |
|
2023 |
"/ | index | |
|
2024 |
"/ index := curSel findFirst:[:item| (aColOfItems includes:item) not]. |
|
2025 |
"/ index == 0 ifTrue:[ ^ self]. |
|
2026 |
"/ ]. |
|
2027 |
"/ newSel := OrderedCollection new. |
|
2028 |
"/ browserItemList do:[: item| |
|
2029 |
"/ (aColOfItems includes:item) ifTrue:[ |
|
2030 |
"/ newSel add:item. |
|
2031 |
"/ ]. |
|
2032 |
"/ ]. |
|
2033 |
"/ self updateToExternFileHolderLock doLocked:[ |
|
2034 |
"/ self selectionInFileList value:newSel withoutNotifying:self. |
|
2035 |
"/ ]. |
|
4335
b56935032115
keep selection on update and insert new lines smarter in displayed list
penk
parents:
4298
diff
changeset
|
2036 |
! |
b56935032115
keep selection on update and insert new lines smarter in displayed list
penk
parents:
4298
diff
changeset
|
2037 |
|
14574
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2038 |
selectNextFile |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2039 |
|sel idx nextIdx nextItem| |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2040 |
|
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2041 |
sel := selectionInFileList value. |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2042 |
sel isEmpty ifTrue:[ |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2043 |
idx := 0 |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2044 |
] ifFalse:[ |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2045 |
idx := browserItemList indexOf:(selectionInFileList value last). |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2046 |
]. |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2047 |
nextIdx := idx == browserItemList size ifTrue:[1] ifFalse:[idx + 1]. |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2048 |
nextItem := browserItemList at:nextIdx. |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2049 |
self selectItems:{ nextItem }. |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2050 |
! |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2051 |
|
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2052 |
selectPreviousFile |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2053 |
|sel idx prevIdx prevItem| |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2054 |
|
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2055 |
sel := selectionInFileList value. |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2056 |
sel isEmpty ifTrue:[ |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2057 |
idx := browserItemList size + 1 |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2058 |
] ifFalse:[ |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2059 |
idx := browserItemList indexOf:(selectionInFileList value first). |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2060 |
]. |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2061 |
prevIdx := idx == 1 ifTrue:[browserItemList size] ifFalse:[idx - 1]. |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2062 |
prevItem := browserItemList at:prevIdx. |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2063 |
self selectItems:{ prevItem }. |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2064 |
! |
8057b1c7ec88
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14465
diff
changeset
|
2065 |
|
3983 | 2066 |
selectedFileItems |
2067 |
||
2068 |
| sel | |
|
2069 |
||
12826
efcb58c3ca55
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12605
diff
changeset
|
2070 |
sel := self selectedItemsWithoutDotDotDirectory reject:[:item | item isDirectory]. |
3987 | 2071 |
^ sel |
2072 |
! |
|
2073 |
||
2074 |
selectedFileNames |
|
2075 |
^ self selectedFileItems collect:[:item| item fileName]. |
|
3887 | 2076 |
! |
2077 |
||
4978
9ca1ae265211
selectedFiles for directoryContentsBrowser without the .. dir
penk
parents:
4976
diff
changeset
|
2078 |
selectedFiles |
9ca1ae265211
selectedFiles for directoryContentsBrowser without the .. dir
penk
parents:
4976
diff
changeset
|
2079 |
|
9ca1ae265211
selectedFiles for directoryContentsBrowser without the .. dir
penk
parents:
4976
diff
changeset
|
2080 |
^ self selectedItemsWithoutDotDotDirectory collect:[:item| item fileName]. |
9ca1ae265211
selectedFiles for directoryContentsBrowser without the .. dir
penk
parents:
4976
diff
changeset
|
2081 |
! |
9ca1ae265211
selectedFiles for directoryContentsBrowser without the .. dir
penk
parents:
4976
diff
changeset
|
2082 |
|
3983 | 2083 |
selectedItems |
4713 | 2084 |
| selection | |
2085 |
||
2086 |
selection := self selectionInFileList value copy. |
|
2087 |
selection isNil ifTrue:[ ^ #()]. |
|
5870 | 2088 |
selection isSequenceable ifFalse:[ |
2089 |
selection := OrderedCollection with:selection |
|
2090 |
]. |
|
4972 | 2091 |
^ selection. |
2092 |
! |
|
2093 |
||
2094 |
selectedItemsWithoutDotDotDirectory |
|
2095 |
| selection | |
|
2096 |
||
5676 | 2097 |
selection := self selectionInFileList value. |
4972 | 2098 |
selection isNil ifTrue:[ ^ #()]. |
5868 | 2099 |
selection isSequenceable ifFalse:[ |
2100 |
selection := OrderedCollection with:selection. |
|
2101 |
]. |
|
12412
5df92e9efb33
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12342
diff
changeset
|
2102 |
selection := selection reject:[:e | e isNil]. |
5df92e9efb33
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12342
diff
changeset
|
2103 |
selection isEmpty ifTrue:[ ^ #()]. |
8977
0fd3fcbb8fc7
copy asOrderedCollection -> copyAsOrderedCollection
Claus Gittinger <cg@exept.de>
parents:
8845
diff
changeset
|
2104 |
selection := selection copyAsOrderedCollection. |
4202 | 2105 |
(self viewDirsInContentsBrowser value and:[browserItemList notEmpty]) ifTrue:[ |
4713 | 2106 |
selection removeIdentical:(browserItemList first) ifAbsent:[nil] |
3887 | 2107 |
]. |
4713 | 2108 |
^ selection. |
3887 | 2109 |
! ! |
2110 |
||
4713 | 2111 |
!DirectoryContentsBrowser methodsFor:'startup & release'! |
3887 | 2112 |
|
2113 |
makeDependent |
|
2114 |
||
4007 | 2115 |
super makeDependent. |
3887 | 2116 |
self currentFileNameHolder addDependent:self. |
4027 | 2117 |
self currentSortOrder addDependent:self. |
4202 | 2118 |
self viewDirsInContentsBrowser addDependent:self. |
5869 | 2119 |
self sortDirectoriesBeforeFiles addDependent:self. |
4011 | 2120 |
self filterBlockHolder addDependent:self. |
3887 | 2121 |
self sortBlockHolder addDependent:self. |
2122 |
! |
|
2123 |
||
2124 |
postBuildBrowser:aWidget |
|
2125 |
||
4713 | 2126 |
browser := aWidget scrolledView. |
2127 |
browser wantsFocusWithPointerEnter. |
|
3887 | 2128 |
"/ dont register icons anymore |
2129 |
"/ FileBrowser icons keysAndValuesDo:[:aKey :anIcon| |
|
2130 |
"/ browser registerImage:anIcon key:aKey. |
|
2131 |
"/ ]. |
|
4960
c76ffd8375ae
startUpdatetask later (after colDescr is fix)
Claus Gittinger <cg@exept.de>
parents:
4957
diff
changeset
|
2132 |
"/ self columnDescriptors:(self tableColumns value). |
4071 | 2133 |
! |
2134 |
||
5444 | 2135 |
postOpenFromMaster:fromMaster |
4071 | 2136 |
|
4998 | 2137 |
self sortFileListsBy:(self sortBlockProperty value) withReverse:(self currentSortOrder value). |
7714 | 2138 |
self matchBlock:(self filterBlockHolder value). |
5444 | 2139 |
fromMaster ifFalse:[ |
5442 | 2140 |
self currentFileNameHolderChangedForCommon. |
2141 |
]. |
|
12342
78b5ffcbccc3
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12324
diff
changeset
|
2142 |
self startUpdateTask. |
5443 | 2143 |
self currentFileNameHolderChanged. |
3887 | 2144 |
self viewedColumnsChanged. |
4071 | 2145 |
self windowGroup addPreEventHook:self. |
3887 | 2146 |
! |
2147 |
||
2148 |
release |
|
2149 |
"release my resources |
|
2150 |
" |
|
4342 | 2151 |
self stopUpdateTask. |
3887 | 2152 |
super release. |
2153 |
! |
|
2154 |
||
2155 |
releaseAsSubCanvas |
|
2156 |
||
4342 | 2157 |
self stopUpdateTask. |
3887 | 2158 |
^ super releaseAsSubCanvas. |
2159 |
! ! |
|
2160 |
||
4342 | 2161 |
!DirectoryContentsBrowser methodsFor:'update columns cycle'! |
3887 | 2162 |
|
6222
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2163 |
findNextItemFor:aConditionBlock |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2164 |
|checkRowAndReturnItemIfConditionIsTrue |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2165 |
firstRowShown lastRowShown rLow rHigh numItems| |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2166 |
|
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2167 |
checkRowAndReturnItemIfConditionIsTrue := |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2168 |
[:row | |item| |
7963 | 2169 |
item := browserItemList at:row ifAbsent:nil. |
2170 |
item notNil ifTrue:[ |
|
2171 |
(aConditionBlock value:item) ifTrue:[ |
|
2172 |
^ item. |
|
2173 |
] |
|
6222
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2174 |
]. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2175 |
]. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2176 |
|
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2177 |
firstRowShown := browser indexOfFirstRowShown. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2178 |
lastRowShown := browser indexOfLastRowShown. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2179 |
|
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2180 |
firstRowShown to:lastRowShown do:checkRowAndReturnItemIfConditionIsTrue. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2181 |
|
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2182 |
numItems := browserItemList size. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2183 |
|
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2184 |
rLow := firstRowShown - 1. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2185 |
rHigh := lastRowShown + 1. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2186 |
[(rLow >= 1) or:[ rHigh <= numItems]] whileTrue:[ |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2187 |
rLow >= 1 ifTrue:[ |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2188 |
checkRowAndReturnItemIfConditionIsTrue value:rLow. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2189 |
rLow := rLow - 1 |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2190 |
]. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2191 |
rHigh <= numItems ifTrue:[ |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2192 |
checkRowAndReturnItemIfConditionIsTrue value:rHigh. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2193 |
rHigh := rHigh + 1 |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2194 |
]. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2195 |
]. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2196 |
^ nil. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2197 |
|
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2198 |
"/ ^ self allItems detect:aBlock ifNone:[nil]. |
4017 | 2199 |
! |
2200 |
||
2201 |
findNextVisibleItemFor:aConditionBlock |
|
6222
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2202 |
|firstRow row item| |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2203 |
|
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2204 |
firstRow := browser indexOfFirstRowShown. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2205 |
firstRow <= 0 ifTrue:[firstRow := 1]. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2206 |
|
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2207 |
row := firstRow. |
6826 | 2208 |
[true] whileTrue:[ |
6222
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2209 |
((row <= browserItemList size) and:[ (browser isRowVisible:row) ]) ifFalse:[ |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2210 |
^ nil. |
3983 | 2211 |
]. |
8658
bf595f0cb6f5
changed #findNextVisibleItemFor:
Stefan Vogel <sv@exept.de>
parents:
8533
diff
changeset
|
2212 |
item := browserItemList at:row ifAbsent:[^ nil "possible race condition - item removed from browserItemList"]. |
6222
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2213 |
(aConditionBlock value:item) ifTrue:[ |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2214 |
^ item. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2215 |
]. |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2216 |
row := row + 1. |
6826 | 2217 |
] |
2218 |
||
2219 |
"Modified: / 18-07-2006 / 08:56:47 / cg" |
|
3887 | 2220 |
! |
2221 |
||
5010 | 2222 |
getFileInfoFor:anItem |
3887 | 2223 |
|
2224 |
| type| |
|
2225 |
||
5010 | 2226 |
type := anItem fileName fileType. |
2227 |
anItem fileType:type. |
|
3887 | 2228 |
^ type |
2229 |
! |
|
2230 |
||
5010 | 2231 |
getIconFor:anItem |
14186
2ed966dc0816
Do not refer to FileBrowser methods
Stefan Vogel <sv@exept.de>
parents:
13797
diff
changeset
|
2232 |
|icon| |
2ed966dc0816
Do not refer to FileBrowser methods
Stefan Vogel <sv@exept.de>
parents:
13797
diff
changeset
|
2233 |
|
14190
928d16f1fa55
class: DirectoryContentsBrowser
Stefan Vogel <sv@exept.de>
parents:
14186
diff
changeset
|
2234 |
icon := MIMETypeIconLibrary iconForKeyMatching:anItem iconKey. |
5010 | 2235 |
anItem isRemoteDirectory ifTrue:[ |
3906 | 2236 |
^ icon "/ do not query attributes |
2237 |
]. |
|
14186
2ed966dc0816
Do not refer to FileBrowser methods
Stefan Vogel <sv@exept.de>
parents:
13797
diff
changeset
|
2238 |
^ MIMETypeIconLibrary addOnIconsFor:(anItem fileName) to:icon. |
3887 | 2239 |
! |
2240 |
||
5010 | 2241 |
getIconForMimeType:mime for:anItem |
7908
820560688c8a
changed #getIconForMimeType:for:
Claus Gittinger <cg@exept.de>
parents:
7901
diff
changeset
|
2242 |
|currentIcon newIcon images| |
820560688c8a
changed #getIconForMimeType:for:
Claus Gittinger <cg@exept.de>
parents:
7901
diff
changeset
|
2243 |
|
14191
80b1adf0313d
class: DirectoryContentsBrowser
Stefan Vogel <sv@exept.de>
parents:
14190
diff
changeset
|
2244 |
newIcon := MIMETypeIconLibrary iconForKeyMatching:mime. |
9323 | 2245 |
currentIcon := anItem iconOrNil. |
2246 |
||
2247 |
(currentIcon notNil and:[currentIcon class == MultiImage]) ifTrue:[ |
|
3887 | 2248 |
images := currentIcon images. |
2249 |
images removeFirst. |
|
2250 |
images addFirst:newIcon. |
|
7908
820560688c8a
changed #getIconForMimeType:for:
Claus Gittinger <cg@exept.de>
parents:
7901
diff
changeset
|
2251 |
^ currentIcon. |
3887 | 2252 |
]. |
9323 | 2253 |
^ newIcon. |
3887 | 2254 |
! |
2255 |
||
5010 | 2256 |
getIconForMimeTypeByContents:anItem |
2257 |
^ self getIconForMimeType:(anItem mimeTypeForContents) for:anItem |
|
4404
1165b811a9a9
only ask once for mimeTypeOfContents
Claus Gittinger <cg@exept.de>
parents:
4402
diff
changeset
|
2258 |
! |
1165b811a9a9
only ask once for mimeTypeOfContents
Claus Gittinger <cg@exept.de>
parents:
4402
diff
changeset
|
2259 |
|
5010 | 2260 |
getPreviewFor:anItem |
3887 | 2261 |
|
9225 | 2262 |
| column icon| |
3887 | 2263 |
|
9225 | 2264 |
column := browser columnDescriptorAt:previewIndex. |
3887 | 2265 |
column isNil ifTrue:[ |
2266 |
previewIndex := 0. |
|
2267 |
] ifFalse:[ |
|
13717
00aa1ccdc596
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12826
diff
changeset
|
2268 |
(anItem hasMimeType and:[anItem mimeType isImageType]) ifTrue:[ |
5238 | 2269 |
Error handle:[:ex| |
3887 | 2270 |
icon := nil. |
2271 |
] do:[ |scale extent w h | |
|
5010 | 2272 |
icon := Image fromFile:(anItem fileName pathName). |
3887 | 2273 |
icon notNil ifTrue:[ |
2274 |
extent := icon extent. |
|
2275 |
w := column width - 4. |
|
2276 |
h := column height. |
|
2277 |
||
2278 |
(extent x > w or:[extent y > h]) ifTrue:[ |
|
2279 |
scale := extent / (w@h). |
|
2280 |
scale := scale x max:(scale y). |
|
2281 |
icon := icon magnifiedTo:((extent / scale max:8.0) asInteger). |
|
2282 |
]. |
|
4713 | 2283 |
icon := icon onDevice:(browser device). |
3887 | 2284 |
] |
2285 |
] |
|
2286 |
] ifFalse:[ icon := nil]. |
|
5010 | 2287 |
anItem preview:(icon ? ''). |
3887 | 2288 |
]. |
2289 |
^ icon |
|
2290 |
! |
|
2291 |
||
4342 | 2292 |
updateColumnsCycle |
6026
0a098f7a9e09
Stop update task when application is closed
Stefan Vogel <sv@exept.de>
parents:
5994
diff
changeset
|
2293 |
"update items in the following order |
4970 | 2294 |
- update item if item properties are changed |
2295 |
- update icon for visible items by suffix |
|
2296 |
- update icon for visible items by contents |
|
2297 |
- update file info for visible items if file info column is shown |
|
2298 |
- update preview for visible items if preview column is shown |
|
2299 |
||
2300 |
- update icon for invisible items by suffix |
|
2301 |
- update icon for invisible items by contents |
|
2302 |
- update file info for invisible items if file info column is shown |
|
2303 |
- update preview for invisible items if preview column is shown |
|
7601
3958b3fb0caa
update of icons got corrupted
Claus Gittinger <cg@exept.de>
parents:
7584
diff
changeset
|
2304 |
- update file info for invisible items if file info column is not shown |
3958b3fb0caa
update of icons got corrupted
Claus Gittinger <cg@exept.de>
parents:
7584
diff
changeset
|
2305 |
Return true, if more is to be done. |
4970 | 2306 |
" |
3887 | 2307 |
|
4404
1165b811a9a9
only ask once for mimeTypeOfContents
Claus Gittinger <cg@exept.de>
parents:
4402
diff
changeset
|
2308 |
|desc mime icon type preview| |
3887 | 2309 |
|
4017 | 2310 |
browserItemList notEmpty ifTrue:[ |
9103
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2311 |
"/ update item if item's properties have changed |
5475 | 2312 |
"/ desc := self findNextVisibleItemFor:[:n| n accessFirstTime ]. |
2313 |
"/ desc notNil ifTrue:[ |
|
2314 |
"/ browser invalidateVisibleRow:desc. |
|
2315 |
"/ self debugMessage:'item properties are changed ', desc baseName. |
|
2316 |
"/ ^ true. |
|
2317 |
"/ ]. |
|
9103
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2318 |
|
3887 | 2319 |
"/ update icon for visible items by suffix |
9323 | 2320 |
desc := self findNextVisibleItemFor:[:n| n iconOrNil isNil ]. |
3967 | 2321 |
desc notNil ifTrue:[ |
3887 | 2322 |
icon := self getIconFor:desc. |
6438
4430ef82be3f
100% cpu busy loop, if an icon for an item
Claus Gittinger <cg@exept.de>
parents:
6382
diff
changeset
|
2323 |
icon notNil ifTrue:[ |
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2324 |
icon ~= desc icon ifTrue:[ |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2325 |
desc icon:icon. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2326 |
(iconIndex ~~ 0) ifTrue:[ |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2327 |
browser invalidateVisibleRow:desc colAt:iconIndex |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2328 |
]. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2329 |
self debugMessage:'icon for visible items ', desc baseName. |
11445 | 2330 |
^ true |
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2331 |
]. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2332 |
]. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2333 |
]. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2334 |
"/ update icon for visible items by contents |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2335 |
desc := self findNextVisibleItemFor: |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2336 |
[:n| |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2337 |
(n iconKey == #file |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2338 |
and:[(mime := n mimeTypeForContents asSymbol) ~= #unknown]) |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2339 |
]. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2340 |
desc notNil ifTrue:[ |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2341 |
icon := self getIconForMimeType:mime for:desc. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2342 |
"/ icon := self getIconForMimeTypeByContents:desc. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2343 |
icon ~= desc icon ifTrue:[ |
6438
4430ef82be3f
100% cpu busy loop, if an icon for an item
Claus Gittinger <cg@exept.de>
parents:
6382
diff
changeset
|
2344 |
desc icon:icon. |
4430ef82be3f
100% cpu busy loop, if an icon for an item
Claus Gittinger <cg@exept.de>
parents:
6382
diff
changeset
|
2345 |
(icon notNil and:[iconIndex ~~ 0]) ifTrue:[ |
4430ef82be3f
100% cpu busy loop, if an icon for an item
Claus Gittinger <cg@exept.de>
parents:
6382
diff
changeset
|
2346 |
browser invalidateVisibleRow:desc colAt:iconIndex |
4430ef82be3f
100% cpu busy loop, if an icon for an item
Claus Gittinger <cg@exept.de>
parents:
6382
diff
changeset
|
2347 |
]. |
3967 | 2348 |
]. |
2349 |
^ true |
|
2350 |
]. |
|
3887 | 2351 |
"/ update file info for visible items if file info column is shown |
2352 |
fileDescriptionIndex ~~ 0 ifTrue:[ |
|
4345 | 2353 |
desc := self findNextVisibleItemFor:[:n| n fileType isEmpty ]. |
3887 | 2354 |
desc notNil ifTrue:[ |
2355 |
type := self getFileInfoFor:desc. |
|
6222
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2356 |
type notNil ifTrue:[ |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2357 |
browser invalidateVisibleRow:desc colAt:fileDescriptionIndex |
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2358 |
]. |
5475 | 2359 |
self debugMessage:'file info for visible items if file info column is shown ', desc baseName. |
3887 | 2360 |
^ true |
2361 |
] |
|
2362 |
]. |
|
2363 |
"/ update preview for visible items if preview column is shown |
|
2364 |
previewIndex ~~ 0 ifTrue:[ |
|
4017 | 2365 |
desc := self findNextVisibleItemFor:[:n| n preview isNil ]. |
3887 | 2366 |
desc notNil ifTrue:[ |
2367 |
preview := self getPreviewFor:desc. |
|
2368 |
preview notNil ifTrue:[ |
|
4713 | 2369 |
browser invalidateVisibleRow:desc colAt:previewIndex |
3887 | 2370 |
]. |
5475 | 2371 |
self debugMessage:'preview for visible items if preview column is shown ', desc baseName. |
3887 | 2372 |
^ true |
2373 |
] |
|
2374 |
]. |
|
2375 |
]. |
|
2376 |
||
4349 | 2377 |
"/ validate invisible items to make them available after scrolling |
4342 | 2378 |
self allItems notEmpty ifTrue:[ |
3887 | 2379 |
"/ update icon for invisible items by suffix |
9323 | 2380 |
desc := self findNextItemFor:[:n| n iconOrNil isNil ]. |
3887 | 2381 |
desc notNil ifTrue:[ |
2382 |
icon := self getIconFor:desc. |
|
6440 | 2383 |
icon notNil ifTrue:[ |
2384 |
desc icon:icon. |
|
2385 |
browser invalidateVisibleRow:desc colAt:iconIndex. |
|
2386 |
self debugMessage:'icon for invisible items by suffix ', desc baseName. |
|
2387 |
^ true |
|
2388 |
]. |
|
3887 | 2389 |
]. |
2390 |
"/ update icon for invisible items by contents |
|
2391 |
desc := self findNextItemFor:[:n| (n iconKey == #file and:[n mimeTypeForContents ~= #unknown])]. |
|
2392 |
desc notNil ifTrue:[ |
|
2393 |
icon := self getIconForMimeTypeByContents:desc. |
|
2394 |
desc icon:icon. |
|
6222
8d7dfc929ab3
update visible and near-visible items first.
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
2395 |
browser invalidateVisibleRow:desc colAt:iconIndex. |
5475 | 2396 |
self debugMessage:'icon for invisible items by contents ', desc baseName. |
3887 | 2397 |
^ true |
2398 |
]. |
|
2399 |
"/ update file info for invisible items if file info column is shown |
|
2400 |
fileDescriptionIndex ~~ 0 ifTrue:[ |
|
2401 |
desc := self findNextItemFor:[:n| n fileType isNil ]. |
|
2402 |
desc notNil ifTrue:[ |
|
2403 |
self getFileInfoFor:desc. |
|
5475 | 2404 |
self debugMessage:'update file info for invisible items if file info column is shown ', desc baseName. |
3887 | 2405 |
^ true |
2406 |
]. |
|
2407 |
]. |
|
2408 |
"/ update preview for invisible items if preview column is shown |
|
2409 |
previewIndex ~~ 0 ifTrue:[ |
|
2410 |
desc := self findNextItemFor:[:n| n preview isNil ]. |
|
2411 |
desc notNil ifTrue:[ |
|
2412 |
self getPreviewFor:desc. |
|
5475 | 2413 |
self debugMessage:'update preview for invisible items if preview column is shown: ', desc baseName. |
3887 | 2414 |
^ true |
2415 |
]. |
|
2416 |
]. |
|
2417 |
"/ update file info for invisible items if file info column is not shown |
|
2418 |
desc := self findNextItemFor:[:n| n fileType isNil ]. |
|
2419 |
desc notNil ifTrue:[ |
|
2420 |
self getFileInfoFor:desc. |
|
5475 | 2421 |
self debugMessage:'update file info for invisible items if file info column is not shown: ', desc baseName. |
3887 | 2422 |
^ true |
2423 |
]. |
|
2424 |
]. |
|
2425 |
^ false |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2426 |
|
11445 | 2427 |
"Modified: / 20-03-2012 / 13:05:28 / cg" |
4342 | 2428 |
! ! |
2429 |
||
2430 |
!DirectoryContentsBrowser methodsFor:'update task'! |
|
2431 |
||
4346 | 2432 |
createItemList |
9103
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2433 |
"reread the whole list of items" |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2434 |
|
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2435 |
|rawFilteredItems| |
4342 | 2436 |
|
2437 |
directory notNil ifTrue:[ |
|
9103
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2438 |
self allItems:self readDirectoryItems. |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2439 |
rawFilteredItems := self evaluateFilter:(self allItems). |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2440 |
filteredItems := self sortBlockHolder value sortItemList:rawFilteredItems. |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2441 |
|
4342 | 2442 |
"/ Transcript showCR:'getAllTime:', getAllTime asString. |
2443 |
"/ Transcript showCR:'filterTime:', filterTime asString. |
|
2444 |
"/ Transcript showCR:'sortTime:', sortTime asString. |
|
5780
0951e30d7914
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5777
diff
changeset
|
2445 |
"/ Transcript showCR:'time after sort', Timestamp now asString. |
4342 | 2446 |
] ifFalse:[ |
2447 |
self allItems:OrderedCollection new. |
|
2448 |
filteredItems := OrderedCollection new. |
|
2449 |
]. |
|
2450 |
self |
|
7539 | 2451 |
enqueueMessage:#setBrowserItemList: |
2452 |
for:self |
|
2453 |
arguments:(Array with:filteredItems). |
|
4342 | 2454 |
! |
2455 |
||
4346 | 2456 |
debugMessage:aString |
5716 | 2457 |
Debug == true ifTrue:[ |
4346 | 2458 |
Transcript showCR:aString |
2459 |
]. |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2460 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2461 |
" |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2462 |
Debug := true |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2463 |
Debug := false |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2464 |
" |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2465 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2466 |
"Modified (comment): / 07-01-2012 / 16:30:25 / cg" |
4346 | 2467 |
! |
2468 |
||
2469 |
directoryChanged |
|
9103
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2470 |
"reread the whole list of items" |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2471 |
|
5935
72f0c8866406
attempt to preserve scroll-position as per directory
Claus Gittinger <cg@exept.de>
parents:
5870
diff
changeset
|
2472 |
|pos| |
4346 | 2473 |
|
11445 | 2474 |
self setBrowserItemList:#(). |
2475 |
directoryContentsChangeFlag := true. |
|
12342
78b5ffcbccc3
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12324
diff
changeset
|
2476 |
"/ ^ self. |
11445 | 2477 |
|
4346 | 2478 |
self createItemList. |
5935
72f0c8866406
attempt to preserve scroll-position as per directory
Claus Gittinger <cg@exept.de>
parents:
5870
diff
changeset
|
2479 |
|
72f0c8866406
attempt to preserve scroll-position as per directory
Claus Gittinger <cg@exept.de>
parents:
5870
diff
changeset
|
2480 |
directory notNil ifTrue:[ |
72f0c8866406
attempt to preserve scroll-position as per directory
Claus Gittinger <cg@exept.de>
parents:
5870
diff
changeset
|
2481 |
pos := AbstractFileBrowser directoryHistory getPositionFor:(directory pathName). |
72f0c8866406
attempt to preserve scroll-position as per directory
Claus Gittinger <cg@exept.de>
parents:
5870
diff
changeset
|
2482 |
"/ self halt. |
72f0c8866406
attempt to preserve scroll-position as per directory
Claus Gittinger <cg@exept.de>
parents:
5870
diff
changeset
|
2483 |
pos notNil ifTrue:[ |
72f0c8866406
attempt to preserve scroll-position as per directory
Claus Gittinger <cg@exept.de>
parents:
5870
diff
changeset
|
2484 |
browser scrollToLine:pos. |
72f0c8866406
attempt to preserve scroll-position as per directory
Claus Gittinger <cg@exept.de>
parents:
5870
diff
changeset
|
2485 |
] |
72f0c8866406
attempt to preserve scroll-position as per directory
Claus Gittinger <cg@exept.de>
parents:
5870
diff
changeset
|
2486 |
]. |
11177 | 2487 |
|
11446 | 2488 |
"Modified: / 20-03-2012 / 13:16:25 / cg" |
4346 | 2489 |
! |
2490 |
||
4342 | 2491 |
directoryContentsChanged |
9880
06f533cdb0c7
changed: #directoryContentsChanged
Claus Gittinger <cg@exept.de>
parents:
9791
diff
changeset
|
2492 |
|oldItems itemsToAdd itemsToRemove newItems newAllItems oldAllItems| |
4342 | 2493 |
|
2494 |
directory isNil ifTrue:[^ self]. |
|
11446 | 2495 |
|
12324
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2496 |
"/ updatingColumns := true. |
11446 | 2497 |
|
4342 | 2498 |
newAllItems := self readDirectoryItems. |
8496 | 2499 |
|
11448 | 2500 |
oldItems := filteredItems copy ? #(). |
2501 |
||
2502 |
(oldItems isEmptyOrNil |
|
2503 |
or:[newAllItems size > 150]) ifTrue:[ |
|
2504 |
self createItemList. |
|
12113 | 2505 |
filterChangeFlag := false. |
11448 | 2506 |
^ self |
2507 |
]. |
|
9880
06f533cdb0c7
changed: #directoryContentsChanged
Claus Gittinger <cg@exept.de>
parents:
9791
diff
changeset
|
2508 |
|
4342 | 2509 |
newItems := self evaluateFilter:newAllItems. |
9880
06f533cdb0c7
changed: #directoryContentsChanged
Claus Gittinger <cg@exept.de>
parents:
9791
diff
changeset
|
2510 |
itemsToAdd := OrderedCollection new. |
06f533cdb0c7
changed: #directoryContentsChanged
Claus Gittinger <cg@exept.de>
parents:
9791
diff
changeset
|
2511 |
itemsToRemove := OrderedCollection new. |
06f533cdb0c7
changed: #directoryContentsChanged
Claus Gittinger <cg@exept.de>
parents:
9791
diff
changeset
|
2512 |
|
06f533cdb0c7
changed: #directoryContentsChanged
Claus Gittinger <cg@exept.de>
parents:
9791
diff
changeset
|
2513 |
oldItems notEmptyOrNil ifTrue:[ |
4342 | 2514 |
"/ MERGE WITH CURRENT CONTENTS |
4894 | 2515 |
oldItems copy do:[:anOldItem| |
4342 | 2516 |
"/ remove no longer valid files |
5474 | 2517 |
(newItems includes:anOldItem) ifFalse:[ |
9880
06f533cdb0c7
changed: #directoryContentsChanged
Claus Gittinger <cg@exept.de>
parents:
9791
diff
changeset
|
2518 |
itemsToRemove add:anOldItem. |
4342 | 2519 |
oldItems removeIdentical:anOldItem |
2520 |
] |
|
2521 |
]. |
|
2522 |
]. |
|
2523 |
"/ add new files |
|
2524 |
newItems do:[:aNewItem| |
|
5474 | 2525 |
(oldItems includes:aNewItem) ifFalse:[ |
9880
06f533cdb0c7
changed: #directoryContentsChanged
Claus Gittinger <cg@exept.de>
parents:
9791
diff
changeset
|
2526 |
itemsToAdd add:aNewItem. |
4342 | 2527 |
] |
2528 |
]. |
|
9880
06f533cdb0c7
changed: #directoryContentsChanged
Claus Gittinger <cg@exept.de>
parents:
9791
diff
changeset
|
2529 |
oldAllItems := self allItems. |
11448 | 2530 |
oldAllItems notEmpty ifTrue:[ |
12113 | 2531 |
oldAllItems removeAllFoundIn:itemsToRemove |
5716 | 2532 |
]. |
9880
06f533cdb0c7
changed: #directoryContentsChanged
Claus Gittinger <cg@exept.de>
parents:
9791
diff
changeset
|
2533 |
itemsToAdd do:[: aNewItem | |
06f533cdb0c7
changed: #directoryContentsChanged
Claus Gittinger <cg@exept.de>
parents:
9791
diff
changeset
|
2534 |
(oldAllItems includes:aNewItem) ifFalse:[ |
06f533cdb0c7
changed: #directoryContentsChanged
Claus Gittinger <cg@exept.de>
parents:
9791
diff
changeset
|
2535 |
oldAllItems add:aNewItem. |
5716 | 2536 |
] |
2537 |
]. |
|
4342 | 2538 |
self |
2539 |
enqueueMessage:#value |
|
12113 | 2540 |
for:[ |
2541 |
self browserItemListAdd:itemsToAdd remove:itemsToRemove. |
|
2542 |
filterChangeFlag := false. |
|
2543 |
] |
|
4342 | 2544 |
arguments:#(). |
2545 |
filteredItems := newItems. |
|
7572 | 2546 |
|
11460
0669e11fb7fb
changed: #directoryContentsChanged
Claus Gittinger <cg@exept.de>
parents:
11448
diff
changeset
|
2547 |
"Modified: / 23-03-2012 / 14:42:32 / cg" |
4342 | 2548 |
! |
2549 |
||
5010 | 2550 |
evaluateFilter:anItemsList |
9103
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2551 |
"return filtered items from anItemsList" |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2552 |
|
11445 | 2553 |
|showDir showHidden filterBlock newItemList noOfShownFiles noOfFiles showFiles| |
9103
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2554 |
|
4342 | 2555 |
noOfFiles := 0. |
11445 | 2556 |
noOfShownFiles := 0. |
9103
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2557 |
|
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2558 |
showHidden := self showHiddenFiles value. |
4342 | 2559 |
showDir := self viewDirsInContentsBrowser value. |
5870 | 2560 |
showFiles := self viewFilesInContentsBrowser value. |
2561 |
||
11592 | 2562 |
filterBlock := self matchBlock ? [:v1 :v2 | true ]. |
9103
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2563 |
newItemList := anItemsList |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2564 |
select:[:eachItem | |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2565 |
|isDir showIt| |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2566 |
|
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2567 |
isDir := eachItem isDirectory. |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2568 |
isDir ifFalse:[noOfFiles := noOfFiles + 1]. |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2569 |
|
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2570 |
showIt := isDir |
9318 | 2571 |
ifTrue:[ showDir and:[ showHidden or:[ eachItem fileName isHidden not ]]] |
9103
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2572 |
ifFalse:[ showFiles and:[filterBlock |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2573 |
value:eachItem fileName |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2574 |
value:eachItem baseName]]. |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2575 |
|
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2576 |
showIt ifTrue:[ |
11445 | 2577 |
isDir ifFalse:[noOfShownFiles := noOfShownFiles + 1]. |
9103
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2578 |
]. |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2579 |
showIt |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2580 |
]. |
eba365efe5e6
hidden files (directories) handling
Claus Gittinger <cg@exept.de>
parents:
8998
diff
changeset
|
2581 |
|
11445 | 2582 |
self noOfShownFiles:noOfShownFiles noOfFiles:noOfFiles. |
4342 | 2583 |
^ newItemList |
11445 | 2584 |
|
12061 | 2585 |
"Modified: / 20-11-2012 / 14:28:33 / cg" |
4342 | 2586 |
! |
2587 |
||
2588 |
filterChanged |
|
5777
d8ca0c8e0af5
dont update list after a filterChange, if the new filter
Claus Gittinger <cg@exept.de>
parents:
5740
diff
changeset
|
2589 |
|newFilteredItems| |
d8ca0c8e0af5
dont update list after a filterChange, if the new filter
Claus Gittinger <cg@exept.de>
parents:
5740
diff
changeset
|
2590 |
|
d8ca0c8e0af5
dont update list after a filterChange, if the new filter
Claus Gittinger <cg@exept.de>
parents:
5740
diff
changeset
|
2591 |
newFilteredItems := self evaluateFilter:self allItems copy. |
12061 | 2592 |
filterChangeFlag ifTrue:[^ self]. |
2593 |
||
5777
d8ca0c8e0af5
dont update list after a filterChange, if the new filter
Claus Gittinger <cg@exept.de>
parents:
5740
diff
changeset
|
2594 |
newFilteredItems ~= filteredItems ifTrue:[ |
d8ca0c8e0af5
dont update list after a filterChange, if the new filter
Claus Gittinger <cg@exept.de>
parents:
5740
diff
changeset
|
2595 |
filteredItems := newFilteredItems. |
d8ca0c8e0af5
dont update list after a filterChange, if the new filter
Claus Gittinger <cg@exept.de>
parents:
5740
diff
changeset
|
2596 |
filteredItems := self sortBlockHolder value sortItemList:filteredItems. |
d8ca0c8e0af5
dont update list after a filterChange, if the new filter
Claus Gittinger <cg@exept.de>
parents:
5740
diff
changeset
|
2597 |
self |
d8ca0c8e0af5
dont update list after a filterChange, if the new filter
Claus Gittinger <cg@exept.de>
parents:
5740
diff
changeset
|
2598 |
enqueueMessage:#value |
d8ca0c8e0af5
dont update list after a filterChange, if the new filter
Claus Gittinger <cg@exept.de>
parents:
5740
diff
changeset
|
2599 |
for:[ self setBrowserItemList:filteredItems ] |
8227 | 2600 |
arguments:#(). |
5777
d8ca0c8e0af5
dont update list after a filterChange, if the new filter
Claus Gittinger <cg@exept.de>
parents:
5740
diff
changeset
|
2601 |
]. |
12061 | 2602 |
|
2603 |
"Modified: / 20-11-2012 / 14:28:54 / cg" |
|
4342 | 2604 |
! |
2605 |
||
12324
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2606 |
modificationCycle |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2607 |
| oldModificationTime desc| |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2608 |
|
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2609 |
directory isNil ifTrue:[^ self]. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2610 |
|
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2611 |
directory exists ifFalse:[ |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2612 |
"/ directory vanished |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2613 |
directoryContentsChangeFlag := true. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2614 |
^ self |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2615 |
]. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2616 |
directory isRootDirectory ifTrue:[ |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2617 |
^ self |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2618 |
]. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2619 |
|
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2620 |
oldModificationTime := modificationTime. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2621 |
modificationTime := directory modificationTime. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2622 |
|
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2623 |
oldModificationTime ~= modificationTime ifTrue:[ |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2624 |
directoryContentsChangeFlag := true. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2625 |
self wakeUpForDirectoryContentsChanged. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2626 |
^ self |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2627 |
]. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2628 |
|
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2629 |
desc := self findNextItemFor:[:n| n hasBeenModified ]. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2630 |
|
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2631 |
desc notNil ifTrue:[ |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2632 |
desc resetItem. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2633 |
browser invalidateVisibleRow:desc. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2634 |
self debugMessage:'item is modified ', desc baseName. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2635 |
^ self. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2636 |
]. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2637 |
|
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2638 |
"Modified: / 20-03-2012 / 12:24:38 / cg" |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2639 |
! |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2640 |
|
4342 | 2641 |
readDirectoryItems |
7601
3958b3fb0caa
update of icons got corrupted
Claus Gittinger <cg@exept.de>
parents:
7584
diff
changeset
|
2642 |
|list contents itemClass| |
4342 | 2643 |
|
8496 | 2644 |
list := OrderedCollection new. |
2645 |
contents := DirectoryContents directoryNamed:directory. |
|
2646 |
||
2647 |
contents notEmptyOrNil ifTrue:[ |
|
7601
3958b3fb0caa
update of icons got corrupted
Claus Gittinger <cg@exept.de>
parents:
7584
diff
changeset
|
2648 |
itemClass := DirectoryContentsBrowser itemClass. |
8496 | 2649 |
modificationTime := contents modificationTime. |
2650 |
||
5010 | 2651 |
contents itemsDo:[:eachItem| |
7601
3958b3fb0caa
update of icons got corrupted
Claus Gittinger <cg@exept.de>
parents:
7584
diff
changeset
|
2652 |
list add:(itemClass forInfoItem:eachItem). |
4298 | 2653 |
]. |
4342 | 2654 |
]. |
2655 |
^ list |
|
2656 |
! |
|
2657 |
||
2658 |
sortBlockChanged |
|
2659 |
||
2660 |
filteredItems isNil ifTrue:[ ^ self]. |
|
5383 | 2661 |
filteredItems := self sortBlockHolder value sortItemList:filteredItems. |
4342 | 2662 |
self |
2663 |
enqueueMessage:#value |
|
4757 | 2664 |
for:[ self setBrowserItemList:filteredItems ] |
8227 | 2665 |
arguments:#(). |
4342 | 2666 |
! |
2667 |
||
2668 |
startUpdateTask |
|
9538 | 2669 |
(updateTask isNil or:[updateTask isDead]) ifTrue:[ |
4370 | 2670 |
updateTask := [ |
6026
0a098f7a9e09
Stop update task when application is closed
Stefan Vogel <sv@exept.de>
parents:
5994
diff
changeset
|
2671 |
[self isOpen] whileTrue:[ |
4370 | 2672 |
self updateStep |
2673 |
] |
|
2674 |
] newProcess. |
|
4342 | 2675 |
updateTask name:'DirectoryContentsBrowser updateTask'. |
15466
a62dd831dbb8
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
15284
diff
changeset
|
2676 |
updateTask priorityRange:(Processor userBackgroundPriority to:Processor activePriority). |
4370 | 2677 |
updateTask restartable:true. |
4342 | 2678 |
updateTask resume. |
2679 |
]. |
|
9538 | 2680 |
|
2681 |
"Modified: / 10-08-2010 / 14:03:57 / sr" |
|
4342 | 2682 |
! |
2683 |
||
2684 |
stopUpdateTask |
|
2685 |
||
2686 |
updateTask notNil ifTrue:[ |
|
2687 |
updateTask terminate. |
|
6026
0a098f7a9e09
Stop update task when application is closed
Stefan Vogel <sv@exept.de>
parents:
5994
diff
changeset
|
2688 |
updateTask := nil. |
4342 | 2689 |
]. |
2690 |
! |
|
2691 |
||
12324
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2692 |
updateAfterTimeout:hereDueToTimeOut |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2693 |
|mustCheckForModifiedDir| |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2694 |
|
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2695 |
mustCheckForModifiedDir := hereDueToTimeOut. |
5474 | 2696 |
|
7601
3958b3fb0caa
update of icons got corrupted
Claus Gittinger <cg@exept.de>
parents:
7584
diff
changeset
|
2697 |
"/ Transcript showCR:'START'. |
5474 | 2698 |
self isBusy:true. |
12324
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2699 |
self debugMessage:'update cycle'. |
5474 | 2700 |
[ |
12324
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2701 |
[ |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2702 |
mustCheckForModifiedDir ifTrue:[ |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2703 |
self debugMessage:'evaluate modification'. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2704 |
mustCheckForModifiedDir := false. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2705 |
self modificationCycle |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2706 |
]. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2707 |
directoryChangeFlag ifTrue:[ |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2708 |
directoryChangeFlag := false. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2709 |
self debugMessage:'directoryChanged'. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2710 |
self directoryChanged. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2711 |
]. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2712 |
directoryContentsChangeFlag ifTrue:[ |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2713 |
directoryContentsChangeFlag := false. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2714 |
self debugMessage:'directoryContentsChanged'. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2715 |
self directoryContentsChanged. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2716 |
]. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2717 |
filterChangeFlag ifTrue:[ |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2718 |
filterChangeFlag := false. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2719 |
self debugMessage:'filterChanged'. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2720 |
self filterChanged. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2721 |
]. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2722 |
sortBlockChangeFlag ifTrue:[ |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2723 |
sortBlockChangeFlag := false. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2724 |
self debugMessage:'sortBlockChanged'. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2725 |
self sortBlockChanged. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2726 |
]. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2727 |
(updatingColumns := self updateColumnsCycle) ifTrue:[ |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2728 |
self debugMessage:'next time another columns update'. |
14896
fb43a213acc4
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14707
diff
changeset
|
2729 |
changeSema signal. |
fb43a213acc4
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
14707
diff
changeset
|
2730 |
browser repairDamage. |
12324
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2731 |
] ifFalse:[ |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2732 |
self debugMessage:'next time no column update'. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2733 |
]. |
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2734 |
] doWhile:[updatingColumns] |
5474 | 2735 |
] ensure:[ |
2736 |
self isBusy:false. |
|
12324
315b83bfcf3d
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12113
diff
changeset
|
2737 |
updateCycleSemaphore signalIf. |
5474 | 2738 |
]. |
2739 |
"/ Transcript showCR:'STOP'. |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2740 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2741 |
"Created: / 07-01-2012 / 16:27:50 / cg" |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2742 |
! |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2743 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2744 |
updateStep |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2745 |
|timedOut sensor| |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2746 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2747 |
"/ Processor yield. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2748 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2749 |
sensor := self windowGroup sensor. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2750 |
(sensor anyButtonPressed or:[sensor shiftDown]) ifTrue:[ |
13797 | 2751 |
Processor yield. |
2752 |
||
2753 |
"/ no update while scrolling |
|
2754 |
timedOut := ( changeSema waitWithTimeoutMs:(self class updateTaskCyleTime milliseconds) ) isNil. |
|
2755 |
timedOut ifFalse:[changeSema signal]. |
|
2756 |
^ self |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2757 |
]. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2758 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2759 |
AbortOperationRequest handle:[ |
13797 | 2760 |
"/ to get out of a debugger loop... |
2761 |
self debugMessage:'got an abort signal'. |
|
2762 |
self directoryContentsChangeFlag:false. |
|
2763 |
self filterChangeFlag:false. |
|
2764 |
self sortBlockChangeFlag:false. |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2765 |
] do:[ |
13797 | 2766 |
(updatingColumns == true) ifTrue:[ |
2767 |
timedOut := false |
|
2768 |
] ifFalse:[ |
|
2769 |
self debugMessage:'sema wait'. |
|
2770 |
timedOut := (changeSema waitWithTimeoutMs:(self class updateTaskCyleTime asMilliseconds)) isNil. |
|
2771 |
self debugMessage:'timedOut:', timedOut asString. |
|
2772 |
]. |
|
2773 |
||
2774 |
(filterChangeFlag |
|
2775 |
or:[ sortBlockChangeFlag |
|
2776 |
or:[ directoryChangeFlag |
|
2777 |
or:[ directoryContentsChangeFlag |
|
2778 |
or:[ updatingColumns == true |
|
2779 |
or:[ timedOut ]]]]]) ifTrue:[ |
|
2780 |
accessLock critical:[ |
|
2781 |
self updateAfterTimeout:timedOut. |
|
2782 |
]. |
|
2783 |
]. |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2784 |
]. |
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2785 |
|
11445 | 2786 |
"Modified: / 20-03-2012 / 13:07:22 / cg" |
4342 | 2787 |
! ! |
2788 |
||
4862 | 2789 |
!DirectoryContentsBrowser methodsFor:'update task trigger'! |
2790 |
||
2791 |
wakeUp |
|
9538 | 2792 |
self isOpen ifTrue:[ |
2793 |
"/ the updateTask might be nil or dead.... |
|
2794 |
self startUpdateTask |
|
2795 |
]. |
|
6226 | 2796 |
changeSema signal. |
9538 | 2797 |
|
2798 |
"Modified: / 10-08-2010 / 14:07:40 / sr" |
|
4862 | 2799 |
! |
2800 |
||
2801 |
wakeUpForDirectoryChanged |
|
2802 |
self isBusy ifTrue:[ |
|
5474 | 2803 |
self isBusy:false. |
4862 | 2804 |
updateTask interruptWith:[AbortSignal raise]. |
2805 |
]. |
|
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2806 |
directoryChangeFlag := true. |
4862 | 2807 |
self wakeUp. |
11058
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2808 |
|
ab216c9278c6
added: #updateAfterTimeout:
Claus Gittinger <cg@exept.de>
parents:
10559
diff
changeset
|
2809 |
"Modified: / 07-01-2012 / 16:43:12 / cg" |
4862 | 2810 |
! |
2811 |
||
2812 |
wakeUpForDirectoryContentsChanged |
|
2813 |
||
2814 |
self directoryContentsChangeFlag:true. |
|
2815 |
self wakeUp. |
|
2816 |
! |
|
2817 |
||
2818 |
wakeUpForFilterChanged |
|
2819 |
||
2820 |
self filterChangeFlag:true. |
|
2821 |
self wakeUp. |
|
2822 |
! |
|
2823 |
||
2824 |
wakeUpForSortBlockChanged |
|
2825 |
||
2826 |
self sortBlockChangeFlag:true. |
|
2827 |
self wakeUp. |
|
2828 |
! ! |
|
2829 |
||
2830 |
!DirectoryContentsBrowser methodsFor:'update task-disk usage'! |
|
4555 | 2831 |
|
2832 |
diskUsageInKiloBytesFor:aDirectory |
|
6770 | 2833 |
|line sum kb| |
4555 | 2834 |
|
2835 |
OperatingSystem isUNIXlike ifTrue:[ |
|
2836 |
line := OperatingSystem getCommandOutputFrom:('du -s -k ' , aDirectory pathName). |
|
4559 | 2837 |
line notNil ifTrue:[ |
2838 |
kb := Number readFrom:line readStream. |
|
2839 |
]. |
|
4555 | 2840 |
^ kb |
2841 |
]. |
|
2842 |
||
6770 | 2843 |
sum := 0. |
2844 |
aDirectory recursiveDirectoryContentsDo:[:fnString | |
|
2845 |
|fn| |
|
2846 |
||
2847 |
fn := aDirectory construct:fnString. |
|
2848 |
fn isDirectory ifFalse:[ |
|
6809 | 2849 |
fn exists ifTrue:[ "/ cares for missing links in WinNT |
2850 |
sum := sum + fn fileSize |
|
2851 |
]. |
|
6770 | 2852 |
]. |
2853 |
]. |
|
2854 |
^ sum / 1024 |
|
6809 | 2855 |
|
2856 |
"Modified: / 04-07-2006 / 11:27:38 / cg" |
|
4555 | 2857 |
! |
2858 |
||
4781 | 2859 |
flushRememberedDiskUsageInfo |
2860 |
diskUsageInfo := nil. |
|
2861 |
! |
|
2862 |
||
4782 | 2863 |
flushRememberedDiskUsageInfoFor:aDirectory |
2864 |
|dirPath keysToRemove| |
|
2865 |
||
4783 | 2866 |
diskUsageInfo isNil ifTrue:[ ^ self ]. |
2867 |
||
4782 | 2868 |
dirPath := aDirectory pathName. |
2869 |
keysToRemove := diskUsageInfo keys |
|
2870 |
select:[:key | |
|
2871 |
key startsWith:dirPath |
|
2872 |
]. |
|
2873 |
diskUsageInfo removeAllKeys:keysToRemove. |
|
2874 |
! |
|
2875 |
||
4781 | 2876 |
isDiskUsageInfoStillValid:infoForDirectory for:aDirectoryPath |
4556 | 2877 |
|diskUsageRememberTime infoTimestamp infoKiloBytes infoMegaBytes| |
2878 |
||
2879 |
diskUsageRememberTime := 30. |
|
2880 |
||
2881 |
infoTimestamp := infoForDirectory key. |
|
2882 |
infoKiloBytes := infoForDirectory value. |
|
2883 |
infoMegaBytes := infoKiloBytes // 1024. |
|
2884 |
||
2885 |
"/ only update info every 30 seconds |
|
2886 |
"/ plus another second for every 5 megabytes |
|
2887 |
"/ (i.e. for 100 mb, keep info for 50seconds) |
|
2888 |
||
2889 |
diskUsageRememberTime := diskUsageRememberTime + (infoMegaBytes / 5). "/ another second for every megabyte |
|
2890 |
||
5780
0951e30d7914
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5777
diff
changeset
|
2891 |
(Timestamp now getSeconds - infoTimestamp getSeconds) > diskUsageRememberTime ifTrue:[ |
4556 | 2892 |
^ false |
2893 |
]. |
|
4781 | 2894 |
"/ (aDirectoryPath asFilename modificationTime > infoTimestamp) ifTrue:[ |
2895 |
"/ ^ false |
|
2896 |
"/ ]. |
|
4556 | 2897 |
^ true |
2898 |
! |
|
2899 |
||
4555 | 2900 |
showDiskUsageInfoFor:aDirectory as:kiloBytes |
2901 |
|kbString| |
|
2902 |
||
2903 |
kbString := UnitConverter fileSizeStringFor:(kiloBytes * 1024). |
|
2904 |
self notify:('%2 in %1' |
|
2905 |
bindWith:(aDirectory baseName "pathName" allBold) |
|
2906 |
with:(kbString , 'b') "allBold"). |
|
2907 |
! |
|
2908 |
||
4781 | 2909 |
startDiskUsageInfoProcess |
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5959
diff
changeset
|
2910 |
|aColOfFiles selectedFile info| |
4781 | 2911 |
|
7563 | 2912 |
aColOfFiles := self currentSelectedObjects. |
8252
17b35ca1a9ab
changed #startDiskUsageInfoProcess
Claus Gittinger <cg@exept.de>
parents:
8227
diff
changeset
|
2913 |
|
4781 | 2914 |
(aColOfFiles isEmpty or:[self currentFilesAreInSameDirectory not]) ifTrue:[ |
2915 |
^ self |
|
2916 |
]. |
|
2917 |
aColOfFiles size == 1 ifTrue:[ |
|
2918 |
selectedFile := aColOfFiles first. |
|
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5959
diff
changeset
|
2919 |
info := selectedFile linkInfo. |
5974 | 2920 |
(info notNil and:[info isSymbolicLink]) ifTrue:[ |
8372 | 2921 |
"/ self notify:'Symbolic link to: ' , (info path ? '') allBold |
4781 | 2922 |
] ifFalse:[ |
2923 |
self startDiskUsageInfoProcessFor:selectedFile. |
|
2924 |
]. |
|
2925 |
]. |
|
7563 | 2926 |
|
2927 |
"Modified: / 04-12-2006 / 13:15:40 / cg" |
|
4781 | 2928 |
! |
2929 |
||
4555 | 2930 |
startDiskUsageInfoProcessFor:selectedFile |
4556 | 2931 |
|directory dirPath infoForDirectory infoValue| |
4555 | 2932 |
|
2933 |
self showDiskUsageHolder value ifFalse:[^ self]. |
|
2934 |
||
2935 |
selectedFile isDirectory ifTrue:[ |
|
2936 |
directory := selectedFile |
|
2937 |
] ifFalse:[ |
|
2938 |
directory := selectedFile directory |
|
2939 |
]. |
|
2940 |
||
2941 |
dirPath := directory pathName. |
|
2942 |
diskUsageInfo isNil ifTrue:[ |
|
2943 |
diskUsageInfo := Dictionary new. |
|
2944 |
]. |
|
2945 |
infoForDirectory := diskUsageInfo at:dirPath ifAbsent:nil. |
|
2946 |
infoForDirectory notNil ifTrue:[ |
|
4781 | 2947 |
(self isDiskUsageInfoStillValid:infoForDirectory for:dirPath) ifTrue:[ |
4556 | 2948 |
infoValue := infoForDirectory value. |
4555 | 2949 |
]. |
2950 |
]. |
|
2951 |
||
2952 |
infoValue notNil ifTrue:[ |
|
2953 |
self showDiskUsageInfoFor:directory as:infoValue. |
|
2954 |
^ self. |
|
2955 |
]. |
|
2956 |
||
2957 |
diskUsageUpdateProcess notNil ifTrue:[ |
|
2958 |
diskUsageUpdateProcess terminate |
|
2959 |
]. |
|
2960 |
diskUsageUpdateProcess := |
|
2961 |
[ |
|
2962 |
|kiloBytes| |
|
2963 |
||
2964 |
self notify:('collecting disk usage of %1...' bindWith:directory baseName). |
|
2965 |
kiloBytes := self diskUsageInKiloBytesFor:directory. |
|
4559 | 2966 |
kiloBytes notNil ifTrue:[ |
9116
469bd38ba4c6
changed: #startDiskUsageInfoProcessFor:
Claus Gittinger <cg@exept.de>
parents:
9105
diff
changeset
|
2967 |
diskUsageInfo notNil ifTrue:[ |
469bd38ba4c6
changed: #startDiskUsageInfoProcessFor:
Claus Gittinger <cg@exept.de>
parents:
9105
diff
changeset
|
2968 |
diskUsageInfo at:dirPath put:(Timestamp now -> kiloBytes). |
469bd38ba4c6
changed: #startDiskUsageInfoProcessFor:
Claus Gittinger <cg@exept.de>
parents:
9105
diff
changeset
|
2969 |
self showDiskUsageInfoFor:directory as:kiloBytes. |
469bd38ba4c6
changed: #startDiskUsageInfoProcessFor:
Claus Gittinger <cg@exept.de>
parents:
9105
diff
changeset
|
2970 |
]. |
4559 | 2971 |
] |
4555 | 2972 |
] fork. |
2973 |
! ! |
|
2974 |
||
3887 | 2975 |
!DirectoryContentsBrowser::DirectoryContentsItem class methodsFor:'instance creation'! |
2976 |
||
3983 | 2977 |
fileName:aFilename |
3999
10b79980664c
get an item from dirContents
Claus Gittinger <cg@exept.de>
parents:
3996
diff
changeset
|
2978 |
| instance fileItem| |
7601
3958b3fb0caa
update of icons got corrupted
Claus Gittinger <cg@exept.de>
parents:
7584
diff
changeset
|
2979 |
|
3983 | 2980 |
aFilename asString = '..' ifTrue:[ |
7601
3958b3fb0caa
update of icons got corrupted
Claus Gittinger <cg@exept.de>
parents:
7584
diff
changeset
|
2981 |
instance := self new. |
3983 | 2982 |
instance fileName:aFilename. |
2983 |
^ instance. |
|
2984 |
]. |
|
3999
10b79980664c
get an item from dirContents
Claus Gittinger <cg@exept.de>
parents:
3996
diff
changeset
|
2985 |
fileItem := DirectoryContents contentsItemForFileName:aFilename. |
7601
3958b3fb0caa
update of icons got corrupted
Claus Gittinger <cg@exept.de>
parents:
7584
diff
changeset
|
2986 |
fileItem isNil ifTrue:[^ nil]. |
3958b3fb0caa
update of icons got corrupted
Claus Gittinger <cg@exept.de>
parents:
7584
diff
changeset
|
2987 |
^ self forInfoItem:fileItem. |
3999
10b79980664c
get an item from dirContents
Claus Gittinger <cg@exept.de>
parents:
3996
diff
changeset
|
2988 |
|
10b79980664c
get an item from dirContents
Claus Gittinger <cg@exept.de>
parents:
3996
diff
changeset
|
2989 |
" |
10b79980664c
get an item from dirContents
Claus Gittinger <cg@exept.de>
parents:
3996
diff
changeset
|
2990 |
DirectoryContentsItem fileName:'..' |
10b79980664c
get an item from dirContents
Claus Gittinger <cg@exept.de>
parents:
3996
diff
changeset
|
2991 |
" |
3983 | 2992 |
! |
2993 |
||
2994 |
forInfoItem:anItem |
|
3887 | 2995 |
| instance | |
7601
3958b3fb0caa
update of icons got corrupted
Claus Gittinger <cg@exept.de>
parents:
7584
diff
changeset
|
2996 |
|
3887 | 2997 |
instance := self new. |
3983 | 2998 |
instance fileName:anItem fileName. |
2999 |
anItem isRemoteDirectory ifTrue:[ |
|
3000 |
instance beRemoteDirectory. |
|
3001 |
] ifFalse:[ |
|
3002 |
instance fileInfo:anItem info. |
|
3003 |
]. |
|
3906 | 3004 |
^ instance |
3887 | 3005 |
! ! |
3006 |
||
3007 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'accessing'! |
|
3008 |
||
3983 | 3009 |
fileInfo:something |
3010 |
fileInfo := something. |
|
3011 |
! |
|
3012 |
||
3887 | 3013 |
fileName |
3014 |
^ fileName |
|
3015 |
! |
|
3016 |
||
3017 |
fileName:aFilename |
|
5994 | 3018 |
"set fileName" |
3019 |
||
4101 | 3020 |
fileName := aFilename asFilename. |
5994 | 3021 |
self assert:(fileName notNil). |
3887 | 3022 |
! |
3023 |
||
3024 |
fileType |
|
5994 | 3025 |
"returns the type of the file" |
3026 |
||
4345 | 3027 |
fileType isNil ifTrue:[ |
3028 |
fileType := ''. |
|
3029 |
]. |
|
3887 | 3030 |
^ fileType |
3031 |
! |
|
3032 |
||
3033 |
fileType:aType |
|
3034 |
fileType := aType. |
|
3035 |
! |
|
3036 |
||
3037 |
icon |
|
9323 | 3038 |
"answer the icon displayed in the table widget; if the icon is unspecified, |
3039 |
and the fileInfo is set a default icon is returned otherwise nil" |
|
3040 |
||
3041 |
|key| |
|
3042 |
||
3043 |
icon notNil ifTrue:[^ icon ]. |
|
3044 |
||
3045 |
key := #file. "/ default |
|
3046 |
||
3047 |
self isRemoteDirectory ifTrue:[ |
|
3048 |
key := #directory. |
|
3049 |
] ifFalse:[ |
|
3050 |
"do not fetch the fileInfo..." |
|
3051 |
fileInfo isNil ifTrue:[ ^ nil ]. |
|
3052 |
||
3053 |
self isDirectory ifTrue:[ |
|
3054 |
key := #directory. |
|
3055 |
] ifFalse:[ |
|
3056 |
self isSymbolicLink ifTrue:[ |
|
3057 |
key := #fileLink |
|
3058 |
] ifFalse:[ |
|
3059 |
key := #file |
|
3060 |
]. |
|
3061 |
]. |
|
3062 |
]. |
|
3063 |
^ MIMETypeIconLibrary iconForKey:key. |
|
3887 | 3064 |
! |
3065 |
||
3066 |
icon:anIcon |
|
3067 |
||
3068 |
icon := anIcon. |
|
3069 |
! |
|
3070 |
||
3071 |
iconKey |
|
3072 |
iconKey isNil ifTrue:[ |
|
3906 | 3073 |
self isRemoteDirectory ifTrue:[ |
14186
2ed966dc0816
Do not refer to FileBrowser methods
Stefan Vogel <sv@exept.de>
parents:
13797
diff
changeset
|
3074 |
iconKey := MIMETypeIconLibrary iconKeyForRemoteDirectory:fileName. |
3906 | 3075 |
] ifFalse:[ |
14186
2ed966dc0816
Do not refer to FileBrowser methods
Stefan Vogel <sv@exept.de>
parents:
13797
diff
changeset
|
3076 |
iconKey := MIMETypeIconLibrary iconKeyForFile:fileName. |
3906 | 3077 |
] |
3887 | 3078 |
]. |
3079 |
^ iconKey |
|
3080 |
! |
|
3081 |
||
9323 | 3082 |
iconOrNil |
3083 |
"answer the icon or nil if unspecifed" |
|
3084 |
||
3085 |
^ icon |
|
3086 |
! |
|
3087 |
||
3887 | 3088 |
isDirectory |
3967 | 3089 |
self isRemoteDirectory ifTrue:[^ true]. |
3090 |
||
3091 |
self getFileInfo. |
|
3092 |
fileInfo isNil ifTrue:[^ false]. |
|
3093 |
^ fileInfo isDirectory |
|
3094 |
! |
|
3887 | 3095 |
|
3967 | 3096 |
isSymbolicLink |
3097 |
self isRemoteDirectory ifTrue:[^ false]. |
|
3098 |
||
3099 |
self getFileInfo. |
|
3100 |
fileInfo isNil ifTrue:[^ false]. |
|
3101 |
^ fileInfo isSymbolicLink |
|
3887 | 3102 |
! |
3103 |
||
3104 |
lastButOneSuffix |
|
3105 |
"returns the suffix of the file |
|
3106 |
" |
|
3107 |
||
3108 |
^ self suffixes at:2 |
|
3109 |
! |
|
3110 |
||
3111 |
lastSuffix |
|
3112 |
"returns the suffix of the file |
|
3113 |
" |
|
3114 |
||
3115 |
^ self suffixes at:1 |
|
3116 |
! |
|
3117 |
||
4988 | 3118 |
linkTargetIsDirectory |
3119 |
self isSymbolicLink ifFalse:[^ false]. |
|
3120 |
||
3121 |
^ fileName info isDirectory |
|
3122 |
! |
|
3123 |
||
3887 | 3124 |
mimeType |
3125 |
mimeType isNil ifTrue:[ |
|
3126 |
mimeType := MIMETypes mimeTypeForFilename:(self fileName). |
|
3127 |
mimeType isNil ifTrue:[ |
|
3128 |
mimeType := #unknown |
|
3129 |
] |
|
3130 |
]. |
|
3131 |
^ mimeType |
|
3132 |
! |
|
3133 |
||
3134 |
preview |
|
3135 |
||
3136 |
^ preview |
|
3137 |
! |
|
3138 |
||
3139 |
preview:aLabel |
|
3140 |
||
3141 |
preview := aLabel. |
|
3142 |
! |
|
3143 |
||
3144 |
suffix |
|
3145 |
"returns the suffix of the file |
|
3146 |
" |
|
4017 | 3147 |
self isDirectory ifTrue:[^'']. |
3887 | 3148 |
suffix isNil ifTrue:[ |
3149 |
(OperatingSystem isUNIXlike and:[(self baseName at:1) == $.]) ifTrue:[ |
|
3150 |
suffix := ''. |
|
3151 |
] ifFalse:[ |
|
3152 |
suffix := fileName suffix. |
|
3153 |
] |
|
3154 |
]. |
|
3155 |
^ suffix |
|
3156 |
! |
|
3157 |
||
3158 |
suffixes |
|
3159 |
||
3160 |
| lastSuff lastButOneSuff| |
|
3161 |
||
3967 | 3162 |
(fileName name occurrencesOf:$.) <= 1 ifTrue:[ |
3163 |
^ Array with:(self suffix) with:nil. |
|
3164 |
]. |
|
3165 |
(fileName baseName occurrencesOf:$.) <= 1 ifTrue:[ |
|
3166 |
^ Array with:(self suffix) with:nil. |
|
3167 |
]. |
|
3887 | 3168 |
|
3967 | 3169 |
((lastSuff := self suffix) isEmpty) ifTrue:[ |
3170 |
lastSuff := nil. |
|
3171 |
] ifFalse:[ |
|
3172 |
lastSuff := lastSuff asLowercase. |
|
3173 |
]. |
|
3174 |
||
3175 |
((lastButOneSuff := fileName withoutSuffix suffix) isEmpty) ifTrue:[ |
|
3176 |
lastButOneSuff := nil. |
|
3177 |
] ifFalse:[ |
|
3178 |
lastButOneSuff := lastButOneSuff asLowercase. |
|
3179 |
]. |
|
3180 |
||
3181 |
(lastSuff notNil and:[lastButOneSuff notNil]) ifTrue:[ |
|
3182 |
(lastSuff = 'bak' or:[lastSuff = 'sav']) ifTrue:[ |
|
3183 |
lastSuff := lastButOneSuff. |
|
3887 | 3184 |
lastButOneSuff := nil. |
3967 | 3185 |
] |
3887 | 3186 |
]. |
3967 | 3187 |
^ Array with:lastSuff with:lastButOneSuff |
3887 | 3188 |
! |
3189 |
||
3190 |
type |
|
3191 |
"returns the type of the file |
|
3192 |
" |
|
3193 |
^ self valueAt:#type |
|
3194 |
||
3195 |
! ! |
|
3196 |
||
3197 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'actions'! |
|
3198 |
||
3199 |
resetImageFile |
|
3200 |
" if the image preview extent is changed the icon will set to nil to force the update task to reload the image " |
|
3201 |
||
13717
00aa1ccdc596
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12826
diff
changeset
|
3202 |
(mimeType notNil and:[ mimeType isImageType]) ifTrue:[ |
3887 | 3203 |
preview := nil |
3204 |
] |
|
3205 |
! |
|
3206 |
||
5475 | 3207 |
resetItem |
3887 | 3208 |
" dont know what someone else is doing with the file - read all item properties new " |
5994 | 3209 |
|
3887 | 3210 |
fileInfo := nil. |
3211 |
icon := nil. |
|
3212 |
fileType := nil. |
|
3213 |
preview := nil. |
|
3214 |
owner := nil. |
|
3215 |
group := nil. |
|
4073 | 3216 |
iconKey := nil. |
3217 |
mimeTypeForContents := nil. |
|
3218 |
mimeType := nil. |
|
3887 | 3219 |
! ! |
3220 |
||
3221 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'change queries'! |
|
3222 |
||
3967 | 3223 |
hasBeenModified |
5994 | 3224 |
"check if item modification time has changed" |
3225 |
||
3226 |
|info| |
|
3887 | 3227 |
|
3906 | 3228 |
self isRemoteDirectory ifTrue:[^ false]. |
8496 | 3229 |
"/ root directories are not verified |
3230 |
fileName isRootDirectory ifTrue:[ ^ false ]. |
|
3231 |
||
3906 | 3232 |
|
5475 | 3233 |
fileInfo isNil ifTrue:[ |
3234 |
"first time of invokation " |
|
3235 |
info := self getFileInfo. |
|
3236 |
info isNil ifTrue:[ ^ false]. |
|
3237 |
^ true |
|
3887 | 3238 |
]. |
8372 | 3239 |
fileInfo isSymbolicLink ifTrue:[ |
3240 |
"/ symbolic links are not verified |
|
3241 |
^ false |
|
3242 |
]. |
|
3243 |
||
5475 | 3244 |
self modificationTime ~= fileName modificationTime ifTrue:[ |
3887 | 3245 |
^ true |
3246 |
]. |
|
3247 |
^ false |
|
3248 |
! ! |
|
3249 |
||
6188 | 3250 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'comparing'! |
3887 | 3251 |
|
5010 | 3252 |
= anItem |
3253 |
||
3254 |
"/ Transcript showCR:(anItem species == self species). |
|
3255 |
anItem species == self species ifFalse:[ ^ false]. |
|
3256 |
anItem isNil ifTrue:[ ^ false]. |
|
3257 |
^ (self fileName = anItem fileName) |
|
3887 | 3258 |
! |
3259 |
||
3260 |
hash |
|
3261 |
^ fileName hash |
|
3262 |
! ! |
|
3263 |
||
3264 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'presentation'! |
|
3265 |
||
3266 |
baseName |
|
5994 | 3267 |
"returns the baseName of the file" |
3268 |
||
10559
e36369957676
Directories are displayed in bold font for easier navigation
vrany
parents:
10300
diff
changeset
|
3269 |
baseName isNil ifTrue:[ |
e36369957676
Directories are displayed in bold font for easier navigation
vrany
parents:
10300
diff
changeset
|
3270 |
baseName := fileName baseName. |
e36369957676
Directories are displayed in bold font for easier navigation
vrany
parents:
10300
diff
changeset
|
3271 |
fileName isDirectory ifTrue:[ |
e36369957676
Directories are displayed in bold font for easier navigation
vrany
parents:
10300
diff
changeset
|
3272 |
baseName := baseName allBold. |
e36369957676
Directories are displayed in bold font for easier navigation
vrany
parents:
10300
diff
changeset
|
3273 |
]. |
e36369957676
Directories are displayed in bold font for easier navigation
vrany
parents:
10300
diff
changeset
|
3274 |
]. |
e36369957676
Directories are displayed in bold font for easier navigation
vrany
parents:
10300
diff
changeset
|
3275 |
^ baseName |
e36369957676
Directories are displayed in bold font for easier navigation
vrany
parents:
10300
diff
changeset
|
3276 |
|
e36369957676
Directories are displayed in bold font for easier navigation
vrany
parents:
10300
diff
changeset
|
3277 |
"Modified: / 09-08-2011 / 14:48:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3887 | 3278 |
! |
3279 |
||
3280 |
baseNameWithOutSuffix |
|
5994 | 3281 |
"returns the baseName of the file" |
3282 |
||
10559
e36369957676
Directories are displayed in bold font for easier navigation
vrany
parents:
10300
diff
changeset
|
3283 |
| baseNameWithOutSuffix | |
3887 | 3284 |
|
4017 | 3285 |
self isDirectory ifTrue:[^ self baseName]. |
10559
e36369957676
Directories are displayed in bold font for easier navigation
vrany
parents:
10300
diff
changeset
|
3286 |
baseNameWithOutSuffix := self baseName asFilename withoutSuffix asString. |
e36369957676
Directories are displayed in bold font for easier navigation
vrany
parents:
10300
diff
changeset
|
3287 |
(baseNameWithOutSuffix isEmpty or:[baseNameWithOutSuffix = '.']) ifTrue:[ |
3887 | 3288 |
^ self baseName |
3289 |
]. |
|
10559
e36369957676
Directories are displayed in bold font for easier navigation
vrany
parents:
10300
diff
changeset
|
3290 |
^ baseNameWithOutSuffix. |
3887 | 3291 |
! |
3292 |
||
3293 |
date |
|
5994 | 3294 |
"returns the modTimeString" |
3295 |
||
3887 | 3296 |
| modTime | |
3297 |
||
3967 | 3298 |
modTime := self modificationTime. |
3299 |
modTime isNil ifTrue:[ |
|
3300 |
^ '???' |
|
3887 | 3301 |
]. |
3967 | 3302 |
^ modTime asDate printString. |
3887 | 3303 |
! |
3304 |
||
3305 |
fileInfoString |
|
3306 |
"get stat info on selected file - return a string which can be |
|
3307 |
shown in a box" |
|
3308 |
||
3309 |
| afileType | |
|
3310 |
||
3311 |
fileName isNil ifTrue:[^ nil]. |
|
3312 |
afileType := self fileType. |
|
3313 |
afileType isNil ifTrue:[ |
|
3314 |
^ ''. |
|
3315 |
]. |
|
3316 |
^ afileType |
|
3317 |
! |
|
3318 |
||
3967 | 3319 |
fileSize |
5994 | 3320 |
"returns the fileSize" |
3321 |
||
3967 | 3322 |
self getFileInfo. |
3323 |
fileInfo isNil ifTrue:[^ nil]. |
|
3324 |
||
3325 |
^ fileInfo fileSize |
|
3326 |
! |
|
3327 |
||
3887 | 3328 |
group |
5994 | 3329 |
"returns the printable group" |
3330 |
||
3887 | 3331 |
|gid| |
3332 |
||
3333 |
group isNil ifTrue:[ |
|
3967 | 3334 |
self getFileInfo. |
3335 |
fileInfo isNil ifTrue:[^ '???']. |
|
3336 |
||
3337 |
gid := fileInfo gid. |
|
3338 |
(LastGIDToGroupNameMapping notNil and:[gid == LastGIDToGroupNameMapping key]) ifTrue:[ |
|
3339 |
group := LastGIDToGroupNameMapping value |
|
3340 |
] ifFalse:[ |
|
3341 |
group := OperatingSystem getGroupNameFromID:gid. |
|
3342 |
LastGIDToGroupNameMapping := gid -> group. |
|
3343 |
] |
|
3887 | 3344 |
]. |
3345 |
^ group |
|
3346 |
! |
|
3347 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
3348 |
inodeNumber |
5994 | 3349 |
"returns the inode number" |
3350 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
3351 |
self getFileInfo. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
3352 |
fileInfo isNil ifTrue:[^ nil]. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
3353 |
^ fileInfo id |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
3354 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4972
diff
changeset
|
3355 |
|
3887 | 3356 |
modificationTime |
5994 | 3357 |
"returns the absolute time of modification" |
3358 |
||
3967 | 3359 |
self getFileInfo. |
3360 |
fileInfo isNil ifTrue:[^ nil]. |
|
3361 |
||
3362 |
^ fileInfo modificationTime |
|
3887 | 3363 |
! |
3364 |
||
3365 |
owner |
|
5994 | 3366 |
"returns the printable owner" |
3367 |
||
3887 | 3368 |
|uid| |
3369 |
||
3370 |
owner isNil ifTrue:[ |
|
3967 | 3371 |
self getFileInfo. |
3372 |
fileInfo isNil ifTrue:[^ '???']. |
|
3373 |
||
3374 |
uid := fileInfo uid. |
|
3375 |
(LastUIDToUserNameMapping notNil and:[uid == LastUIDToUserNameMapping key]) ifTrue:[ |
|
3376 |
owner := LastUIDToUserNameMapping value |
|
3377 |
] ifFalse:[ |
|
3378 |
owner := OperatingSystem getUserNameFromID:uid. |
|
3379 |
LastUIDToUserNameMapping := uid -> owner. |
|
3380 |
] |
|
3887 | 3381 |
]. |
3382 |
^ owner |
|
3383 |
! |
|
3384 |
||
3385 |
permissions |
|
5994 | 3386 |
"returns the permissions as printable string" |
3387 |
||
3967 | 3388 |
|mode permissionString| |
3887 | 3389 |
|
3967 | 3390 |
self getFileInfo. |
3391 |
fileInfo isNil ifTrue:[^ '???'.]. |
|
3887 | 3392 |
|
3967 | 3393 |
mode := fileInfo mode. |
3394 |
permissionString := String new:9 withAll:$-. |
|
3395 |
||
3396 |
1 to:9 by:3 do:[:i| |
|
3397 |
(mode bitAt:i ) == 1 ifTrue:[permissionString at:10 - i put:$x]. |
|
3398 |
(mode bitAt:i + 1) == 1 ifTrue:[permissionString at:9 - i put:$w]. |
|
3399 |
(mode bitAt:i + 2) == 1 ifTrue:[permissionString at:8 - i put:$r]. |
|
3887 | 3400 |
]. |
3967 | 3401 |
^ permissionString |
3887 | 3402 |
! |
3403 |
||
4970 | 3404 |
sizeInBytesString |
3405 |
|locSize| |
|
3406 |
||
3407 |
locSize := self fileSize. |
|
3408 |
locSize isNil ifTrue:[^ '???']. |
|
3409 |
||
3410 |
^ locSize printString "/ leftPaddedTo:8. |
|
3411 |
! |
|
3412 |
||
5312 | 3413 |
sizeInKiloBytesString |
3414 |
|locSize| |
|
3415 |
||
3416 |
locSize := self fileSize. |
|
3417 |
locSize isNil ifTrue:[^ '???']. |
|
3418 |
||
3419 |
(locSize \\ 1024) == 0 ifTrue:[ |
|
3420 |
^ (locSize // 1024) printString , ' ' |
|
3421 |
]. |
|
3422 |
^ ((locSize / 1024) asFixedPoint:1) printString |
|
3423 |
! |
|
3424 |
||
3887 | 3425 |
sizeString |
5994 | 3426 |
"returns the size of the file" |
3427 |
||
3428 |
| unitString locSize| |
|
3887 | 3429 |
|
3967 | 3430 |
locSize := self fileSize. |
3431 |
locSize isNil ifTrue:[^ '???']. |
|
3432 |
||
4402
c13678e65aa8
sizeCol is aligned on the decimalPoint
Claus Gittinger <cg@exept.de>
parents:
4376
diff
changeset
|
3433 |
unitString := UnitConverter fileSizeStringFor:locSize. |
c13678e65aa8
sizeCol is aligned on the decimalPoint
Claus Gittinger <cg@exept.de>
parents:
4376
diff
changeset
|
3434 |
^ unitString withoutSeparators "/ leftPaddedTo:8. |
3887 | 3435 |
! |
3436 |
||
3437 |
timeAndDate |
|
5994 | 3438 |
"returns the time- and date string" |
3439 |
||
5338 | 3440 |
|resources format modTime date| |
3887 | 3441 |
|
3967 | 3442 |
modTime := self modificationTime. |
3443 |
modTime isNil ifTrue:[ |
|
3444 |
^ '???' |
|
3887 | 3445 |
]. |
4938 | 3446 |
|
14186
2ed966dc0816
Do not refer to FileBrowser methods
Stefan Vogel <sv@exept.de>
parents:
13797
diff
changeset
|
3447 |
resources := AbstractFileBrowser classResources. |
5338 | 3448 |
|
4938 | 3449 |
"/ format := '%(year)-%(mon)-%(day) %h:%m:%s'. |
3450 |
date := modTime asDate. |
|
3451 |
date = Date today ifTrue:[ |
|
5338 | 3452 |
format := (resources string:'Today') , ' %(yearOrTime)' |
4938 | 3453 |
] ifFalse:[ |
3454 |
false "date = Date yesterday" ifTrue:[ |
|
5338 | 3455 |
format := (resources string:'Yesterday') , ' %(yearOrTime)' |
4938 | 3456 |
] ifFalse:[ |
8845
471945efed1c
Smalltalk language -> UserPreferences current language
Claus Gittinger <cg@exept.de>
parents:
8715
diff
changeset
|
3457 |
UserPreferences current languageTerritory == #us ifTrue:[ |
4938 | 3458 |
format := '%(ShortMonthName), %(dayPadded) %(yearOrTime)'. |
3459 |
] ifFalse:[ |
|
3460 |
format :='%(day)-%(ShortMonthName) %(yearOrTime)'. |
|
3461 |
]. |
|
3462 |
]. |
|
3967 | 3463 |
]. |
4938 | 3464 |
|
3465 |
^ modTime printStringFormat:format. |
|
3887 | 3466 |
! ! |
3467 |
||
5716 | 3468 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'printing'! |
3469 |
||
3470 |
printOn:aStream |
|
3471 |
super printOn:aStream. |
|
8003
7af5b26e1723
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7963
diff
changeset
|
3472 |
aStream |
7af5b26e1723
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7963
diff
changeset
|
3473 |
nextPut:$[; |
7af5b26e1723
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7963
diff
changeset
|
3474 |
nextPutAll:fileName asString; |
7af5b26e1723
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7963
diff
changeset
|
3475 |
nextPut:$]. |
5716 | 3476 |
! ! |
3477 |
||
3887 | 3478 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'private'! |
3479 |
||
3967 | 3480 |
getFileInfo |
3887 | 3481 |
fileInfo isNil ifTrue:[ |
3906 | 3482 |
self isRemoteDirectory ifTrue:[ |
3483 |
"/ do not access, to avoid automount |
|
3887 | 3484 |
] ifFalse:[ |
3967 | 3485 |
fileInfo := fileName linkInfo. |
3486 |
]. |
|
3487 |
]. |
|
3488 |
^ fileInfo |
|
3887 | 3489 |
! ! |
3490 |
||
3491 |
!DirectoryContentsBrowser::DirectoryContentsItem methodsFor:'queries'! |
|
3492 |
||
3906 | 3493 |
beRemoteDirectory |
3494 |
fileType := #remoteDirectory. |
|
3495 |
! |
|
3496 |
||
3887 | 3497 |
exists |
3498 |
^ fileName exists |
|
3499 |
! |
|
3500 |
||
3501 |
hasMimeType |
|
3502 |
||
3503 |
^ (self mimeType ~= #unknown) |
|
3504 |
! |
|
3505 |
||
3906 | 3506 |
isRemoteDirectory |
3507 |
^ fileType == #remoteDirectory |
|
3508 |
! |
|
3509 |
||
3887 | 3510 |
mimeTypeForContents |
3511 |
||
3512 |
mimeTypeForContents isNil ifTrue:[ |
|
3513 |
mimeTypeForContents := MIMETypes mimeTypeOfContents:(self fileName). |
|
3514 |
mimeTypeForContents isNil ifTrue:[ |
|
3515 |
mimeTypeForContents := #unknown |
|
3516 |
] ifFalse:[ |
|
3517 |
" set mimeType to mimeType of contents if a better mimeType is found " |
|
3518 |
mimeType := mimeTypeForContents. |
|
3519 |
iconKey := mimeTypeForContents. |
|
3520 |
] |
|
3521 |
]. |
|
3522 |
^ mimeTypeForContents |
|
3523 |
! ! |
|
3524 |
||
3525 |
!DirectoryContentsBrowser class methodsFor:'documentation'! |
|
3526 |
||
3527 |
version |
|
15592
cdeaf8307c45
class: DirectoryContentsBrowser
Stefan Vogel <sv@exept.de>
parents:
15466
diff
changeset
|
3528 |
^ '$Header: /cvs/stx/stx/libtool/DirectoryContentsBrowser.st,v 1.271 2015-04-22 17:53:25 stefan Exp $' |
8845
471945efed1c
Smalltalk language -> UserPreferences current language
Claus Gittinger <cg@exept.de>
parents:
8715
diff
changeset
|
3529 |
! |
471945efed1c
Smalltalk language -> UserPreferences current language
Claus Gittinger <cg@exept.de>
parents:
8715
diff
changeset
|
3530 |
|
471945efed1c
Smalltalk language -> UserPreferences current language
Claus Gittinger <cg@exept.de>
parents:
8715
diff
changeset
|
3531 |
version_CVS |
15592
cdeaf8307c45
class: DirectoryContentsBrowser
Stefan Vogel <sv@exept.de>
parents:
15466
diff
changeset
|
3532 |
^ '$Header: /cvs/stx/stx/libtool/DirectoryContentsBrowser.st,v 1.271 2015-04-22 17:53:25 stefan Exp $' |
3887 | 3533 |
! ! |
12093
900b133ef74c
class: DirectoryContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
12061
diff
changeset
|
3534 |