author | penk |
Fri, 25 Oct 2002 14:03:21 +0200 | |
changeset 4060 | efb0431e606d |
parent 4050 | d63d33ad9c41 |
child 4071 | f923c8257818 |
permissions | -rw-r--r-- |
3892 | 1 |
"{ Package: 'stx:libtool' }" |
2 |
||
3 |
ApplicationModel subclass:#AbstractFileBrowser |
|
3967 | 4 |
instanceVariableNames:'aspects' |
5 |
classVariableNames:'DirectoryHistory DefaultCommandPerMIME SettingsAspects |
|
6 |
RuntimeAspects DirectoryBookmarks LastEnforcedNameSpace |
|
7 |
CommandHistory DefaultCommandPerSuffix CommandHistorySize |
|
8 |
LastFileDiffFile' |
|
9 |
poolDictionaries:'' |
|
10 |
category:'Interface-Tools-File' |
|
3892 | 11 |
! |
12 |
||
13 |
AbstractFileBrowser class instanceVariableNames:'DisabledCursorImage EnabledCursorImage' |
|
14 |
||
15 |
" |
|
16 |
The following class instance variables are inherited by this class: |
|
17 |
||
3967 | 18 |
ApplicationModel - ClassResources |
19 |
Model - |
|
20 |
Object - |
|
3892 | 21 |
" |
22 |
! |
|
23 |
||
24 |
Object subclass:#Clipboard |
|
3967 | 25 |
instanceVariableNames:'method files' |
26 |
classVariableNames:'' |
|
27 |
poolDictionaries:'' |
|
28 |
privateIn:AbstractFileBrowser |
|
3892 | 29 |
! |
30 |
||
31 |
Object subclass:#CodeExecutionLock |
|
3967 | 32 |
instanceVariableNames:'locked' |
33 |
classVariableNames:'' |
|
34 |
poolDictionaries:'' |
|
35 |
privateIn:AbstractFileBrowser |
|
3892 | 36 |
! |
37 |
||
38 |
OrderedCollection subclass:#DirectoryHistory |
|
4022 | 39 |
instanceVariableNames:'forwardList backList lastWasForwardPath lastBackPath lastAddPath' |
3967 | 40 |
classVariableNames:'HistorySize' |
41 |
poolDictionaries:'' |
|
42 |
privateIn:AbstractFileBrowser |
|
3952 | 43 |
! |
44 |
||
45 |
Object subclass:#DirectoryHistoryItem |
|
3967 | 46 |
instanceVariableNames:'path position' |
47 |
classVariableNames:'' |
|
48 |
poolDictionaries:'' |
|
49 |
privateIn:AbstractFileBrowser::DirectoryHistory |
|
3892 | 50 |
! |
51 |
||
52 |
OrderedSet subclass:#FilenameHistory |
|
3967 | 53 |
instanceVariableNames:'' |
54 |
classVariableNames:'' |
|
55 |
poolDictionaries:'' |
|
56 |
privateIn:AbstractFileBrowser |
|
3892 | 57 |
! |
58 |
||
59 |
Object subclass:#SaveAspectItem |
|
3967 | 60 |
instanceVariableNames:'value isHolder' |
61 |
classVariableNames:'' |
|
62 |
poolDictionaries:'' |
|
63 |
privateIn:AbstractFileBrowser |
|
3892 | 64 |
! |
65 |
||
66 |
||
67 |
!AbstractFileBrowser class methodsFor:'classAccess'! |
|
68 |
||
3952 | 69 |
directoryHistoryClass |
70 |
||
71 |
^ AbstractFileBrowser::DirectoryHistory |
|
72 |
! |
|
73 |
||
3892 | 74 |
filenameHistoryClass |
75 |
||
76 |
^ FilenameHistory |
|
77 |
! ! |
|
78 |
||
3952 | 79 |
!AbstractFileBrowser class methodsFor:'classVarAccess'! |
80 |
||
81 |
directoryHistory |
|
82 |
||
83 |
DirectoryHistory isNil ifTrue:[ |
|
84 |
DirectoryHistory := self directoryHistoryClass new. |
|
3964 | 85 |
"/ DirectoryHistory inspect. |
3952 | 86 |
]. |
87 |
^ DirectoryHistory |
|
88 |
! |
|
89 |
||
90 |
resetClassVars |
|
91 |
||
92 |
DirectoryHistory := nil. |
|
93 |
||
94 |
" |
|
95 |
AbstractFileBrowser resetClassVars |
|
96 |
" |
|
97 |
! ! |
|
98 |
||
3892 | 99 |
!AbstractFileBrowser class methodsFor:'defaults'! |
100 |
||
101 |
commandHistory |
|
102 |
||
103 |
CommandHistory isNil ifTrue:[ |
|
104 |
CommandHistory := OrderedCollection new. |
|
105 |
]. |
|
106 |
^ CommandHistory |
|
107 |
! |
|
108 |
||
109 |
commandHistorySize |
|
110 |
||
111 |
CommandHistorySize isNil ifTrue:[ |
|
112 |
CommandHistorySize := 50 |
|
113 |
]. |
|
114 |
^ CommandHistorySize |
|
115 |
! |
|
116 |
||
117 |
defaultCommandPerMIME |
|
118 |
||
119 |
DefaultCommandPerMIME isNil ifTrue:[ |
|
120 |
self initializeDefaultCommands |
|
121 |
]. |
|
122 |
^ DefaultCommandPerMIME |
|
123 |
! |
|
124 |
||
125 |
defaultFilterList |
|
126 |
||
127 |
DefaultFilters isNil ifTrue:[ |
|
128 |
DefaultFilters := #( '*' |
|
129 |
'*.st' |
|
130 |
'*.htm*' |
|
131 |
'*.txt' |
|
132 |
'*.gif' |
|
133 |
'*.xpm' |
|
134 |
'*.jpg' |
|
135 |
'*.[h,c]*' |
|
136 |
) |
|
137 |
]. |
|
138 |
^ DefaultFilters. |
|
139 |
! |
|
140 |
||
141 |
directoryBookmarks |
|
142 |
||
143 |
DirectoryBookmarks isNil ifTrue:[ |
|
144 |
DirectoryBookmarks := OrderedCollection new. |
|
145 |
DirectoryBookmarks add:Filename homeDirectory asAbsoluteFilename. |
|
146 |
DirectoryBookmarks add:Filename tempDirectory. |
|
147 |
DirectoryBookmarks add:Filename currentDirectory asAbsoluteFilename. |
|
148 |
Smalltalk systemPath do:[:path | |
|
149 |
((path ~= '.') and:[path asFilename exists]) ifTrue:[ |
|
150 |
DirectoryBookmarks add:path asFilename. |
|
151 |
] |
|
152 |
] |
|
153 |
]. |
|
154 |
^ DirectoryBookmarks |
|
155 |
||
156 |
"/ DirectoryBookmarks := nil |
|
157 |
! |
|
158 |
||
159 |
initializeDefaultCommands |
|
160 |
DefaultCommandPerMIME := Dictionary new. |
|
161 |
||
162 |
DefaultCommandPerMIME at:'application/x-tar-compressed' put:'gunzip < %1 | tar tvf -'. |
|
163 |
DefaultCommandPerMIME at:'application/pdf' put:'acroread -display %2 %1'. |
|
164 |
||
165 |
" |
|
166 |
self initializeDefaultCommands |
|
167 |
" |
|
168 |
! |
|
169 |
||
170 |
listOfRuntimeValuesToRemark |
|
171 |
||
172 |
" list of all aspects that will be saved with save settings" |
|
173 |
||
174 |
^ #( |
|
175 |
#filterModel |
|
176 |
#enableFileHistory |
|
177 |
#fileHistory |
|
178 |
#currentFileNameHolder |
|
4027 | 179 |
#sortBlockProperty |
3892 | 180 |
) |
181 |
! |
|
182 |
||
183 |
listOfSavedSettingsAspects |
|
184 |
||
185 |
" list of all aspects that will be saved with save settings" |
|
186 |
||
187 |
^ #( |
|
188 |
#viewDirectoriesInDirectoryContentsBrowser |
|
189 |
#sortCaseless |
|
190 |
#fileHistory |
|
191 |
#showDirectoryTreeHolder |
|
192 |
#showHiddenFiles |
|
193 |
#viewDescription |
|
194 |
#viewDetails |
|
195 |
#viewDirectoryDescription |
|
196 |
#viewFilesInDirectoryTree |
|
197 |
#viewGroup |
|
198 |
#viewOwner |
|
199 |
#viewPermissions |
|
200 |
#viewPreview |
|
201 |
#viewSize |
|
202 |
#viewTime |
|
203 |
#viewType |
|
204 |
#enableFileHistory |
|
205 |
#openMultipleApplicationsForType |
|
206 |
#filenameEntryFieldVisibleHolder |
|
207 |
#toolBarVisibleHolder |
|
208 |
) |
|
209 |
! |
|
210 |
||
211 |
resetAspects |
|
212 |
||
213 |
RuntimeAspects := nil. |
|
214 |
SettingsAspects := nil. |
|
215 |
||
216 |
" |
|
217 |
self resetAspects |
|
218 |
" |
|
219 |
! |
|
220 |
||
221 |
runtimeAspects |
|
222 |
||
223 |
RuntimeAspects isNil ifTrue:[ |
|
224 |
RuntimeAspects := Dictionary new. |
|
225 |
]. |
|
226 |
^ RuntimeAspects |
|
227 |
! |
|
228 |
||
229 |
settingsAspects |
|
230 |
||
231 |
SettingsAspects isNil ifTrue:[ |
|
232 |
SettingsAspects := Dictionary new. |
|
233 |
]. |
|
234 |
^ SettingsAspects |
|
235 |
! ! |
|
236 |
||
237 |
!AbstractFileBrowser class methodsFor:'image'! |
|
238 |
||
239 |
DisabledCursorImage |
|
240 |
||
241 |
DisabledCursorImage isNil ifTrue:[ |
|
242 |
DisabledCursorImage := Image fromFile:'xpmBitmaps/cursors/no_entry.xpm' |
|
243 |
]. |
|
244 |
^ DisabledCursorImage |
|
245 |
! |
|
246 |
||
247 |
EnabledCursorImage |
|
248 |
||
249 |
EnabledCursorImage isNil ifTrue:[ |
|
250 |
EnabledCursorImage := Image fromFile:'xpmBitmaps/cursors/double_crossHair.xpm' |
|
251 |
]. |
|
252 |
^ EnabledCursorImage |
|
253 |
! ! |
|
254 |
||
255 |
!AbstractFileBrowser class methodsFor:'image specs'! |
|
256 |
||
257 |
clearHistoryIcon |
|
258 |
^ Icon deleteIcon |
|
259 |
! |
|
260 |
||
261 |
closeIcon |
|
262 |
"This resource specification was automatically generated |
|
263 |
by the ImageEditor of ST/X." |
|
264 |
||
265 |
"Do not manually edit this!! If it is corrupted, |
|
266 |
the ImageEditor may not be able to read the specification." |
|
267 |
||
268 |
" |
|
269 |
self closeIcon inspect |
|
270 |
ImageEditor openOnClass:self andSelector:#closeIcon |
|
271 |
" |
|
272 |
||
273 |
<resource: #image> |
|
274 |
||
275 |
^Icon |
|
276 |
constantNamed:#'AbstractFileBrowser class closeIcon' |
|
277 |
ifAbsentPut:[(Depth8Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
278 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ H@@@@@@@@@@@@B@ @@@@@@@@@@@@HB@ @@@@@@@@@B@ H@@@@@@@@@@@@@@ HB@@@@@@@B@ H@@@@@@@@@ |
|
279 |
@@@@@@@B@ H@@@@B@ H@@@@@@@@@@@@@@@@@@@HB@ @B@ H@@@@@@@@@@@@@@@@@@@@@@ HB@ H@@@@@@@@@@@@@@@@@@@@@@@@B@ H@@@@@@@@@@@@@@@@@ |
|
280 |
@@@@@@@B@ HB@ @@@@@@@@@@@@@@@@@@@@@B@ H@@ HB@@@@@@@@@@@@@@@@@@@B@ H@@@@B@ H@@@@@@@@A@@@@@@@B@ H@@@@@@@HB@ @@@@@@@@@@@@@B |
|
281 |
@ H@@@@@@@@@@ HB@@@@@@@@@@@@@ H@@@@@@@@@@@@B@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@A@@@@@@@@@@@@@@@@@@@@@@@@@PD@@P@@ |
|
282 |
@@DA@@@@@PD@@@DA@@@@@P@@@@D@@@D@@@D@@P@@@@D@@@D@@@D@@@@A@@@A@@@A@@@A@@@A@PDA@@@A@@@@@P@@@P@@@P@@@@D@@P@@@@@@@@DA@@DA@@@A |
|
283 |
@P@@@PD@@@@A@P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[255 255 255 0 0 0 255 0 0]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@A C@A0G@@8N@@\\@@N8@@G0@@C @@G0@@N8@@\\B@8N@A0G@A C@@@@@A@@@MFL0QIQHQII8QIE@M&X0@@@@') ; yourself); yourself] |
|
284 |
! |
|
285 |
||
286 |
copyIcon |
|
287 |
<resource: #programImage> |
|
288 |
||
289 |
^ ToolbarIconLibrary copy20x20Icon "copy28x28Icon" |
|
290 |
! |
|
291 |
||
292 |
cutIcon |
|
293 |
<resource: #programImage> |
|
294 |
||
295 |
^ ToolbarIconLibrary cut20x20Icon2 "cut28x28Icon" |
|
296 |
! |
|
297 |
||
298 |
deleteIcon |
|
299 |
<resource: #programImage> |
|
300 |
||
301 |
^ ToolbarIconLibrary erase20x20Icon "/ delete28x28Icon |
|
302 |
! |
|
303 |
||
304 |
diffIcon |
|
305 |
"This resource specification was automatically generated |
|
306 |
by the ImageEditor of ST/X." |
|
307 |
||
308 |
"Do not manually edit this!! If it is corrupted, |
|
309 |
the ImageEditor may not be able to read the specification." |
|
310 |
||
311 |
" |
|
312 |
self diffIcon inspect |
|
313 |
ImageEditor openOnClass:self andSelector:#diffIcon |
|
314 |
" |
|
315 |
||
316 |
<resource: #image> |
|
317 |
||
318 |
^Icon |
|
319 |
constantNamed:#'AbstractFileBrowser class diffIcon' |
|
320 |
ifAbsentPut:[(Depth8Image new) width: 26; height: 22; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
321 |
@@@@@@@@A@PDA@PDA@PD@@@@@@@@@@@@@@@@@@@@@@@DA XFA XFA P@@@@@@@@@@@@@@@@@@@@@@@PFA XF@@@@@@@@@@@@@@@@@@@@@@@@@@@@A@XFA @F |
|
322 |
A XD@@@@@@@@@@@@@@@@@@@@@@@DA X@A XFA P@@@@@@@@@@@@@@@@@@@@@@@PFA @FA XFA@@@@@@@@@@@@@@@@@@@@@@@A@XF@@XFA XD@@@@@@@@@@@@ |
|
323 |
@@@@@@@@@@@DA X@A XFA P@@@@@@@@@@@@@@@@@@@@@@@PFA X@A XFA@@@@@@@@@@@@@@@@@@@@@@@A@XFA X@@@@@@@@@@@@@@@@@@@@@@@@@@@@DA XF |
|
324 |
A XFA P@@@@@@@@@@@@@@@@@@@@@@@PFA XFA XFA@@@@@@@@@@@@@@@@@@@@@@@A@PDA@PDA@PD@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
325 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
326 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
327 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 129 129 129 0 0 0 194 194 194 132 132 132 198 198 198 255 255 255]; mask:((Depth1Image new) width: 26; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@?8@@@O>@@@C? @@@?<@@@O> @@C?(@@@?:@@@O> @@C?8@@@??@@@O>8@@C?''@@@?80@@@@@@@@T[@@@DI@@@GSX@@BT$@@@%I@@@IRP@@A4$@@@@@@@@@@a') ; yourself); yourself] |
|
328 |
! |
|
329 |
||
330 |
fileInIcon |
|
331 |
<resource: #programImage> |
|
332 |
||
333 |
^ ToolbarIconLibrary fileIn20x20Icon |
|
334 |
! |
|
335 |
||
336 |
goHomeIcon |
|
337 |
"This resource specification was automatically generated |
|
338 |
by the ImageEditor of ST/X." |
|
339 |
||
340 |
"Do not manually edit this!! If it is corrupted, |
|
341 |
the ImageEditor may not be able to read the specification." |
|
342 |
||
343 |
" |
|
344 |
self goHomeIcon inspect |
|
345 |
ImageEditor openOnClass:self andSelector:#goHomeIcon |
|
346 |
" |
|
347 |
||
348 |
<resource: #image> |
|
349 |
||
350 |
^Icon |
|
351 |
constantNamed:#'AbstractFileBrowser class goHomeIcon' |
|
352 |
ifAbsentPut:[(Depth4Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
353 |
@@@@@@@@@@@@@@@@@@@@@@H@@@@@@@@@@@@@I4@@@@@@@@@@@@H"]@@@@@@@@@@@H''A7P@@@@@@@@@H''FA]D@@@@@@@@I7FC W]@@@@@@@I7FCL8DWP@@@@@ |
|
354 |
@''FCL3NA]D@@@@H''FCL3L3 WQ@@@I7FCL3L3L8E7PDPQFCL1DQL3"@@DQADXL1DQDSNH@@P@@@ 1EUUQL8 @@@@@BCDUY&D3"@@@@@@HLQU&XSNH@@@@@@ 1 |
|
355 |
EVY!!L8 @@@@@BCDUY&D3"@@@@@@HLQU&XSNH@@@@@@ 1EVY!!L8 @@@@@BCDUY&D3"@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 64 0 0 255 0 0 255 255 255 129 0 0 80 194 89 60 120 60 194 0 0 161 161 161]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@A@@@C @FG0@FO8@F_<@F?>@G??@G?? G??0O??8_??<???<???<G??0G??0G??0G??0G??0G??0G??0G??0G??0') ; yourself); yourself] |
|
356 |
! |
|
357 |
||
358 |
hexToggle22x22Icon |
|
359 |
"This resource specification was automatically generated |
|
360 |
by the ImageEditor of ST/X." |
|
361 |
||
362 |
"Do not manually edit this!! If it is corrupted, |
|
363 |
the ImageEditor may not be able to read the specification." |
|
364 |
||
365 |
" |
|
366 |
self hexToggle22x22Icon inspect |
|
367 |
ImageEditor openOnClass:self andSelector:#hexToggle22x22Icon |
|
368 |
" |
|
369 |
||
370 |
<resource: #image> |
|
371 |
||
372 |
^Icon |
|
373 |
constantNamed:#'AbstractFileBrowser class hexToggle22x22Icon' |
|
374 |
ifAbsentPut:[(Depth8Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
375 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@EAPTEAPTEAPTE@@@@@@@@@@@@@@@@AP@@@@T@@@@EAP@@@@@@@@@@ |
|
376 |
@@@@@@TEAP@E@@TEAPT@@@@@@@@@@@@@@@@EAP@@AP@@APTE@@@@@@@@@@@@@@@@APTE@@T@APTEAP@@@@@@@@@@@@@@@@T@@@@E@@TEAPT@@@@@@@@@@@@@ |
|
377 |
@@@EAPTEAPTEAPTE@@@@@@@@@@@@@@@@AP@@@@T@@@@EAP@@@@@@@@@@@@@@@@T@AP@E@@T@APT@@@@@@@@@@@@@@@@E@@@@AP@@@@TE@@@@@@@@@@@@@@@@ |
|
378 |
AP@E@@T@AP@EAP@@@@@@@@@@@@@@@@T@AP@E@@@@APT@@@@@@@@@@@@@@@@EAPTEAPTEAPTE@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
379 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
380 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 105 133 190 129 129 129 194 194 194 255 0 0 255 255 255]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@A?>@A?>@A?>@A?>@A?>@A?>@A?>@A?>@A?>@A?>@A?>@A?>@A?>@A?>@A?>@@@@@B''Q@B$J@C&D@B$J@B''Q@') ; yourself); yourself] |
|
381 |
! |
|
382 |
||
383 |
historyIcon |
|
384 |
<resource: #programImage> |
|
385 |
||
386 |
^ ToolbarIconLibrary history20x20Icon "/ history28x28Icon |
|
387 |
! |
|
388 |
||
389 |
homeIcon |
|
390 |
<resource: #programImage> |
|
391 |
||
392 |
^ ToolbarIconLibrary home28x28Icon |
|
393 |
! |
|
394 |
||
395 |
htmlReloadIcon |
|
396 |
"This resource specification was automatically generated |
|
397 |
by the ImageEditor of ST/X." |
|
398 |
||
399 |
"Do not manually edit this!! If it is corrupted, |
|
400 |
the ImageEditor may not be able to read the specification." |
|
401 |
||
402 |
" |
|
403 |
self htmlReloadIcon inspect |
|
404 |
ImageEditor openOnClass:self andSelector:#htmlReloadIcon |
|
405 |
" |
|
406 |
||
407 |
<resource: #image> |
|
408 |
||
409 |
^Icon |
|
410 |
constantNamed:#'AbstractFileBrowser class htmlReloadIcon' |
|
411 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
412 |
@@@@@@@@@@@UT@@@@@EU@D@@@@UT@@@H@AUP@@@@@EU@@@@@@EU@@@@E@EU@@@@@@EU@@@@@AUUT@@@@@UUP@@@@@EU@@@@@@AT@@@@@@@P@@@@H@@@@@@@@ |
|
413 |
@@@@@@@@@@@@@@@H@@@@@@@@@@@@@@@G@@@@@@@J@@@@@@@I@@@@@@@@') ; colorMapFromArray:#[0 0 0 0 129 0]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@G<C@_?C@??#A?C3C>@;G<@KG<@CG<@C??$C_?NCO>_CG<?#C9?3A3?;@''??@@?#P@?C\A?COC>CG?<CC?8C@? C') ; yourself); yourself] |
|
414 |
! |
|
415 |
||
416 |
leftArrow |
|
417 |
"This resource specification was automatically generated |
|
418 |
by the ImageEditor of ST/X." |
|
419 |
||
420 |
"Do not manually edit this!! If it is corrupted, |
|
421 |
the ImageEditor may not be able to read the specification." |
|
422 |
||
423 |
" |
|
424 |
self leftArrow inspect |
|
425 |
ImageEditor openOnClass:self andSelector:#leftArrow |
|
426 |
" |
|
427 |
||
428 |
<resource: #image> |
|
429 |
||
430 |
^Icon |
|
431 |
constantNamed:#'AbstractFileBrowser class leftArrow' |
|
432 |
ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
433 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@D@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@PH@@@@@@@@@ |
|
434 |
@@@@@@@@@@@@@@@@@@@A@0D@@@@@@@@@@@@@@@@@@@@@@@@@@@DDAPH@@@@@@@@@@@@@@@@@@@@@@@@@@PX@A0D@@@@@@@@@@@@@@@@@@@@@@@@AB@@IB HK |
|
435 |
@0LA@PDK@@@@@@@@@@@@@@DL@@@MC <P@@@@DPLR@@@@@@@@@@@@@PX@@ALTEP8PDQDVE0\R@@@@@@@@@@@AAADQD1PUEQTNF@$SFP(R@@@@@@@@@@@KB!!P[ |
|
436 |
GAPUEQT]GQ4]GP(R@@@@@@@@@@@@D (TG!!0TEA,_G1<[H@(R@@@@@@@@@@@@@AHJC!!< GQ4JB (JB"DK@@@@@@@@@@@@@@@RB 8^B DRD!!HRD!!HK@@@@@@@@ |
|
437 |
@@@@@@@@D (]H H@@@@@@@@@@@@@@@@@@@@@@@@@@AHJHPD@@@@@@@@@@@@@@@@@@@@@@@@@@@@K@PH@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B0D@@@@@@@@@ |
|
438 |
@@@@@@@@@@@@@@@@@@@@@@,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
439 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[224 224 224 0 32 64 0 32 96 32 64 96 96 128 160 64 96 128 128 160 192 32 96 128 128 160 160 160 192 224 0 96 128 0 0 0 128 128 160 64 192 192 32 160 192 64 128 192 128 192 224 192 224 224 0 0 32 96 192 224 0 160 192 0 128 192 160 224 224 96 160 192 128 192 192 64 160 192 192 192 192 32 192 192 0 192 224 0 128 160 32 192 224 64 192 224 0 192 192 0 64 96 0 64 128]; mask:((Depth1Image new) width: 24; height: 24; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@B@@@F@@@N@@@^@@@>@@A??@C??@G??@O??@O??@G??@C??@A??@@>@@@^@@@N@@@F@@@B@@@@@@@@@@@@@@@@@@') ; yourself); yourself] |
|
440 |
! |
|
441 |
||
442 |
leftArrow20x20Icon |
|
443 |
"This resource specification was automatically generated |
|
444 |
by the ImageEditor of ST/X." |
|
445 |
||
446 |
"Do not manually edit this!! If it is corrupted, |
|
447 |
the ImageEditor may not be able to read the specification." |
|
448 |
||
449 |
" |
|
450 |
self leftArrow20x20Icon inspect |
|
451 |
ImageEditor openOnClass:self andSelector:#leftArrow20x20Icon |
|
452 |
Icon flushCachedIcons |
|
453 |
" |
|
454 |
||
455 |
<resource: #image> |
|
456 |
||
457 |
^Icon |
|
458 |
constantNamed:#'AbstractFileBrowser class leftArrow20x20Icon' |
|
459 |
ifAbsentPut:[(Depth8Image new) width: 20; height: 20; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
460 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@P@@@@@@@@@@@@@@@@@@@@@@@@DB@@@@@@@@@@@@@@@@@@@@@@@A@0D@@@@@@@@@@@@@@@@@@@@@@PPE |
|
461 |
@ @@@@@@@@@@@@@@@@@@@@DF@@\A@@@@@@@@@@@@@@@@@@@AB@@IB HK@0LA@PDK@@@@@@@@@P0@@@4NC1@@@@@Q@1H@@@@@@@DF@@@SEATNDADQE!!\GD @@ |
|
462 |
@@@AAADQD1PUEQTNF@$SFP(R@@@@@@,JEA,\EATUEQ4]GQ4]B!!H@@@@@@AHJEA8\EAP[G1<_F2@JD @@@@@@@AHJC!!< GQ4JB (JB"DK@@@@@@@@@AHJC!!8J |
|
463 |
@QHRD!!HRD ,@@@@@@@@@@AHJGRHB@@@@@@@@@@@@@@@@@@@@@AHJHPD@@@@@@@@@@@@@@@@@@@@@@@,A@ @@@@@@@@@@@@@@@@@@@@@@@@,A@@@@@@@@@@@@ |
|
464 |
@@@@@@@@@@@@@@,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[224 224 224 0 32 64 0 32 96 32 64 96 96 128 160 64 96 128 128 160 192 32 96 128 128 160 160 160 192 224 0 96 128 0 0 0 128 128 160 64 192 192 32 160 192 64 128 192 128 192 224 192 224 224 0 0 32 96 192 224 0 160 192 0 128 192 160 224 224 96 160 192 128 192 192 64 160 192 192 192 192 32 192 192 0 192 224 0 128 160 32 192 224 64 192 224 0 192 192 0 64 96 0 64 128]; mask:((Depth1Image new) width: 20; height: 20; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@B@@@F@@@N@@@^@@@>@@A??@C??@G??@O??@O??@G??@C??@A??@@>@@@^@@@N@@@F@@@B@@@@@@') ; yourself); yourself] |
|
465 |
! |
|
466 |
||
467 |
leftArrow20x20PlusMenuIcon |
|
468 |
"This resource specification was automatically generated |
|
469 |
by the ImageEditor of ST/X." |
|
470 |
||
471 |
"Do not manually edit this!! If it is corrupted, |
|
472 |
the ImageEditor may not be able to read the specification." |
|
473 |
||
474 |
" |
|
475 |
self leftArrow20x20PlusMenuIcon inspect |
|
476 |
ImageEditor openOnClass:self andSelector:#leftArrow20x20PlusMenuIcon |
|
477 |
Icon flushCachedIcons |
|
478 |
" |
|
479 |
||
480 |
<resource: #image> |
|
481 |
||
482 |
^Icon |
|
483 |
constantNamed:#'AbstractFileBrowser class leftArrow20x20PlusMenuIcon' |
|
484 |
ifAbsentPut:[(Depth8Image new) width: 20; height: 20; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
485 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@D@@@@@@@@@@@@@@@@@@@@@@@@A@ @@@@@@@@@@@@@@@@@@@@@@@PLA@@@@@@@@@@@@@@@@@@@@@@DD |
|
486 |
APH@@@@@@@@@@@@@@@@@@@@AA @G@P@@@@@@@@@@@@@@@@@@@P @BP(BB0LC@PDAB0@@@@@@@@DL@@@MC <P@@@@DPLR@@@@@@@AA @@D1PUC!!@QDQXWA1H@ |
|
487 |
@@@@@PPQDQLTEQTUC!! ID1$JD @@@@@KB!!P[GAPUEQT]GQ4]GP(R@@@@@@@RB!!P^GAPTF1<_G1, B!!H@@@@@@@@RB 8_HA4]B (JB (!!B0@@@@@@@@@RB 8^ |
|
488 |
B DRD!!HRD!!HK@@@@@@@@@@@RB!!4"@ @@@@@@@@@@@@@@@@@@@@@RB"DA@@@@@@@@@@@KB0,KB0,K@@@K@PH@@@@@@@@@@@@KB0,KB0@@@@@K@P@@@@@@@@@@ |
|
489 |
@@@KB0,@@@@@@@@K@@@@@@@@@@@@@@@K@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[224 224 224 0 32 64 0 32 96 32 64 96 96 128 160 64 96 128 128 160 192 32 96 128 128 160 160 160 192 224 0 96 128 0 0 0 128 128 160 64 192 192 32 160 192 64 128 192 128 192 224 192 224 224 0 0 32 96 192 224 0 160 192 0 128 192 160 224 224 96 160 192 128 192 192 64 160 192 192 192 192 32 192 192 0 192 224 0 128 160 32 192 224 64 192 224 0 192 192 0 64 96 0 64 128]; mask:((Depth1Image new) width: 20; height: 20; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@A@@@C@@@G@@@O@@@_@@@?? A?? C?? G?? G?? C?? A?? @?? @_@@@O@@?''@@_C@@NA@@D@@@') ; yourself); yourself] |
|
490 |
! |
|
491 |
||
492 |
leftArrowPlusMenu |
|
493 |
"This resource specification was automatically generated |
|
494 |
by the ImageEditor of ST/X." |
|
495 |
||
496 |
"Do not manually edit this!! If it is corrupted, |
|
497 |
the ImageEditor may not be able to read the specification." |
|
498 |
||
499 |
" |
|
500 |
self leftArrowPlusMenu inspect |
|
501 |
ImageEditor openOnClass:self andSelector:#leftArrowPlusMenu |
|
502 |
" |
|
503 |
||
504 |
<resource: #image> |
|
505 |
||
506 |
^Icon |
|
507 |
constantNamed:#'AbstractFileBrowser class leftArrowPlusMenu' |
|
508 |
ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
509 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@D@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@PH@@@@@@@@@ |
|
510 |
@@@@@@@@@@@@@@@@@@@A@0D@@@@@@@@@@@@@@@@@@@@@@@@@@@DDAPH@@@@@@@@@@@@@@@@@@@@@@@@@@PX@A0D@@@@@@@@@@@@@@@@@@@@@@@@AB@@IB HK |
|
511 |
@0LA@PDK@@@@@@@@@@@@@@DL@@@MC <P@@@@DPLR@@@@@@@@@@@@@PX@@ALTEP8PDQDVE0\R@@@@@@@@@@@AAADQD1PUEQTNF@$SFP(R@@@@@@@@@@@KB!!P[ |
|
512 |
GAPUEQT]GQ4]GP(R@@@@@@@@@@@@D (TG!!0TEA,_G1<[H@(R@@@@@@@@@@@@@AHJC!!< GQ4JB (JB"DK@@@@@@@@@@@@@@@RB 8^B DRD!!HRD!!HK@@@@@@@@ |
|
513 |
@@@@@@@@D (]H H@@@@@@@@@@@@@@@@@@@@@@@@@@AHJHPD@@@@@@@@@@@@@@@@@@@@@@@@@@@@K@PH@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B0D@@@@@@@@@ |
|
514 |
@@@@@@@@@@@@@@@@@@@@@@,@@@@@@@@KB0,KB0,K@@@@@@@@@@@@@@@@@@@@@@@@B0,KB0,@@@@@@@@@@@@@@@@@@@@@@@@@@@,KB0@@@@@@@@@@@@@@@@@@ |
|
515 |
@@@@@@@@@@@K@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[224 224 224 0 32 64 0 32 96 32 64 96 96 128 160 64 96 128 128 160 192 32 96 128 128 160 160 160 192 224 0 96 128 0 0 0 128 128 160 64 192 192 32 160 192 64 128 192 128 192 224 192 224 224 0 0 32 96 192 224 0 160 192 0 128 192 160 224 224 96 160 192 128 192 192 64 160 192 192 192 192 32 192 192 0 192 224 0 128 160 32 192 224 64 192 224 0 192 192 0 64 96 0 64 128]; mask:((Depth1Image new) width: 24; height: 24; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@B@@@F@@@N@@@^@@@>@@A??@C??@G??@O??@O??@G??@C??@A??@@>@@@^@@@N@@@F@@@BA?@@@>@@@\@@@H@@@@') ; yourself); yourself] |
|
516 |
! |
|
517 |
||
518 |
leftDownIcon |
|
519 |
"This resource specification was automatically generated |
|
520 |
by the ImageEditor of ST/X." |
|
521 |
||
522 |
"Do not manually edit this!! If it is corrupted, |
|
523 |
the ImageEditor may not be able to read the specification." |
|
524 |
||
525 |
" |
|
526 |
self leftDownIcon inspect |
|
527 |
ImageEditor openOnClass:self andSelector:#leftDownIcon |
|
528 |
" |
|
529 |
||
530 |
<resource: #image> |
|
531 |
||
532 |
^Icon |
|
533 |
constantNamed:#'AbstractFileBrowser class leftDownIcon' |
|
534 |
ifAbsentPut:[(Depth2Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
535 |
UUUUUUUUUUUPAUUUUUUUP@UUUUUUUPB!!UUUUUU@B*AUUUUU@B*(UUUUUPB** UUUUPB***AUUUTB***(EUUUB****%UUUR*****UUUUU@*%UUUUUUPJ)UUUU |
|
536 |
UUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*$@@@@AUPJ*****)UTB******UU@******%UPJ*****)UTAUUUU |
|
537 |
UUUU@@@@@@@AUUUUUUUUUP@a') ; colorMapFromArray:#[255 255 255 0 0 0 40 40 100 255 0 0]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
538 |
@@@@@@@@@@@@ @@@@\@@@@O @@@G<@@@C? @@A?<@@@?? @@_?<@@G?? @@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C??? @???8@O? |
|
539 |
?>@C??? @???8@O??>@@@@@@@@@@@@@a') ; yourself); yourself] |
|
540 |
! |
|
541 |
||
542 |
leftIcon |
|
543 |
"This resource specification was automatically generated |
|
544 |
by the ImageEditor of ST/X." |
|
545 |
||
546 |
"Do not manually edit this!! If it is corrupted, |
|
547 |
the ImageEditor may not be able to read the specification." |
|
548 |
||
549 |
" |
|
550 |
self leftIcon inspect |
|
551 |
ImageEditor openOnClass:self andSelector:#leftIcon |
|
552 |
" |
|
553 |
||
554 |
<resource: #image> |
|
555 |
||
556 |
^Icon |
|
557 |
constantNamed:#'AbstractFileBrowser class leftIcon' |
|
558 |
ifAbsentPut:[(Depth2Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
559 |
UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUPUUUUUUUUPUUUUUUUUP%UUUUUUUP)UUUUUUUP*P@@@@@AP*$@@@@@@P******* |
|
560 |
*P********$********)J********U********%V*%UUUUUUUZ)UUUUUUUP*UUUUUUUUV%UUUUUUUUYUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU |
|
561 |
UUUUUUUUUUUUUUUUUUUUUP@a') ; colorMapFromArray:#[255 255 255 0 0 0 40 40 100 255 0 0]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
562 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@H@@@@F@@@@C @@@A8@@@@>@@@@_???0O???<G????C????0_???<C????@_???0C8@@@@^@@@@C @@@@X@@@@@@ |
|
563 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself] |
|
564 |
! |
|
565 |
||
566 |
menuHistoryList9x20Icon |
|
567 |
"This resource specification was automatically generated |
|
568 |
by the ImageEditor of ST/X." |
|
569 |
||
570 |
"Do not manually edit this!! If it is corrupted, |
|
571 |
the ImageEditor may not be able to read the specification." |
|
572 |
||
573 |
" |
|
574 |
self menuHistoryList9x20Icon inspect |
|
575 |
ImageEditor openOnClass:self andSelector:#menuHistoryList9x20Icon |
|
576 |
Icon flushCachedIcons |
|
577 |
" |
|
578 |
||
579 |
<resource: #image> |
|
580 |
||
581 |
^Icon |
|
582 |
constantNamed:#'AbstractFileBrowser class menuHistoryList9x20Icon' |
|
583 |
ifAbsentPut:[(Depth1Image new) width: 9; height: 20; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a') ; colorMapFromArray:#[255 255 255 0 0 0]; mask:((Depth1Image new) width: 9; height: 20; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a') ; yourself); yourself] |
|
584 |
! |
|
585 |
||
586 |
menuHistoryListIcon |
|
587 |
"This resource specification was automatically generated |
|
588 |
by the ImageEditor of ST/X." |
|
589 |
||
590 |
"Do not manually edit this!! If it is corrupted, |
|
591 |
the ImageEditor may not be able to read the specification." |
|
592 |
||
593 |
" |
|
594 |
self menuHistoryListIcon inspect |
|
595 |
ImageEditor openOnClass:self andSelector:#menuHistoryListIcon |
|
596 |
" |
|
597 |
||
598 |
<resource: #image> |
|
599 |
||
600 |
^Icon |
|
601 |
constantNamed:#'AbstractFileBrowser class menuHistoryListIcon' |
|
602 |
ifAbsentPut:[(Depth1Image new) width: 12; height: 12; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??S?<O?0??C?<O?0??/?=_?0??C?<O?0') ; colorMapFromArray:#[255 255 255 0 0 0]; mask:((Depth1Image new) width: 12; height: 12; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@O@@<@C0A?8C?@G8@O@@X@@@A?8@@@') ; yourself); yourself] |
|
603 |
! |
|
604 |
||
3923 | 605 |
newDirectory20x20Icon |
606 |
"This resource specification was automatically generated |
|
607 |
by the ImageEditor of ST/X." |
|
608 |
||
609 |
"Do not manually edit this!! If it is corrupted, |
|
610 |
the ImageEditor may not be able to read the specification." |
|
611 |
||
612 |
" |
|
613 |
self newDirectory20x20Icon inspect |
|
614 |
ImageEditor openOnClass:self andSelector:#newDirectory20x20Icon |
|
615 |
Icon flushCachedIcons |
|
616 |
" |
|
617 |
||
618 |
<resource: #image> |
|
619 |
||
620 |
^Icon |
|
621 |
constantNamed:#'AbstractFileBrowser class newDirectory20x20Icon' |
|
622 |
ifAbsentPut:[(Depth8Image new) width: 20; height: 20; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
623 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@PDA@PDA@P@@@@@@@@@@@@@@@@@A@ HB@ HA@@@@@@@@@@@@@@@@@PHB@ HB@ HA |
|
624 |
@@@@@@@@@@@@@@DA@PDA@PDA@P@@@@@@@@@@@@D@@PHB@ HB@ HB@ HB@@@@@ HB@P@A@ HB@ HB@ HB@ @B@@H@@ HA@@DB@ HB@ HB@ H@@ H@@ H@@ D@ |
|
625 |
@PHB@ HB@ HB@@HB@ @B@ H@@P@A@ HB@ HB@ HB@ HB@ HB@ HA@@DB@ HB@ HB@ HB@ HB@ HB@ D@@PHB@ HB@ HB@ HB@ HB@ HB@P@A@ HB@ HB@ HB |
|
626 |
@ HB@ HB@ HA@@DB@ HB@ HB@ HB@ HB@ HB@ D@@PHB@ HB@ HB@ HB@ HB@ HB@P@A@ HB@ HB@ HB@ HB@ HB@ HA@@DA@PDA@PDA@PDA@PDA@PDA@PD@ |
|
627 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[255 0 0 0 0 0 255 255 0]; mask:((Depth1Image new) width: 20; height: 20; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@DQ@O:R@O9T@_<8@??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? @@@@@@@@') ; yourself); yourself] |
|
628 |
! |
|
629 |
||
3892 | 630 |
pasteIcon |
631 |
<resource: #programImage> |
|
632 |
||
633 |
^ ToolbarIconLibrary paste20x20Icon "/ paste28x28Icon |
|
634 |
! |
|
635 |
||
636 |
rightArrow |
|
637 |
"This resource specification was automatically generated |
|
638 |
by the ImageEditor of ST/X." |
|
639 |
||
640 |
"Do not manually edit this!! If it is corrupted, |
|
641 |
the ImageEditor may not be able to read the specification." |
|
642 |
||
643 |
" |
|
644 |
self rightArrow inspect |
|
645 |
ImageEditor openOnClass:self andSelector:#rightArrow |
|
646 |
" |
|
647 |
||
648 |
<resource: #image> |
|
649 |
||
650 |
^Icon |
|
651 |
constantNamed:#'AbstractFileBrowser class rightArrow' |
|
652 |
ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
653 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@PH@@@@@@@@@ |
|
654 |
@@@@@@@@@@@@@@@@@@@@@0PB@@@@@@@@@@@@@@@@@@@@@@@@@@@@@PTF@ @@@@@@@@@@@@@@@@@@@@@@@@@@@0\@A@H@@@@@@@@@@@@@@@@A@PDA@PDH@P\I |
|
655 |
@@XB@@@@@@@@@@@@@@@AA0(@@@@@B ,LB @D@ @@@@@@@@@@@@@MB \NB ,ODADRD0(@A H@@@@@@@@@@@@M@@TTEQLQE!!\WD 0K@@PB@@@@@@@@@@@MB <W |
|
656 |
E1\WD!!\WD!!LYDQ(B@@@@@@@@@@@AB <[D10[GQ8QG!!$QF H@@@@@@@@@@@@AA!!(ZF!!(ZE1H^FQDZ@ @@@@@@@@@@@@@A@ HB@ HB@1DYDQ(B@@@@@@@@@@@@ |
|
657 |
@@@@@@@@@@@@@QXQF H@@@@@@@@@@@@@@@@@@@@@@@@@@0PZ@ @@@@@@@@@@@@@@@@@@@@@@@@@@@Q(B@@@@@@@@@@@@@@@@@@@@@@@@@@@@@0H@@@@@@@@@ |
|
658 |
@@@@@@@@@@@@@@@@@@@@@P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
659 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[224 224 224 0 32 64 0 0 0 0 64 96 32 128 160 128 160 192 32 96 128 128 192 192 0 64 64 160 192 192 192 224 224 160 192 224 96 192 224 32 64 96 160 224 224 128 192 224 96 160 192 0 160 192 0 128 192 64 192 192 64 160 192 96 192 192 32 160 192 0 128 160 192 192 192 64 224 224 0 96 128 32 192 192 64 192 224 0 192 224 0 192 192]; mask:((Depth1Image new) width: 24; height: 24; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@D@@@F@@@G@@@G @@G0@O?8@O?<@O?>@O??@O??@O?>@O?<@O?8@@G0@@G @@G@@@F@@@D@@@@@@@@@@@@@@@@@@') ; yourself); yourself] |
|
660 |
! |
|
661 |
||
662 |
rightArrow20x20Icon |
|
663 |
"This resource specification was automatically generated |
|
664 |
by the ImageEditor of ST/X." |
|
665 |
||
666 |
"Do not manually edit this!! If it is corrupted, |
|
667 |
the ImageEditor may not be able to read the specification." |
|
668 |
||
669 |
" |
|
670 |
self rightArrow20x20Icon inspect |
|
671 |
ImageEditor openOnClass:self andSelector:#rightArrow20x20Icon |
|
672 |
Icon flushCachedIcons |
|
673 |
" |
|
674 |
||
675 |
<resource: #image> |
|
676 |
||
677 |
^Icon |
|
678 |
constantNamed:#'AbstractFileBrowser class rightArrow20x20Icon' |
|
679 |
ifAbsentPut:[(Depth8Image new) width: 20; height: 20; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
680 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@A@@@@@@@@@@@@@@@@@@@@@@@@@@DB@@@@@@@@@@@@@@@@@@@@@@@@@0PB@@@@@@@@@@@@@@@@@@@@@@@A |
|
681 |
APXB@@@@@@@@@@@@@@@@@@@@@@LG@@PB@@@@@@@@@@@A@PDA@PDH@P\I@@XB@@@@@@@@@@DGB @@@@@JB00J@@PB@@@@@@@@CP(GC (KC1@QD!!LJ@@XB@@@@ |
|
682 |
@@@M@@TTEQLQE!!\WD 0K@@PB@@@@@@4JC1\WE1\RE1\RD1$QF H@@@@@@P(OF1L\F14^DQ8YDQ(B@@@@@@@AA!!(ZF!!(ZE1H^FQDZ@ @@@@@@@@DB@ HB@ HC |
|
683 |
DQ$QF H@@@@@@@@@@@@@@@@@@@DVDQ(B@@@@@@@@@@@@@@@@@@@@@0PZ@ @@@@@@@@@@@@@@@@@@@@@AF H@@@@@@@@@@@@@@@@@@@@@@@LB@@@@@@@@@@@@ |
|
684 |
@@@@@@@@@@@@@P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[224 224 224 0 32 64 0 0 0 0 64 96 32 128 160 128 160 192 32 96 128 128 192 192 0 64 64 160 192 192 192 224 224 160 192 224 96 192 224 32 64 96 160 224 224 128 192 224 96 160 192 0 160 192 0 128 192 64 192 192 64 160 192 96 192 192 32 160 192 0 128 160 192 192 192 64 224 224 0 96 128 32 192 192 64 192 224 0 192 224 0 192 192]; mask:((Depth1Image new) width: 20; height: 20; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@D@@@F@@@G@@@G @@G0@O?8@O?<@O?>@O??@O??@O?>@O?<@O?8@@G0@@G @@G@@@F@@@D@@@@@@') ; yourself); yourself] |
|
685 |
! |
|
686 |
||
687 |
rightArrowPlusMenu |
|
688 |
"This resource specification was automatically generated |
|
689 |
by the ImageEditor of ST/X." |
|
690 |
||
691 |
"Do not manually edit this!! If it is corrupted, |
|
692 |
the ImageEditor may not be able to read the specification." |
|
693 |
||
694 |
" |
|
695 |
self rightArrowPlusMenu inspect |
|
696 |
ImageEditor openOnClass:self andSelector:#rightArrowPlusMenu |
|
697 |
" |
|
698 |
||
699 |
<resource: #image> |
|
700 |
||
701 |
^Icon |
|
702 |
constantNamed:#'AbstractFileBrowser class rightArrowPlusMenu' |
|
703 |
ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
704 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@PH@@@@@@@@@ |
|
705 |
@@@@@@@@@@@@@@@@@@@@@0PB@@@@@@@@@@@@@@@@@@@@@@@@@@@@@PTF@ @@@@@@@@@@@@@@@@@@@@@@@@@@@0\@A@H@@@@@@@@@@@@@@@@A@PDA@PDH@P\I |
|
706 |
@@XB@@@@@@@@@@@@@@@AA0(@@@@@B ,LB @D@ @@@@@@@@@@@@@MB \NB ,ODADRD0(@A H@@@@@@@@@@@@M@@TTEQLQE!!\WD 0K@@PB@@@@@@@@@@@MB <W |
|
707 |
E1\WD!!\WD!!LYDQ(B@@@@@@@@@@@AB <[D10[GQ8QG!!$QF H@@@@@@@@@@@@AA!!(ZF!!(ZE1H^FQDZ@ @@@@@@@@@@@@@A@ HB@ HB@1DYDQ(B@@@@@@@@@@@@ |
|
708 |
@@@@@@@@@@@@@QXQF H@@@@@@@@@@@@@@@@@@@@@@@@@@0PZ@ @@@@@@@@@@@@@@@@@@@@@@@@@@@Q(B@@@@@@@@@@@@@@@@@@@@@@@@@@@@@0H@@@@@@@@@ |
|
709 |
@@@@@@@@@@@@@@@@@@@@@P@@@@@@@@@B@ HB@ HB@@@@@@@@@@@@@@@@@@@@@@@@@ HB@ H@@@@@@@@@@@@@@@@@@@@@@@@@@@HB@ @@@@@@@@@@@@@@@@@@ |
|
710 |
@@@@@@@@@@@B@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[224 224 224 0 32 64 0 0 0 0 64 96 32 128 160 128 160 192 32 96 128 128 192 192 0 64 64 160 192 192 192 224 224 160 192 224 96 192 224 32 64 96 160 224 224 128 192 224 96 160 192 0 160 192 0 128 192 64 192 192 64 160 192 96 192 192 32 160 192 0 128 160 192 192 192 64 224 224 0 96 128 32 192 192 64 192 224 0 192 224 0 192 192]; mask:((Depth1Image new) width: 24; height: 24; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@D@@@F@@@G@@@G @@G0@O?8@O?<@O?>@O??@O??@O?>@O?<@O?8@@G0@@G @@G@@@F@@@DA?@@@>@@@\@@@H@@@@') ; yourself); yourself] |
|
711 |
! |
|
712 |
||
713 |
rightArrowPlusMenu20x20Icon |
|
714 |
"This resource specification was automatically generated |
|
715 |
by the ImageEditor of ST/X." |
|
716 |
||
717 |
"Do not manually edit this!! If it is corrupted, |
|
718 |
the ImageEditor may not be able to read the specification." |
|
719 |
||
720 |
" |
|
721 |
self rightArrowPlusMenu20x20Icon inspect |
|
722 |
ImageEditor openOnClass:self andSelector:#rightArrowPlusMenu20x20Icon |
|
723 |
Icon flushCachedIcons |
|
724 |
" |
|
725 |
||
726 |
<resource: #image> |
|
727 |
||
728 |
^Icon |
|
729 |
constantNamed:#'AbstractFileBrowser class rightArrowPlusMenu20x20Icon' |
|
730 |
ifAbsentPut:[(Depth8Image new) width: 20; height: 20; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
731 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@D@@@@@@@@@@@@@@@@@@@@@@@@@@PH@@@@@@@@@@@@@@@@@@@@@@@@CA@H@@@@@@@@@@@@@@@@@@@@@@@DE |
|
732 |
A H@@@@@@@@@@@@@@@@@@@@@@0\@A@H@@@@@@@@@@@DA@PDA@P AA0$@A H@@@@@@@@@@P\J@@@@@@(KC@(@A@H@@@@@@@@MB \NB ,ODADRD0(@A H@@@@@ |
|
733 |
@@4@AQPUD1DVE1\RC@,@A@H@@@@@CP(OE1\WE1HWE1HSFQDZ@ @@@@@AB <[D10[GQ8QG!!$QF H@@@@@@@DFF!!(ZF!!(WD!!8YDQ(B@@@@@@@@@PHB@ HB@ LQ |
|
734 |
FQDZ@ @@@@@@@@@@@@@@@@@@@QXQF H@@@@@@@@@@@@@@@@@@@@CAA(B@@@@@@@@@@@@@@@@@@@@@@DZ@ @@@ HB@ HB@ @@@@@@@@@@@0H@@@@@@ HB@ H@ |
|
735 |
@@@@@@@@@@@A@@@@@@@@@ HB@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@a') ; colorMapFromArray:#[224 224 224 0 32 64 0 0 0 0 64 96 32 128 160 128 160 192 32 96 128 128 192 192 0 64 64 160 192 192 192 224 224 160 192 224 96 192 224 32 64 96 160 224 224 128 192 224 96 160 192 0 160 192 0 128 192 64 192 192 64 160 192 96 192 192 32 160 192 0 128 160 192 192 192 64 224 224 0 96 128 32 192 192 64 192 224 0 192 224 0 192 192]; mask:((Depth1Image new) width: 20; height: 20; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@H@@@L@@@N@@@O@@@O @_?0@_?8@_?<@_?>@_?>@_?<@_?8@_?0@@O @@O@@@N_0@LO @HG@@@B@') ; yourself); yourself] |
|
736 |
! |
|
737 |
||
738 |
rightIcon |
|
739 |
"This resource specification was automatically generated |
|
740 |
by the ImageEditor of ST/X." |
|
741 |
||
742 |
"Do not manually edit this!! If it is corrupted, |
|
743 |
the ImageEditor may not be able to read the specification." |
|
744 |
||
745 |
" |
|
746 |
self rightIcon inspect |
|
747 |
ImageEditor openOnClass:self andSelector:#rightIcon |
|
748 |
" |
|
749 |
||
750 |
<resource: #image> |
|
751 |
||
752 |
^Icon |
|
753 |
constantNamed:#'AbstractFileBrowser class rightIcon' |
|
754 |
ifAbsentPut:[(Depth2Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
755 |
UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUTIUUUUUUUUB%UEUUUUUP*EP@@@@@@J)T@@@@@@B*%B******* |
|
756 |
*P********(J********B********P********PEUUUUUV*QEUUUUUP*PUUUUUUTJQUUUUUUUBQUUUUUUUPQUUUUUUUPAUUUUUUUTUUUUUUUUUUUUUUUUUUU |
|
757 |
UUUUUUUUUUUUUUUUUUUUUP@a') ; colorMapFromArray:#[255 255 255 0 0 0 50 50 100 255 0 0]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
758 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@C@@@@@8@@@@O@@@@C8A????@_???8G????A????0_???<G???>A????@@@@O @@@C0@@@@8@@@@L@@@@ |
|
759 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself] |
|
760 |
! |
|
761 |
||
762 |
searchIcon |
|
763 |
<resource: #programImage> |
|
764 |
||
765 |
^ ToolbarIconLibrary search16x16Icon "/ search28x28Icon |
|
766 |
! |
|
767 |
||
768 |
shellIcon |
|
769 |
<resource: #programImage> |
|
770 |
||
771 |
OperatingSystem isMSDOSlike ifTrue:[ |
|
772 |
^ ToolbarIconLibrary dos20x20Icon |
|
773 |
]. |
|
774 |
^ ToolbarIconLibrary shell20x20Icon |
|
775 |
! |
|
776 |
||
777 |
upArrow |
|
778 |
"This resource specification was automatically generated |
|
779 |
by the ImageEditor of ST/X." |
|
780 |
||
781 |
"Do not manually edit this!! If it is corrupted, |
|
782 |
the ImageEditor may not be able to read the specification." |
|
783 |
||
784 |
" |
|
785 |
self upArrow inspect |
|
786 |
ImageEditor openOnClass:self andSelector:#upArrow |
|
787 |
" |
|
788 |
||
789 |
<resource: #image> |
|
790 |
||
791 |
^Icon |
|
792 |
constantNamed:#'AbstractFileBrowser class upArrow' |
|
793 |
ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
794 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@PH@@@@@@@@@ |
|
795 |
@@@@@@@@@@@@@@@@@@@A@0PE@@@@@@@@@@@@@@@@@@@@@@@@@@DFA0 DAP@@@@@@@@@@@@@@@@@@@@@@@P$@A0(HA@T@@@@@@@@@@@@@@@@@@@@AB0@@C@4N |
|
796 |
C0PE@@@@@@@@@@@@@@@@@@DF@@@LB@ MD@<DAP@@@@@@@@@@@@@@@PLGDQHHD1LHE@8UA@H@@@@@@@@@@@@AE!!\XA@<SD1LHEPPYF DB@@@@@@@@@@D\@Q0A |
|
797 |
GA4OD1LJEPD\@Q0A@ @@@@@@@@@@@@@@@!!8^C1T_A@T@@@@@@@@@@@@@@@@@@@@@E @GHATRA@T@@@@@@@@@@@@@@@@@@@@@E @GDQT_A@T@@@@@@@@@@@@@ |
|
798 |
@@@@@@@@@P@!!H!!TJA@T@@@@@@@@@@@@@@@@@@@@@@P\#IATTA@T@@@@@@@@@@@@@@@@@@@@@@QXXFPPDF H@@@@@@@@@@@@@@@@@@@@@@ TEAPTE@ H@@@@@ |
|
799 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
800 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[224 224 224 0 32 64 0 0 0 96 128 160 0 96 128 0 0 32 128 160 192 192 224 224 0 160 192 128 128 160 32 192 192 128 160 160 96 192 224 0 192 224 32 192 224 32 160 192 64 224 224 160 192 224 64 192 192 0 128 192 0 192 192 0 128 160 32 64 96 64 96 128 32 96 128 0 64 128 0 64 96 192 192 192 0 32 96 32 128 192 128 192 224 64 192 224 128 192 192 160 224 224 96 192 192 96 160 192 64 160 192]; mask:((Depth1Image new) width: 24; height: 24; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@F@@@O@@@_ @@?0@A?8@C?<@G?>@O??@_?? @?0@@?0@@?0@@?0@@?0@@?0@@?0@@@@@@@@@@@@@@@@@@@@@') ; yourself); yourself] |
|
801 |
! |
|
802 |
||
803 |
upArrow20x20Icon |
|
804 |
"This resource specification was automatically generated |
|
805 |
by the ImageEditor of ST/X." |
|
806 |
||
807 |
"Do not manually edit this!! If it is corrupted, |
|
808 |
the ImageEditor may not be able to read the specification." |
|
809 |
||
810 |
" |
|
811 |
self upArrow20x20Icon inspect |
|
812 |
ImageEditor openOnClass:self andSelector:#upArrow20x20Icon |
|
813 |
Icon flushCachedIcons |
|
814 |
" |
|
815 |
||
816 |
<resource: #image> |
|
817 |
||
818 |
^Icon |
|
819 |
constantNamed:#'AbstractFileBrowser class upArrow20x20Icon' |
|
820 |
ifAbsentPut:[(Depth8Image new) width: 20; height: 20; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
821 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@DB@@@@@@@@@@@@@@@@@@@@@@@A@0PE@@@@@@@@@@@@@@@@@@@@@PXG |
|
822 |
B@PE@@@@@@@@@@@@@@@@@@DI@@\JB@PE@@@@@@@@@@@@@@@AB0@@C@4NC0PE@@@@@@@@@@@@@PX@@@0HB@4PC0PE@@@@@@@@@@DCA1DRBALSBAPNEPPB@@@@ |
|
823 |
@@@AE!!\XA@<SD1LHEPPYF DB@@@@@Q0AG@D\GP<SD0(U@Q0AG@DB@@@@@@@@@@H^G <UG0PE@@@@@@@@@@@@@@@@E @GHATRA@T@@@@@@@@@@@@@@@@V@@\Q |
|
824 |
EQ<DAP@@@@@@@@@@@@@@@@D@HRHUB PE@@@@@@@@@@@@@@@@@P\#IATTA@T@@@@@@@@@@@@@@@@AE!! YA@PZ@ @@@@@@@@@@@@@@@@HEAPTEAPHB@@@@@@@@ |
|
825 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[224 224 224 0 32 64 0 0 0 96 128 160 0 96 128 0 0 32 128 160 192 192 224 224 0 160 192 128 128 160 32 192 192 128 160 160 96 192 224 0 192 224 32 192 224 32 160 192 64 224 224 160 192 224 64 192 192 0 128 192 0 192 192 0 128 160 32 64 96 64 96 128 32 96 128 0 64 128 0 64 96 192 192 192 0 32 96 32 128 192 128 192 224 64 192 224 128 192 192 160 224 224 96 192 192 96 160 192 64 160 192]; mask:((Depth1Image new) width: 20; height: 20; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@F@@@O@@@_ @@?0@A?8@C?<@G?>@O??@_?? @?0@@?0@@?0@@?0@@?0@@?0@@?0@@@@@@@@@') ; yourself); yourself] |
|
826 |
! |
|
827 |
||
828 |
upArrowPlusMenu |
|
829 |
"This resource specification was automatically generated |
|
830 |
by the ImageEditor of ST/X." |
|
831 |
||
832 |
"Do not manually edit this!! If it is corrupted, |
|
833 |
the ImageEditor may not be able to read the specification." |
|
834 |
||
835 |
" |
|
836 |
self upArrowPlusMenu inspect |
|
837 |
ImageEditor openOnClass:self andSelector:#upArrowPlusMenu |
|
838 |
" |
|
839 |
||
840 |
<resource: #image> |
|
841 |
||
842 |
^Icon |
|
843 |
constantNamed:#'AbstractFileBrowser class upArrowPlusMenu' |
|
844 |
ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
845 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@PH@@@@@@@@@ |
|
846 |
@@@@@@@@@@@@@@@@@@@A@0PE@@@@@@@@@@@@@@@@@@@@@@@@@@DFA0 DAP@@@@@@@@@@@@@@@@@@@@@@@P$@A0(HA@T@@@@@@@@@@@@@@@@@@@@AB0@@C@4N |
|
847 |
C0PE@@@@@@@@@@@@@@@@@@DF@@@LB@ MD@<DAP@@@@@@@@@@@@@@@PLGDQHHD1LHE@8UA@H@@@@@@@@@@@@AE!!\XA@<SD1LHEPPYF DB@@@@@@@@@@D\@Q0A |
|
848 |
GA4OD1LJEPD\@Q0A@ @@@@@@@@@@@@@@@!!8^C1T_A@T@@@@@@@@@@@@@@@@@@@@@E @GHATRA@T@@@@@@@@@@@@@@@@@@@@@E @GDQT_A@T@@@@@@@@@@@@@ |
|
849 |
@@@@@@@@@P@!!H!!TJA@T@@@@@@@@@@@@@@@@@@@@@@P\#IATTA@T@@@@@@@@@@@@@@@@@@@@@@QXXFPPDF H@@@@@@@@@@@@@@@@@@@@@@ TEAPTE@ H@@@@@ |
|
850 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B@ HB@ HB@@@@@@@@@@@@@@@@@@@@@@@@@ HB@ H@@@@@@@@@@@@@@@@@@@@@@@@@@@HB@ @@@@@@@@@@@@@@@@@@ |
|
851 |
@@@@@@@@@@@B@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[224 224 224 0 32 64 0 0 0 96 128 160 0 96 128 0 0 32 128 160 192 192 224 224 0 160 192 128 128 160 32 192 192 128 160 160 96 192 224 0 192 224 32 192 224 32 160 192 64 224 224 160 192 224 64 192 192 0 128 192 0 192 192 0 128 160 32 64 96 64 96 128 32 96 128 0 64 128 0 64 96 192 192 192 0 32 96 32 128 192 128 192 224 64 192 224 128 192 192 160 224 224 96 192 192 96 160 192 64 160 192]; mask:((Depth1Image new) width: 24; height: 24; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@F@@@O@@@_ @@?0@A?8@C?<@G?>@O??@_?? @?0@@?0@@?0@@?0@@?0@@?0@@?0@@@A?@@@>@@@\@@@H@@@@') ; yourself); yourself] |
|
852 |
! |
|
853 |
||
854 |
vt100Terminal |
|
855 |
<resource: #programImage> |
|
856 |
||
857 |
^ ToolbarIconLibrary shell20x20Icon |
|
858 |
! ! |
|
859 |
||
860 |
!AbstractFileBrowser class methodsFor:'menu specs'! |
|
861 |
||
862 |
baseBookmarksMenuSpec |
|
863 |
"This resource specification was automatically generated |
|
864 |
by the MenuEditor of ST/X." |
|
865 |
||
866 |
"Do not manually edit this!! If it is corrupted, |
|
867 |
the MenuEditor may not be able to read the specification." |
|
868 |
||
869 |
" |
|
870 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec |
|
871 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec)) startUp |
|
872 |
" |
|
873 |
||
874 |
<resource: #menu> |
|
875 |
||
876 |
^ |
|
877 |
#(#Menu |
|
878 |
#( |
|
879 |
#(#MenuItem |
|
880 |
#label: 'Add Bookmark' |
|
881 |
#translateLabel: true |
|
882 |
#value: #addBookmark |
|
883 |
#enabled: #currentFilesHasDirectories |
|
884 |
) |
|
885 |
#(#MenuItem |
|
886 |
#label: 'Remove Bookmark' |
|
887 |
#translateLabel: true |
|
888 |
#value: #removeBookmark |
|
889 |
#enabled: #hasBookmarksToRemove |
|
890 |
) |
|
891 |
) |
|
892 |
nil |
|
893 |
nil |
|
894 |
) |
|
895 |
! |
|
896 |
||
897 |
directoryMenu |
|
898 |
"This resource specification was automatically generated |
|
899 |
by the MenuEditor of ST/X." |
|
900 |
||
901 |
"Do not manually edit this!! If it is corrupted, |
|
902 |
the MenuEditor may not be able to read the specification." |
|
903 |
||
904 |
" |
|
905 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#directoryMenu |
|
906 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser directoryMenu)) startUp |
|
907 |
" |
|
908 |
||
909 |
<resource: #menu> |
|
910 |
||
911 |
^ |
|
912 |
#(#Menu |
|
913 |
#( |
|
914 |
#(#MenuItem |
|
915 |
#label: 'Up' |
|
916 |
#translateLabel: true |
|
917 |
#value: #doGoDirectoryUp |
|
918 |
) |
|
919 |
#(#MenuItem |
|
920 |
#label: '-' |
|
921 |
) |
|
922 |
#(#MenuItem |
|
923 |
#label: 'Back' |
|
924 |
#translateLabel: true |
|
925 |
#value: #doBack |
|
926 |
#activeHelpKey: #directoryBack |
|
927 |
#enabled: #enableBack |
|
928 |
) |
|
929 |
#(#MenuItem |
|
930 |
#label: 'Forward' |
|
931 |
#translateLabel: true |
|
932 |
#value: #doForward |
|
933 |
#activeHelpKey: #directoryBack |
|
934 |
#enabled: #enableForward |
|
935 |
) |
|
936 |
#(#MenuItem |
|
937 |
#label: '-' |
|
938 |
) |
|
939 |
#(#MenuItem |
|
940 |
#label: 'Default' |
|
941 |
#translateLabel: true |
|
942 |
#value: #doGotoDefaultDirectory |
|
943 |
) |
|
944 |
#(#MenuItem |
|
945 |
#label: 'Home' |
|
946 |
#translateLabel: true |
|
947 |
#value: #doGotoHomeDirectory |
|
948 |
) |
|
949 |
#(#MenuItem |
|
3952 | 950 |
#label: 'Visited Directories' |
951 |
#translateLabel: true |
|
952 |
#submenuChannel: #visitedDirectoriesMenu |
|
953 |
) |
|
954 |
#(#MenuItem |
|
3892 | 955 |
#label: 'Bookmarks' |
956 |
#translateLabel: true |
|
957 |
#submenuChannel: #bookmarksMenuSpec |
|
958 |
) |
|
959 |
) |
|
960 |
nil |
|
961 |
nil |
|
962 |
) |
|
963 |
! |
|
964 |
||
965 |
editMenu |
|
966 |
"This resource specification was automatically generated |
|
967 |
by the MenuEditor of ST/X." |
|
968 |
||
969 |
"Do not manually edit this!! If it is corrupted, |
|
970 |
the MenuEditor may not be able to read the specification." |
|
971 |
||
972 |
" |
|
973 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#editMenu |
|
974 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser editMenu)) startUp |
|
975 |
" |
|
976 |
||
977 |
<resource: #menu> |
|
978 |
||
979 |
^ |
|
980 |
#(#Menu |
|
981 |
#( |
|
982 |
#(#MenuItem |
|
983 |
#label: 'Copy' |
|
984 |
#translateLabel: true |
|
985 |
#value: #copyInDirContentsBrowser |
|
986 |
#enabled: #hasSelection |
|
987 |
) |
|
988 |
#(#MenuItem |
|
989 |
#label: 'Cut' |
|
990 |
#translateLabel: true |
|
991 |
#value: #cutInDirContentsBrowser |
|
992 |
#enabled: #hasSelection |
|
993 |
) |
|
994 |
#(#MenuItem |
|
995 |
#label: 'Paste' |
|
996 |
#translateLabel: true |
|
997 |
#value: #pasteFiles |
|
998 |
#enabled: #canPaste |
|
999 |
) |
|
1000 |
#(#MenuItem |
|
1001 |
#label: 'Delete' |
|
1002 |
#translateLabel: true |
|
1003 |
#value: #deleteInDirContentsBrowser |
|
1004 |
#enabled: #hasSelection |
|
1005 |
) |
|
1006 |
#(#MenuItem |
|
1007 |
#label: '-' |
|
1008 |
) |
|
1009 |
#(#MenuItem |
|
1010 |
#label: 'Copy All Filenames' |
|
1011 |
#translateLabel: true |
|
1012 |
#value: #copyFileList |
|
1013 |
#enabled: #fileListIsNotEmpty |
|
1014 |
) |
|
1015 |
#(#MenuItem |
|
1016 |
#label: 'Copy Selected Filenames' |
|
1017 |
#translateLabel: true |
|
1018 |
#value: #copySelectedFilenames |
|
1019 |
#enabled: #hasSelection |
|
1020 |
) |
|
1021 |
) |
|
1022 |
nil |
|
1023 |
nil |
|
1024 |
) |
|
1025 |
! |
|
1026 |
||
1027 |
fileMenu |
|
1028 |
"This resource specification was automatically generated |
|
1029 |
by the MenuEditor of ST/X." |
|
1030 |
||
1031 |
"Do not manually edit this!! If it is corrupted, |
|
1032 |
the MenuEditor may not be able to read the specification." |
|
1033 |
||
1034 |
" |
|
1035 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileMenu |
|
1036 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileMenu)) startUp |
|
1037 |
" |
|
1038 |
||
1039 |
<resource: #menu> |
|
1040 |
||
1041 |
^ |
|
1042 |
#(#Menu |
|
1043 |
#( |
|
1044 |
#(#MenuItem |
|
1045 |
#label: 'New' |
|
1046 |
#translateLabel: true |
|
1047 |
#submenuChannel: #newMenu |
|
1048 |
) |
|
1049 |
#(#MenuItem |
|
1050 |
#label: 'Rename' |
|
1051 |
#translateLabel: true |
|
1052 |
#value: #renameSelection |
|
1053 |
#enabled: #hasSelection |
|
1054 |
#shortcutKeyCharacter: #Replace |
|
1055 |
) |
|
1056 |
#(#MenuItem |
|
1057 |
#label: '-' |
|
1058 |
) |
|
1059 |
#(#MenuItem |
|
4040 | 1060 |
#label: 'Open in Text Editor' |
3892 | 1061 |
#translateLabel: true |
1062 |
#value: #doShowFileContents |
|
1063 |
) |
|
1064 |
#(#MenuItem |
|
1065 |
#label: 'Properties...' |
|
1066 |
#translateLabel: true |
|
1067 |
#value: #doShowProperties |
|
1068 |
#enabled: #hasSelection |
|
1069 |
) |
|
1070 |
#(#MenuItem |
|
1071 |
#label: '-' |
|
1072 |
#isVisible: #javaSupportLoaded |
|
1073 |
) |
|
1074 |
#(#MenuItem |
|
4040 | 1075 |
#label: 'File in' |
3892 | 1076 |
#translateLabel: true |
1077 |
#value: #fileFileIn |
|
1078 |
#enabled: #hasSelection |
|
1079 |
) |
|
1080 |
#(#MenuItem |
|
4040 | 1081 |
#label: 'File in to Namespace...' |
3892 | 1082 |
#translateLabel: true |
1083 |
#value: #fileFileInToNameSpace |
|
1084 |
#enabled: #hasSelection |
|
1085 |
) |
|
1086 |
#(#MenuItem |
|
1087 |
#label: '-' |
|
1088 |
#isVisible: #javaSupportLoaded |
|
1089 |
) |
|
1090 |
#(#MenuItem |
|
1091 |
#label: 'Add to Java Class Path' |
|
1092 |
#translateLabel: true |
|
1093 |
#isVisible: #javaSupportLoaded |
|
1094 |
#enabled: #canAddToClassPath |
|
1095 |
) |
|
1096 |
#(#MenuItem |
|
1097 |
#label: 'Remove from Java Class Path' |
|
1098 |
#translateLabel: true |
|
1099 |
#isVisible: #javaSupportLoaded |
|
1100 |
#enabled: #canRemoveFromClassPath |
|
1101 |
) |
|
1102 |
#(#MenuItem |
|
1103 |
#label: 'Add to Java Source Path' |
|
1104 |
#translateLabel: true |
|
1105 |
#isVisible: #javaSupportLoaded |
|
1106 |
#enabled: #canAddToSourcePath |
|
1107 |
) |
|
1108 |
#(#MenuItem |
|
1109 |
#label: 'Remove from Java Source Path' |
|
1110 |
#translateLabel: true |
|
1111 |
#isVisible: #javaSupportLoaded |
|
1112 |
#enabled: #canRemoveFromSourcePath |
|
1113 |
) |
|
1114 |
) |
|
1115 |
nil |
|
1116 |
nil |
|
1117 |
) |
|
1118 |
! |
|
1119 |
||
1120 |
newMenu |
|
1121 |
"This resource specification was automatically generated |
|
1122 |
by the MenuEditor of ST/X." |
|
1123 |
||
1124 |
"Do not manually edit this!! If it is corrupted, |
|
1125 |
the MenuEditor may not be able to read the specification." |
|
1126 |
||
1127 |
" |
|
1128 |
MenuEditor new openOnClass:DirectoryTreeBrowser andSelector:#newMenu |
|
1129 |
(Menu new fromLiteralArrayEncoding:(DirectoryTreeBrowser newMenu)) startUp |
|
1130 |
" |
|
1131 |
||
1132 |
<resource: #menu> |
|
1133 |
||
1134 |
^ |
|
1135 |
#(#Menu |
|
1136 |
#( |
|
1137 |
#(#MenuItem |
|
1138 |
#label: 'Directory...' |
|
1139 |
#translateLabel: true |
|
1140 |
#value: #newDirectory |
|
1141 |
) |
|
1142 |
#(#MenuItem |
|
1143 |
#label: 'File...' |
|
1144 |
#translateLabel: true |
|
1145 |
#value: #newFile |
|
1146 |
) |
|
1147 |
#(#MenuItem |
|
1148 |
#label: 'Hard Link...' |
|
1149 |
#translateLabel: true |
|
1150 |
#isVisible: #systemIsUnix |
|
1151 |
#value: #newHardLink |
|
1152 |
) |
|
1153 |
#(#MenuItem |
|
1154 |
#label: 'Symbolic Link...' |
|
1155 |
#translateLabel: true |
|
1156 |
#isVisible: #systemIsUnix |
|
1157 |
#value: #newSoftLink |
|
1158 |
) |
|
1159 |
) |
|
1160 |
nil |
|
1161 |
nil |
|
1162 |
) |
|
3906 | 1163 |
! |
1164 |
||
1165 |
sortMenu |
|
1166 |
"This resource specification was automatically generated |
|
1167 |
by the MenuEditor of ST/X." |
|
1168 |
||
1169 |
"Do not manually edit this!! If it is corrupted, |
|
1170 |
the MenuEditor may not be able to read the specification." |
|
1171 |
||
1172 |
" |
|
3907 | 1173 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#sortMenu |
1174 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser sortMenu)) startUp |
|
3906 | 1175 |
" |
1176 |
||
1177 |
<resource: #menu> |
|
1178 |
||
1179 |
^ |
|
1180 |
#(#Menu |
|
1181 |
#( |
|
1182 |
#(#MenuItem |
|
1183 |
#label: 'By Filename' |
|
1184 |
#translateLabel: true |
|
1185 |
#hideMenuOnActivated: false |
|
3989 | 1186 |
#choice: #sortBlockProperty |
3906 | 1187 |
#choiceValue: #baseName |
1188 |
) |
|
1189 |
#(#MenuItem |
|
1190 |
#label: 'By Type' |
|
1191 |
#translateLabel: true |
|
1192 |
#hideMenuOnActivated: false |
|
3989 | 1193 |
#choice: #sortBlockProperty |
3906 | 1194 |
#choiceValue: #suffix |
1195 |
) |
|
1196 |
#(#MenuItem |
|
1197 |
#label: 'By Permissions' |
|
1198 |
#translateLabel: true |
|
1199 |
#hideMenuOnActivated: false |
|
3989 | 1200 |
#choice: #sortBlockProperty |
3906 | 1201 |
#choiceValue: #permissions |
1202 |
) |
|
1203 |
#(#MenuItem |
|
1204 |
#label: 'By Owner' |
|
1205 |
#translateLabel: true |
|
1206 |
#hideMenuOnActivated: false |
|
1207 |
#isVisible: #viewOwner |
|
3989 | 1208 |
#choice: #sortBlockProperty |
3906 | 1209 |
#choiceValue: #owner |
1210 |
) |
|
1211 |
#(#MenuItem |
|
1212 |
#label: 'By Group' |
|
1213 |
#translateLabel: true |
|
1214 |
#hideMenuOnActivated: false |
|
1215 |
#isVisible: #viewOwner |
|
3989 | 1216 |
#choice: #sortBlockProperty |
3906 | 1217 |
#choiceValue: #group |
1218 |
) |
|
1219 |
#(#MenuItem |
|
1220 |
#label: 'By Size' |
|
1221 |
#translateLabel: true |
|
1222 |
#hideMenuOnActivated: false |
|
3989 | 1223 |
#choice: #sortBlockProperty |
1224 |
#choiceValue: #fileSize |
|
3906 | 1225 |
) |
1226 |
#(#MenuItem |
|
1227 |
#label: 'By Date && Time' |
|
1228 |
#translateLabel: true |
|
1229 |
#hideMenuOnActivated: false |
|
3989 | 1230 |
#choice: #sortBlockProperty |
3964 | 1231 |
#choiceValue: #modificationTime |
3906 | 1232 |
) |
3907 | 1233 |
#(#MenuItem |
1234 |
#label: '-' |
|
1235 |
) |
|
1236 |
#(#MenuItem |
|
1237 |
#label: 'Ignore Case in Sort' |
|
1238 |
#translateLabel: true |
|
1239 |
#hideMenuOnActivated: false |
|
1240 |
#indication: #sortCaseless |
|
1241 |
) |
|
3906 | 1242 |
) |
1243 |
nil |
|
1244 |
nil |
|
1245 |
) |
|
4018 | 1246 |
! |
1247 |
||
1248 |
viewDetailsMenuSpec |
|
1249 |
"This resource specification was automatically generated |
|
1250 |
by the MenuEditor of ST/X." |
|
1251 |
||
1252 |
"Do not manually edit this!! If it is corrupted, |
|
1253 |
the MenuEditor may not be able to read the specification." |
|
1254 |
||
1255 |
" |
|
1256 |
MenuEditor new openOnClass:DirectoryContentsBrowser andSelector:#viewBrowserMenu |
|
1257 |
(Menu new fromLiteralArrayEncoding:(DirectoryContentsBrowser viewBrowserMenu)) startUp |
|
1258 |
" |
|
1259 |
||
1260 |
<resource: #menu> |
|
1261 |
||
1262 |
^ |
|
1263 |
#(#Menu |
|
1264 |
#( |
|
1265 |
#(#MenuItem |
|
1266 |
#label: 'Suffix' |
|
1267 |
#translateLabel: true |
|
1268 |
#hideMenuOnActivated: false |
|
1269 |
#enabled: #viewDetails |
|
1270 |
#indication: #viewType |
|
1271 |
) |
|
1272 |
#(#MenuItem |
|
1273 |
#label: 'Permissions' |
|
1274 |
#translateLabel: true |
|
1275 |
#hideMenuOnActivated: false |
|
1276 |
#enabled: #viewDetails |
|
1277 |
#indication: #viewPermissions |
|
1278 |
) |
|
1279 |
#(#MenuItem |
|
1280 |
#label: 'Owner' |
|
1281 |
#translateLabel: true |
|
1282 |
#hideMenuOnActivated: false |
|
1283 |
#enabled: #viewDetails |
|
1284 |
#indication: #viewOwner |
|
1285 |
) |
|
1286 |
#(#MenuItem |
|
1287 |
#label: 'Group' |
|
1288 |
#translateLabel: true |
|
1289 |
#hideMenuOnActivated: false |
|
1290 |
#enabled: #viewDetails |
|
1291 |
#indication: #viewGroup |
|
1292 |
) |
|
1293 |
#(#MenuItem |
|
1294 |
#label: 'Size' |
|
1295 |
#translateLabel: true |
|
1296 |
#hideMenuOnActivated: false |
|
1297 |
#enabled: #viewDetails |
|
1298 |
#indication: #viewSize |
|
1299 |
) |
|
1300 |
#(#MenuItem |
|
1301 |
#label: 'Date && Time' |
|
1302 |
#translateLabel: true |
|
1303 |
#hideMenuOnActivated: false |
|
1304 |
#enabled: #viewDetails |
|
1305 |
#indication: #viewTime |
|
1306 |
) |
|
1307 |
#(#MenuItem |
|
1308 |
#label: 'File Info' |
|
1309 |
#translateLabel: true |
|
1310 |
#hideMenuOnActivated: false |
|
1311 |
#enabled: #viewDetails |
|
1312 |
#indication: #viewDescription |
|
1313 |
) |
|
1314 |
#(#MenuItem |
|
1315 |
#label: 'Preview' |
|
1316 |
#translateLabel: true |
|
1317 |
#hideMenuOnActivated: false |
|
1318 |
#enabled: #viewDetails |
|
1319 |
#indication: #viewPreview |
|
1320 |
) |
|
1321 |
#(#MenuItem |
|
1322 |
#label: '-' |
|
1323 |
) |
|
1324 |
#(#MenuItem |
|
1325 |
#label: 'Hidden Files' |
|
1326 |
#translateLabel: true |
|
1327 |
#indication: #showHiddenFiles |
|
1328 |
) |
|
1329 |
) |
|
1330 |
nil |
|
1331 |
nil |
|
1332 |
) |
|
3892 | 1333 |
! ! |
1334 |
||
1335 |
!AbstractFileBrowser class methodsFor:'misc'! |
|
1336 |
||
1337 |
newLock |
|
1338 |
^ CodeExecutionLock new |
|
1339 |
! ! |
|
1340 |
||
1341 |
!AbstractFileBrowser methodsFor:'actions'! |
|
1342 |
||
1343 |
askForCommandFor:fileName thenDo:aBlock |
|
1344 |
"setup and launch a querybox to ask for unix command. |
|
1345 |
Then evaluate aBlock passing the command-string as argument." |
|
1346 |
||
1347 |
|box osName| |
|
1348 |
||
1349 |
osName := OperatingSystem platformName. |
|
1350 |
||
1351 |
box := FilenameEnterBox |
|
1352 |
title:(resources string:'Execute %1 command:' with:osName) |
|
1353 |
okText:(resources string:'Execute') |
|
1354 |
action:aBlock. |
|
1355 |
||
1356 |
fileName notNil ifTrue:[ |
|
1357 |
self initialCommandFor:fileName into:box. |
|
1358 |
]. |
|
1359 |
box directory:(self getDirWithoutFileName:fileName). |
|
1360 |
box showAtPointer. |
|
1361 |
box destroy. |
|
1362 |
||
1363 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
|
1364 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
1365 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
1366 |
! |
|
1367 |
||
1368 |
changeFileBrowserTitleTo:aString |
|
1369 |
||
1370 |
self application:#FileBrowserV2 |
|
1371 |
do:#changeFileBrowserTitleTo: |
|
1372 |
withArg:aString |
|
1373 |
! |
|
1374 |
||
1375 |
copyFileList |
|
1376 |
||
1377 |
| fileList stream| |
|
1378 |
fileList := self application:#DirectoryContentsBrowser do:#descriptions. |
|
1379 |
stream := WriteStream on:''. |
|
1380 |
fileList do:[: item | |
|
1381 |
stream nextPutAll:(item fileName asString). |
|
1382 |
stream cr. |
|
1383 |
]. |
|
1384 |
self window setTextSelection:stream contents. |
|
1385 |
stream close. |
|
1386 |
! |
|
1387 |
||
1388 |
copySelectedFilenames |
|
1389 |
||
1390 |
| fileList stream| |
|
3982 | 1391 |
fileList := self application:#DirectoryContentsBrowser do:#selectedFiles. |
3892 | 1392 |
fileList isEmpty ifTrue:[^ self]. |
1393 |
stream := WriteStream on:''. |
|
1394 |
fileList do:[: file | |
|
1395 |
stream nextPutAll:(file asString). |
|
1396 |
stream cr. |
|
1397 |
]. |
|
1398 |
self window setTextSelection:stream contents. |
|
1399 |
stream close. |
|
1400 |
! |
|
1401 |
||
1402 |
doAddTerminal |
|
1403 |
||
1404 |
| item dir directories| |
|
1405 |
||
1406 |
directories := self currentDirectories value. |
|
1407 |
||
1408 |
directories isEmpty ifTrue:[ |
|
1409 |
dir := Filename homeDirectory |
|
1410 |
] ifFalse:[ |
|
1411 |
dir := directories first. |
|
1412 |
]. |
|
1413 |
||
3982 | 1414 |
item := (DirectoryContentsBrowser itemClass fileName:dir). |
3892 | 1415 |
self fileApplicationDo:#openTerminalApplication: withArg:item. |
1416 |
! |
|
1417 |
||
1418 |
doExecuteCommand |
|
1419 |
||
1420 |
| action fileName| |
|
3982 | 1421 |
fileName := self firstSelectedFile. |
3892 | 1422 |
action := [:command | |
1423 |
self addToCommandHistory:command for:fileName. |
|
1424 |
self executeCommand:command. |
|
1425 |
]. |
|
1426 |
self askForCommandFor:fileName thenDo:action |
|
1427 |
! |
|
1428 |
||
1429 |
doGoDirectoryUp |
|
3906 | 1430 |
| upDir directories rootInTreeView| |
3892 | 1431 |
|
1432 |
self enableDirectoryUp value ifFalse:[ ^ self]. |
|
1433 |
self currentFilesAreInSameDirectory ifTrue:[ |
|
1434 |
directories := self currentDirectories value. |
|
1435 |
upDir := directories first directory. |
|
3906 | 1436 |
] ifFalse:[ |
1437 |
rootInTreeView := self application:#DirectoryTreeBrowser do:#rootHolder. |
|
1438 |
upDir := rootInTreeView value asFilename directory. |
|
3892 | 1439 |
]. |
3906 | 1440 |
self currentFileNameHolder value:(OrderedCollection with:upDir). |
3892 | 1441 |
! |
1442 |
||
1443 |
doGotoDefaultDirectory |
|
1444 |
self gotoFile:(Filename defaultDirectory). |
|
1445 |
! |
|
1446 |
||
1447 |
doGotoHomeDirectory |
|
1448 |
||
1449 |
| home | |
|
1450 |
||
1451 |
home := Filename homeDirectory. |
|
1452 |
self gotoFile:home. |
|
1453 |
! |
|
1454 |
||
1455 |
doOpenSearchFile |
|
1456 |
||
1457 |
|item files| |
|
1458 |
||
4034 | 1459 |
files := self currentFileNameHolder value. |
1460 |
files notEmpty ifTrue:[ |
|
1461 |
item := DirectoryContentsBrowser itemClass fileName:(files first). |
|
1462 |
] ifFalse:[ |
|
1463 |
item := DirectoryContentsBrowser itemClass fileName:(Filename homeDirectory asAbsoluteFilename). |
|
3892 | 1464 |
]. |
1465 |
self openSearchFileOn:item. |
|
1466 |
! |
|
1467 |
||
1468 |
doShowFileContents |
|
1469 |
||
1470 |
^ self application:#DirectoryContentsBrowser do:#doShowFileContents. |
|
1471 |
! |
|
1472 |
||
1473 |
doShowProperties |
|
1474 |
||
1475 |
"show long stat (file)-info" |
|
1476 |
||
1477 |
self fileGetInfo:true |
|
1478 |
! |
|
1479 |
||
1480 |
fileApplicationDo:selector |
|
1481 |
||
1482 |
^ self application:#FileApplicationNoteBook do:selector |
|
1483 |
! |
|
1484 |
||
1485 |
fileApplicationDo:selector withArg:arg |
|
1486 |
^ self application:#FileApplicationNoteBook do:selector withArg:arg |
|
1487 |
! |
|
1488 |
||
1489 |
fileGetInfo:longInfo |
|
1490 |
"get info on selected file - show it in a box" |
|
1491 |
||
1492 |
|string box updater| |
|
1493 |
||
3906 | 1494 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
3892 | 1495 |
string notNil ifTrue:[ |
1496 |
box := InfoBox title:string. |
|
1497 |
updater := [ |
|
1498 |
[true] whileTrue:[ |
|
1499 |
Delay waitForSeconds:2. |
|
3906 | 1500 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
1501 |
string isNil ifTrue:[ ^ self]. |
|
3892 | 1502 |
box title:string |
1503 |
] |
|
1504 |
] fork. |
|
1505 |
box showAtPointer. |
|
1506 |
updater terminate. |
|
1507 |
box destroy |
|
1508 |
] |
|
1509 |
! |
|
1510 |
||
1511 |
gotoFile:aFilename |
|
1512 |
||
3964 | 1513 |
" select only if the file is not already in selection" |
1514 |
| currentSel | |
|
1515 |
||
1516 |
currentSel := self currentFileNameHolder value. |
|
1517 |
((currentSel findFirst:[:aFile| aFile = aFilename]) == 0) ifTrue:[ |
|
1518 |
self currentFileNameHolder value:(OrderedCollection with:(aFilename asAbsoluteFilename)). |
|
1519 |
]. |
|
3892 | 1520 |
! |
1521 |
||
1522 |
openApplByFileItem:aItem |
|
1523 |
||
1524 |
self fileApplicationDo:#openApplByFileItem: withArg:aItem |
|
1525 |
! |
|
1526 |
||
1527 |
openCommandResultApplication |
|
1528 |
||
1529 |
^ self fileApplicationDo:#openCommandResultApplication |
|
1530 |
! |
|
1531 |
||
1532 |
openSearchFileOn:aItem |
|
1533 |
||
1534 |
^ self fileApplicationDo:#openSearchFileOn: withArg:aItem |
|
1535 |
! |
|
1536 |
||
1537 |
openTextEditorOn:aItem |
|
1538 |
||
1539 |
^ self fileApplicationDo:#openTextEditorOn: withArg:aItem |
|
1540 |
! |
|
1541 |
||
1542 |
updateAndSelect:aColOfFiles |
|
1543 |
||
1544 |
self application:#DirectoryContentsBrowser do:#doUpdate. |
|
1545 |
self application:#DirectoryTreeBrowser do:#doUpdate. |
|
1546 |
||
1547 |
aColOfFiles notNil ifTrue:[ self currentFileNameHolder value:aColOfFiles ]. |
|
1548 |
! |
|
1549 |
||
1550 |
updateCurrentDirectory |
|
1551 |
||
1552 |
self updateAndSelect:nil |
|
1553 |
! ! |
|
1554 |
||
1555 |
!AbstractFileBrowser methodsFor:'actions bookmarks'! |
|
1556 |
||
1557 |
addBookmark |
|
1558 |
||
1559 |
|directories| |
|
1560 |
||
1561 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
1562 |
directories := self currentDirectories value. |
|
1563 |
self addBookmark:directories. |
|
1564 |
! |
|
1565 |
||
1566 |
addBookmark:aColOfDirectories |
|
1567 |
|idx bookmarks| |
|
1568 |
||
1569 |
aColOfDirectories do:[ : path | |
|
1570 |
bookmarks := self class directoryBookmarks. |
|
1571 |
idx := bookmarks indexOf:path. |
|
1572 |
idx == 0 ifTrue:[ |
|
1573 |
bookmarks addLast:path. |
|
1574 |
]. |
|
1575 |
]. |
|
1576 |
! |
|
1577 |
||
1578 |
hasBookmarks |
|
1579 |
^ self class directoryBookmarks size > 0 |
|
1580 |
! |
|
1581 |
||
1582 |
hasBookmarksToRemove |
|
1583 |
||
1584 |
|bookmarks directories| |
|
1585 |
||
3982 | 1586 |
directories := self currentSelectedDirectories. |
3892 | 1587 |
bookmarks := self class directoryBookmarks. |
1588 |
^ (bookmarks size > 0 and:[directories notEmpty]) |
|
1589 |
! |
|
1590 |
||
1591 |
removeBookmark |
|
1592 |
||
1593 |
|bookmarks directories| |
|
1594 |
||
1595 |
bookmarks := self class directoryBookmarks. |
|
1596 |
bookmarks isNil ifTrue:[ ^ self]. |
|
3982 | 1597 |
directories := self currentSelectedDirectories. |
3892 | 1598 |
directories isEmpty ifTrue:[^ self]. |
1599 |
directories do:[:dir| |
|
1600 |
bookmarks remove:dir ifAbsent:nil. |
|
1601 |
]. |
|
1602 |
! ! |
|
1603 |
||
1604 |
!AbstractFileBrowser methodsFor:'actions history'! |
|
1605 |
||
1606 |
addToCommandHistory:aCommandString for:aFilename |
|
1607 |
|cmd suffix cmdHist| |
|
1608 |
||
1609 |
cmdHist := self class commandHistory. |
|
1610 |
(aCommandString notNil and:[aCommandString notEmpty]) ifTrue:[ |
|
1611 |
cmdHist notNil ifTrue:[ |
|
1612 |
cmdHist addFirst:aCommandString. |
|
1613 |
cmdHist size > self class commandHistorySize ifTrue:[ |
|
1614 |
cmdHist removeLast |
|
1615 |
] |
|
1616 |
]. |
|
1617 |
aFilename notNil ifTrue:[ |
|
1618 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
|
1619 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
1620 |
DefaultCommandPerSuffix := Dictionary new. |
|
1621 |
]. |
|
1622 |
suffix := aFilename asFilename suffix. |
|
1623 |
suffix notNil ifTrue:[ |
|
1624 |
DefaultCommandPerSuffix at:suffix put:cmd. |
|
1625 |
] |
|
1626 |
] |
|
1627 |
] |
|
1628 |
! |
|
1629 |
||
1630 |
doBack |
|
1631 |
||
4022 | 1632 |
| fileName| |
1633 |
||
1634 |
fileName := self dirHistory goBack. |
|
3892 | 1635 |
fileName notNil ifTrue:[ |
3952 | 1636 |
self gotoFile:(fileName asFilename). |
3892 | 1637 |
] |
1638 |
! |
|
1639 |
||
1640 |
doForward |
|
1641 |
||
3964 | 1642 |
| fileName| |
1643 |
||
3952 | 1644 |
fileName := self dirHistory goForward. |
3892 | 1645 |
fileName notNil ifTrue:[ |
3952 | 1646 |
self gotoFile:(fileName asFilename). |
4022 | 1647 |
] ifFalse:[ |
1648 |
self enableForward value:false. |
|
1649 |
||
1650 |
]. |
|
3892 | 1651 |
! ! |
1652 |
||
1653 |
!AbstractFileBrowser methodsFor:'applications'! |
|
1654 |
||
1655 |
application:aApplication do:aMethod |
|
1656 |
||
1657 |
|appl| |
|
1658 |
||
1659 |
appl := self applications at:aApplication ifAbsent:nil. |
|
1660 |
appl notNil ifTrue:[ |
|
1661 |
^ appl perform:aMethod. |
|
1662 |
]. |
|
1663 |
^ nil. |
|
1664 |
! |
|
1665 |
||
1666 |
application:aApplication do:aMethod withArg:arg |
|
1667 |
|appl| |
|
1668 |
||
1669 |
appl := self applications at:aApplication ifAbsent:nil. |
|
1670 |
appl notNil ifTrue:[ |
|
1671 |
^ appl perform:aMethod with:arg |
|
1672 |
]. |
|
1673 |
^ nil |
|
1674 |
! |
|
1675 |
||
1676 |
application:aApplication do:aMethod withArg:arg1 withArg:arg2 |
|
1677 |
|appl| |
|
1678 |
||
1679 |
appl := self applications at:aApplication ifAbsent:nil. |
|
1680 |
appl notNil ifTrue:[ |
|
1681 |
(arg1 notNil and:[arg2 notNil]) ifTrue:[ |
|
1682 |
^ appl perform:aMethod with:arg1 with:arg2 |
|
1683 |
] |
|
1684 |
]. |
|
1685 |
^ nil |
|
4004 | 1686 |
! |
1687 |
||
1688 |
directoryContentsBrowser |
|
1689 |
^ self applications at:#DirectoryContentsBrowser ifAbsent:nil. |
|
3892 | 1690 |
! ! |
1691 |
||
1692 |
!AbstractFileBrowser methodsFor:'aspects'! |
|
1693 |
||
1694 |
applications |
|
1695 |
"returns the list of registered applications |
|
1696 |
" |
|
1697 |
^ aspects at:#applications |
|
1698 |
! |
|
1699 |
||
1700 |
backgroundProcesses |
|
1701 |
||
1702 |
^ self aspectFor:#backgroundProcesses ifAbsent:[List new] |
|
1703 |
! |
|
1704 |
||
1705 |
currentDirectories |
|
1706 |
||
1707 |
" returns a Ordered Collection of all directories currently selected |
|
1708 |
if only a file is selected currentDirectories holds the directory of the file |
|
1709 |
" |
|
1710 |
||
1711 |
^ self aspectFor:#currentDirectories ifAbsent:[ (OrderedCollection new) asValue ]. |
|
1712 |
! |
|
1713 |
||
1714 |
currentFileNameHolder |
|
1715 |
||
1716 |
" returns a OrderedCollection of all files that are selected |
|
1717 |
if no file but a directory is selected it contains the directories |
|
1718 |
in contrast to currentDirectories wich have only the directories |
|
1719 |
" |
|
1720 |
||
1721 |
^ self aspectFor:#currentFileNameHolder ifAbsent:[(OrderedCollection with:(Filename currentDirectory asAbsoluteFilename)) asValue] |
|
1722 |
! |
|
1723 |
||
1724 |
enableDirectoryUp |
|
1725 |
||
1726 |
^ self aspectFor:#enableDirectoryUp ifAbsent:[false asValue] |
|
1727 |
! |
|
1728 |
||
1729 |
enableHome |
|
1730 |
||
1731 |
^ self aspectFor:#enableHome ifAbsent:[ true asValue ]. |
|
1732 |
! |
|
1733 |
||
1734 |
enableViewNoteBookApplication |
|
1735 |
||
1736 |
^ self aspectFor:#enableViewNoteBookApplication ifAbsent:[false asValue] |
|
1737 |
! |
|
1738 |
||
1739 |
hasSelection |
|
1740 |
||
1741 |
^ self aspectFor:#hasSelection ifAbsent:[ false asValue ]. |
|
1742 |
! |
|
1743 |
||
1744 |
notifyChannel |
|
1745 |
||
1746 |
^ self aspectFor:#notifyChannel ifAbsent:['' asValue] |
|
1747 |
! ! |
|
1748 |
||
1749 |
!AbstractFileBrowser methodsFor:'aspects handling'! |
|
1750 |
||
1751 |
aspectFor:something ifAbsent:aBlock |
|
1752 |
"returns the model for an aspect |
|
1753 |
" |
|
1754 |
|holder saveAspectItem| |
|
1755 |
||
1756 |
(holder := aspects at:something ifAbsent:nil) isNil ifTrue:[ |
|
1757 |
saveAspectItem := self settingsAspectValueFor:something. |
|
1758 |
saveAspectItem isNil ifTrue:[ |
|
1759 |
saveAspectItem := self runtimeAspectValueFor:something. |
|
1760 |
]. |
|
1761 |
saveAspectItem notNil ifTrue:[ |
|
1762 |
saveAspectItem isHolder ifTrue:[ |
|
1763 |
holder := ValueHolder with:saveAspectItem value |
|
1764 |
] ifFalse:[ |
|
1765 |
holder := saveAspectItem value |
|
1766 |
]. |
|
1767 |
] ifFalse:[ |
|
1768 |
holder := aBlock value. |
|
1769 |
]. |
|
1770 |
holder notNil ifTrue:[ |
|
1771 |
aspects at:something put:holder |
|
1772 |
] |
|
1773 |
]. |
|
1774 |
^ holder |
|
1775 |
! |
|
1776 |
||
1777 |
aspects |
|
1778 |
^ aspects |
|
1779 |
! |
|
1780 |
||
1781 |
runtimeAspectValueFor:something |
|
1782 |
"returns the default aspect item from the class variable RuntimeAspects |
|
1783 |
" |
|
1784 |
^ self class runtimeAspects at:something ifAbsent:nil. |
|
1785 |
! |
|
1786 |
||
1787 |
saveRuntimeAspectValues |
|
1788 |
|savedAspects dictionary value isHolder aspect| |
|
1789 |
||
1790 |
savedAspects := self class listOfRuntimeValuesToRemark. |
|
1791 |
dictionary := Dictionary new. |
|
1792 |
savedAspects do:[ : aspectKey | |
|
1793 |
aspect := self perform:aspectKey. |
|
1794 |
isHolder := aspect isValueModel. |
|
1795 |
isHolder ifTrue:[value:= aspect value] ifFalse:[ value := aspect]. |
|
1796 |
dictionary at:aspectKey |
|
1797 |
put:(SaveAspectItem withValue:value isHolder:isHolder) |
|
1798 |
]. |
|
1799 |
||
1800 |
RuntimeAspects := dictionary. |
|
1801 |
! |
|
1802 |
||
1803 |
saveSettingsAspectValues |
|
1804 |
|savedAspects dictionary value isHolder aspect| |
|
1805 |
||
1806 |
savedAspects := self class listOfSavedSettingsAspects. |
|
1807 |
dictionary := Dictionary new. |
|
1808 |
savedAspects do:[ : aspectKey | |
|
1809 |
aspect := self perform:aspectKey. |
|
1810 |
isHolder := aspect isValueModel. |
|
1811 |
isHolder ifTrue:[value:= aspect value] ifFalse:[ value := aspect]. |
|
1812 |
dictionary at:aspectKey |
|
1813 |
put:(SaveAspectItem withValue:value isHolder:isHolder) |
|
1814 |
]. |
|
1815 |
||
1816 |
SettingsAspects := dictionary. |
|
1817 |
! |
|
1818 |
||
1819 |
settingsAspectValueFor:something |
|
1820 |
"returns the default aspect from the class variable Aspects |
|
1821 |
" |
|
1822 |
^ self class settingsAspects at:something ifAbsent:nil. |
|
1823 |
! ! |
|
1824 |
||
4011 | 1825 |
!AbstractFileBrowser methodsFor:'aspects-filter'! |
1826 |
||
4018 | 1827 |
filterBackgroundColor |
1828 |
||
1829 |
^ self aspectFor:#filterBackgroundColor ifAbsent:[Color white asValue] |
|
1830 |
! |
|
1831 |
||
4011 | 1832 |
filterBlockHolder |
1833 |
||
1834 |
^ self aspectFor:#filterBlockHolder ifAbsent:[self getFilter asValue] |
|
1835 |
! |
|
1836 |
||
1837 |
filterListModel |
|
1838 |
||
1839 |
^ self aspectFor:#filterListModel ifAbsent:[self class defaultFilterList] |
|
1840 |
! |
|
1841 |
||
1842 |
filterModel |
|
1843 |
||
1844 |
^ self aspectFor:#filterModel ifAbsent:[(self filterListModel at:1) asValue] |
|
1845 |
! |
|
1846 |
||
4018 | 1847 |
filterValueBox |
1848 |
||
1849 |
^ self aspectFor:#filterValueBox ifAbsent:[ValueHolder new] |
|
1850 |
! |
|
1851 |
||
4011 | 1852 |
getFilter |
1853 |
| filter showHidden| |
|
1854 |
||
1855 |
filter := self filterModel value. |
|
1856 |
filter = '' ifTrue:[filter := '*']. |
|
1857 |
showHidden := self showHiddenFiles value. |
|
1858 |
showHidden ifTrue:[ |
|
1859 |
^ [: el | filter match:el]. |
|
1860 |
] ifFalse:[ |
|
1861 |
^ [: el | ((el asString startsWith:'.') not) and:[filter match:el]]. |
|
1862 |
] |
|
4018 | 1863 |
! |
1864 |
||
1865 |
shownFiles |
|
1866 |
||
1867 |
^ self aspectFor:#shownFiles ifAbsent:['-/-' asValue] |
|
4011 | 1868 |
! ! |
1869 |
||
3892 | 1870 |
!AbstractFileBrowser methodsFor:'aspects-history'! |
1871 |
||
1872 |
dirHistory |
|
1873 |
||
3952 | 1874 |
^ self class directoryHistory |
3892 | 1875 |
! |
1876 |
||
1877 |
enableBack |
|
1878 |
||
1879 |
^ self aspectFor:#enableBack ifAbsent:[false asValue] |
|
1880 |
! |
|
1881 |
||
1882 |
enableFileHistory |
|
1883 |
||
1884 |
^ self aspectFor:#enableFileHistory ifAbsent:[false asValue] |
|
1885 |
! |
|
1886 |
||
1887 |
enableForward |
|
1888 |
||
1889 |
^ self aspectFor:#enableForward ifAbsent:[false asValue] |
|
1890 |
! |
|
1891 |
||
1892 |
fileHistory |
|
1893 |
||
1894 |
^ self aspectFor:#fileHistory ifAbsent:[FilenameHistory new] |
|
1895 |
! ! |
|
1896 |
||
1897 |
!AbstractFileBrowser methodsFor:'aspects-visibility'! |
|
1898 |
||
1899 |
filenameEntryFieldVisibleHolder |
|
1900 |
||
1901 |
^ self aspectFor:#filenameEntryFieldVisibleHolder ifAbsent:[true asValue] |
|
1902 |
! |
|
1903 |
||
1904 |
openMultipleApplicationsForType |
|
1905 |
||
1906 |
^ self aspectFor:#openMultipleApplicationsForType ifAbsent:[ false asValue ]. |
|
1907 |
! |
|
1908 |
||
1909 |
showDirectoryTreeHolder |
|
1910 |
||
1911 |
| | |
|
1912 |
||
1913 |
^ self aspectFor:#showDirectoryTreeHolder ifAbsent:[ true asValue ] |
|
1914 |
! |
|
1915 |
||
1916 |
showHiddenFiles |
|
1917 |
||
1918 |
^ self aspectFor:#showHiddenFiles ifAbsent:[ true asValue ]. |
|
1919 |
! |
|
1920 |
||
1921 |
toolBarVisibleHolder |
|
1922 |
||
1923 |
^ self aspectFor:#toolBarVisibleHolder ifAbsent:[true asValue] |
|
1924 |
! |
|
1925 |
||
1926 |
viewDescription |
|
1927 |
||
1928 |
^ self aspectFor:#viewDescription ifAbsent:[ false asValue ]. |
|
1929 |
! |
|
1930 |
||
1931 |
viewDetails |
|
1932 |
||
1933 |
^ self aspectFor:#viewDetails ifAbsent:[ false asValue ]. |
|
1934 |
! |
|
1935 |
||
1936 |
viewDirectoriesInDirectoryContentsBrowser |
|
1937 |
||
1938 |
^ self aspectFor:#viewDirectoriesInDirectoryContentsBrowser ifAbsent:[ false asValue ]. |
|
1939 |
! |
|
1940 |
||
1941 |
viewDirectoryDescription |
|
1942 |
||
1943 |
^ self aspectFor:#viewDirectoryDescription ifAbsent:[ true asValue ]. |
|
1944 |
! |
|
1945 |
||
1946 |
viewFilesInDirectoryTree |
|
1947 |
||
1948 |
^ self aspectFor:#viewFilesInDirectoryTree ifAbsent:[ false asValue ]. |
|
1949 |
! |
|
1950 |
||
1951 |
viewGroup |
|
1952 |
||
1953 |
^ self aspectFor:#viewGroup ifAbsent:[ false asValue ]. |
|
1954 |
! |
|
1955 |
||
1956 |
viewNoteBookApplicationHolder |
|
1957 |
||
1958 |
^ self aspectFor:#viewNoteBookApplicationHolder ifAbsent:[ false asValue]. |
|
1959 |
! |
|
1960 |
||
1961 |
viewOwner |
|
1962 |
||
1963 |
^ self aspectFor:#viewOwner ifAbsent:[ false asValue ]. |
|
1964 |
! |
|
1965 |
||
1966 |
viewPermissions |
|
1967 |
||
1968 |
^ self aspectFor:#viewPermissions ifAbsent:[ false asValue ]. |
|
1969 |
! |
|
1970 |
||
1971 |
viewPreview |
|
1972 |
||
1973 |
^ self aspectFor:#viewPreview ifAbsent:[ false asValue ]. |
|
1974 |
! |
|
1975 |
||
1976 |
viewSize |
|
1977 |
||
1978 |
^ self aspectFor:#viewSize ifAbsent:[ false asValue ]. |
|
1979 |
! |
|
1980 |
||
1981 |
viewTime |
|
1982 |
||
1983 |
^ self aspectFor:#viewTime ifAbsent:[ false asValue ]. |
|
1984 |
! |
|
1985 |
||
1986 |
viewType |
|
1987 |
||
1988 |
^ self aspectFor:#viewType ifAbsent:[ false asValue ]. |
|
1989 |
! ! |
|
1990 |
||
1991 |
!AbstractFileBrowser methodsFor:'background processing'! |
|
1992 |
||
1993 |
executeCommand:cmd |
|
1994 |
||
1995 |
self executeCommand:cmd inDirectory:nil |
|
1996 |
! |
|
1997 |
||
1998 |
executeCommand:cmd inDirectory:aDir |
|
1999 |
||
2000 |
| nameString executionBlock| |
|
2001 |
||
2002 |
executionBlock := self getExecutionBlockForCommand:cmd inDirectory:aDir. |
|
2003 |
nameString := 'Command> ', cmd. |
|
2004 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
2005 |
! |
|
2006 |
||
2007 |
getExecutionBlockForCommand:cmd |
|
2008 |
||
2009 |
^ self getExecutionBlockForCommand:cmd inDirectory:nil |
|
2010 |
! |
|
2011 |
||
2012 |
getExecutionBlockForCommand:cmd inDirectory:aDir |
|
2013 |
||
2014 |
| dir dirs| |
|
2015 |
||
2016 |
dir := aDir. |
|
2017 |
aDir isNil ifTrue:[ |
|
3982 | 2018 |
dirs := self currentSelectedDirectories. |
3892 | 2019 |
dirs size ~= 1 ifTrue:[ ^ self]. |
2020 |
dir := dirs anElement. |
|
2021 |
]. |
|
2022 |
^ [:stream| stream notNil ifTrue:[ |
|
2023 |
OperatingSystem |
|
2024 |
executeCommand:cmd |
|
2025 |
inputFrom:nil |
|
2026 |
outputTo:stream |
|
2027 |
errorTo:stream |
|
2028 |
inDirectory:dir |
|
2029 |
onError:[:status| false]. |
|
2030 |
] |
|
2031 |
]. |
|
2032 |
! |
|
2033 |
||
2034 |
killAllRunningBackgroundProcesses |
|
2035 |
||
2036 |
self backgroundProcesses do:[ : process | |
|
2037 |
self notifyChannel value:'kill ', process name. |
|
2038 |
process terminate. |
|
2039 |
]. |
|
2040 |
! |
|
2041 |
||
2042 |
makeExecutionResultProcessFor:aBlock withName:aString |
|
2043 |
| stream process appl nameString| |
|
2044 |
||
2045 |
appl := self openCommandResultApplication. |
|
2046 |
stream := appl resultStream. |
|
2047 |
nameString := aString ? 'Execution Result'. |
|
2048 |
appl changeTabTo:nameString. |
|
2049 |
process := [ [aBlock value:stream] valueNowOrOnUnwindDo:[ |
|
2050 |
self backgroundProcesses remove:process ifAbsent:[]. |
|
2051 |
appl process value:nil. |
|
2052 |
]] newProcess. |
|
2053 |
process priority:(Processor userBackgroundPriority). |
|
2054 |
process name:nameString. |
|
2055 |
self backgroundProcesses add:process. |
|
2056 |
appl process value:process. |
|
2057 |
process resume. |
|
2058 |
! ! |
|
2059 |
||
2060 |
!AbstractFileBrowser methodsFor:'change & update'! |
|
2061 |
||
4011 | 2062 |
abstractCurrentFileNameHolderChanged |
2063 |
" do here all the things that have to be done for every part of the FileBrowserV2 |
|
2064 |
and the things that have to be done if it runs standalone " |
|
2065 |
||
2066 |
| newDirectories oldDirectories size rootInTreeView holder| |
|
2067 |
||
2068 |
holder := self currentFileNameHolder value. |
|
2069 |
self hasSelection value:(holder value notEmpty). |
|
2070 |
newDirectories := self directoriesForFiles:(holder value). |
|
2071 |
oldDirectories := self currentDirectories value. |
|
2072 |
oldDirectories ~= newDirectories ifTrue:[ |
|
2073 |
self currentDirectories value:newDirectories. |
|
2074 |
size := newDirectories size. |
|
2075 |
rootInTreeView := self application:#DirectoryTreeBrowser do:#rootHolder. |
|
2076 |
rootInTreeView := rootInTreeView notNil ifTrue:[rootInTreeView value]. |
|
2077 |
self enableDirectoryUp value:(((size == 1) and:[newDirectories first isRootDirectory not]) or:[(rootInTreeView notNil and:[rootInTreeView value asFilename isRootDirectory not])]). |
|
4022 | 2078 |
newDirectories notEmpty ifTrue:[ |
2079 |
newDirectories do:[: dir | |
|
4011 | 2080 |
self dirHistory addToHistory:(dir asString). |
2081 |
]. |
|
2082 |
]. |
|
2083 |
self enableHome value:((newDirectories includes:(Filename homeDirectory))not). |
|
2084 |
]. |
|
4022 | 2085 |
self enableForward value:self canForward. |
2086 |
self enableBack value:self canBack. |
|
4011 | 2087 |
^ self |
2088 |
! |
|
2089 |
||
2090 |
filterModelChanged |
|
2091 |
||
2092 |
self filterBlockHolder value:(self getFilter). |
|
2093 |
! |
|
2094 |
||
3892 | 2095 |
update:something with:aParameter from:changedObject |
2096 |
||
2097 |
" do here all the things that have to be done for every part of the FileBrowserV2 |
|
2098 |
and the things that have to be done if it runs standalone " |
|
2099 |
||
2100 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4011 | 2101 |
self abstractCurrentFileNameHolderChanged. |
3892 | 2102 |
^ self |
2103 |
]. |
|
3989 | 2104 |
changedObject == self sortCaseless ifTrue:[ |
2105 |
self sortFileListsBy:#baseName withReverse:false. |
|
2106 |
^ self |
|
2107 |
]. |
|
2108 |
changedObject == self sortBlockProperty ifTrue:[ |
|
2109 |
self sortFileListsBy:(self sortBlockProperty value) withReverse:false. |
|
2110 |
^ self. |
|
2111 |
]. |
|
4011 | 2112 |
(changedObject == self filterModel or:[changedObject == self showHiddenFiles]) ifTrue:[ |
2113 |
self filterModelChanged. |
|
2114 |
^ self |
|
4004 | 2115 |
]. |
3989 | 2116 |
|
3892 | 2117 |
super update:something with:aParameter from:changedObject |
4004 | 2118 |
! |
2119 |
||
2120 |
updateFilterBoxColor |
|
2121 |
^ self |
|
3892 | 2122 |
! ! |
2123 |
||
2124 |
!AbstractFileBrowser methodsFor:'clipboard'! |
|
2125 |
||
2126 |
canPaste |
|
2127 |
||
2128 |
^ self aspectFor:#canPaste ifAbsent:[ false asValue ]. |
|
2129 |
! |
|
2130 |
||
2131 |
clipboard |
|
2132 |
||
2133 |
^ self aspectFor:#clipboard ifAbsent:[Clipboard new] |
|
2134 |
! |
|
2135 |
||
2136 |
copyFilesToClipBoard:colOfFiles |
|
2137 |
"defete current selected files/directories |
|
2138 |
" |
|
2139 |
self putInClipBoard:colOfFiles as:#copy. |
|
2140 |
! |
|
2141 |
||
2142 |
cutFilesToClipBoard:colOfFiles |
|
2143 |
"defete current selected files/directories |
|
2144 |
" |
|
2145 |
self putInClipBoard:colOfFiles as:#cut. |
|
2146 |
! |
|
2147 |
||
2148 |
emptyClipBoard |
|
2149 |
||
2150 |
self clipboard files:nil. |
|
2151 |
self canPaste value:false. |
|
2152 |
! |
|
2153 |
||
2154 |
putInClipBoard:colOfFiles as:aSymbol |
|
2155 |
||
2156 |
| stream clp| |
|
2157 |
||
2158 |
colOfFiles isEmpty ifTrue:[ ^ self]. |
|
2159 |
clp := self clipboard. |
|
2160 |
clp files:nil. |
|
2161 |
clp method:aSymbol. |
|
2162 |
stream := WriteStream on:''. |
|
2163 |
stream nextPutAll:aSymbol asString. |
|
2164 |
stream nextPutAll:' <'. |
|
2165 |
stream nextPutAll:colOfFiles first asString. |
|
2166 |
colOfFiles size > 1 ifTrue:[ |
|
2167 |
stream nextPutAll:' ...'. |
|
2168 |
]. |
|
2169 |
stream nextPutAll:'> to clipboard'. |
|
2170 |
||
2171 |
self notifyChannel value:stream contents. |
|
2172 |
stream close. |
|
2173 |
clp files:colOfFiles. |
|
2174 |
self canPaste value:true. |
|
2175 |
! ! |
|
2176 |
||
2177 |
!AbstractFileBrowser methodsFor:'drag & drop'! |
|
2178 |
||
2179 |
canDropArchiv:dropedObjects for:filename |
|
2180 |
||
2181 |
(filename isDirectory |
|
2182 |
and:[filename isWritable and:[dropedObjects notEmpty]]) ifTrue:[ |
|
2183 |
^ true |
|
2184 |
]. |
|
2185 |
^ false |
|
2186 |
! |
|
2187 |
||
2188 |
canDropFiles:dropedObjects for:filename |
|
2189 |
| checkObject filenameDirString checkObjectString filenameDir| |
|
2190 |
||
2191 |
dropedObjects isEmpty ifTrue:[^ false]. |
|
2192 |
filenameDir := self getDirWithoutFileName:filename. |
|
2193 |
filenameDir isWritable not ifTrue:[^ false]. |
|
2194 |
filenameDirString := filenameDir asString. |
|
2195 |
dropedObjects do:[:aObject | |
|
2196 |
checkObject := aObject theObject. |
|
2197 |
checkObjectString := checkObject asString. |
|
2198 |
checkObject isDirectory ifTrue:[ |
|
2199 |
(self fileName:filenameDirString startsWith:checkObjectString) ifTrue:[ |
|
2200 |
" can not drop a directory in his parents " |
|
2201 |
^ false |
|
2202 |
] |
|
2203 |
] ifFalse:[ |
|
2204 |
(filenameDirString = checkObject directory asString |
|
2205 |
or:[ filenameDirString = checkObject physicalPathName asFilename directory asString ]) ifTrue:[ |
|
2206 |
" can not drop a file in same directory " |
|
2207 |
^ false |
|
2208 |
] |
|
2209 |
] |
|
2210 |
]. |
|
2211 |
^ true |
|
2212 |
! |
|
2213 |
||
2214 |
doStartDrag:aDropSource in:aView |
|
2215 |
"set the cursors before starting the drag & drop operation |
|
2216 |
" |
|
2217 |
|hdl| |
|
2218 |
||
2219 |
||
2220 |
hdl := DragAndDropManager new. |
|
2221 |
||
2222 |
hdl disabledCursor:self class DisabledCursorImage. |
|
2223 |
hdl enabledCursor:self class EnabledCursorImage. |
|
2224 |
hdl alienCursor:nil. |
|
2225 |
||
2226 |
hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft |
|
2227 |
! ! |
|
2228 |
||
2229 |
!AbstractFileBrowser methodsFor:'file operations'! |
|
2230 |
||
2231 |
copyFile:aSourceFile to:aDestFile |
|
2232 |
"copy to |
|
2233 |
" |
|
2234 |
|copy| |
|
2235 |
||
2236 |
copy := FileOperation copy copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true. |
|
2237 |
copy result ifTrue:[ |
|
2238 |
self notifyChannel value:('copy ', aSourceFile baseName, ' to:,', aDestFile baseName). |
|
2239 |
] ifFalse:[ |
|
2240 |
self notifyChannel value:copy errorString. |
|
2241 |
]. |
|
2242 |
^ copy result |
|
2243 |
! |
|
2244 |
||
2245 |
copyFiles:aColOfSourceFiles to:aDirectory |
|
2246 |
"copy aColOfSourceFiles to aDirectory |
|
2247 |
" |
|
2248 |
|copy| |
|
2249 |
||
2250 |
copy := FileOperation copy copyFiles:aColOfSourceFiles to:aDirectory. |
|
2251 |
copy result ifFalse:[ |
|
2252 |
self notifyChannel value:copy errorString. |
|
2253 |
]. |
|
2254 |
self updateCurrentDirectory. |
|
2255 |
^ copy colOfCopiedFiles |
|
2256 |
! |
|
2257 |
||
2258 |
copyOrMoveDialog:aCol |
|
2259 |
||
2260 |
| size stream dialog| |
|
2261 |
||
2262 |
size := aCol size. |
|
2263 |
stream := WriteStream on:''. |
|
2264 |
stream nextPutAll:'copy or move file'. |
|
2265 |
size == 1 ifFalse:[ |
|
2266 |
stream nextPutAll:'s'. |
|
2267 |
]. |
|
2268 |
stream nextPutAll:': '. |
|
2269 |
stream nextPutAll:aCol first baseName asString. |
|
2270 |
size == 1 ifFalse:[ |
|
2271 |
stream nextPutAll:' ... '. |
|
2272 |
stream nextPutAll:aCol last baseName asString. |
|
2273 |
]. |
|
2274 |
||
2275 |
dialog := OptionBox |
|
2276 |
request:stream contents |
|
2277 |
label:'move or copy' |
|
2278 |
form:(WarningBox iconBitmap) |
|
2279 |
buttonLabels:#('cancel' 'move' 'copy') |
|
2280 |
values:#(#cancel #move #copy) |
|
2281 |
default:#copy. |
|
2282 |
dialog isNil ifTrue:[dialog := #cancel]. |
|
2283 |
^ dialog. |
|
2284 |
! |
|
2285 |
||
2286 |
copyOrMoveFiles:aColOfSourceFiles to:aDirectory |
|
2287 |
"copy aColOfSourceFiles to aDirectory |
|
2288 |
" |
|
2289 |
|dialog| |
|
2290 |
||
2291 |
dialog := self copyOrMoveDialog:aColOfSourceFiles. |
|
2292 |
dialog == #copy ifTrue:[ |
|
2293 |
self copyFiles:aColOfSourceFiles to:aDirectory. |
|
2294 |
^ self. |
|
2295 |
]. |
|
2296 |
dialog == #move ifTrue:[ |
|
2297 |
self moveFiles:aColOfSourceFiles to:aDirectory. |
|
2298 |
^ self. |
|
2299 |
]. |
|
2300 |
! |
|
2301 |
||
2302 |
deleteFile:aFile |
|
2303 |
"delete current selected files/directories |
|
2304 |
" |
|
2305 |
||
2306 |
^ self deleteFiles:(OrderedCollection with:aFile). |
|
2307 |
! |
|
2308 |
||
2309 |
deleteFiles:colOfFiles |
|
2310 |
"delete current selected files/directories |
|
2311 |
" |
|
2312 |
|delete| |
|
2313 |
||
2314 |
delete := FileOperation delete deleteFiles:colOfFiles. |
|
2315 |
delete result ifFalse:[ |
|
2316 |
self notifyChannel value:delete errorString. |
|
2317 |
]. |
|
2318 |
self updateCurrentDirectory. |
|
2319 |
^ delete result. |
|
2320 |
! |
|
2321 |
||
2322 |
moveFile:aSourceFile to:aDestFile |
|
2323 |
"defete current selected files/directories |
|
2324 |
" |
|
2325 |
||
2326 |
|move| |
|
2327 |
||
2328 |
move := FileOperation move moveFile:aSourceFile to:aDestFile. |
|
2329 |
move result ifTrue:[ |
|
2330 |
self notifyChannel value:('move ', aSourceFile asString, ' to ', aDestFile asString). |
|
2331 |
] ifFalse:[ |
|
2332 |
self notifyChannel value:move errorString. |
|
2333 |
]. |
|
2334 |
self updateCurrentDirectory. |
|
2335 |
^ move result |
|
2336 |
! |
|
2337 |
||
2338 |
moveFiles:aColOfSourceFiles to:aDirectory |
|
2339 |
"move aColOfSourceFiles to aDirectory |
|
2340 |
" |
|
2341 |
|move| |
|
2342 |
||
2343 |
move := FileOperation move moveFiles:aColOfSourceFiles to:aDirectory. |
|
2344 |
move result ifFalse:[ |
|
2345 |
self notifyChannel value:move errorString. |
|
2346 |
]. |
|
2347 |
self updateCurrentDirectory. |
|
2348 |
^ move colOfMovedFiles |
|
2349 |
! |
|
2350 |
||
2351 |
newDirectory |
|
2352 |
"ask for and create a new directory" |
|
2353 |
||
2354 |
| directories directory create newFile| |
|
2355 |
||
2356 |
directories := self currentDirectories value. |
|
2357 |
(directories size ~= 1) ifTrue:[^ self]. |
|
2358 |
directory := directories first. |
|
2359 |
create := FileOperation create createDirectoryIn:directory. |
|
2360 |
create result ifFalse:[ ^ self]. |
|
2361 |
newFile := create createdFile. |
|
2362 |
newFile notNil ifTrue:[ |
|
3982 | 2363 |
self updateCurrentDirectory. |
3892 | 2364 |
] |
2365 |
! |
|
2366 |
||
2367 |
newFile |
|
2368 |
"ask for and create a new file" |
|
2369 |
||
2370 |
| curFile directories directory create file| |
|
2371 |
||
2372 |
directories := self currentDirectories value. |
|
2373 |
(directories size ~= 1) ifTrue:[^ self]. |
|
2374 |
directory := directories first. |
|
3982 | 2375 |
curFile := self firstSelectedFile. |
3892 | 2376 |
curFile notNil ifTrue:[ |
2377 |
file := curFile. |
|
2378 |
] ifFalse:[ |
|
2379 |
file := directory. |
|
2380 |
]. |
|
2381 |
create := FileOperation create createFileIn:file. |
|
2382 |
create result ifFalse:[ ^ self]. |
|
2383 |
self updateAndSelect:(OrderedCollection with:(create createdFile)). |
|
2384 |
! |
|
2385 |
||
2386 |
newHardLink |
|
2387 |
"ask for and create a hard link (unix only)" |
|
2388 |
||
2389 |
self newLink:false. |
|
2390 |
! |
|
2391 |
||
2392 |
newLink:symbolic |
|
2393 |
||
2394 |
"ask for and create a symbolic if symbolic is true otherwise a hard link (unix only)" |
|
2395 |
||
2396 |
| sel create createdFile| |
|
2397 |
||
2398 |
sel := self currentFileNameHolder value. |
|
2399 |
(sel size ~= 1) ifTrue:[^ self]. |
|
2400 |
symbolic ifTrue:[ |
|
2401 |
create := FileOperation create createSoftLinkIn:(sel first). |
|
2402 |
] ifFalse:[ |
|
2403 |
create := FileOperation create createHardLinkIn:(sel first). |
|
2404 |
]. |
|
2405 |
create result ifFalse:[ ^ self]. |
|
2406 |
createdFile := create createdFile. |
|
2407 |
createdFile notNil ifTrue:[ |
|
2408 |
self updateAndSelect:(OrderedCollection with:createdFile). |
|
2409 |
]. |
|
2410 |
! |
|
2411 |
||
2412 |
newSoftLink |
|
2413 |
"ask for and create a soft link (unix only)" |
|
2414 |
||
2415 |
self newLink:true. |
|
2416 |
! |
|
2417 |
||
2418 |
pasteFiles |
|
2419 |
"defete current selected files/directories |
|
2420 |
" |
|
2421 |
| buffer destination files directories copiedFiles| |
|
2422 |
||
2423 |
files := self clipboard files. |
|
2424 |
(files isNil or:[files isEmpty]) ifTrue:[ ^ self ]. |
|
2425 |
buffer := self clipboard copy. |
|
3982 | 2426 |
directories := self currentSelectedDirectories. |
3892 | 2427 |
directories isEmpty ifTrue:[ |
2428 |
|box dirStringCol| |
|
2429 |
dirStringCol := directories collect:[:aDir| aDir asString]. |
|
2430 |
box := ListSelectionBox new. |
|
2431 |
box title:'In which directory you want to paste ?'. |
|
2432 |
box list:dirStringCol. |
|
2433 |
box okAction:[:sel | destination := sel asFilename]. |
|
2434 |
box showAtPointer |
|
2435 |
] ifFalse:[ |
|
2436 |
destination := directories first. |
|
2437 |
]. |
|
2438 |
copiedFiles := self copyFiles:(buffer files) to:destination. |
|
2439 |
||
2440 |
(self clipboard method == #cut) ifTrue:[ |
|
2441 |
self deleteFiles:copiedFiles. |
|
2442 |
] |
|
2443 |
! |
|
2444 |
||
2445 |
renameFile:aFile |
|
2446 |
"rename the selected file(s)" |
|
2447 |
||
2448 |
^ self renameFiles:(OrderedCollection with:aFile). |
|
2449 |
! |
|
2450 |
||
2451 |
renameFile:filename to:newFileString update:aBoolean |
|
2452 |
"rename filename to newFileString" |
|
2453 |
||
2454 |
|rename| |
|
2455 |
||
2456 |
rename := FileOperation rename renameFile:filename to:newFileString. |
|
2457 |
rename result ifTrue:[ |
|
2458 |
aBoolean ifTrue:[ |
|
2459 |
self updateAndSelect:(rename renamedFiles). |
|
2460 |
]. |
|
2461 |
] ifFalse:[ |
|
2462 |
self notifyChannel value:rename errorString. |
|
2463 |
]. |
|
2464 |
^ rename result |
|
2465 |
! |
|
2466 |
||
2467 |
renameFiles:aColOfFiles |
|
2468 |
"rename the selected file(s)" |
|
2469 |
||
2470 |
|rename| |
|
2471 |
||
2472 |
rename := FileOperation rename renameFiles:aColOfFiles. |
|
2473 |
rename result ifFalse:[ |
|
2474 |
self notifyChannel value:rename errorString |
|
2475 |
] ifTrue:[ |
|
2476 |
self updateAndSelect:(rename renamedFiles) |
|
2477 |
]. |
|
2478 |
^ rename result |
|
2479 |
! |
|
2480 |
||
2481 |
renameSelection |
|
2482 |
"rename the selected file(s)" |
|
2483 |
||
2484 |
|rename| |
|
2485 |
||
2486 |
rename := FileOperation rename renameFiles:self currentFileNameHolder value. |
|
2487 |
rename result ifFalse:[ |
|
2488 |
self notifyChannel value:rename errorString |
|
2489 |
] ifTrue:[ |
|
2490 |
self updateAndSelect:(rename renamedFiles) |
|
2491 |
]. |
|
2492 |
^ rename result |
|
2493 |
! ! |
|
2494 |
||
2495 |
!AbstractFileBrowser methodsFor:'font encoding'! |
|
2496 |
||
2497 |
fileEncoding |
|
2498 |
"open a dialog to allow change of the files character encoding. |
|
2499 |
Files are converted to internal encoding when read, and converted back |
|
2500 |
to this encoding when saved. |
|
2501 |
The default encoding is nil, which means that files are already in |
|
2502 |
the internal encoding (which is iso8859). |
|
2503 |
Notice: currently, not too many encodings are supported by the system." |
|
2504 |
||
2505 |
|dialog list descr encodings encodingNames idx| |
|
2506 |
||
2507 |
list := SelectionInList new. |
|
2508 |
||
2509 |
descr := CharacterArray supportedExternalEncodings. |
|
2510 |
encodings := descr at:2. |
|
2511 |
encodingNames := descr at:1. |
|
2512 |
||
2513 |
list list:encodingNames. |
|
2514 |
list selectionIndex:(encodings indexOf:(self fileEncodingHolder value) ifAbsent:1). |
|
2515 |
dialog := Dialog new. |
|
2516 |
||
2517 |
dialog addTextLabel:('Specify the files encoding.\\The default (a 1-to-1 encoding) works for 7bit ascii\and iso8859 (= ANSI) encoded text files.\') withCRs. |
|
2518 |
dialog addVerticalSpace. |
|
2519 |
dialog addListBoxOn:list withNumberOfLines:5. |
|
2520 |
||
2521 |
dialog addAbortAndOkButtons. |
|
2522 |
dialog open. |
|
2523 |
||
2524 |
dialog accepted ifTrue:[ |
|
2525 |
idx := list selectionIndex. |
|
2526 |
self fileEncodingHolder value:(encodings at:idx). |
|
2527 |
"/ subView externalEncoding:fileEncoding. |
|
2528 |
||
2529 |
self validateFontEncodingFor:(encodings at:idx) ask:true. |
|
2530 |
]. |
|
2531 |
! |
|
2532 |
||
2533 |
fileEncodingHolder |
|
2534 |
"return/create the 'fileEncodingModel' value holder (automatically generated)" |
|
2535 |
||
2536 |
^ self aspectFor:#fileEncodingHolder ifAbsent:[ValueHolder new] |
|
2537 |
! |
|
2538 |
||
2539 |
preferredFontEncodingFor:fileEncoding |
|
2540 |
"given a file encoding, return corresponding preferred fontEncoding |
|
2541 |
match pattern" |
|
2542 |
||
2543 |
|fe| |
|
2544 |
||
2545 |
fe := MIMETypes fontForCharset:fileEncoding. |
|
2546 |
fe notNil ifTrue:[^ fe]. |
|
2547 |
^ 'iso8859*' |
|
2548 |
! |
|
2549 |
||
2550 |
validateFontEncodingFor:newEncoding ask:ask |
|
2551 |
"if required, query user if he/she wants to change to another font, |
|
2552 |
which is able to display text encoded as specified by newEncoding" |
|
2553 |
||
2554 |
|fontsEncoding msg filter f defaultFont pref| |
|
2555 |
||
2556 |
"/ PENK fontsEncoding := subView font encoding. |
|
2557 |
||
2558 |
pref := self preferredFontEncodingFor:newEncoding. |
|
2559 |
||
2560 |
(pref match:fontsEncoding) ifTrue:[ |
|
2561 |
^ self |
|
2562 |
]. |
|
2563 |
"/ stupid ... |
|
2564 |
pref = 'ascii*' ifTrue:[ |
|
2565 |
(fontsEncoding match:'iso8859*') ifTrue:[ |
|
2566 |
^ self |
|
2567 |
] |
|
2568 |
]. |
|
2569 |
||
2570 |
filter := [:f | |coding| |
|
2571 |
(coding := f encoding) notNil |
|
2572 |
and:[pref match:coding]]. |
|
2573 |
||
2574 |
defaultFont := TextView defaultFont onDevice:device. |
|
2575 |
(pref match:(defaultFont encoding)) ifFalse:[ |
|
2576 |
defaultFont := nil. |
|
2577 |
]. |
|
2578 |
||
2579 |
defaultFont isNil ifTrue:[ |
|
2580 |
(pref = 'ascii*' |
|
2581 |
or:[pref = 'iso8859*']) ifTrue:[ |
|
2582 |
defaultFont := FontDescription family:'courier' face:'medium' style:'roman' size:12 |
|
2583 |
] |
|
2584 |
]. |
|
2585 |
||
2586 |
defaultFont isNil ifTrue:[ |
|
2587 |
defaultFont := device |
|
2588 |
listOfAvailableFonts |
|
2589 |
detect:[:f | filter value:f] |
|
2590 |
ifNone:nil. |
|
2591 |
defaultFont isNil ifTrue:[ |
|
2592 |
||
2593 |
"/ flush list, and refetch font list |
|
2594 |
"/ (in case someone just changed the font path ...) |
|
2595 |
||
2596 |
device flushListOfAvailableFonts. |
|
2597 |
defaultFont := device |
|
2598 |
listOfAvailableFonts |
|
2599 |
detect:[:f | filter value:f] |
|
2600 |
ifNone:nil. |
|
2601 |
]. |
|
2602 |
||
2603 |
defaultFont isNil ifTrue:[ |
|
2604 |
Dialog warn:'your display does not seem to provide any ' , newEncoding , '-encoded font.'. |
|
2605 |
^ self. |
|
2606 |
] |
|
2607 |
]. |
|
2608 |
||
2609 |
msg := 'switch to a %1 encoded font ?'. |
|
2610 |
(ask not or:[self confirm:(resources string:msg with:pref) withCRs]) |
|
2611 |
ifTrue:[ |
|
2612 |
self withWaitCursorDo:[ |
|
2613 |
f := FontPanel |
|
2614 |
fontFromUserInitial:defaultFont |
|
2615 |
title:(resources string:'font selection') |
|
2616 |
filter:filter. |
|
2617 |
f notNil ifTrue:[ |
|
2618 |
"/ PENK subView font:f |
|
2619 |
] |
|
2620 |
] |
|
2621 |
] |
|
2622 |
! ! |
|
2623 |
||
2624 |
!AbstractFileBrowser methodsFor:'menu'! |
|
2625 |
||
3952 | 2626 |
bookmarksMenuSpec |
2627 |
"This resource specification was automatically generated |
|
2628 |
by the MenuEditor of ST/X." |
|
2629 |
||
2630 |
"Do not manually edit this!! If it is corrupted, |
|
2631 |
the MenuEditor may not be able to read the specification." |
|
2632 |
||
2633 |
" |
|
2634 |
MenuEditor new openOnClass:FileBrowser andSelector:#bookmarksMenuSpec |
|
2635 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser bookmarksMenuSpec)) startUp |
|
2636 |
" |
|
2637 |
<resource: #programMenu> |
|
2638 |
||
2639 |
|menu bookmarks| |
|
2640 |
||
2641 |
menu := self class baseBookmarksMenuSpec. |
|
2642 |
menu := menu decodeAsLiteralArray. |
|
2643 |
menu receiver:self. |
|
2644 |
bookmarks := self class directoryBookmarks. |
|
2645 |
"/ add the history items ... |
|
2646 |
||
2647 |
bookmarks size > 0 ifTrue:[ |
|
2648 |
menu addItem:(MenuItem labeled:'-'). |
|
2649 |
bookmarks do:[:dirName | |
|
2650 |
menu addItem:((MenuItem label:dirName asString value:[ |
|
2651 |
(self currentDirectories value includes:dirName) ifFalse:[ |
|
2652 |
self currentFileNameHolder value:(OrderedCollection with:dirName). |
|
2653 |
]. |
|
2654 |
])). |
|
2655 |
]. |
|
2656 |
]. |
|
2657 |
^ menu |
|
2658 |
||
2659 |
"Modified: / 17.8.1998 / 10:13:05 / cg" |
|
2660 |
! |
|
2661 |
||
3906 | 2662 |
canBack |
2663 |
||
4024 | 2664 |
|
2665 |
^ self dirHistory canBack. |
|
3906 | 2666 |
! |
2667 |
||
2668 |
canForward |
|
2669 |
||
3964 | 2670 |
"/ | currentSelection | |
2671 |
"/ |
|
2672 |
"/ currentSelection := self currentDirectories value. |
|
2673 |
"/ currentSelection size ~~ 1 ifTrue:[ ^ false]. |
|
2674 |
||
3906 | 2675 |
^ self dirHistory canForward. |
2676 |
! |
|
2677 |
||
3892 | 2678 |
menuDirHistory:backOrForward |
2679 |
"initialize the directory menu |
|
2680 |
" |
|
2681 |
<resource: #programMenu > |
|
2682 |
||
3964 | 2683 |
|menu pathList currentSel currentPath| |
3892 | 2684 |
|
2685 |
menu := Menu new. |
|
2686 |
menu receiver:self. |
|
2687 |
||
2688 |
self dirHistory isEmpty ifTrue:[^ nil]. |
|
2689 |
backOrForward == #back ifTrue:[ |
|
3964 | 2690 |
currentSel := self currentDirectories value. |
2691 |
currentSel size == 1 ifTrue:[ |
|
2692 |
currentPath := currentSel first asString. |
|
2693 |
] ifFalse:[ |
|
2694 |
currentPath := nil. |
|
3892 | 2695 |
]. |
3964 | 2696 |
pathList := self dirHistory getBackCollectionFrom:currentPath. |
3892 | 2697 |
] ifFalse:[ |
3964 | 2698 |
pathList := self dirHistory getForwardCollection. |
3892 | 2699 |
]. |
4022 | 2700 |
pathList isEmpty ifTrue:[ ^ nil]. |
3964 | 2701 |
pathList do:[:aPath| |
2702 |
| menuItem | |
|
2703 |
menuItem := MenuItem new. |
|
2704 |
menuItem label:aPath. |
|
2705 |
menuItem value:[ |
|
2706 |
self currentFileNameHolder value:(OrderedCollection with:(aPath asFilename)). |
|
2707 |
]. |
|
2708 |
menu addItem:menuItem. |
|
3952 | 2709 |
]. |
3892 | 2710 |
^ menu |
2711 |
! |
|
2712 |
||
2713 |
menuDirHistoryBack |
|
2714 |
"initialize the directory menu |
|
2715 |
" |
|
2716 |
<resource: #programMenu > |
|
2717 |
||
2718 |
^ self menuDirHistory:#back. |
|
2719 |
! |
|
2720 |
||
2721 |
menuDirHistoryForward |
|
2722 |
"initialize the directory menu |
|
2723 |
" |
|
2724 |
<resource: #programMenu > |
|
2725 |
||
2726 |
^ self menuDirHistory:#forward. |
|
3906 | 2727 |
! |
2728 |
||
2729 |
menuFileHistory |
|
2730 |
"initialize the file history menu |
|
2731 |
" |
|
2732 |
<resource: #programMenu > |
|
2733 |
||
2734 |
|menu hist text removeItem removeCol| |
|
2735 |
||
2736 |
menu := Menu new. |
|
2737 |
menu receiver:self. |
|
2738 |
||
2739 |
hist := self fileHistory. |
|
2740 |
hist isEmpty ifTrue:[^ nil]. |
|
2741 |
text := LabelAndIcon icon:(self class clearHistoryIcon) string:'Clear File History'. |
|
2742 |
removeCol := OrderedCollection new. |
|
2743 |
hist do:[:aFileItem| |
|
2744 |
aFileItem fileName exists ifTrue:[ |
|
2745 |
menu addItem:(MenuItem label: aFileItem fileName asString value:[ |
|
2746 |
self currentFileNameHolder value:(OrderedCollection with:(aFileItem fileName)). |
|
2747 |
self openApplByFileItem:aFileItem |
|
2748 |
]). |
|
2749 |
] ifFalse:[ |
|
2750 |
removeCol add:aFileItem. |
|
2751 |
] |
|
2752 |
]. |
|
2753 |
"/ remove all not existing history entries |
|
2754 |
removeCol do:[ : el | |
|
2755 |
hist remove:el. |
|
2756 |
]. |
|
2757 |
removeItem := MenuItem label:text value:[ |
|
2758 |
self fileHistory removeAll. |
|
2759 |
self enableFileHistory value:false. |
|
2760 |
]. |
|
2761 |
menu addItem:(MenuItem label:'-'). |
|
2762 |
menu addItem:removeItem. |
|
2763 |
^ menu |
|
3952 | 2764 |
! |
2765 |
||
2766 |
visitedDirectoriesMenu |
|
2767 |
||
2768 |
<resource: #programMenu > |
|
2769 |
||
2770 |
|menu histCopy text removeItem| |
|
2771 |
||
2772 |
menu := Menu new. |
|
2773 |
menu receiver:self. |
|
2774 |
||
2775 |
self dirHistory isEmpty ifTrue:[^ nil]. |
|
4040 | 2776 |
text := LabelAndIcon icon:(self class clearHistoryIcon) string:(resources string:'Clear History'). |
3952 | 2777 |
removeItem := MenuItem new. |
4040 | 2778 |
removeItem translateLabel:true. |
3952 | 2779 |
removeItem label:text. |
2780 |
removeItem value:[ |
|
2781 |
self dirHistory removeAll. |
|
3964 | 2782 |
self enableForward value:self canForward. |
2783 |
self enableBack value:self canBack. |
|
3952 | 2784 |
]. |
2785 |
histCopy := self dirHistory. |
|
2786 |
histCopy do:[:aFile| |
|
2787 |
menu addItem:(MenuItem label:aFile asString value:[ |
|
3958 | 2788 |
self currentFileNameHolder value:(OrderedCollection with:(aFile path asFilename)). |
3952 | 2789 |
]). |
2790 |
]. |
|
2791 |
menu addItem:(MenuItem label:'-'). |
|
2792 |
menu addItem:removeItem. |
|
2793 |
^ menu |
|
3892 | 2794 |
! ! |
2795 |
||
2796 |
!AbstractFileBrowser methodsFor:'menu access'! |
|
2797 |
||
3906 | 2798 |
viewInContentsBrowserMenu |
3892 | 2799 |
|
3961 | 2800 |
^ self application:#DirectoryContentsBrowser do:#viewBrowserMenu |
3892 | 2801 |
! ! |
2802 |
||
3906 | 2803 |
!AbstractFileBrowser methodsFor:'menu accessing'! |
2804 |
||
2805 |
sortMenu |
|
2806 |
||
2807 |
<resource: #programMenu > |
|
2808 |
||
2809 |
|menu| |
|
2810 |
||
2811 |
menu := Menu new fromLiteralArrayEncoding:self class sortMenu. |
|
2812 |
menu ifNil:[ ^ nil ]. |
|
2813 |
menu receiver:self. |
|
2814 |
^ menu |
|
4018 | 2815 |
! |
2816 |
||
2817 |
viewDetailsMenuSpec |
|
2818 |
^self class viewDetailsMenuSpec |
|
3906 | 2819 |
! ! |
2820 |
||
3892 | 2821 |
!AbstractFileBrowser methodsFor:'menu actions cvs'! |
2822 |
||
2823 |
cvsAddAndCommit |
|
2824 |
||
4046
2f096def132b
commit in after add checks now only the added files in not all
penk
parents:
4040
diff
changeset
|
2825 |
|sel log cmd dir executionBlock nameString block| |
3892 | 2826 |
|
2827 |
log := Dialog |
|
2828 |
requestText:(resources string:'enter initial log message') |
|
2829 |
lines:10 |
|
2830 |
columns:70 |
|
2831 |
initialAnswer:nil. |
|
2832 |
||
3982 | 2833 |
sel := self currentSelectedFiles. |
3892 | 2834 |
executionBlock := [ : stream | |
2835 |
log notNil ifTrue:[ |
|
2836 |
sel size > 0 ifTrue:[ |
|
2837 |
sel do:[:fn | |
|
2838 |
dir := self getDirWithoutFileName:fn. |
|
2839 |
cmd := ('cvs add -m ''' , log , ''' ' , fn baseName). |
|
2840 |
block := self getExecutionBlockForCommand:cmd inDirectory:dir. |
|
2841 |
block value:stream. |
|
4046
2f096def132b
commit in after add checks now only the added files in not all
penk
parents:
4040
diff
changeset
|
2842 |
cmd := ('cvs commit -l -m ''' , log , ''' ' , fn baseName). |
3892 | 2843 |
block := self getExecutionBlockForCommand:cmd inDirectory:dir. |
2844 |
block value:stream. |
|
2845 |
] |
|
4046
2f096def132b
commit in after add checks now only the added files in not all
penk
parents:
4040
diff
changeset
|
2846 |
] |
3892 | 2847 |
] |
2848 |
]. |
|
2849 |
nameString := 'Command> add and commit'. |
|
2850 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
2851 |
! |
|
2852 |
||
2853 |
cvsCommit |
|
2854 |
||
2855 |
|nSel log msg cmd selectedFiles| |
|
2856 |
||
3982 | 2857 |
selectedFiles:= self currentSelectedFiles. |
3892 | 2858 |
nSel := selectedFiles size. |
2859 |
||
2860 |
nSel == 1 ifTrue:[ |
|
2861 |
msg := resources string:'enter log message for checkIn of ''%1''' with:(selectedFiles first baseName) |
|
2862 |
] ifFalse:[ |
|
2863 |
nSel > 1 ifTrue:[ |
|
2864 |
msg := resources string:'enter log message for %1 files to checkIn' with:nSel printString |
|
2865 |
] ifFalse:[ |
|
2866 |
msg := resources string:'enter log message for checkIn' |
|
2867 |
] |
|
2868 |
]. |
|
2869 |
||
2870 |
log := Dialog |
|
2871 |
requestText:msg |
|
2872 |
lines:10 |
|
2873 |
columns:70 |
|
2874 |
initialAnswer:nil. |
|
2875 |
||
2876 |
log notNil ifTrue:[ |
|
2877 |
nSel > 0 ifTrue:[ |
|
2878 |
selectedFiles do:[:fn | |
|
2879 |
cmd := ('cvs commit -m ''' , log , ''' ' , fn baseName). |
|
2880 |
self executeCommand:cmd. |
|
2881 |
] |
|
2882 |
] ifFalse:[ |
|
2883 |
cmd := ('cvs commit -l -m ''' , log , ''''). |
|
2884 |
self executeCommand:cmd. |
|
2885 |
]. |
|
2886 |
] |
|
2887 |
! |
|
2888 |
||
2889 |
cvsRemoveAndRemoveFromCVS:filesToRemove |
|
2890 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
2891 |
||
2892 |
|msg toRemove updateRunning cmd executionBlock nameString| |
|
2893 |
||
2894 |
updateRunning := self backgroundProcesses value notEmpty. |
|
2895 |
self killAllRunningBackgroundProcesses. |
|
2896 |
toRemove := OrderedCollection new. |
|
2897 |
||
2898 |
executionBlock := [ : stream | |
|
2899 |
| block | |
|
2900 |
filesToRemove do:[:fileName | |
|
2901 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
2902 |
"was not able to remove it" |
|
2903 |
| lastError | |
|
2904 |
lastError := OperatingSystem lastErrorString. |
|
2905 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
2906 |
lastError isNil ifFalse:[ |
|
2907 |
msg := msg , '\\(' , lastError , ')' |
|
2908 |
]. |
|
2909 |
Dialog warn:msg withCRs |
|
2910 |
] do:[ |
|
2911 |
|answer contents| |
|
2912 |
||
2913 |
(fileName isSymbolicLink not) ifTrue:[ |
|
2914 |
fileName remove. |
|
2915 |
cmd := ('cvs remove -f ' , fileName baseName). |
|
2916 |
block := self getExecutionBlockForCommand:cmd. |
|
2917 |
block value:stream. |
|
2918 |
] |
|
2919 |
]. |
|
2920 |
]. |
|
2921 |
||
2922 |
cmd := ('cvs commit -m ''removed via FileBrowser'''). |
|
2923 |
block := self getExecutionBlockForCommand:cmd. |
|
2924 |
block value:stream. |
|
2925 |
]. |
|
2926 |
nameString := 'Command> remove and commit ', filesToRemove first baseName. |
|
2927 |
filesToRemove size > 1 ifTrue:[ |
|
2928 |
nameString := nameString, ' ...'. |
|
2929 |
]. |
|
2930 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
2931 |
! |
|
2932 |
||
2933 |
cvsRemoveFileAndCVSContainer |
|
2934 |
||
2935 |
|sel question aswer| |
|
2936 |
||
3982 | 2937 |
sel := self currentSelectedFiles. |
3892 | 2938 |
|
2939 |
sel size > 0 ifTrue:[ |
|
2940 |
sel size > 1 ifTrue:[ |
|
2941 |
question := resources string:'Remove %1 selected files and their CVS containers ?' with:(sel size) |
|
2942 |
] ifFalse:[ |
|
2943 |
question := resources string:'Remove ''%1'' and its CVS container ?' with:(sel first baseName allBold) |
|
2944 |
]. |
|
2945 |
||
2946 |
aswer := Dialog |
|
2947 |
confirm:question withCRs |
|
2948 |
yesLabel:(resources at:'Remove') |
|
2949 |
noLabel:(resources at:'Cancel'). |
|
2950 |
aswer ifTrue:[ |
|
2951 |
self withCursor:(Cursor wait) do:[ |
|
2952 |
self cvsRemoveAndRemoveFromCVS:sel |
|
2953 |
] |
|
2954 |
] |
|
2955 |
] |
|
2956 |
! |
|
2957 |
||
2958 |
cvsUpdateAll |
|
2959 |
||
2960 |
| cmd | |
|
2961 |
||
2962 |
cmd := 'cvs upd -l'. |
|
2963 |
self executeCommand:cmd. |
|
2964 |
! |
|
2965 |
||
2966 |
cvsUpdateAllRecursive |
|
2967 |
||
2968 |
| cmd | |
|
2969 |
||
2970 |
cmd := 'cvs upd -d'. |
|
2971 |
self executeCommand:cmd. |
|
2972 |
! |
|
2973 |
||
2974 |
cvsUpdateSelection |
|
2975 |
||
2976 |
| selectedFiles stream| |
|
2977 |
||
2978 |
||
3982 | 2979 |
selectedFiles:= self currentSelectedFiles. |
3892 | 2980 |
stream := WriteStream on:''. |
2981 |
stream nextPutAll:'cvs upd '. |
|
2982 |
selectedFiles do:[: file | |
|
2983 |
stream nextPutAll:file baseName. |
|
2984 |
stream space. |
|
2985 |
]. |
|
2986 |
self executeCommand:stream contents. |
|
2987 |
stream close. |
|
2988 |
! ! |
|
2989 |
||
2990 |
!AbstractFileBrowser methodsFor:'menu actions edit'! |
|
2991 |
||
2992 |
copyInDirContentsBrowser |
|
2993 |
||
2994 |
^ self application:#DirectoryContentsBrowser do:#doCopy. |
|
2995 |
! |
|
2996 |
||
2997 |
cutInDirContentsBrowser |
|
2998 |
||
2999 |
^ self application:#DirectoryContentsBrowser do:#doCut. |
|
3000 |
! |
|
3001 |
||
3002 |
deleteInDirContentsBrowser |
|
3003 |
||
3004 |
^ self application:#DirectoryContentsBrowser do:#doDelete. |
|
3005 |
! ! |
|
3006 |
||
3007 |
!AbstractFileBrowser methodsFor:'menu actions tools'! |
|
3008 |
||
3009 |
createProjectAndOpenProjectBrowser |
|
3010 |
|nm f s directory| |
|
3011 |
||
3012 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
3013 |
directory := self currentDirectories value first. |
|
3014 |
nm := directory baseName. |
|
3015 |
f := (directory construct:nm) withSuffix:'prj'. |
|
3016 |
f exists ifTrue:[ |
|
3017 |
Dialog warn:'A file named ' , f baseName , ' already exists.'. |
|
3018 |
^ self. |
|
3019 |
]. |
|
3020 |
s := f writeStream. |
|
3021 |
s nextPutAll:' |
|
3022 |
name ''' , nm , ''' |
|
3023 |
type #classLibrary |
|
3024 |
package #''private:' , nm , ''' |
|
3025 |
prerequisites nil |
|
3026 |
||
3027 |
classes #( ) |
|
3028 |
'. |
|
3029 |
s close. |
|
3030 |
ProjectBrowser openOnFile:f. |
|
3031 |
! |
|
3032 |
||
3033 |
fileFileIn |
|
3034 |
"fileIn the selected file(s)" |
|
3035 |
||
3036 |
self fileFileInLazy:false |
|
3037 |
! |
|
3038 |
||
3039 |
fileFileInLazy |
|
3040 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
3041 |
||
3042 |
self fileFileInLazy:true |
|
3043 |
! |
|
3044 |
||
3045 |
fileFileInLazy:lazy |
|
3046 |
"fileIn the selected file(s)" |
|
3047 |
||
3048 |
| selectedFiles| |
|
3049 |
||
3982 | 3050 |
selectedFiles:= self currentSelectedFiles. |
3892 | 3051 |
selectedFiles do:[:fileName | |
3052 |
self singleFileFileIn:fileName lazy:lazy |
|
3053 |
]. |
|
3054 |
! |
|
3055 |
||
3056 |
fileFileInToNameSpace |
|
3057 |
"fileIn the selected file(s)<into a nameSpace" |
|
3058 |
||
3059 |
|ns listOfKnownNameSpaces| |
|
3060 |
||
3061 |
listOfKnownNameSpaces := Set new. |
|
3062 |
NameSpace |
|
3063 |
allNamespaces |
|
3064 |
do:[:eachNameSpace | |
|
3065 |
listOfKnownNameSpaces add:eachNameSpace name |
|
3066 |
]. |
|
3067 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
|
3068 |
||
3069 |
ns := Dialog |
|
3070 |
request:'During fileIn, new classes are created in nameSpace:' |
|
3071 |
initialAnswer:(LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
|
3072 |
list:listOfKnownNameSpaces. |
|
3073 |
ns isEmptyOrNil ifTrue:[^ self]. |
|
3074 |
||
3075 |
LastEnforcedNameSpace := ns. |
|
3076 |
ns := NameSpace name:ns. |
|
3077 |
||
3078 |
Class nameSpaceQuerySignal |
|
3079 |
answer:ns |
|
3080 |
do:[ self fileFileInLazy:false ] |
|
3081 |
! |
|
3082 |
||
3083 |
fileFindAllDuplicates |
|
3084 |
"scan directory and all subdirs for duplicate files" |
|
3085 |
||
3086 |
|fileNames dir infoDir filesBySize |
|
3087 |
result info dirPrefix myName stream textBox maxLength directories| |
|
3088 |
||
3089 |
||
3090 |
self withWaitCursorDo:[ |
|
3091 |
result := Dictionary new. |
|
3092 |
myName := self class name asString. |
|
3982 | 3093 |
directories := self currentSelectedDirectories. |
3892 | 3094 |
directories isEmpty ifTrue:[^ self]. |
3095 |
||
3096 |
dir := directories first. |
|
3097 |
"/ self label: myName, '- gathering file names ...'. |
|
3098 |
fileNames := dir recursiveDirectoryContents. |
|
3099 |
fileNames := fileNames collect:[:fn | dir construct:fn]. |
|
3100 |
fileNames := fileNames select:[:fn | fn isDirectory not]. |
|
3101 |
||
3102 |
"/ self label:myName , '- gathering sizes ...'. |
|
3103 |
infoDir := Dictionary new. |
|
3104 |
fileNames do:[:fn | |
|
3105 |
infoDir at:fn put:(fn fileSize) |
|
3106 |
]. |
|
3107 |
||
3108 |
"/ for each, get the files size. |
|
3109 |
"/ in a first pass, look for files of the same size and |
|
3110 |
"/ compare them ... |
|
3111 |
||
3112 |
"/ self label:myName , '- preselect possible duplicates ...'. |
|
3113 |
filesBySize := Dictionary new. |
|
3114 |
infoDir keysAndValuesDo:[:fn :sz | |
|
3115 |
|entry| |
|
3116 |
||
3117 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
3118 |
entry add:fn. |
|
3119 |
]. |
|
3120 |
||
3121 |
"/ any of same size ? |
|
3122 |
||
3123 |
"/ self label:myName , '- checking for duplicates ...'. |
|
3124 |
filesBySize do:[:entry | |
|
3125 |
|files| |
|
3126 |
||
3127 |
entry size > 1 ifTrue:[ |
|
3128 |
files := entry asArray. |
|
3129 |
1 to:files size-1 do:[:idx1 | |
|
3130 |
idx1+1 to:files size do:[:idx2 | |
|
3131 |
|fn1 fn2| |
|
3132 |
||
3133 |
fn1 := files at:idx1. |
|
3134 |
fn2 := files at:idx2. |
|
3135 |
||
3136 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
3137 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
|
3138 |
"/ compare the files |
|
3139 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3140 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
|
3141 |
result at:fn1 put:fn2. |
|
3142 |
] |
|
3143 |
] |
|
3144 |
] |
|
3145 |
] |
|
3146 |
] |
|
3147 |
]. |
|
3148 |
||
3149 |
"/ self label:myName , '- sorting ...'. |
|
3150 |
dirPrefix := dir pathName. |
|
3151 |
result := result associations. |
|
3152 |
result := result collect:[:assoc | |
|
3153 |
|f1 f2| |
|
3154 |
||
3155 |
f1 := assoc key name. |
|
3156 |
f2 := assoc value name. |
|
3157 |
(f1 startsWith:dirPrefix) ifTrue:[ |
|
3158 |
f1 := f1 copyFrom:dirPrefix size + 2. |
|
3159 |
]. |
|
3160 |
(f2 startsWith:dirPrefix) ifTrue:[ |
|
3161 |
f2 := f2 copyFrom:dirPrefix size + 2. |
|
3162 |
]. |
|
3163 |
f1 < f2 ifTrue:[ |
|
3164 |
f2 -> f1 |
|
3165 |
] ifFalse:[ |
|
3166 |
f1 -> f2 |
|
3167 |
] |
|
3168 |
]. |
|
3169 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
3170 |
||
3171 |
info := OrderedCollection new. |
|
3172 |
result do:[:assoc | |
|
3173 |
info add:(assoc key , ' same as ' , assoc value) |
|
3174 |
]. |
|
3175 |
info isEmpty ifTrue:[ |
|
3176 |
info := 'No duplicate files found.' |
|
3177 |
]. |
|
3178 |
]. |
|
3179 |
||
3180 |
stream := WriteStream on:''. |
|
3181 |
info do:[:el| |
|
3182 |
stream nextPutAll:el. |
|
3183 |
stream cr. |
|
3184 |
]. |
|
3185 |
textBox := TextBox new. |
|
3186 |
textBox initialText:(stream contents). |
|
3187 |
textBox title:'File dublicates in directory: ', dir asString. |
|
3188 |
textBox readOnly:true. |
|
3189 |
textBox noCancel. |
|
3190 |
textBox label:'Dublicates in ', dir asString. |
|
3191 |
maxLength := 10. |
|
3192 |
info do:[: el | |
|
3193 |
maxLength := maxLength max:(el size). |
|
3194 |
]. |
|
3195 |
textBox extent:((maxLength * 5)@(info size * 20)); sizeFixed:false. |
|
3196 |
textBox showAtPointer. |
|
3197 |
stream close. |
|
3198 |
"/ subView contents:info. |
|
3199 |
"/ self label:myName. |
|
3200 |
! |
|
3201 |
||
3202 |
fileFindDuplicates |
|
3203 |
"scan directory for duplicate files" |
|
3204 |
||
4050 | 3205 |
|fileNames infoDir filesBySize |
3892 | 3206 |
result info stream textBox maxLength directories allFiles titleStream size| |
3207 |
||
3208 |
"/ (self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.' |
|
3209 |
"/ yesButton:'proceed') ifFalse:[^ self]. |
|
3210 |
||
3211 |
self withWaitCursorDo:[ |
|
3212 |
result := Dictionary new. |
|
3213 |
||
3982 | 3214 |
directories := self currentSelectedDirectories. |
3892 | 3215 |
directories isEmpty ifTrue:[^ self]. |
3216 |
||
3217 |
allFiles := OrderedCollection new. |
|
3218 |
directories do:[ : dir| |
|
3219 |
fileNames := dir directoryContents. |
|
3220 |
fileNames := fileNames collect:[:fn | dir construct:fn]. |
|
3221 |
fileNames := fileNames select:[:fn | fn isDirectory not]. |
|
3222 |
allFiles addAll:fileNames. |
|
3223 |
]. |
|
3224 |
||
3225 |
infoDir := Dictionary new. |
|
3226 |
allFiles do:[:fn | |
|
3227 |
infoDir at:fn put:(fn info) |
|
3228 |
]. |
|
3229 |
||
3230 |
"/ for each, get the files size. |
|
3231 |
"/ in a first pass, look for files of the same size and |
|
3232 |
"/ compare them ... |
|
3233 |
||
3234 |
filesBySize := Dictionary new. |
|
3235 |
infoDir keysAndValuesDo:[:fn :info | |
|
3236 |
|sz entry| |
|
3237 |
||
3238 |
sz := info size. |
|
3239 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
3240 |
entry add:fn. |
|
3241 |
]. |
|
3242 |
||
3243 |
"/ any of same size ? |
|
3244 |
||
3245 |
filesBySize do:[:entry | |
|
3246 |
|files| |
|
3247 |
||
3248 |
entry size > 1 ifTrue:[ |
|
3249 |
files := entry asArray. |
|
3250 |
1 to:files size-1 do:[:idx1 | |
|
3251 |
idx1+1 to:files size do:[:idx2 | |
|
3252 |
|fn1 fn2| |
|
3253 |
||
3254 |
fn1 := files at:idx1. |
|
3255 |
fn2 := files at:idx2. |
|
3256 |
||
3257 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
|
3258 |
"/ compare the files |
|
3259 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3260 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
|
3261 |
result at:fn1 put:fn2. |
|
3262 |
] |
|
3263 |
] |
|
3264 |
] |
|
3265 |
] |
|
3266 |
] |
|
3267 |
]. |
|
3268 |
||
3269 |
result := result associations. |
|
3270 |
result := result collect:[:assoc | |
|
3271 |
|f1 f2| |
|
3272 |
||
3273 |
f1 := assoc key asString. |
|
3274 |
f2 := assoc value asString. |
|
3275 |
f1 < f2 ifTrue:[ |
|
3276 |
f2 -> f1 |
|
3277 |
] ifFalse:[ |
|
3278 |
f1 -> f2 |
|
3279 |
] |
|
3280 |
]. |
|
3281 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
3282 |
||
3283 |
info := OrderedCollection new. |
|
3284 |
size := self getBestDirectory asString size. |
|
3285 |
result do:[:assoc | |
|
3286 |
|fn1 fn2| |
|
3287 |
||
3288 |
fn1 := assoc key. |
|
3289 |
fn2 := assoc value. |
|
3290 |
size > 1 ifTrue:[ |
|
3291 |
fn1 := ('..', (fn1 copyFrom:(size + 1))). |
|
3292 |
fn2 := ('..', (fn2 copyFrom:(size + 1))). |
|
3293 |
]. |
|
3294 |
(fn1 includes:Character space) ifTrue:[ |
|
3295 |
fn1 := '"' , fn1 , '"' |
|
3296 |
]. |
|
3297 |
(fn2 includes:Character space) ifTrue:[ |
|
3298 |
fn2 := '"' , fn2 , '"' |
|
3299 |
]. |
|
3300 |
info add:(fn1 , ' same as ' , fn2) |
|
3301 |
]. |
|
3302 |
info isEmpty ifTrue:[ |
|
3303 |
info add:'No duplicate files found.' |
|
3304 |
]. |
|
3305 |
]. |
|
3306 |
stream := WriteStream on:''. |
|
3307 |
info do:[:el| |
|
3308 |
stream nextPutAll:el. |
|
3309 |
stream cr. |
|
3310 |
]. |
|
3311 |
titleStream := WriteStream on:''. |
|
3312 |
titleStream nextPutAll:'File dublicates in director'. |
|
3313 |
directories size == 1 ifTrue:[ |
|
3314 |
titleStream nextPutAll:'y: ', directories first asString. |
|
3315 |
] ifFalse:[ |
|
3316 |
titleStream nextPutAll:'ies: '. |
|
3317 |
titleStream cr. |
|
3318 |
directories do:[:dir| |
|
3319 |
size > 1 ifTrue:[ |
|
3320 |
titleStream nextPutAll:'..'. |
|
3321 |
titleStream nextPutAll:((dir asString) copyFrom:(size + 1)). |
|
3322 |
] ifFalse:[ |
|
3323 |
titleStream nextPutAll:(dir asString). |
|
3324 |
]. |
|
3325 |
titleStream cr. |
|
3326 |
] |
|
3327 |
]. |
|
3328 |
||
3329 |
textBox := TextBox new. |
|
3330 |
textBox initialText:(stream contents). |
|
3331 |
textBox title:(titleStream contents). |
|
3332 |
textBox readOnly:true. |
|
3333 |
textBox noCancel. |
|
4050 | 3334 |
[ |
3335 |
| stream | |
|
3336 |
stream := WriteStream on:'Dublicates in '. |
|
3337 |
directories do:[ :aDirectory | |
|
3338 |
stream nextPutAll:aDirectory baseName |
|
3339 |
stream space |
|
3340 |
]. |
|
3341 |
textBox label:stream contents. |
|
3342 |
]. |
|
3892 | 3343 |
maxLength := 10. |
3344 |
info do:[: el | |
|
3345 |
maxLength := maxLength max:(el size). |
|
3346 |
]. |
|
3347 |
textBox extent:((maxLength * 5)@(info size * 10)); sizeFixed:false. |
|
3348 |
textBox showAtPointer. |
|
3349 |
titleStream close. |
|
3350 |
stream close. |
|
3351 |
! |
|
3352 |
||
3353 |
fileFindFile |
|
3354 |
|filename files| |
|
3355 |
||
3356 |
files := self currentFileNameHolder value. |
|
3357 |
files notEmpty ifTrue:[ |
|
3358 |
filename := files first. |
|
3359 |
] ifFalse:[ |
|
3360 |
filename := (Filename homeDirectory). |
|
3361 |
]. |
|
3362 |
FindFileApplication openOnFileName:filename. |
|
3363 |
! |
|
3364 |
||
3365 |
installAllAsAutoloaded |
|
3366 |
"install all classes found here as autoloaded classes" |
|
3367 |
||
3368 |
self allItemsOfCurrentDirectory do:[:fileItem | |
|
3369 |
(fileItem hasMimeType and:[fileItem mimeType isSmalltalkSource]) ifTrue:[ |
|
3370 |
self installAsAutoloaded:(fileItem fileName). |
|
3371 |
] |
|
3372 |
]. |
|
3373 |
! |
|
3374 |
||
3375 |
installAsAutoloaded:aFilename |
|
3376 |
"install aFilename as autoloaded class" |
|
3377 |
||
3378 |
|chunks s| |
|
3379 |
||
3380 |
chunks := ChangeSet fromStream:(s := aFilename asFilename readStream). s close. |
|
3381 |
chunks |
|
3382 |
select:[:eachChunk | eachChunk isClassDefinitionChange] |
|
3383 |
thenDo:[:eachClassChunk | eachClassChunk installAsAutoloadedClassIfNotPrivate]. |
|
3384 |
! |
|
3385 |
||
3386 |
loadImageAndPerform:aSelectorOrBlock |
|
3387 |
||
3388 |
|img path files| |
|
3389 |
||
3982 | 3390 |
files := self currentSelectedFiles. |
3892 | 3391 |
files isEmpty ifTrue:[ ^ self]. |
3392 |
files do:[:fileName | |
|
3393 |
path := fileName. |
|
3394 |
path isDirectory ifFalse:[ |
|
3395 |
img := Image fromFile:(path pathName). |
|
3396 |
img notNil ifTrue:[ |
|
3397 |
aSelectorOrBlock isSymbol ifTrue:[ |
|
3398 |
img perform:aSelectorOrBlock |
|
3399 |
] ifFalse:[ |
|
3400 |
aSelectorOrBlock value:img |
|
3401 |
] |
|
3402 |
] ifFalse:[ |
|
3403 |
Dialog warn:'unknown format: ' , fileName asString |
|
3404 |
] |
|
3405 |
] |
|
3406 |
]. |
|
3407 |
! |
|
3408 |
||
3409 |
openASN1Browser |
|
3410 |
||
3411 |
self openTool:OSI::ASN1Browser |
|
3412 |
! |
|
3413 |
||
3414 |
openAppletViewer |
|
3415 |
|numItems files| |
|
3416 |
||
3982 | 3417 |
files := self currentSelectedFiles. |
3892 | 3418 |
(numItems := files size) > 2 ifTrue:[ |
3419 |
(self |
|
3420 |
confirm:(resources string:'open for each of the %1 items ?' |
|
3421 |
with:numItems)) ifFalse:[^ self]. |
|
3422 |
]. |
|
3423 |
||
3424 |
Java startupJavaSystem. |
|
3425 |
"/ Java markAllClassesUninitialized. |
|
3426 |
"/ Java initAllStaticFields. |
|
3427 |
"/ Java initAllClasses. |
|
3428 |
||
3429 |
files do:[:fileName | |
|
3430 |
|p path| |
|
3431 |
||
3432 |
path := fileName. |
|
3433 |
path isDirectory ifFalse:[ |
|
3434 |
p := Java |
|
3435 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
|
3436 |
argumentString:path pathName. |
|
3437 |
p resume. |
|
3438 |
] |
|
3439 |
]. |
|
3440 |
! |
|
3441 |
||
3442 |
openCBrowser |
|
3443 |
||
3444 |
|directories| |
|
3445 |
||
3982 | 3446 |
directories := self currentSelectedDirectories. |
3892 | 3447 |
directories isEmpty ifTrue:[ ^ self]. |
3448 |
self withWaitCursorDo:[ |
|
3449 |
CBrowser::Browser openIn:directories first. |
|
3450 |
] |
|
3451 |
! |
|
3452 |
||
3453 |
openChangesBrowser |
|
3454 |
"open a change browser on the selected file(s)" |
|
3455 |
||
3456 |
self openTool:(UserPreferences current changesBrowserClass) |
|
3457 |
! |
|
3458 |
||
3459 |
openDiffView |
|
3460 |
"open a diff-view" |
|
3461 |
||
4060 | 3462 |
| name1 name2 text1 text2 f d err nm l1 files title defaultName| |
3892 | 3463 |
|
3982 | 3464 |
files := self currentSelectedFiles. |
3892 | 3465 |
files isEmpty ifTrue:[ |
3466 |
Dialog warn:'you have to select a file first'. |
|
3467 |
^ self. |
|
3468 |
]. |
|
3469 |
(files size == 2) ifTrue:[ |
|
3470 |
name1 := files last. |
|
3471 |
name2 := files first. |
|
3472 |
] ifFalse:[ |
|
3473 |
LastFileDiffFile notNil ifTrue:[ |
|
3474 |
"/ f := self currentDirectory value asFilename construct:(LastFileDiffFile baseName). |
|
3475 |
(LastFileDiffFile exists |
|
3476 |
and:[LastFileDiffFile isReadable]) ifTrue:[ |
|
3477 |
name1 := f. |
|
3478 |
] |
|
3479 |
]. |
|
3480 |
name2 := files first. |
|
4060 | 3481 |
title := 'show difference between ', name2 baseName, ' and:'. |
3482 |
defaultName := name1 notNil ifTrue:[name1 baseName] ifFalse:[nil]. |
|
3483 |
name1 := DialogBox |
|
3484 |
requestFileName:title |
|
3485 |
default:defaultName |
|
3486 |
ok:'OK' |
|
3487 |
abort:'Use File List' |
|
3488 |
pattern:'*' |
|
3489 |
fromDirectory:(name2 asFilename directory). |
|
3490 |
||
3491 |
||
3492 |
||
3892 | 3493 |
]. |
3494 |
||
3495 |
(name1 isNil or:[name1 asString isEmpty]) ifTrue:[ |
|
3496 |
text1 := self getAllFilesAsStringCollection asStringCollection withTabs. |
|
3497 |
text1 := text1 collect:[:l | l isNil ifTrue:[' '] ifFalse:[l]]. |
|
3498 |
name1 := nil. |
|
3499 |
l1 := 'browser contents' |
|
3500 |
] ifFalse:[ |
|
4060 | 3501 |
name1 := name1 asFilename. |
3892 | 3502 |
LastFileDiffFile := name1. |
4060 | 3503 |
name1 asFilename isReadable ifFalse:[ |
3892 | 3504 |
nm := name1. |
4060 | 3505 |
name1 asFilename exists ifFalse:[ |
3892 | 3506 |
err := '%1 does not exist'. |
3507 |
] ifTrue:[ |
|
3508 |
err := '%1 is not readable' |
|
3509 |
]. |
|
3510 |
]. |
|
4060 | 3511 |
l1 := name1 |
3892 | 3512 |
]. |
3513 |
||
3514 |
err isNil ifTrue:[ |
|
3515 |
name2 isReadable ifFalse:[ |
|
3516 |
nm := name2. |
|
3517 |
name2 exists ifFalse:[ |
|
3518 |
err := '%1 does not exist'. |
|
3519 |
] ifTrue:[ |
|
3520 |
err := '%1 is not readable' |
|
3521 |
]. |
|
3522 |
]. |
|
3523 |
]. |
|
3524 |
err notNil ifTrue:[ |
|
3525 |
Dialog warn:(resources string:err with:nm pathName). |
|
3526 |
^ self |
|
3527 |
]. |
|
3528 |
||
3529 |
self withWaitCursorDo:[ |
|
3530 |
name1 notNil ifTrue:[ |
|
3531 |
text1 := name1 contents. |
|
3532 |
]. |
|
3533 |
text2 := name2 contents. |
|
3534 |
text1 = text2 ifTrue:[ |
|
3535 |
self information:'same contents' |
|
3536 |
] ifFalse:[ |
|
3537 |
d := DiffTextView |
|
3538 |
openOn:text1 label:l1 |
|
3539 |
and:text2 label:name2 pathName. |
|
4060 | 3540 |
d topView label:'file differences'. |
3892 | 3541 |
] |
3542 |
] |
|
3543 |
! |
|
3544 |
||
3545 |
openEditor |
|
3546 |
self openTool:EditTextView |
|
3547 |
! |
|
3548 |
||
3549 |
openHTMLReader |
|
3550 |
||
3551 |
self openTool:HTMLDocumentView ignoreDirectories:false |
|
3552 |
! |
|
3553 |
||
3554 |
openImageEditor |
|
3555 |
||
3556 |
[self loadImageAndPerform:#edit] fork |
|
3557 |
! |
|
3558 |
||
3559 |
openImageInspector |
|
3560 |
[self loadImageAndPerform:#inspect] fork |
|
3561 |
! |
|
3562 |
||
3563 |
openImagePreview |
|
3564 |
||
3565 |
[self loadImageAndPerform:[:img | |
|
3566 |
|i top viewer| |
|
3567 |
||
3568 |
top := StandardSystemView new. |
|
3569 |
||
3570 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
3571 |
i := img. |
|
3572 |
top extent:200@200. |
|
3573 |
top label:(img fileName asFilename directoryName asFilename baseName , '/' , img fileName asFilename baseName). |
|
3574 |
top openAndWait. |
|
3575 |
||
3576 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
|
3577 |
i := i magnifiedPreservingRatioTo:200@200. |
|
3578 |
]. |
|
3579 |
viewer image:i. |
|
3580 |
]. |
|
3581 |
] fork |
|
3582 |
! |
|
3583 |
||
3584 |
openMP3Player |
|
3585 |
|file| |
|
3586 |
||
3982 | 3587 |
file := self currentSelectedFiles. |
3892 | 3588 |
(file isEmpty) ifTrue:[ |
3589 |
^ self. |
|
3590 |
]. |
|
3591 |
file := file first. |
|
3592 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
3593 |
! |
|
3594 |
||
3595 |
openSlideShow |
|
3596 |
||
3597 |
|directories dir| |
|
3598 |
||
3982 | 3599 |
directories := self currentSelectedDirectories. |
3892 | 3600 |
directories isEmpty ifTrue:[^ self]. |
3601 |
||
3602 |
dir := directories first. |
|
3603 |
CodingExamples_GUI::SlideShow openIn:dir. |
|
3604 |
! |
|
3605 |
||
3606 |
openSnapshotImageBrowser |
|
3607 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
|
3608 |
! |
|
3609 |
||
3610 |
openTerminal |
|
3611 |
||
3612 |
|directories dir| |
|
3613 |
||
3982 | 3614 |
directories := self currentSelectedDirectories. |
3892 | 3615 |
directories isEmpty ifTrue:[ |
3616 |
dir := Filename homeDirectory. |
|
3617 |
] ifFalse:[ |
|
3618 |
dir := directories first. |
|
3619 |
]. |
|
3620 |
||
3621 |
VT100TerminalView openShellIn:dir. |
|
3622 |
! |
|
3623 |
||
3624 |
openTool:aToolClass |
|
3625 |
"open a tool on the selected file(s)" |
|
3626 |
||
3627 |
^ self openTool:aToolClass ignoreDirectories:true |
|
3628 |
! |
|
3629 |
||
3630 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
3631 |
"open a tool on the selected file(s)" |
|
3632 |
||
3633 |
^ self |
|
3634 |
openTool:aToolClass |
|
3635 |
with:#openOn: |
|
3636 |
ignoreDirectories:ignoreDirs |
|
3637 |
! |
|
3638 |
||
3639 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
|
3640 |
"open a tool on the selected file(s)" |
|
3641 |
||
3642 |
|numItems path tool files| |
|
3643 |
||
3644 |
aToolClass isNil ifTrue:[ |
|
3645 |
Dialog warn:'Sorry, that tool seems to be not available'. |
|
3646 |
^ nil. |
|
3647 |
]. |
|
3982 | 3648 |
files := self currentSelectedFiles. |
3892 | 3649 |
|
3650 |
(numItems := files size) > 2 ifTrue:[ |
|
3651 |
(self |
|
3652 |
confirm:(resources string:'open for each of the %1 items ?' |
|
3653 |
with:numItems)) ifFalse:[^ self]. |
|
3654 |
]. |
|
3655 |
||
3656 |
self withWaitCursorDo:[ |
|
3657 |
files do:[:fileName | |
|
3658 |
(ignoreDirs not or:[fileName isDirectory not]) ifTrue:[ |
|
3659 |
fileName isAbsolute ifTrue:[ |
|
3660 |
path := fileName getName. |
|
3661 |
] ifFalse:[ |
|
3662 |
path := fileName pathName. |
|
3663 |
]. |
|
3664 |
tool := aToolClass perform:aSelector with:path. |
|
3665 |
] |
|
3666 |
]. |
|
3667 |
]. |
|
3668 |
^ tool |
|
3669 |
! |
|
3670 |
||
3671 |
openZipTool |
|
3672 |
|zipTool directories dir| |
|
3673 |
||
3674 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
|
3982 | 3675 |
directories := self currentSelectedDirectories. |
3892 | 3676 |
directories isEmpty ifTrue:[ |
3677 |
dir := directories first. |
|
3678 |
] ifFalse:[ |
|
3679 |
dir := Filename homeDirectory. |
|
3680 |
]. |
|
3681 |
||
3682 |
zipTool initialExtractDirectory:dir. |
|
3683 |
]. |
|
3684 |
! |
|
3685 |
||
3686 |
readAbbrevFile |
|
3687 |
"read the abbrev file and install classes found there as autoloaded classes" |
|
3688 |
||
3689 |
| directories dir| |
|
3690 |
||
3982 | 3691 |
directories := self currentSelectedDirectories. |
3892 | 3692 |
directories isEmpty ifTrue:[^ self]. |
3693 |
||
3694 |
dir := directories first. |
|
3695 |
Smalltalk installAutoloadedClassesFrom:(dir construct:'abbrev.stc'). |
|
3696 |
! |
|
3697 |
||
3698 |
singleFileFileIn:fileName lazy:lazy |
|
3699 |
"fileIn the selected file(s)" |
|
3700 |
||
3701 |
|aStream wasLazy| |
|
3702 |
||
3703 |
fileName type == #regular ifTrue:[ |
|
3704 |
||
3705 |
(ObjectFileLoader notNil |
|
3706 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
|
3707 |
AbortOperationRequest catch:[ |
|
3708 |
|p| |
|
3709 |
||
3710 |
"/ |
|
3711 |
"/ look if already loaded ... then unload first |
|
3712 |
"/ |
|
3713 |
p := fileName pathName. |
|
3714 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
3715 |
(Dialog confirm:(resources |
|
3716 |
string:'%1 is already loaded; load anyway ?' |
|
3717 |
with:p)) ifFalse:[ |
|
3718 |
^ self |
|
3719 |
]. |
|
3720 |
Transcript showCR:'unloading old ' , p , ' ...'. |
|
3721 |
ObjectFileLoader unloadObjectFile:p. |
|
3722 |
]. |
|
3723 |
||
3724 |
Transcript showCR:'loading ' , p , ' ...'. |
|
3725 |
ObjectFileLoader loadObjectFile:p. |
|
3949 | 3726 |
Class addInfoRecord:('fileIn ' , fileName asFilename pathName) |
3892 | 3727 |
] |
3728 |
] ifFalse:[ ((fileName hasSuffix:'cls') |
|
3729 |
and:[((fileName mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
|
3730 |
"/ loading a binary class file |
|
3731 |
aStream := fileName readStream. |
|
3732 |
aStream notNil ifTrue:[ |
|
3733 |
aStream fileInBinary. |
|
3734 |
] |
|
3735 |
] ifFalse:[ |
|
3736 |
((fileName hasSuffix:'class') |
|
3737 |
or:[(fileName hasSuffix:'cla')]) ifTrue:[ |
|
3738 |
"/ loading a java class file |
|
3739 |
JavaClassReader notNil ifTrue:[ |
|
3740 |
JavaClassReader loadFile:(fileName pathName) |
|
3741 |
] |
|
3742 |
] ifFalse:[ (fileName hasSuffix:'sif') ifTrue:[ |
|
3743 |
"/ loading a sif (smalltalk interchange format) file |
|
3744 |
SmalltalkInterchangeSTXFileInManager autoload. |
|
3745 |
SmalltalkInterchangeFileManager newForFileIn |
|
3746 |
fileName: fileName pathName; |
|
3747 |
fileIn. |
|
3748 |
] ifFalse:[ (fileName hasSuffix:'pcl') ifTrue:[ |
|
3749 |
Parcel isNil ifTrue:[ |
|
3750 |
Dialog warn:'Parcel support not loaded.' |
|
3751 |
] ifFalse:[ |
|
3752 |
Parcel loadParcelFrom: fileName pathName |
|
3753 |
] |
|
3754 |
] ifFalse:[ |
|
3755 |
"/ loading a regular (chunk) or xml source file |
|
3756 |
aStream := fileName readStream. |
|
3757 |
aStream notNil ifTrue:[ |
|
3758 |
Error handle:[ : ex | |
|
3759 |
Dialog warn:'Error on file in: ', ex errorString. |
|
3760 |
] do:[ |
|
3761 |
[ |
|
3762 |
Class withoutUpdatingChangesDo:[ |
|
3763 |
wasLazy := Compiler compileLazy:lazy. |
|
3764 |
aStream fileIn. |
|
3765 |
]. |
|
3766 |
Class addInfoRecord:('fileIn ' , fileName asString) |
|
3767 |
] ensure:[ |
|
3768 |
Compiler compileLazy:wasLazy. |
|
3769 |
aStream close |
|
3770 |
] |
|
3771 |
] |
|
3772 |
] |
|
3773 |
]]] |
|
3774 |
]] |
|
3775 |
]. |
|
3776 |
! ! |
|
3777 |
||
3778 |
!AbstractFileBrowser methodsFor:'menu queries cvs'! |
|
3779 |
||
3780 |
canCvsAddAndCommit |
|
3781 |
||
3982 | 3782 |
|selectedFiles| |
3783 |
||
3784 |
selectedFiles := self currentSelectedFiles. |
|
3785 |
^ (selectedFiles notEmpty and:[self currentFilesAreInSameDirectory]). |
|
3892 | 3786 |
! |
3787 |
||
3788 |
canRemoveCVSContainer |
|
3789 |
||
3982 | 3790 |
|selectedFiles dirOfFile cvsDir| |
3791 |
||
3792 |
selectedFiles := self currentSelectedFiles. |
|
3793 |
selectedFiles isEmpty ifTrue:[^ false]. |
|
3794 |
^ ((selectedFiles detect:[:fileName| |
|
3795 |
dirOfFile := self getDirWithoutFileName:fileName. |
|
3892 | 3796 |
cvsDir := dirOfFile construct:'CVS'. |
3797 |
(cvsDir isDirectory and:[cvsDir exists]) |
|
3798 |
] ifNone:[nil]) notNil). |
|
3799 |
! ! |
|
3800 |
||
3801 |
!AbstractFileBrowser methodsFor:'menu queries tools'! |
|
3802 |
||
3803 |
anySTFilesPresent |
|
3804 |
||
3805 |
^ self anyFilesPresentWithSuffix:'st' |
|
3806 |
! |
|
3807 |
||
3808 |
canCreateNewProject |
|
3809 |
||
3982 | 3810 |
| selectedFiles | |
3892 | 3811 |
|
3812 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
3982 | 3813 |
selectedFiles := self currentSelectedFiles. |
3892 | 3814 |
^ [ |
3982 | 3815 |
((selectedFiles detect:[:fileName| | suffix| |
3816 |
suffix := fileName suffix asLowercase. |
|
3817 |
(suffix = 'prj' or:[suffix = 'st']) |
|
3818 |
] ifNone:[nil]) notNil) |
|
3819 |
] |
|
3892 | 3820 |
! |
3821 |
||
3822 |
canDoTerminal |
|
3823 |
||
3824 |
^ OperatingSystem isUNIXlike |
|
3825 |
or:[OperatingSystem isMSWINDOWSlike] |
|
3826 |
! |
|
3827 |
||
3828 |
canDoTerminalAndSystemIsDOS |
|
3829 |
||
3830 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
3831 |
! |
|
3832 |
||
3833 |
canDoTerminalAndSystemIsUnix |
|
3834 |
||
3835 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
3836 |
! |
|
3837 |
||
3838 |
canReadAbbrevFile |
|
3839 |
||
3840 |
||
3841 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
3842 |
^ (self currentDirectories value first construct:'abbrev.stc') exists |
|
3843 |
! |
|
3844 |
||
3845 |
canRemoveFromSourcePath |
|
3846 |
||
3847 |
^ false |
|
3848 |
! |
|
3849 |
||
3850 |
hasASN1 |
|
3851 |
^ [ OSI::ASN1Parser notNil |
|
3852 |
and:[OSI::ASN1Parser isLoaded]] |
|
3853 |
||
3854 |
! |
|
3855 |
||
3856 |
hasASN1AndSelection |
|
3857 |
^ [ self hasSelection value |
|
3982 | 3858 |
and:[self currentSelectedFiles size > 0 |
3892 | 3859 |
and:[OSI::ASN1Parser notNil |
3860 |
and:[OSI::ASN1Parser isLoaded]]]] |
|
3861 |
! |
|
3862 |
||
3863 |
hasCBrowser |
|
3864 |
^ [ CBrowser::Browser notNil ] |
|
3865 |
! |
|
3866 |
||
3867 |
hasJava |
|
3868 |
||
3869 |
^ [ JavaClassReader notNil |
|
3870 |
and:[JavaClassReader isLoaded]] |
|
3871 |
! |
|
3872 |
||
3873 |
hasJavaAndSelection |
|
3874 |
||
3982 | 3875 |
^ [ self currentSelectedFiles size > 0 |
3892 | 3876 |
and:[JavaClassReader notNil |
3877 |
and:[JavaClassReader isLoaded]]] |
|
3878 |
! |
|
3879 |
||
3880 |
hasMP3Player |
|
3881 |
||
3882 |
^ [ MP3PlayerApplication notNil |
|
3883 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
|
3884 |
! |
|
3885 |
||
3886 |
hasMP3PlayerAndSelection |
|
3887 |
||
3982 | 3888 |
^ [ self currentSelectedFiles size > 0 |
3892 | 3889 |
and:[ self hasMP3Player value]] |
3890 |
! |
|
3891 |
||
3892 |
hasSlideShow |
|
3893 |
||
3894 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
3895 |
! |
|
3896 |
||
3897 |
hasSnapshotSelection |
|
3898 |
||
3899 |
^ [ |
|
3900 |
| files | |
|
3982 | 3901 |
files := self currentSelectedFiles. |
3892 | 3902 |
((files size == 1) |
3903 |
and:[ files first hasSuffix:'img' ]) |
|
3904 |
] |
|
3905 |
! |
|
3906 |
||
3907 |
hasZipFileSelected |
|
3908 |
||
3982 | 3909 |
^ [|sel fileName fn suff| |
3910 |
||
3911 |
sel := self currentSelectedFiles. |
|
3892 | 3912 |
sel size == 1 ifTrue:[ |
3982 | 3913 |
fileName := sel first. |
3914 |
fileName notNil ifTrue:[ |
|
3915 |
suff := fileName suffix asLowercase. |
|
3892 | 3916 |
suff = 'zip' or:[suff = 'jar'] |
3917 |
] ifFalse:[ |
|
3918 |
false |
|
3919 |
] |
|
3920 |
] ifFalse:[ |
|
3921 |
false |
|
3922 |
] |
|
3923 |
] |
|
3924 |
! |
|
3925 |
||
3926 |
javaSupportLoaded |
|
3927 |
||
3928 |
^ false |
|
3929 |
! ! |
|
3930 |
||
3906 | 3931 |
!AbstractFileBrowser methodsFor:'presentation'! |
3932 |
||
3933 |
getModeString:modeBits |
|
3934 |
"convert file-mode bits into a more user-friendly string. |
|
3935 |
This is wrong here - should be moved into OperatingSystem." |
|
3936 |
||
3937 |
^ self getModeString:modeBits |
|
3938 |
with:#( 'owner:' $r $w $x |
|
3939 |
' group:' $r $w $x |
|
3940 |
' others:' $r $w $x ) |
|
3941 |
! |
|
3942 |
||
3943 |
getModeString:modeBits with:texts |
|
3944 |
"convert file-mode bits into a more user-friendly string. |
|
3945 |
This is wrong here - should be moved into OperatingSystem." |
|
3946 |
||
3947 |
|bits modeString| |
|
3948 |
||
3949 |
bits := modeBits bitAnd:8r777. |
|
3950 |
modeString := ''. |
|
3951 |
||
3952 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
3953 |
with: texts do:[:bitMask :access | |
|
3954 |
|ch| |
|
3955 |
||
3956 |
bitMask isNil ifTrue:[ |
|
3957 |
modeString := modeString , access |
|
3958 |
] ifFalse:[ |
|
3959 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
|
3960 |
ch := $- |
|
3961 |
] ifFalse:[ |
|
3962 |
ch := access |
|
3963 |
]. |
|
3964 |
modeString := modeString copyWith:ch |
|
3965 |
] |
|
3966 |
]. |
|
3967 |
^ modeString |
|
3968 |
! ! |
|
3969 |
||
3892 | 3970 |
!AbstractFileBrowser methodsFor:'queries'! |
3971 |
||
3906 | 3972 |
getFileInfoStringForFirstSelectedFile:longInfo |
3973 |
"get stat info on selected file - return a string which can be |
|
3974 |
shown in a box" |
|
3975 |
||
3976 |
| selFiles filename text fileOutput type modeBits modeString s ts isLink info| |
|
3977 |
||
3978 |
selFiles := self currentFileNameHolder value. |
|
3979 |
((selFiles size == 1) not) ifTrue:[ ^ nil]. |
|
3980 |
filename := selFiles first. |
|
3981 |
||
3982 |
text := StringCollection new. |
|
3983 |
||
3984 |
text add:('filename: ', filename asString). |
|
3985 |
isLink := filename isSymbolicLink. |
|
3986 |
isLink ifTrue:[ |
|
3987 |
text add:('symbolic link to: ', (filename linkInfo path)) |
|
3988 |
]. |
|
3989 |
||
3990 |
info := filename info. |
|
3991 |
type := info type. |
|
3992 |
(longInfo and:[type == #regular]) ifTrue:[ |
|
3993 |
fileOutput := filename fileType. |
|
3994 |
]. |
|
3995 |
||
3996 |
s := ('type: '). |
|
3997 |
fileOutput isNil ifTrue:[ |
|
3998 |
s := s , type asString |
|
3999 |
] ifFalse:[ |
|
4000 |
s := s , 'regular (' , fileOutput , ')' |
|
4001 |
]. |
|
4002 |
text add:s. |
|
4003 |
isLink = true ifTrue:[ |
|
4004 |
info := filename linkInfo |
|
4005 |
] ifFalse:[ |
|
4006 |
info := filename info |
|
4007 |
]. |
|
4008 |
||
4000 | 4009 |
text add:('size: ', (info fileSize) printString). |
3906 | 4010 |
|
4011 |
modeBits := info mode. |
|
4012 |
modeString := self getModeString:modeBits. |
|
4013 |
longInfo ifTrue:[ |
|
4014 |
text add:('access: ', modeString,' ', (modeBits printStringRadix:8)). |
|
4015 |
] ifFalse:[ |
|
4016 |
text add:('access: ', modeString) |
|
4017 |
]. |
|
4018 |
text add:('owner: ', |
|
4019 |
(OperatingSystem getUserNameFromID:(info uid))). |
|
4020 |
longInfo ifTrue:[ |
|
4021 |
text add:('group: ', |
|
4022 |
(OperatingSystem getGroupNameFromID:(info gid))). |
|
4023 |
||
4000 | 4024 |
ts := info accessTime. |
3906 | 4025 |
text add:('last access: ',ts asTime printString ,' ', ts asDate printString). |
4026 |
||
4000 | 4027 |
ts := info modificationTime. |
3906 | 4028 |
text add:('last modification: ', ts asTime printString, ' ', ts asDate printString). |
4029 |
]. |
|
4030 |
^ text asString |
|
4031 |
! |
|
4032 |
||
3892 | 4033 |
initialCommandFor:fileName into:aBox |
4034 |
"set a useful initial command for execute box." |
|
4035 |
||
4036 |
|mime cmd select path suffix| |
|
4037 |
||
4038 |
path := self getDirWithoutFileName:fileName. |
|
4039 |
suffix := fileName asFilename suffix. |
|
4040 |
DefaultCommandPerSuffix notNil ifTrue:[ |
|
4041 |
cmd := DefaultCommandPerSuffix at:suffix ifAbsent:nil. |
|
4042 |
cmd notNil ifTrue:[ |
|
4043 |
aBox initialText:(cmd , ' ' , fileName baseName) selectFrom:1 to:cmd size. |
|
4044 |
^ self |
|
4045 |
]. |
|
4046 |
]. |
|
4047 |
mime := MIMETypes mimeTypeForSuffix:suffix. |
|
4048 |
"/ mime notNil ifTrue:[ |
|
4049 |
"/ cmd := self initialCommandForMIME:mime file:path |
|
4050 |
"/ ]. |
|
4051 |
||
4052 |
"/ XXX should be changed to take stuff from a config file |
|
4053 |
"/ XXX or from resources. |
|
4054 |
||
4055 |
(path type == #regular) ifTrue:[ |
|
4056 |
path isExecutableProgram ifTrue:[ |
|
4057 |
aBox initialText:(fileName , ' <arguments>'). |
|
4058 |
^ self |
|
4059 |
]. |
|
4060 |
||
4061 |
select := true. |
|
4062 |
||
4063 |
"some heuristics - my personal preferences ... |
|
4064 |
(actually this should come from a configfile)" |
|
4065 |
||
4066 |
(fileName endsWith:'akefile') ifTrue:[ |
|
4067 |
aBox initialText:'make target' selectFrom:6 to:11. |
|
4068 |
^ self |
|
4069 |
]. |
|
4070 |
||
4071 |
cmd := self class defaultCommandPerMIME at:mime ifAbsent:nil. |
|
4072 |
cmd notNil ifTrue:[ |
|
4073 |
select := false |
|
4074 |
]. |
|
4075 |
||
4076 |
cmd isNil ifTrue:[ |
|
4077 |
||
4078 |
suffix := path suffix. |
|
4079 |
(suffix = 'C') ifTrue:[ |
|
4080 |
cmd := 'g++ -c %1'. |
|
4081 |
select := 6. |
|
4082 |
] ifFalse:[ |
|
4083 |
suffix := suffix asLowercase. |
|
4084 |
||
4085 |
(suffix = 'taz') ifTrue:[ |
|
4086 |
aBox initialText:'zcat %1 | tar tvf -'. |
|
4087 |
select := false. |
|
4088 |
]. |
|
4089 |
(suffix = 'tar') ifTrue:[ |
|
4090 |
cmd := 'tar tvf %1'. |
|
4091 |
select := 7. |
|
4092 |
]. |
|
4093 |
(suffix = 'zoo') ifTrue:[ |
|
4094 |
cmd := 'zoo -list %1'. |
|
4095 |
select := 9. |
|
4096 |
]. |
|
4097 |
(suffix = 'zip') ifTrue:[ |
|
4098 |
cmd := 'unzip -l %1'. |
|
4099 |
select := 8. |
|
4100 |
]. |
|
4101 |
(suffix = 'jar') ifTrue:[ |
|
4102 |
cmd := 'unzip -l %1'. |
|
4103 |
select := 8. |
|
4104 |
]. |
|
4105 |
(suffix = 'z') ifTrue:[ |
|
4106 |
(fileName asLowercase endsWith:'tar.z') ifTrue:[ |
|
4107 |
cmd := 'zcat %1 | tar tvf -'. |
|
4108 |
select := false. |
|
4109 |
] ifFalse:[ |
|
4110 |
cmd := 'uncompress %1' |
|
4111 |
]. |
|
4112 |
]. |
|
4113 |
(suffix = 'gz') ifTrue:[ |
|
4114 |
(fileName asLowercase endsWith:'tar.gz') ifTrue:[ |
|
4115 |
cmd := ('gunzip < %1 | tar tvf -' ). |
|
4116 |
select := false. |
|
4117 |
] ifFalse:[ |
|
4118 |
cmd := 'gunzip %1'. |
|
4119 |
]. |
|
4120 |
]. |
|
4121 |
(suffix = 'html') ifTrue:[ |
|
4122 |
cmd := 'netscape %1' |
|
4123 |
]. |
|
4124 |
(suffix = 'htm') ifTrue:[ |
|
4125 |
cmd := 'netscape %1' |
|
4126 |
]. |
|
4127 |
(suffix = 'uue') ifTrue:[ |
|
4128 |
cmd := 'uudecode %1' |
|
4129 |
]. |
|
4130 |
(suffix = 'c') ifTrue:[ |
|
4131 |
cmd := 'cc -c %1'. |
|
4132 |
select := 5. |
|
4133 |
]. |
|
4134 |
(suffix = 'cc') ifTrue:[ |
|
4135 |
cmd := 'g++ -c %1'. |
|
4136 |
select := 6. |
|
4137 |
]. |
|
4138 |
(suffix = 'xbm') ifTrue:[ |
|
4139 |
cmd := 'bitmap %1' |
|
4140 |
]. |
|
4141 |
(suffix = 'ps') ifTrue:[ |
|
4142 |
cmd := 'ghostview %1' |
|
4143 |
]. |
|
4144 |
((suffix = '1') or:[suffix = 'man']) ifTrue:[ |
|
4145 |
cmd := 'nroff -man %1'. |
|
4146 |
select := 10. |
|
4147 |
]. |
|
4148 |
]. |
|
4149 |
]. |
|
4150 |
||
4151 |
cmd isNil ifTrue:[ |
|
4152 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
4153 |
cmd := '<cmd>' |
|
4154 |
] ifFalse:[ |
|
4155 |
cmd := DefaultCommandPerSuffix |
|
4156 |
at:suffix |
|
4157 |
ifAbsent:'<cmd>'. |
|
4158 |
]. |
|
4159 |
cmd := cmd , ' %1'. |
|
4160 |
]. |
|
4161 |
||
4162 |
cmd := cmd bindWith:fileName. |
|
4163 |
select == false ifTrue:[ |
|
4164 |
aBox initialText:cmd |
|
4165 |
] ifFalse:[ |
|
4166 |
select class == Interval ifTrue:[ |
|
4167 |
aBox initialText:cmd selectFrom:select start to:select stop |
|
4168 |
] ifFalse:[ |
|
4169 |
select isInteger ifFalse:[ |
|
4170 |
select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1. |
|
4171 |
]. |
|
4172 |
aBox initialText:cmd selectFrom:1 to:select |
|
4173 |
]. |
|
4174 |
] |
|
4175 |
] |
|
4176 |
! |
|
4177 |
||
4178 |
isAbstractFileBrowser |
|
4179 |
||
4180 |
^ true |
|
4181 |
! |
|
4182 |
||
4183 |
systemIsDOS |
|
4184 |
||
4185 |
^ OperatingSystem isMSDOSlike |
|
4186 |
! |
|
4187 |
||
4188 |
systemIsUnix |
|
4189 |
^ OperatingSystem isUNIXlike |
|
4190 |
! ! |
|
4191 |
||
4192 |
!AbstractFileBrowser methodsFor:'queries-file'! |
|
4193 |
||
4194 |
allItemsOfCurrentDirectory |
|
4195 |
||
4196 |
^ self application:#DirectoryContentsBrowser do:#allItemsOfCurrentDirectory. |
|
4197 |
! |
|
4198 |
||
4199 |
anyFilesPresentWithSuffix:suffix |
|
4200 |
||
4201 |
| directories | |
|
4202 |
||
4203 |
directories := self currentDirectories value. |
|
4204 |
directories do:[ : dir| |
|
4205 |
(dir directoryContents do:[:f| (f asFilename suffix = suffix) ifTrue:[ ^ true]]) |
|
4206 |
]. |
|
4207 |
^ false. |
|
4208 |
! |
|
4209 |
||
4210 |
currentFilesAreInSameDirectory |
|
4211 |
||
4212 |
^ (self currentDirectories value size == 1). |
|
4213 |
! |
|
4214 |
||
4215 |
currentFilesHasDirectories |
|
4216 |
||
4217 |
^ self currentDirectories value notEmpty. |
|
4218 |
! |
|
4219 |
||
3982 | 4220 |
directoriesForFiles:aFileCol |
4221 |
||
4222 |
^ ((aFileCol collect:[:file| self getDirWithoutFileName:file]) asSet). |
|
4223 |
! |
|
4224 |
||
3892 | 4225 |
fileListIsEmpty |
4226 |
||
4227 |
^ self application:#DirectoryContentsBrowser do:#fileListIsEmpty. |
|
4228 |
! |
|
4229 |
||
4230 |
fileListIsNotEmpty |
|
4231 |
||
4232 |
^ self fileListIsEmpty not. |
|
4233 |
! |
|
4234 |
||
4235 |
fileName:aFilename1 startsWith:aFilename2 |
|
4236 |
||
4237 |
" check if aFilename2 starts with the same directories like aFilename1 " |
|
4238 |
||
4239 |
| file1 file2 | |
|
4240 |
||
4241 |
aFilename2 isNil ifTrue:[ ^ false]. |
|
3982 | 4242 |
aFilename1 isNil ifTrue:[ ^ false]. |
3892 | 4243 |
file1 := aFilename1 asFilename. |
4244 |
file2 := aFilename2 asFilename. |
|
4245 |
file2 isRootDirectory ifTrue:[ ^ true]. |
|
4246 |
((file1 isDirectory) |
|
4247 |
and:[(file2 isDirectory) |
|
4248 |
and:[file1 directory = file2 directory]]) ifTrue:[ |
|
4249 |
^ file1 baseName = file2 baseName |
|
4250 |
]. |
|
3982 | 4251 |
^ (file1 pathName) startsWith:(file2 pathName) |
3892 | 4252 |
! |
4253 |
||
4254 |
getAllFilesAsStringCollection |
|
4255 |
||
4256 |
^ self application:#DirectoryContentsBrowser do:#getAllFilesAsStringCollection. |
|
4257 |
! |
|
4258 |
||
4259 |
getBestDirectory |
|
4260 |
||
4261 |
|selFiles stringCol firstPre| |
|
4262 |
||
4263 |
selFiles := self currentDirectories value. |
|
4264 |
selFiles isEmpty ifTrue:[^ nil]. |
|
4265 |
selFiles size == 1 ifTrue:[^ selFiles first]. |
|
4266 |
stringCol := (selFiles collect:[: file| file asString]) asOrderedCollection. |
|
4267 |
firstPre := stringCol at:1. |
|
4268 |
stringCol from:2 do:[:el| |
|
4269 |
firstPre := firstPre commonPrefixWith:el. |
|
4270 |
]. |
|
4271 |
(firstPre endsWith:(OperatingSystem fileSeparator)) ifTrue:[ |
|
4272 |
firstPre removeLast. |
|
4273 |
]. |
|
4274 |
^ firstPre asFilename |
|
4275 |
! |
|
4276 |
||
3982 | 4277 |
getCommonForCurrentFiles |
3892 | 4278 |
|
4279 |
|selFiles stringCol firtsPre| |
|
4280 |
||
4281 |
selFiles := self currentFileNameHolder value. |
|
4282 |
selFiles isEmpty ifTrue:[^ nil]. |
|
4283 |
stringCol := selFiles collect:[: file| file asString]. |
|
4284 |
firtsPre := stringCol at:1. |
|
4285 |
stringCol from:2 do:[:el| |
|
4286 |
firtsPre := firtsPre commonPrefixWith:el. |
|
4287 |
]. |
|
4288 |
^ firtsPre asFilename |
|
4289 |
! |
|
4290 |
||
4291 |
getDirWithoutFileName:aFileName |
|
4292 |
||
4293 |
| dir | |
|
4294 |
aFileName isNil ifTrue:[ |
|
4295 |
^ aFileName. |
|
4296 |
]. |
|
4297 |
dir := aFileName asFilename. |
|
4298 |
dir isDirectory ifFalse:[ |
|
4299 |
dir := dir directory. |
|
4300 |
]. |
|
4301 |
^ dir. |
|
4302 |
! |
|
4303 |
||
4304 |
getInfoItem |
|
4305 |
"get filename of a description-file (.dir.info, README etc.); |
|
4306 |
This file is automatically shown when a directory is enterred. |
|
4307 |
You can add more names below if you like." |
|
4308 |
||
4309 |
|directories| |
|
4310 |
||
3982 | 4311 |
directories := self currentSelectedDirectories. |
3892 | 4312 |
(directories size ~= 1) ifTrue:[ ^ nil]. |
4313 |
||
4314 |
#( |
|
4315 |
'.dir.info' |
|
4316 |
'README' |
|
4317 |
'ReadMe' |
|
4318 |
'Readme' |
|
4319 |
'readme' |
|
4320 |
'read.me' |
|
4321 |
'Read.me' |
|
4322 |
'READ.ME' |
|
4323 |
'README.TXT' |
|
4324 |
'readme.txt' |
|
4325 |
'Readme.txt' |
|
4326 |
'Info.txt' |
|
4327 |
'info.txt' |
|
4328 |
'INFO.TXT' |
|
4329 |
) do:[:f | |
|
3982 | 4330 |
|n dir| |
4331 |
||
3892 | 4332 |
n := (directories first) construct:f. |
4333 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
|
3982 | 4334 |
^ DirectoryContentsBrowser itemClass fileName:n |
3892 | 4335 |
] |
4336 |
]. |
|
4337 |
^ nil |
|
3982 | 4338 |
! ! |
4339 |
||
4340 |
!AbstractFileBrowser methodsFor:'selection'! |
|
4341 |
||
4342 |
currentSelectedDirectories |
|
4343 |
||
4344 |
^ self currentDirectories value. |
|
4345 |
! |
|
4346 |
||
4347 |
currentSelectedFiles |
|
4348 |
||
4349 |
| files | |
|
4350 |
files := self currentFileNameHolder value. |
|
4351 |
^ (files select:[: file | file isDirectory not]). |
|
4352 |
! |
|
4353 |
||
4354 |
firstSelectedFile |
|
4355 |
||
4356 |
| files | |
|
4357 |
files := self currentFileNameHolder value. |
|
4358 |
^ (files detect:[: file | file isDirectory not] ifNone:[nil]). |
|
3892 | 4359 |
! ! |
4360 |
||
3964 | 4361 |
!AbstractFileBrowser methodsFor:'sorting'! |
4362 |
||
3989 | 4363 |
currentSortOrder |
4364 |
||
4365 |
" returns a Ordered Collection of all directories currently selected |
|
4366 |
if only a file is selected currentDirectories holds the directory of the file |
|
4367 |
" |
|
4368 |
||
4027 | 4369 |
^ self aspectFor:#currentSortOrder ifAbsent:[ Dictionary new asValue ]. |
3989 | 4370 |
! |
4371 |
||
4372 |
makeDirectorySortBlockFor:aSortBlock |
|
4373 |
||
4011 | 4374 |
^ [:a :b| |
4375 |
|aIsDir bIsDir res| |
|
4376 |
||
4377 |
aIsDir := a isDirectory. |
|
4378 |
bIsDir := b isDirectory. |
|
4379 |
(aIsDir ~~ bIsDir) ifTrue:[ |
|
4380 |
res := aIsDir |
|
4381 |
] ifFalse:[ |
|
4382 |
res := aSortBlock value:a value:b. |
|
4383 |
]. |
|
4384 |
res |
|
4385 |
]. |
|
3989 | 4386 |
! |
4387 |
||
4388 |
sortBlockHolder |
|
4389 |
|nameSortBlock| |
|
4390 |
||
4391 |
^ self aspectFor:#sortBlockHolder ifAbsent:[ |
|
4004 | 4392 |
self sortCaseless value ifTrue:[ |
3989 | 4393 |
nameSortBlock := [ :a :b | a asString asLowercase < b asString asLowercase.]. |
4394 |
] ifFalse:[ |
|
4395 |
nameSortBlock := [ :a :b | a asString < b asString.]. |
|
4396 |
]. |
|
4397 |
(self makeDirectorySortBlockFor:nameSortBlock) asValue. |
|
4398 |
]. |
|
4399 |
! |
|
4400 |
||
4401 |
sortBlockProperty |
|
4402 |
||
4027 | 4403 |
|
3989 | 4404 |
^ self aspectFor:#sortBlockProperty ifAbsent:[ #baseName asValue ]. |
4405 |
! |
|
4406 |
||
4407 |
sortCaseless |
|
4408 |
||
4409 |
^ self aspectFor:#sortCaseless ifAbsent:[ |
|
4410 |
| holder | |
|
4411 |
holder := (Filename isCaseSensitive not) asValue. |
|
4412 |
holder |
|
4413 |
] |
|
4414 |
! |
|
4415 |
||
4416 |
sortFileListsBy:instanceName |
|
4417 |
||
4418 |
self sortFileListsBy:instanceName withReverse:true |
|
4419 |
! |
|
4420 |
||
4421 |
sortFileListsBy:instanceName withReverse:aBoolean |
|
4422 |
||
4011 | 4423 |
| aSymbol sortCaselessLocal currentSortOrder cmpOp instanceSortBlock sortReverse| |
3964 | 4424 |
|
4425 |
aSymbol := instanceName asSymbol. |
|
4027 | 4426 |
self sortBlockProperty setValue:instanceName asSymbol. |
4427 |
currentSortOrder := self currentSortOrder value. |
|
3989 | 4428 |
currentSortOrder isEmpty ifTrue:[ |
4429 |
currentSortOrder at:#column put:aSymbol. |
|
4430 |
currentSortOrder at:#reverse put:false. |
|
4431 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
3964 | 4432 |
] ifFalse:[ |
3989 | 4433 |
(currentSortOrder at:#sortCaseless) ~= sortCaselessLocal ifTrue:[ |
3964 | 4434 |
"/ sort caseless changed |
3989 | 4435 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
3964 | 4436 |
] ifFalse:[ |
3989 | 4437 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
3964 | 4438 |
"/ same column like before - change sort order ifReverse is true |
4439 |
aBoolean ifTrue:[ |
|
4440 |
| isReverse | |
|
3989 | 4441 |
isReverse := currentSortOrder at:#reverse. |
4442 |
currentSortOrder at:#reverse put:(isReverse not). |
|
3964 | 4443 |
]. |
4444 |
] ifFalse:[ |
|
4445 |
"/ another column - remark column |
|
3989 | 4446 |
currentSortOrder at:#column put:aSymbol. |
3964 | 4447 |
] |
4448 |
] |
|
4449 |
]. |
|
4027 | 4450 |
self currentSortOrder changed. |
3989 | 4451 |
sortCaselessLocal := self sortCaseless value. |
4452 |
(currentSortOrder at:#reverse) ifTrue:[ |
|
4453 |
cmpOp := #'>' |
|
4454 |
] ifFalse:[ |
|
4455 |
cmpOp := #'<' |
|
4456 |
]. |
|
4011 | 4457 |
sortReverse := currentSortOrder at:#reverse. |
3989 | 4458 |
instanceSortBlock := [:a :b | |
4011 | 4459 |
|entry1 entry2| |
4460 |
||
4461 |
((a respondsTo:aSymbol) not) ifTrue:[ |
|
4462 |
true |
|
4463 |
] ifFalse:[ |
|
3989 | 4464 |
entry1 := (a perform:aSymbol). |
4465 |
entry2 := (b perform:aSymbol). |
|
4466 |
((entry1 isNil) or:[entry2 isNil]) ifTrue:[ |
|
4467 |
((entry1 isNil) and:[entry2 isNil]) ifTrue:[true] ifFalse:[ |
|
4468 |
((entry1 notNil) and:[entry2 isNil]) ifTrue:[ |
|
4011 | 4469 |
sortReverse |
3989 | 4470 |
]. |
4011 | 4471 |
sortReverse not |
3989 | 4472 |
] |
4473 |
] ifFalse:[ |
|
4474 |
(aSymbol = #baseName) ifTrue:[ |
|
4475 |
sortCaselessLocal ifTrue:[ |
|
4476 |
entry1 := entry1 asString asLowercase. |
|
4477 |
entry2 := entry2 asString asLowercase. |
|
4478 |
] ifFalse:[ |
|
4479 |
entry1 := entry1 asString. |
|
4480 |
entry2 := entry2 asString. |
|
4481 |
]. |
|
4482 |
]. |
|
4483 |
entry1 perform:cmpOp with:entry2 |
|
4484 |
] |
|
4011 | 4485 |
] |
3989 | 4486 |
]. |
4487 |
self sortBlockHolder value:(self makeDirectorySortBlockFor:instanceSortBlock). |
|
3964 | 4488 |
! ! |
4489 |
||
3892 | 4490 |
!AbstractFileBrowser methodsFor:'startup & release'! |
4491 |
||
4492 |
makeDependent |
|
4004 | 4493 |
self filterModel addDependent:self. |
4494 |
self currentFileNameHolder addDependent:self. |
|
4495 |
self sortBlockProperty addDependent:self. |
|
4496 |
self sortCaseless addDependent:self. |
|
4011 | 4497 |
self showHiddenFiles addDependent:self. |
3892 | 4498 |
! |
4499 |
||
4500 |
masterApplication:anApplication |
|
4501 |
||
4502 |
masterApplication isNil ifTrue:[ |
|
4503 |
(anApplication notNil and:[anApplication askFor:#isAbstractFileBrowser]) ifTrue:[ |
|
4504 |
aspects := anApplication aspects |
|
4505 |
] ifFalse:[ |
|
4506 |
aspects isNil ifTrue:[ |
|
4507 |
aspects := IdentityDictionary new. |
|
4508 |
aspects at:#applications put:(IdentityDictionary new). |
|
4509 |
] |
|
4510 |
]. |
|
4511 |
self applications at:(self className) put:self. |
|
4512 |
self makeDependent. |
|
4513 |
]. |
|
3952 | 4514 |
^ super masterApplication:anApplication. |
3892 | 4515 |
! |
4516 |
||
4517 |
postOpenWith:aBuilder |
|
4518 |
||
4519 |
super postOpenWith:aBuilder. |
|
4520 |
! ! |
|
4521 |
||
4522 |
!AbstractFileBrowser::Clipboard methodsFor:'accessing'! |
|
4523 |
||
4524 |
files |
|
4525 |
"return the value of the instance variable 'files' (automatically generated)" |
|
4526 |
||
4527 |
^ files |
|
4528 |
! |
|
4529 |
||
4530 |
files:something |
|
4531 |
"set the value of the instance variable 'files' (automatically generated)" |
|
4532 |
||
4533 |
files := something. |
|
4534 |
! |
|
4535 |
||
4536 |
method |
|
4537 |
"return the value of the instance variable 'method' (automatically generated)" |
|
4538 |
||
4539 |
^ method |
|
4540 |
! |
|
4541 |
||
4542 |
method:something |
|
4543 |
"set the value of the instance variable 'method' (automatically generated)" |
|
4544 |
||
4545 |
method := something. |
|
4546 |
! ! |
|
4547 |
||
4548 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'! |
|
4549 |
||
4550 |
locked |
|
4551 |
"return the value of the instance variable 'locked' (automatically generated)" |
|
4552 |
||
4553 |
locked isNil ifTrue:[ |
|
4554 |
locked := false. |
|
4555 |
]. |
|
4556 |
^ locked |
|
4557 |
! ! |
|
4558 |
||
4559 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'! |
|
4560 |
||
4561 |
doIfUnLocked:aBlock |
|
4562 |
||
4563 |
self locked ifFalse:[ |
|
4564 |
aBlock value. |
|
4565 |
]. |
|
4566 |
! |
|
4567 |
||
4568 |
doLocked:aBlock |
|
4569 |
||
4570 |
locked := true. |
|
4004 | 4571 |
aBlock ensure:[ |
4572 |
locked := false. |
|
4573 |
] |
|
3892 | 4574 |
! ! |
4575 |
||
3952 | 4576 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'! |
4577 |
||
4578 |
historySize |
|
3892 | 4579 |
|
4580 |
^ 20 |
|
4581 |
! ! |
|
4582 |
||
4032 | 4583 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'new'! |
4584 |
||
4585 |
new |
|
4586 |
||
4587 |
^ super new initialize. |
|
4588 |
! ! |
|
4589 |
||
3952 | 4590 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'! |
4591 |
||
3964 | 4592 |
forwardList |
4593 |
"return the value of the instance variable 'forwardList' (automatically generated)" |
|
4594 |
||
4595 |
forwardList isNil ifTrue:[ |
|
4596 |
forwardList := OrderedCollection new. |
|
4597 |
]. |
|
4598 |
^ forwardList |
|
3952 | 4599 |
! ! |
4600 |
||
3892 | 4601 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'actions'! |
4602 |
||
3952 | 4603 |
addToHistory:aPath |
4604 |
| item| |
|
4605 |
||
4606 |
item := self getItemFor:aPath. |
|
4022 | 4607 |
(lastBackPath notNil and:[lastAddPath notNil and:[lastBackPath = aPath]]) ifTrue:[ |
4608 |
lastAddPath := nil. |
|
4609 |
]. |
|
4610 |
lastAddPath notNil ifTrue:[ |
|
4611 |
self backListAdd:lastAddPath. |
|
4612 |
]. |
|
4613 |
lastAddPath := aPath. |
|
3952 | 4614 |
item isNil ifTrue:[ |
4615 |
" not already in history" |
|
4616 |
self size >= self class historySize ifTrue:[ |
|
4617 |
self removeLast. |
|
4618 |
]. |
|
4619 |
item := DirectoryHistoryItem path:aPath. |
|
4620 |
self addFirst:item |
|
4621 |
] ifFalse:[ |
|
4622 |
"already been there before; move the entry to |
|
4623 |
the beginning, so it will fall out later." |
|
3982 | 4624 |
self remove:item. |
4625 |
self addFirst:item |
|
3892 | 4626 |
]. |
3952 | 4627 |
! |
4628 |
||
4022 | 4629 |
backListAdd:aPath |
4630 |
||
4631 |
backList size >= self class historySize ifTrue:[ |
|
4632 |
backList removeLast. |
|
4633 |
]. |
|
4634 |
backList addFirst:aPath. |
|
4635 |
! |
|
4636 |
||
3964 | 4637 |
forwardListAdd:aPath |
4638 |
||
4022 | 4639 |
forwardList size >= self class historySize ifTrue:[ |
4640 |
forwardList removeLast. |
|
3892 | 4641 |
]. |
4022 | 4642 |
forwardList addFirst:aPath. |
4643 |
! |
|
4644 |
||
4645 |
goBack |
|
4646 |
||
4647 |
" search the item in the list and give back the next in the list" |
|
4648 |
||
4649 |
| retPath| |
|
4650 |
||
4651 |
backList isEmpty ifTrue:[ ^ nil]. |
|
4652 |
retPath := backList first. |
|
4653 |
self forwardListAdd:(self first path). |
|
4654 |
lastBackPath := retPath. |
|
4655 |
backList removeFirst. |
|
4656 |
^ retPath. |
|
4657 |
! |
|
4658 |
||
4659 |
goForward |
|
4660 |
||
4661 |
" return first path of forward list" |
|
4662 |
||
4663 |
| retPath| |
|
4664 |
self forwardList isEmpty ifTrue:[ ^ nil]. |
|
4665 |
retPath := self forwardList first. |
|
4666 |
self forwardList removeFirst. |
|
4667 |
^ retPath. |
|
4668 |
! |
|
4669 |
||
4670 |
resetForwardBackward |
|
4671 |
||
4672 |
backList := self collect:[:item| item path]. |
|
4673 |
forwardList := OrderedCollection new. |
|
4674 |
! |
|
4675 |
||
4676 |
setPosition:aPosition for:aPath |
|
4677 |
||
4678 |
self do:[:item| |
|
4679 |
item path = aPath ifTrue:[ |
|
4680 |
item position:aPosition. |
|
4681 |
] |
|
4682 |
]. |
|
4683 |
! |
|
4684 |
||
4685 |
xxgoBackFrom:aPath |
|
3964 | 4686 |
|
4687 |
" search the item in the list and give back the next in the list" |
|
4688 |
||
4689 |
| index retVal| |
|
4690 |
||
4691 |
self isEmpty ifTrue:[ ^ nil]. |
|
4022 | 4692 |
|
3964 | 4693 |
aPath isNil ifTrue:[ |
4694 |
retVal := self first path |
|
4695 |
] ifFalse:[ |
|
4696 |
index := self findFirst:[:item| item path = aPath]. |
|
4697 |
index == 0 ifTrue:[ |
|
4698 |
retVal := self first path |
|
4699 |
] ifFalse:[ |
|
4700 |
index < self size ifTrue:[ |
|
4701 |
retVal := ((self at:index + 1) path). |
|
4702 |
] |
|
4703 |
]. |
|
4704 |
]. |
|
4705 |
retVal := retVal ? self first path. |
|
4706 |
self forwardListAdd:aPath. |
|
4707 |
^ retVal. |
|
3892 | 4708 |
! ! |
4709 |
||
4032 | 4710 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'initialize'! |
4711 |
||
4712 |
initialize |
|
4713 |
||
4714 |
backList := OrderedCollection new. |
|
4715 |
forwardList := OrderedCollection new. |
|
4716 |
! ! |
|
4717 |
||
3892 | 4718 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'queries'! |
4719 |
||
4024 | 4720 |
canBack |
3964 | 4721 |
|
4022 | 4722 |
^ backList notEmpty |
3892 | 4723 |
! |
4724 |
||
4725 |
canForward |
|
4726 |
||
3964 | 4727 |
^ self forwardList notEmpty. |
4728 |
! |
|
4729 |
||
4730 |
getBackCollectionFrom:aPath |
|
3952 | 4731 |
|
4022 | 4732 |
"/ | backCol index | |
4733 |
"/ |
|
4734 |
"/ backCol := OrderedCollection new. |
|
4735 |
"/ aPath isNil ifTrue:[ |
|
4736 |
"/ index := 0. |
|
4737 |
"/ ] ifFalse:[ |
|
4738 |
"/ index := self findFirst:[:item| item path = aPath]. |
|
4739 |
"/ ]. |
|
4740 |
"/ "/ if aPath is not in collection starts from 1 with collect af path |
|
4741 |
"/ index < self size ifTrue:[ |
|
4742 |
"/ self from:(index + 1) to:(self size) do:[:item | |
|
4743 |
"/ backCol add:(item path). |
|
4744 |
"/ ]. |
|
4745 |
"/ ]. |
|
4746 |
^ backList. |
|
3952 | 4747 |
! |
4748 |
||
4749 |
getForwardCollection |
|
4750 |
||
3964 | 4751 |
^ self forwardList. |
3952 | 4752 |
! |
4753 |
||
4754 |
getItemFor:aPath |
|
4755 |
||
4756 |
self do:[:item| item path = aPath ifTrue:[^ item]]. |
|
4757 |
^ nil. |
|
4758 |
! |
|
4759 |
||
4760 |
getPositionFor:aPath |
|
4761 |
||
4762 |
|item| |
|
4763 |
||
4764 |
item := self getItemFor:aPath. |
|
4765 |
||
4766 |
item notNil ifTrue:[ |
|
4767 |
^ item position. |
|
4768 |
]. |
|
4769 |
^ nil |
|
4770 |
! |
|
4771 |
||
4772 |
includesPath:aPath |
|
4773 |
||
4774 |
self do:[:item| item path = aPath ifTrue:[^ true]]. |
|
4775 |
^ false. |
|
4776 |
! ! |
|
4777 |
||
4778 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'! |
|
4779 |
||
4780 |
path:aPath |
|
4781 |
||
4782 |
^ self new path:aPath |
|
4783 |
! ! |
|
4784 |
||
4785 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'! |
|
4786 |
||
4787 |
path |
|
4788 |
"return the value of the instance variable 'path' (automatically generated)" |
|
4789 |
||
4790 |
^ path |
|
4791 |
! |
|
4792 |
||
4793 |
path:something |
|
4794 |
"set the value of the instance variable 'path' (automatically generated)" |
|
4795 |
||
4796 |
path := something. |
|
4797 |
! |
|
4798 |
||
4799 |
position |
|
4800 |
"return the value of the instance variable 'position' (automatically generated)" |
|
4801 |
||
4802 |
^ position |
|
4803 |
! |
|
4804 |
||
4805 |
position:something |
|
4806 |
"set the value of the instance variable 'position' (automatically generated)" |
|
4807 |
||
4808 |
position := something. |
|
4809 |
! |
|
4810 |
||
4811 |
printString |
|
4812 |
||
4813 |
^ self path asString |
|
3892 | 4814 |
! ! |
4815 |
||
4816 |
!AbstractFileBrowser::FilenameHistory class methodsFor:'attributes access'! |
|
4817 |
||
4818 |
FilenameHistorySize |
|
4819 |
||
4820 |
^ 20 |
|
4821 |
! |
|
4822 |
||
4823 |
HistorySize |
|
4824 |
||
4825 |
^ 20 |
|
4826 |
! ! |
|
4827 |
||
4828 |
!AbstractFileBrowser::FilenameHistory methodsFor:'adding & removing'! |
|
4829 |
||
4830 |
add:aApplItem |
|
4831 |
||
4832 |
super add:aApplItem. |
|
4833 |
(self size > self class FilenameHistorySize) ifTrue:[ |
|
4834 |
self removeLast. |
|
4835 |
] |
|
4836 |
! ! |
|
4837 |
||
4838 |
!AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'! |
|
4839 |
||
4840 |
withValue:aValue isHolder:aBoolean |
|
4841 |
||
4842 |
| instance | |
|
4843 |
||
4844 |
instance := self basicNew. |
|
4845 |
instance value:aValue. |
|
4846 |
instance isHolder:aBoolean. |
|
4847 |
^ instance |
|
4848 |
! ! |
|
4849 |
||
4850 |
!AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'! |
|
4851 |
||
4852 |
isHolder |
|
4853 |
"return the value of the instance variable 'isHolder' (automatically generated)" |
|
4854 |
||
4855 |
^ isHolder |
|
4856 |
! |
|
4857 |
||
4858 |
isHolder:something |
|
4859 |
"set the value of the instance variable 'isHolder' (automatically generated)" |
|
4860 |
||
4861 |
isHolder := something. |
|
4862 |
! |
|
4863 |
||
4864 |
value |
|
4865 |
"return the value of the instance variable 'value' (automatically generated)" |
|
4866 |
||
4867 |
^ value |
|
4868 |
! |
|
4869 |
||
4870 |
value:something |
|
4871 |
"set the value of the instance variable 'value' (automatically generated)" |
|
4872 |
||
4873 |
value := something. |
|
4874 |
! ! |
|
4875 |
||
4876 |
!AbstractFileBrowser class methodsFor:'documentation'! |
|
4877 |
||
4878 |
version |
|
4060 | 4879 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.32 2002-10-25 12:02:22 penk Exp $' |
3892 | 4880 |
! ! |