author | Claus Gittinger <cg@exept.de> |
Mon, 30 Jun 2003 11:38:05 +0200 | |
changeset 5007 | 82d60e287837 |
parent 5001 | 0f93de1a9531 |
child 5008 | 3f24f5a9f740 |
permissions | -rw-r--r-- |
3892 | 1 |
"{ Package: 'stx:libtool' }" |
2 |
||
3 |
AbstractFileBrowser subclass:#FileApplicationNoteBook |
|
4621 | 4 |
instanceVariableNames:'canvasHolder selectedEditorPage listOfApplications tabMenuIndex |
5 |
tabList selectionHistoryList privateTabList' |
|
6 |
classVariableNames:'' |
|
7 |
poolDictionaries:'' |
|
8 |
category:'Interface-Tools-File' |
|
3892 | 9 |
! |
10 |
||
11 |
AbstractFileApplicationNoteBookComponent subclass:#ArchiveViewApplication |
|
4621 | 12 |
instanceVariableNames:'archiveFileList enableStopButton fileTable currentSortOrder |
13 |
selectionHolder tableColumns commandProcess errorListHolder |
|
14 |
viewErrorList temporaryDirectory enableRemoveErrorOutput |
|
15 |
errorListVisibilityHolder hasListEntriesHolder archiver process |
|
16 |
terminateByMe columnDescriptors inDropMode' |
|
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
privateIn:FileApplicationNoteBook |
|
3892 | 20 |
! |
21 |
||
22 |
Object subclass:#ArchivItem |
|
4621 | 23 |
instanceVariableNames:'fileName size dateAndTime permissions icon ownerGroup method crc |
24 |
compressSize ratio version type isDirectory' |
|
25 |
classVariableNames:'' |
|
26 |
poolDictionaries:'' |
|
27 |
privateIn:FileApplicationNoteBook::ArchiveViewApplication |
|
3892 | 28 |
! |
29 |
||
30 |
AbstractFileApplicationNoteBookComponent subclass:#CommandResult |
|
4621 | 31 |
instanceVariableNames:'resultStream enableStopButton process labelHolder' |
32 |
classVariableNames:'' |
|
33 |
poolDictionaries:'' |
|
34 |
privateIn:FileApplicationNoteBook |
|
3892 | 35 |
! |
36 |
||
37 |
AbstractFileApplicationNoteBookComponent subclass:#HtmlViewApplication |
|
4621 | 38 |
instanceVariableNames:'htmlView labelHolder infoLabelHolder' |
39 |
classVariableNames:'' |
|
40 |
poolDictionaries:'' |
|
41 |
privateIn:FileApplicationNoteBook |
|
3892 | 42 |
! |
43 |
||
44 |
AbstractFileApplicationNoteBookComponent subclass:#ImageViewApplication |
|
4621 | 45 |
instanceVariableNames:'imageFile imageView image fitSize fitMode' |
46 |
classVariableNames:'' |
|
47 |
poolDictionaries:'' |
|
48 |
privateIn:FileApplicationNoteBook |
|
3892 | 49 |
! |
50 |
||
51 |
AbstractFileApplicationNoteBookComponent subclass:#Terminal |
|
4621 | 52 |
instanceVariableNames:'terminalView' |
4759 | 53 |
classVariableNames:'DefaultLineLimit' |
4621 | 54 |
poolDictionaries:'' |
55 |
privateIn:FileApplicationNoteBook |
|
3892 | 56 |
! |
57 |
||
58 |
AbstractFileApplicationNoteBookComponent subclass:#TextEditor |
|
4953 | 59 |
instanceVariableNames:'fileContentsModel modifiedChannel editView enableSave |
4621 | 60 |
enableReload presentation changeItemProcess closeApplication |
61 |
semaChangeItem printAsHexDump itemChanged itemRemoved |
|
4969 | 62 |
enableHexToggle md5CheckSum md5HashValueComputationProcess |
63 |
viewModifiedChannel textEditorModificationTime checkModifiedBlock' |
|
4621 | 64 |
classVariableNames:'' |
65 |
poolDictionaries:'' |
|
66 |
privateIn:FileApplicationNoteBook |
|
3892 | 67 |
! |
68 |
||
69 |
AbstractFileApplicationNoteBookComponent subclass:#XViewApplication |
|
4621 | 70 |
instanceVariableNames:'xView xFile vncServerPID vncPortNr vncConnection viewerPID |
71 |
vncLock vncServerIsTerminated xItem ext' |
|
72 |
classVariableNames:'' |
|
73 |
poolDictionaries:'' |
|
74 |
privateIn:FileApplicationNoteBook |
|
3892 | 75 |
! |
76 |
||
77 |
||
78 |
!FileApplicationNoteBook class methodsFor:'application list'! |
|
79 |
||
80 |
applicationList |
|
81 |
" returns a list of all applications to start by the NoteBookApplication with |
|
82 |
#className #type |
|
83 |
||
84 |
example: |
|
85 |
#( #'FooEditor' nil ) |
|
86 |
" |
|
87 |
||
88 |
^ #( |
|
89 |
#( #'TextEditor' #file ) |
|
90 |
#( #'TextEditor' #directoryDescription ) |
|
91 |
#( #'HtmlViewApplication' nil ) |
|
92 |
#( #'FindFileApplication' nil ) |
|
93 |
#( #'Terminal' nil ) |
|
94 |
#( #'ImageViewApplication' nil ) |
|
95 |
#( #'ArchiveViewApplication' nil ) |
|
96 |
#( #'CommandResult' nil ) |
|
97 |
#( #'XViewApplication' nil ) |
|
98 |
) |
|
99 |
! |
|
100 |
||
101 |
classFor:aApplicationListItem |
|
102 |
|rawName cls| |
|
103 |
||
104 |
rawName := aApplicationListItem at:1. |
|
105 |
(cls := self privateClassesAt:rawName) isNil ifTrue:[ |
|
106 |
cls := Smalltalk at:rawName. |
|
107 |
]. |
|
108 |
^ cls |
|
109 |
! |
|
110 |
||
111 |
defaultApplication |
|
112 |
" returns the application to be started if no itemQuery returns true or no supportedSuffix is supported |
|
113 |
" |
|
114 |
||
115 |
^ self applicationList detect:[: applItem| |
|
116 |
(((self classFor:applItem) == self textEditorClass) |
|
117 |
and:[(self typeFor:applItem) == #file]) |
|
118 |
] ifNone:[nil]. |
|
119 |
! |
|
120 |
||
121 |
typeFor:aApplicationListItem |
|
122 |
||
123 |
^ aApplicationListItem at:2 |
|
124 |
! ! |
|
125 |
||
126 |
!FileApplicationNoteBook class methodsFor:'classAccess'! |
|
127 |
||
128 |
textEditorClass |
|
129 |
||
130 |
^ TextEditor |
|
131 |
! ! |
|
132 |
||
133 |
!FileApplicationNoteBook class methodsFor:'defaults'! |
|
134 |
||
135 |
openAnotherApplicationOnSameItem |
|
136 |
||
137 |
^ false |
|
138 |
! ! |
|
139 |
||
140 |
!FileApplicationNoteBook class methodsFor:'interface specs'! |
|
141 |
||
142 |
windowSpec |
|
143 |
"This resource specification was automatically generated |
|
144 |
by the UIPainter of ST/X." |
|
145 |
||
146 |
"Do not manually edit this!! If it is corrupted, |
|
147 |
the UIPainter may not be able to read the specification." |
|
148 |
||
149 |
" |
|
150 |
UIPainter new openOnClass:NoteBookApplication andSelector:#windowSpec |
|
151 |
NoteBookApplication new openInterface:#windowSpec |
|
152 |
NoteBookApplication open |
|
153 |
" |
|
154 |
||
155 |
<resource: #canvas> |
|
156 |
||
157 |
^ |
|
158 |
#(#FullSpec |
|
159 |
#name: #windowSpec |
|
160 |
#window: |
|
161 |
#(#WindowSpec |
|
162 |
#label: 'FileBrowserV2TextEditor' |
|
163 |
#name: 'FileBrowserV2TextEditor' |
|
164 |
#min: #(#Point 10 10) |
|
165 |
#max: #(#Point 1024 768) |
|
166 |
#bounds: #(#Rectangle 16 42 316 342) |
|
167 |
) |
|
168 |
#component: |
|
169 |
#(#SpecCollection |
|
170 |
#collection: #( |
|
171 |
#(#NoteBookViewSpec |
|
172 |
#name: 'CommandAndTextEditor' |
|
173 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
174 |
#model: #selectedEditorPage |
|
175 |
#menu: #tabList |
|
176 |
#useIndex: true |
|
177 |
#accessTabMenuAction: #tabMenuAt: |
|
178 |
#canvas: #canvasHolder |
|
179 |
#keepCanvasAlive: true |
|
180 |
) |
|
181 |
) |
|
182 |
||
183 |
) |
|
184 |
) |
|
185 |
! ! |
|
186 |
||
187 |
!FileApplicationNoteBook class methodsFor:'menu specs'! |
|
188 |
||
189 |
tabMenu |
|
190 |
"This resource specification was automatically generated |
|
191 |
by the MenuEditor of ST/X." |
|
192 |
||
193 |
"Do not manually edit this!! If it is corrupted, |
|
194 |
the MenuEditor may not be able to read the specification." |
|
195 |
||
196 |
" |
|
197 |
MenuEditor new openOnClass:FileApplicationNoteBook andSelector:#tabMenu |
|
198 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook tabMenu)) startUp |
|
199 |
" |
|
200 |
||
201 |
<resource: #menu> |
|
202 |
||
203 |
^ |
|
204 |
#(#Menu |
|
205 |
#( |
|
206 |
#(#MenuItem |
|
4392 | 207 |
#label: 'New Text Editor' |
208 |
#itemValue: #newTextEditor |
|
4045 | 209 |
#translateLabel: true |
4392 | 210 |
) |
211 |
#(#MenuItem |
|
212 |
#label: 'Select in Filelist' |
|
213 |
#itemValue: #doSelectInList |
|
214 |
#translateLabel: true |
|
4045 | 215 |
) |
216 |
#(#MenuItem |
|
4572 | 217 |
#label: 'Rename' |
218 |
#itemValue: #doRenameTab |
|
219 |
#translateLabel: true |
|
220 |
) |
|
221 |
#(#MenuItem |
|
222 |
#label: '-' |
|
223 |
) |
|
224 |
#(#MenuItem |
|
3892 | 225 |
#label: 'Close' |
4392 | 226 |
#itemValue: #doCloseApplication |
3892 | 227 |
#translateLabel: true |
228 |
) |
|
229 |
) |
|
230 |
nil |
|
231 |
nil |
|
232 |
) |
|
233 |
! ! |
|
234 |
||
235 |
!FileApplicationNoteBook methodsFor:'accessing'! |
|
236 |
||
237 |
listOfApplications |
|
238 |
"return the value of the instance variable 'listOfApplications' (automatically generated)" |
|
239 |
||
240 |
listOfApplications isNil ifTrue:[ |
|
241 |
listOfApplications := OrderedCollection new. |
|
242 |
]. |
|
243 |
^ listOfApplications |
|
244 |
! |
|
245 |
||
246 |
selectionHistoryList |
|
247 |
||
248 |
selectionHistoryList isNil ifTrue:[ |
|
249 |
selectionHistoryList := OrderedCollection new. |
|
250 |
]. |
|
251 |
^ selectionHistoryList |
|
252 |
! |
|
253 |
||
254 |
selectionHistoryList:aCol |
|
255 |
||
256 |
selectionHistoryList := aCol |
|
257 |
! ! |
|
258 |
||
4360 | 259 |
!FileApplicationNoteBook methodsFor:'accessing-applications'! |
3892 | 260 |
|
261 |
getAllApplicationsByClass:aClass andType:aType |
|
262 |
||
263 |
^ self listOfApplications select:[ : appl | |
|
264 |
((appl class = aClass) |
|
265 |
and:[appl type = aType]) |
|
266 |
]. |
|
267 |
! |
|
268 |
||
269 |
getApplicationByType:aType |
|
270 |
||
271 |
^ self listOfApplications detect:[ : appl | |
|
272 |
(appl type == aType) |
|
273 |
] ifNone:[nil]. |
|
274 |
! |
|
275 |
||
276 |
getIndexFor:aApplication |
|
277 |
||
278 |
| index | |
|
279 |
||
280 |
index := self listOfApplications indexOf:aApplication. |
|
281 |
index ~~ 0 ifTrue:[ |
|
282 |
^ index. |
|
283 |
]. |
|
284 |
^ nil. |
|
285 |
! |
|
286 |
||
287 |
getSameApplicationsFor:aApplication |
|
288 |
||
289 |
^ self listOfApplications select:[ : appl | |
|
290 |
( (appl ~= aApplication) |
|
291 |
and:[ (appl isKindOf:(aApplication class)) |
|
292 |
and:[ (appl item = (aApplication item)) |
|
293 |
and:[ (appl type == aApplication type) ]]]) |
|
294 |
]. |
|
295 |
! ! |
|
296 |
||
297 |
!FileApplicationNoteBook methodsFor:'actions-app-common'! |
|
298 |
||
299 |
changeItem:aItem for:aAppl |
|
300 |
||
4988 | 301 |
| applIndex string isDirectory | |
3892 | 302 |
|
303 |
applIndex := self getIndexFor:aAppl. |
|
4989 | 304 |
aItem notNil ifTrue:[ |
305 |
isDirectory := aItem isDirectory or:[aItem linkTargetIsDirectory ]. |
|
306 |
||
307 |
(isDirectory not) ifTrue:[ |
|
308 |
(aAppl changeItem:aItem) ifFalse:[ ^ self]. |
|
309 |
self fileHistory add:aItem. |
|
310 |
self enableFileHistory value:true. |
|
311 |
]. |
|
3892 | 312 |
]. |
313 |
string := aAppl getTabString. |
|
4045 | 314 |
self privateTabList at:applIndex put:(Text fromString:string). |
3892 | 315 |
self doSelect:aAppl. |
316 |
! |
|
317 |
||
4161 | 318 |
changeModified:aSymbol for:aAppl |
319 |
||
320 |
| index text stream| |
|
4045 | 321 |
|
322 |
index := self getIndexFor:aAppl. |
|
323 |
index isNil ifTrue:[ ^ self]. |
|
4161 | 324 |
stream := WriteStream with:aAppl getTabString. |
325 |
aSymbol ~~ #unchanged ifTrue:[ |
|
326 |
stream space. |
|
327 |
stream nextPut:$[. |
|
328 |
stream nextPutAll:aSymbol asString. |
|
329 |
stream nextPut:$]. |
|
330 |
text := stream contents asText. |
|
4499 | 331 |
text emphasizeAllWith:UserPreferences current emphasisForModifiedBuffer. |
4161 | 332 |
] ifFalse:[ |
333 |
text := stream contents asText. |
|
334 |
]. |
|
335 |
self privateTabList at:index put:text. |
|
336 |
self selectedEditorPage value == index ifTrue:[ |
|
337 |
self changeFileBrowserTitleTo:text. |
|
4045 | 338 |
]. |
339 |
! |
|
340 |
||
3892 | 341 |
closeSubCanvas:aApplication |
342 |
||
3929 | 343 |
| applIndex historyList localHistoryList selectedPage| |
3892 | 344 |
|
345 |
applIndex := self getIndexFor:aApplication. |
|
346 |
applIndex notNil ifTrue:[ |
|
347 |
"/ "/ UPDATE THE LAST SELECTION BECAUSE SEL INDEX IS DECREMENTED FOR HIGHER INDEXES |
|
348 |
"/ self lastSelection:applIndex. |
|
349 |
||
350 |
historyList := self selectionHistoryList. |
|
351 |
historyList remove:applIndex ifAbsent:nil. |
|
352 |
localHistoryList := OrderedCollection new. |
|
353 |
historyList notEmpty ifTrue:[ |
|
3929 | 354 |
selectedPage := historyList last. |
3892 | 355 |
] ifFalse:[ |
3929 | 356 |
selectedPage := 1. |
357 |
]. |
|
358 |
self selectedEditorPage value:selectedPage. |
|
359 |
||
3892 | 360 |
historyList do:[ : index | |
361 |
index <= applIndex ifTrue:[ |
|
362 |
localHistoryList add:index |
|
363 |
] ifFalse:[ |
|
364 |
localHistoryList add:(index - 1) |
|
365 |
] |
|
366 |
]. |
|
367 |
self selectionHistoryList:localHistoryList. |
|
368 |
self listOfApplications removeIndex:applIndex. |
|
369 |
self privateTabList removeIndex:applIndex. |
|
370 |
self privateTabList isEmpty ifTrue:[ |
|
371 |
self viewNoteBookApplicationHolder value:false. |
|
372 |
self enableViewNoteBookApplication value:false. |
|
4375 | 373 |
self changeFileBrowserTitleTo:'FileBrowser V2'. |
374 |
||
3892 | 375 |
] ifFalse:[ |
376 |
historyList notEmpty ifTrue:[ |
|
377 |
self selectedEditorPage value:(self selectionHistoryList last). |
|
378 |
] |
|
379 |
] |
|
380 |
]. |
|
381 |
||
382 |
"/ because subCanvas was configured to keep its view, |
|
383 |
"/ we must destroy it here. |
|
3987 | 384 |
aApplication window destroy. |
3892 | 385 |
! |
386 |
||
387 |
doCloseApplication |
|
388 |
||
389 |
| appl | |
|
390 |
||
391 |
appl := self listOfApplications at:tabMenuIndex. |
|
392 |
appl doClose. |
|
393 |
! |
|
394 |
||
4572 | 395 |
doRenameTab |
396 |
| newLabel | |
|
397 |
||
398 |
newLabel := Dialog request:'New Tab Label:' initialAnswer:(self privateTabList at:tabMenuIndex). |
|
399 |
newLabel size == 0 ifTrue:[^ self ]. |
|
400 |
self privateTabList at:tabMenuIndex put:newLabel |
|
401 |
! |
|
402 |
||
4045 | 403 |
doSelectInList |
404 |
||
405 |
| appl fileName| |
|
406 |
||
407 |
appl := self listOfApplications at:tabMenuIndex. |
|
408 |
fileName := appl fileName. |
|
409 |
fileName notNil ifTrue:[ |
|
410 |
self gotoFile:fileName. |
|
411 |
]. |
|
412 |
! |
|
413 |
||
3892 | 414 |
openApplByFileItem:aItem |
415 |
||
416 |
" use the default class list for open of applications by item " |
|
417 |
||
418 |
| applList applItem itemClass| |
|
419 |
||
420 |
aItem isNil ifTrue:[ ^ self ]. |
|
421 |
applList := self applicationList. |
|
4110 | 422 |
self openAlwaysInTextEditor value ifTrue:[ |
423 |
^ self openDefaultApplicationByItem:aItem. |
|
424 |
]. |
|
3892 | 425 |
applItem := applList detect:[: aApplItem| |
426 |
itemClass := self class classFor:aApplItem. |
|
427 |
(itemClass canOpenItem:aItem). |
|
428 |
] ifNone:[nil]. |
|
429 |
applItem isNil ifTrue:[ ^ self openDefaultApplicationByItem:aItem]. |
|
430 |
applItem notNil ifTrue:[ |
|
4375 | 431 |
| itemType appl| |
3892 | 432 |
itemType := self class typeFor:applItem. |
433 |
itemClass := self class classFor:applItem. |
|
4375 | 434 |
appl := self openApplicationClass:itemClass withItem:aItem withType:itemType. |
435 |
appl notNil ifTrue:[ ^ appl]. |
|
436 |
^ self openDefaultApplicationByItem:aItem. |
|
3892 | 437 |
]. |
438 |
! |
|
439 |
||
440 |
openApplicationClass:aClass withItem:aItem withType:aType |
|
441 |
||
4392 | 442 |
^ self openApplicationClass:aClass withItem:aItem withType:aType checkExisting:true |
443 |
! |
|
444 |
||
445 |
openApplicationClass:aClass withItem:aItem withType:aType checkExisting:checkExisting |
|
446 |
||
4620 | 447 |
^ self openApplicationClass:aClass |
448 |
withItem:aItem |
|
449 |
withType:aType |
|
450 |
checkExisting:checkExisting |
|
451 |
preSetItem:nil |
|
452 |
! |
|
453 |
||
454 |
openApplicationClass:aClass withItem:aItem withType:aType checkExisting:checkExisting preSetItem:aBlock |
|
4774 | 455 |
|existingAppl newAppl| |
456 |
||
457 |
"do not open unreadable items" |
|
4392 | 458 |
checkExisting ifTrue:[ |
459 |
(aItem notNil and:[aItem isDirectory not and:[aItem fileName isReadable not]]) ifTrue:[ |
|
460 |
Dialog warn:'Can not open unreadable file ', aItem fileName baseName. |
|
461 |
AbortSignal raise. |
|
462 |
]. |
|
4620 | 463 |
existingAppl := self tryToGetExistingApplFor:aClass withItem:aItem withType:aType preSetItem:aBlock. |
4392 | 464 |
existingAppl notNil ifTrue:[ |
465 |
self doSelect:existingAppl. |
|
466 |
^ existingAppl |
|
467 |
]. |
|
3892 | 468 |
]. |
469 |
newAppl := aClass new. |
|
4620 | 470 |
aBlock notNil ifTrue:[ |
471 |
aBlock value:newAppl. |
|
472 |
]. |
|
3892 | 473 |
newAppl type:aType. |
474 |
(newAppl item:aItem) ifFalse:[ ^ nil ]. |
|
3906 | 475 |
(aItem notNil and:[(aItem isDirectory not) and:[aType ~= #directoryDescription]]) ifTrue:[ |
3892 | 476 |
self fileHistory add:aItem. |
477 |
self enableFileHistory value:true. |
|
478 |
]. |
|
479 |
self setSameFileIndexFor:newAppl. |
|
480 |
self startApplication:newAppl. |
|
481 |
^ newAppl |
|
482 |
! |
|
483 |
||
484 |
openDefaultApplicationByItem:aItem |
|
485 |
" open the default application if no application for item is available or the start of the |
|
486 |
available application failed |
|
487 |
" |
|
488 |
| applItem | |
|
489 |
||
490 |
applItem := self class defaultApplication. |
|
491 |
applItem notNil ifTrue:[ |
|
492 |
| itemType itemClass| |
|
493 |
itemType := self class typeFor:applItem. |
|
494 |
itemClass := self class classFor:applItem. |
|
495 |
^ self openApplicationClass:itemClass withItem:aItem withType:itemType. |
|
496 |
]. |
|
497 |
^ nil |
|
498 |
! |
|
499 |
||
500 |
setSameFileIndexFor:anAppl |
|
501 |
||
502 |
|sameFiles index item| |
|
503 |
||
504 |
self class openAnotherApplicationOnSameItem not ifTrue:[ |
|
505 |
anAppl sameFileIndex:nil. |
|
506 |
^ self. |
|
507 |
]. |
|
508 |
item := anAppl item. |
|
509 |
item notNil ifTrue:[ |
|
510 |
| hasSameFiles | |
|
511 |
sameFiles := self getSameApplicationsFor:anAppl. |
|
512 |
hasSameFiles := sameFiles notEmpty. |
|
513 |
hasSameFiles ifTrue:[ |
|
514 |
(sameFiles size == 1 and:[sameFiles first sameFileIndex isNil]) ifTrue:[ |
|
515 |
anAppl sameFileIndex:1. |
|
516 |
^ self |
|
517 |
] ifFalse:[ |
|
518 |
index := (sameFiles collect:[:el | (el sameFileIndex ? 1)]) max. |
|
519 |
anAppl sameFileIndex:index + 1. |
|
520 |
^ self |
|
521 |
] |
|
522 |
]. |
|
523 |
anAppl sameFileIndex:nil. |
|
524 |
]. |
|
525 |
! |
|
526 |
||
5007 | 527 |
startApplication:anApplication |
3892 | 528 |
| window| |
529 |
||
5007 | 530 |
anApplication masterApplication:self. |
531 |
anApplication window ifNil:[ |
|
3892 | 532 |
window := ApplicationSubView new. |
5007 | 533 |
anApplication createBuilder. |
534 |
window client:anApplication. |
|
3892 | 535 |
]. |
5007 | 536 |
self listOfApplications add:anApplication. |
537 |
self privateTabList add:(Text fromString:(anApplication getTabString)). |
|
3892 | 538 |
self viewNoteBookApplicationHolder value:true. |
539 |
self enableViewNoteBookApplication value:true. |
|
5007 | 540 |
self doSelect:anApplication. |
3987 | 541 |
"/ [ |
5007 | 542 |
anApplication postOpenWith:anApplication builder. |
3987 | 543 |
"/ ] forkAt:Processor activePriority. |
3892 | 544 |
! |
545 |
||
546 |
tabStringAdd:aString for:aAppl |
|
547 |
||
548 |
| index text stream| |
|
549 |
||
550 |
index := self getIndexFor:aAppl. |
|
551 |
index isNil ifTrue:[ ^ self]. |
|
552 |
text := self privateTabList at:index. |
|
553 |
stream := WriteStream on:''. |
|
554 |
stream nextPutAll:text. |
|
555 |
stream space. |
|
556 |
stream nextPutAll:aString. |
|
4045 | 557 |
self privateTabList at:index put:(Text fromString:(stream contents)). |
3892 | 558 |
stream close. |
559 |
! |
|
560 |
||
561 |
tabStringChangeTo:aString for:aAppl |
|
562 |
||
563 |
| index| |
|
564 |
||
565 |
index := self getIndexFor:aAppl. |
|
566 |
index isNil ifTrue:[ ^ self]. |
|
4045 | 567 |
self privateTabList at:index put:(Text fromString:aString). |
4180 | 568 |
self selectedEditorPage value == index ifTrue:[ |
569 |
self changeFileBrowserTitleTo:aString. |
|
570 |
]. |
|
3892 | 571 |
! |
572 |
||
4620 | 573 |
tryToGetExistingApplFor:aClass withItem:aItem withType:aType preSetItem:aBlock |
3892 | 574 |
|
575 |
||
4549 | 576 |
| sameAppls changeAppl selAppl| |
3892 | 577 |
|
578 |
aClass wantNewApplicationAnyway ifTrue:[^ nil]. |
|
4549 | 579 |
sameAppls := self getAllApplicationsByClass:aClass andType:aType. |
580 |
sameAppls isEmpty ifTrue:[^ nil]. |
|
3892 | 581 |
((aType == #directoryDescription) or:[aType == #commandResult]) ifTrue:[ |
4549 | 582 |
"/ sameAppls := sameAppl first. |
3892 | 583 |
] ifFalse:[ |
584 |
(self openMultipleApplicationsForType value) ifTrue:[ |
|
585 |
"/ open more than one application for a class and a type |
|
586 |
(self class openAnotherApplicationOnSameItem) ifTrue:[ |
|
587 |
"/ open a new application anyway, no matters if item already open |
|
588 |
^ nil |
|
589 |
] ifFalse:[ |
|
590 |
"/ if item already changed select the application |
|
4549 | 591 |
selAppl := sameAppls detect:[ : appl | |
3892 | 592 |
(appl item = aItem) |
593 |
] ifNone:[nil]. |
|
594 |
]. |
|
595 |
] ifFalse:[ |
|
596 |
"/ keep in same application change the first application of the same class and type - if item not changed otherwise open new |
|
4549 | 597 |
sameAppls := sameAppls select:[ : appl | |
4392 | 598 |
(appl isModified not) |
599 |
]. |
|
3892 | 600 |
]. |
601 |
]. |
|
4393 | 602 |
sameAppls size ~~ 0 ifTrue:[ |
4392 | 603 |
" take first all applications which have nil items |
604 |
second the selected |
|
605 |
third the first |
|
606 |
" |
|
607 |
| nilItemAppls | |
|
608 |
nilItemAppls := sameAppls select:[:appl| appl item == nil ]. |
|
609 |
nilItemAppls notEmpty ifTrue:[sameAppls := nilItemAppls]. |
|
610 |
(sameAppls includes:self selectedApplication) ifTrue:[ |
|
611 |
changeAppl := self selectedApplication. |
|
612 |
] ifFalse:[ |
|
613 |
changeAppl := sameAppls first. |
|
614 |
]. |
|
4620 | 615 |
aBlock notNil ifTrue:[ |
616 |
aBlock value:changeAppl. |
|
617 |
]. |
|
3892 | 618 |
self changeItem:aItem for:changeAppl. |
619 |
selAppl := changeAppl. |
|
620 |
]. |
|
621 |
^ selAppl. |
|
622 |
! ! |
|
623 |
||
624 |
!FileApplicationNoteBook methodsFor:'actions-app-spec'! |
|
625 |
||
4774 | 626 |
addTerminalIn:aDirectory |
627 |
|item| |
|
628 |
||
629 |
item := DirectoryContentsBrowser itemClass fileName:aDirectory. |
|
630 |
self openTerminalApplication:item. |
|
631 |
! |
|
632 |
||
3892 | 633 |
changeDirectoryDescription |
634 |
||
635 |
| aInfoItem| |
|
636 |
||
637 |
aInfoItem := self getInfoItem. |
|
638 |
aInfoItem isNil ifTrue:[ ^ self closeDirectoryDescription ]. |
|
639 |
self openDirectoryDescription. |
|
640 |
! |
|
641 |
||
642 |
closeDirectoryDescription |
|
643 |
||
644 |
| dirContApll | |
|
645 |
||
646 |
dirContApll := self getApplicationByType:#directoryDescription. |
|
647 |
dirContApll notNil ifTrue:[ |
|
648 |
dirContApll doClose. |
|
649 |
]. |
|
650 |
! |
|
651 |
||
4392 | 652 |
newTextEditor |
653 |
||
654 |
^ self openApplicationClass:TextEditor withItem:nil withType:#file checkExisting:false |
|
655 |
! |
|
656 |
||
3892 | 657 |
openArchiveViewApplication:aItem |
658 |
||
659 |
| result | |
|
660 |
result := self openApplicationClass:ArchiveViewApplication withItem:aItem withType:nil. |
|
661 |
result isNil ifTrue:[ |
|
662 |
Dialog warn:'file type of ', aItem fileName baseName, ' not yet supported'. |
|
663 |
^ self. |
|
664 |
]. |
|
665 |
! |
|
666 |
||
667 |
openCommandResultApplication |
|
668 |
||
669 |
||
670 |
^ self openApplicationClass:CommandResult withItem:nil withType:#commandResult |
|
671 |
! |
|
672 |
||
673 |
openDirectoryDescription |
|
674 |
||
675 |
| appl aInfoItem| |
|
676 |
||
677 |
aInfoItem := self getInfoItem. |
|
678 |
aInfoItem notNil ifTrue:[ |
|
679 |
appl := self openTextEditorOn:aInfoItem type:#directoryDescription. |
|
680 |
]. |
|
681 |
! |
|
682 |
||
4880
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4855
diff
changeset
|
683 |
openNewTextEditorOn:aItem |
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4855
diff
changeset
|
684 |
|
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4855
diff
changeset
|
685 |
^ self openApplicationClass:TextEditor withItem:aItem withType:#file checkExisting:false. |
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4855
diff
changeset
|
686 |
! |
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4855
diff
changeset
|
687 |
|
3892 | 688 |
openSearchFileOn:aItem |
689 |
||
690 |
^ self openApplicationClass:FindFileApplication withItem:aItem withType:nil |
|
691 |
! |
|
692 |
||
693 |
openTerminalApplication:aItem |
|
694 |
||
695 |
^ self openApplicationClass:Terminal withItem:aItem withType:nil |
|
696 |
! |
|
697 |
||
4392 | 698 |
openTextEditor |
699 |
||
700 |
^ self openTextEditorOn:nil |
|
701 |
! |
|
702 |
||
4146
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
703 |
openTextEditorForFile:aFilename |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
704 |
|
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
705 |
^ self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:aFilename) type:#file |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
706 |
! |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
707 |
|
3892 | 708 |
openTextEditorOn:aItem |
709 |
||
710 |
^ self openTextEditorOn:aItem type:#file |
|
711 |
! |
|
712 |
||
713 |
openTextEditorOn:aItem type:aDirDescrOrFile |
|
714 |
||
715 |
^ self openApplicationClass:TextEditor withItem:aItem withType:aDirDescrOrFile |
|
4620 | 716 |
! |
717 |
||
718 |
openTextEditorWithHexPresentationOn:aItem |
|
719 |
||
720 |
^ self openApplicationClass:TextEditor |
|
721 |
withItem:aItem |
|
722 |
withType:#file |
|
723 |
checkExisting:true |
|
724 |
preSetItem:[:aTextEditor | aTextEditor presentation:#hexDump]. |
|
3892 | 725 |
! ! |
726 |
||
727 |
!FileApplicationNoteBook methodsFor:'applicationlist access'! |
|
728 |
||
729 |
applicationList |
|
730 |
^ self class applicationList |
|
731 |
! ! |
|
732 |
||
733 |
!FileApplicationNoteBook methodsFor:'aspects'! |
|
734 |
||
735 |
canvasHolder |
|
736 |
||
737 |
canvasHolder isNil ifTrue:[ |
|
738 |
canvasHolder := ValueHolder new. |
|
739 |
]. |
|
740 |
^ canvasHolder. |
|
741 |
! |
|
742 |
||
743 |
privateTabList |
|
744 |
||
745 |
privateTabList isNil ifTrue:[ |
|
746 |
privateTabList := List new. |
|
747 |
privateTabList addDependent:self. |
|
748 |
]. |
|
749 |
^ privateTabList. |
|
750 |
! |
|
751 |
||
752 |
selectedEditorPage |
|
753 |
||
754 |
selectedEditorPage isNil ifTrue:[ |
|
755 |
selectedEditorPage := ValueHolder new. |
|
756 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
757 |
selectedEditorPage addDependent:self. |
|
758 |
"/ selectedEditorPage onChangeSend:#selectedEditorPageChanged to:self. |
|
759 |
]. |
|
760 |
^ selectedEditorPage. |
|
761 |
! |
|
762 |
||
763 |
tabList |
|
764 |
||
765 |
tabList isNil ifTrue:[ |
|
766 |
tabList := (List new) asValue. |
|
767 |
]. |
|
768 |
^ tabList. |
|
769 |
! |
|
770 |
||
771 |
tabList:aValue |
|
772 |
||
773 |
tabList := aValue. |
|
774 |
! ! |
|
775 |
||
776 |
!FileApplicationNoteBook methodsFor:'change & update'! |
|
777 |
||
778 |
update:something with:aParameter from:changedObject |
|
779 |
"Invoked when an object that I depend upon sends a change notification." |
|
780 |
||
781 |
"stub code automatically generated - please change as required" |
|
782 |
||
4071 | 783 |
| appl sel| |
3892 | 784 |
|
785 |
changedObject == self currentDirectories ifTrue:[ |
|
786 |
self viewDirectoryDescription value ifTrue:[ |
|
787 |
self changeDirectoryDescription. |
|
788 |
]. |
|
789 |
^ self. |
|
790 |
]. |
|
791 |
changedObject == self viewDirectoryDescription ifTrue:[ |
|
4071 | 792 |
self viewDirectoryDescriptionChanged. |
3892 | 793 |
^ self. |
794 |
]. |
|
795 |
changedObject == self privateTabList ifTrue:[ |
|
796 |
| privateListOfTabs | |
|
797 |
privateListOfTabs := changedObject. |
|
798 |
privateListOfTabs size > 1 ifTrue:[ |
|
799 |
self tabList value:privateListOfTabs. |
|
800 |
self tabList changed. |
|
801 |
] ifFalse:[ |
|
802 |
self tabList value:nil. |
|
803 |
]. |
|
804 |
^ self |
|
805 |
]. |
|
806 |
changedObject == self selectedEditorPage ifTrue:[ |
|
807 |
| listOfEdits indexOfLastSel list | |
|
808 |
||
809 |
sel := changedObject value. |
|
810 |
"/ dont want the tabs with one application - thats why i have to change my tablist |
|
811 |
"/ sel goes to if - i want select the last selection |
|
812 |
sel = 0 ifTrue:[ |
|
813 |
^ self. |
|
814 |
]. |
|
815 |
list := self selectionHistoryList. |
|
816 |
(list includes:sel) ifTrue:[ |
|
817 |
list remove:sel |
|
818 |
]. |
|
819 |
list add:sel. |
|
820 |
self selectionHistoryList:list. |
|
821 |
appl := self listOfApplications at:sel. |
|
822 |
self doSelect:appl. |
|
823 |
]. |
|
824 |
||
825 |
^ super update:something with:aParameter from:changedObject |
|
4071 | 826 |
! |
827 |
||
828 |
viewDirectoryDescriptionChanged |
|
829 |
||
830 |
||
831 |
|viewDirDescr| |
|
832 |
||
833 |
viewDirDescr := self viewDirectoryDescription value. |
|
834 |
viewDirDescr ifTrue:[ |
|
835 |
self openDirectoryDescription. |
|
836 |
] ifFalse:[ |
|
837 |
self closeDirectoryDescription. |
|
838 |
]. |
|
839 |
^ self. |
|
3892 | 840 |
! ! |
841 |
||
842 |
!FileApplicationNoteBook methodsFor:'menu & actions'! |
|
843 |
||
844 |
tabMenuAt:aTab |
|
845 |
||
846 |
|menu| |
|
847 |
||
848 |
menu := Menu new fromLiteralArrayEncoding:self class tabMenu. |
|
849 |
menu ifNil:[ ^ nil ]. |
|
850 |
tabMenuIndex := aTab. |
|
851 |
menu receiver:self. |
|
852 |
^ menu |
|
853 |
! ! |
|
854 |
||
855 |
!FileApplicationNoteBook methodsFor:'queries'! |
|
856 |
||
857 |
getSameFilesModifiedFor:aAppl |
|
858 |
||
859 |
| sameFileAppl colOfChanged | |
|
860 |
||
861 |
sameFileAppl := self getSameApplicationsFor:aAppl. |
|
862 |
sameFileAppl notEmpty ifTrue:[ |
|
863 |
colOfChanged := OrderedCollection new. |
|
864 |
sameFileAppl do:[ : el | |
|
865 |
el modifiedChannel value ifTrue:[ |
|
866 |
colOfChanged add:el. |
|
867 |
] |
|
868 |
] |
|
869 |
]. |
|
870 |
^ colOfChanged |
|
871 |
! ! |
|
872 |
||
873 |
!FileApplicationNoteBook methodsFor:'selection'! |
|
874 |
||
875 |
doSelect:anAppl |
|
876 |
||
877 |
| index fileName| |
|
878 |
||
879 |
fileName := anAppl fileName. |
|
4161 | 880 |
index := self getIndexFor:anAppl. |
4180 | 881 |
self changeFileBrowserTitleTo:(self privateTabList at:index ifAbsent:nil). |
4523 | 882 |
|
883 |
self notify:(fileName isNil ifTrue:[nil] ifFalse:[fileName asString]). |
|
3982 | 884 |
"/ self gotoFile:fileName. |
3892 | 885 |
index notNil ifTrue:[ |
886 |
canvasHolder value:(anAppl window). |
|
887 |
self selectedEditorPage value:index. |
|
888 |
] |
|
4392 | 889 |
! |
890 |
||
891 |
selectedApplication |
|
892 |
||
893 |
| canvas | |
|
894 |
||
895 |
canvas := self canvasHolder value. |
|
896 |
canvas isNil ifTrue:[ ^ nil]. |
|
897 |
^ canvas application. |
|
3892 | 898 |
! ! |
899 |
||
900 |
!FileApplicationNoteBook methodsFor:'startup & release'! |
|
901 |
||
3954 | 902 |
closeRequest |
903 |
||
4082 | 904 |
self tryCloseApplications ifTrue:[ |
905 |
super closeRequest. |
|
906 |
^ true |
|
3954 | 907 |
]. |
4082 | 908 |
^ false. |
3954 | 909 |
! |
910 |
||
3892 | 911 |
makeDependent |
912 |
||
913 |
self viewDirectoryDescription addDependent:self. |
|
914 |
self currentDirectories addDependent:self. |
|
915 |
! |
|
916 |
||
917 |
postOpenAsSubcanvasWith:aBuilder |
|
918 |
||
4071 | 919 |
self viewDirectoryDescriptionChanged. |
3892 | 920 |
^ super postOpenAsSubcanvasWith:aBuilder. |
921 |
! |
|
922 |
||
923 |
postOpenWith:aBuilder |
|
924 |
||
925 |
" |
|
926 |
only invoked if the application not started from a master |
|
927 |
" |
|
3982 | 928 |
self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:(Filename homeDirectory construct:'.bashrc')). |
3892 | 929 |
^ super postOpenWith:aBuilder |
930 |
! |
|
931 |
||
932 |
preBuildWith:aBuilder |
|
933 |
||
934 |
self masterApplication isNil ifTrue:[ |
|
935 |
self masterApplication:nil. |
|
936 |
]. |
|
937 |
^ super preBuildWith:aBuilder. |
|
4082 | 938 |
! |
939 |
||
940 |
tryCloseApplications |
|
941 |
||
942 |
self listOfApplications do:[:appl| |
|
943 |
appl doClose not ifTrue:[ |
|
944 |
^ false. |
|
945 |
]. |
|
946 |
]. |
|
947 |
^ true |
|
3892 | 948 |
! ! |
949 |
||
950 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'common options'! |
|
951 |
||
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
952 |
classSelectorFor:aItem |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
953 |
|
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
954 |
| class mimeType| |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
955 |
aItem hasMimeType ifFalse:[^nil]. |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
956 |
mimeType := aItem mimeType. |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
957 |
class := self supportedFiles at:mimeType ifAbsent:nil. |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
958 |
(mimeType = 'application/x-gzip-compressed') ifTrue:[ |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
959 |
(aItem lastButOneSuffix = 'tar') ifTrue:[ |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
960 |
class := #tarGZipArchive. |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
961 |
]. |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
962 |
]. |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
963 |
^ class. |
3892 | 964 |
! ! |
965 |
||
966 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'defaults'! |
|
967 |
||
968 |
tabStringFor:aApplicationType |
|
969 |
||
970 |
^ 'Archive for:' |
|
971 |
! ! |
|
972 |
||
4392 | 973 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'help specs'! |
974 |
||
975 |
flyByHelpSpec |
|
976 |
"This resource specification was automatically generated |
|
977 |
by the UIHelpTool of ST/X." |
|
978 |
||
979 |
"Do not manually edit this!! If it is corrupted, |
|
980 |
the UIHelpTool may not be able to read the specification." |
|
981 |
||
982 |
" |
|
983 |
UIHelpTool openOnClass:FileApplicationNoteBook::ArchiveViewApplication |
|
984 |
" |
|
985 |
||
986 |
<resource: #help> |
|
987 |
||
988 |
^super flyByHelpSpec addPairsFrom:#( |
|
989 |
||
990 |
#closeButton |
|
991 |
'Close Archiver' |
|
992 |
||
993 |
#extractItem |
|
994 |
'Extract...' |
|
995 |
||
996 |
#removeOutputButton |
|
997 |
'Remove Error Output' |
|
998 |
||
999 |
#stopButton |
|
1000 |
'Stop' |
|
1001 |
||
1002 |
) |
|
1003 |
! |
|
1004 |
||
1005 |
helpSpec |
|
1006 |
"This resource specification was automatically generated |
|
1007 |
by the UIHelpTool of ST/X." |
|
1008 |
||
1009 |
"Do not manually edit this!! If it is corrupted, |
|
1010 |
the UIHelpTool may not be able to read the specification." |
|
1011 |
||
1012 |
" |
|
1013 |
UIHelpTool openOnClass:FileApplicationNoteBook::ArchiveViewApplication |
|
1014 |
" |
|
1015 |
||
1016 |
<resource: #help> |
|
1017 |
||
1018 |
^super helpSpec addPairsFrom:#( |
|
1019 |
||
1020 |
#closeButton |
|
1021 |
'Close Archiver' |
|
1022 |
||
1023 |
#extractItem |
|
1024 |
'Extract...' |
|
1025 |
||
1026 |
#removeOutputButton |
|
1027 |
'Remove Error Output' |
|
1028 |
||
1029 |
#stopButton |
|
1030 |
'Stop' |
|
1031 |
||
1032 |
) |
|
1033 |
! ! |
|
1034 |
||
3892 | 1035 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'image specs'! |
1036 |
||
4392 | 1037 |
extract28x28Icon |
1038 |
"This resource specification was automatically generated |
|
1039 |
by the ImageEditor of ST/X." |
|
1040 |
||
1041 |
"Do not manually edit this!! If it is corrupted, |
|
1042 |
the ImageEditor may not be able to read the specification." |
|
1043 |
||
1044 |
" |
|
1045 |
self extract28x28Icon inspect |
|
1046 |
ImageEditor openOnClass:self andSelector:#extract28x28Icon |
|
1047 |
Icon flushCachedIcons |
|
1048 |
" |
|
1049 |
||
1050 |
<resource: #image> |
|
1051 |
||
1052 |
^Icon |
|
1053 |
constantNamed:#'FileApplicationNoteBook::ArchiveViewApplication class extract28x28Icon' |
|
1054 |
ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
1055 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
1056 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@3L3L3L@@@@@@@@@@@@CQDMDP0@@@@@EUUAP@@L3L3L3@@@ @PUUTA@@@4QCQDL@@BHAAUUPD@@CL3L3L"H"H"DEUU |
|
1057 |
@P@@MDP4QBH"H"H @@@A@@@3L3L3H"H"H!!DQDQD@@CQDMDP0@@H DP@@@P@@L3L3L3@@@ @Q@ETA@@@4QCQDL@@@@AD@UPD@@CL3L3L0@@@@@@@@@@@@MDP4 |
|
1058 |
QC@@@@@@@@@@@@@3L3L3L@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
1059 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 129 129 129 255 0 0 255 255 255 105 133 190 194 194 194]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
1060 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@G?0@@A?<G? _?A?8G?1_>A?<_? _???8G???>A???? _?G?8G?1_>A?<G? _?@?0G?0@@A?<@@@_?@@@@@@ |
|
1061 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself] |
|
1062 |
! |
|
1063 |
||
1064 |
removeBug28x28Icon |
|
1065 |
"This resource specification was automatically generated |
|
1066 |
by the ImageEditor of ST/X." |
|
1067 |
||
1068 |
"Do not manually edit this!! If it is corrupted, |
|
1069 |
the ImageEditor may not be able to read the specification." |
|
1070 |
||
1071 |
" |
|
1072 |
self removeBug28x28Icon inspect |
|
1073 |
ImageEditor openOnClass:self andSelector:#removeBug28x28Icon |
|
1074 |
Icon flushCachedIcons |
|
1075 |
" |
|
1076 |
||
1077 |
<resource: #image> |
|
1078 |
||
1079 |
^Icon |
|
1080 |
constantNamed:#'FileApplicationNoteBook::ArchiveViewApplication class removeBug28x28Icon' |
|
1081 |
ifAbsentPut:[(Depth2Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
1082 |
UUUUUUUUT@@@@@@@@@@@@@@@@@@@B*@@@@@J(@J(@@@@J(@@* @@@J(@@B*@@@J(@@@J(@@J(@@@@* @J(@@@@B(@J+0@@@@J :*+@@@@B*:**,@@@O***** |
|
1083 |
0@@C:****,@@@N**@@@@@@O*****0@@@>+***<@@@B(N*?0@@@B*@J+0@@@B*@@* @@@B*@@B*@@@B*@@@J(@@B*@@@@* @B*@@@@B*@B*@@@@@J(@@@@@@@ |
|
1084 |
@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 192 192 192 255 0 0 128 0 0]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
1085 |
@@@@@@@@@@@@@@@@O@@C0A8@A8@O@@<@A80^@@O#O0@A>_1@@N/>@@A??0@@??>@G??? BG??8@A??>@G??? @???8@@_?<@@O/>@@G9?D@C83<@A80^@@<@ |
|
1086 |
C0@^@@^@O@@C0@@@@@@@@@@@@@@@@@@a') ; yourself); yourself] |
|
1087 |
! |
|
1088 |
||
3892 | 1089 |
removeError |
1090 |
"This resource specification was automatically generated |
|
1091 |
by the ImageEditor of ST/X." |
|
1092 |
||
1093 |
"Do not manually edit this!! If it is corrupted, |
|
1094 |
the ImageEditor may not be able to read the specification." |
|
1095 |
||
1096 |
" |
|
1097 |
self removeError inspect |
|
1098 |
ImageEditor openOnClass:self andSelector:#removeError |
|
1099 |
Icon flushCachedIcons |
|
1100 |
" |
|
1101 |
||
1102 |
<resource: #image> |
|
1103 |
||
1104 |
^Icon |
|
1105 |
constantNamed:#'FileApplicationNoteBook::ArchiveViewApplication class removeError' |
|
1106 |
ifAbsentPut:[(Depth8Image new) width: 28; height: 22; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
1107 |
@@@@@@@@@@@FA @@@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@@@A X@@@XF@@@@@@@@@@@@@@@@@@@@@@@@ |
|
1108 |
@@@@@@@FA XF@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@XFA X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@XF |
|
1109 |
@@@FA @@@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@@@A X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
1110 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
1111 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
1112 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
1113 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 8 4 8 105 133 190 121 133 157 129 129 129 194 194 194 255 0 0]; mask:((Depth1Image new) width: 28; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@LC@@@A!! @@@L0@@@A8@@@@L@@@@G @@@CL@@@A!! @@@0L@@@@@@@BY=5LAIUUT S5UU8D!!UUPAFU\#@@@@@@@LR9@@D)J @A:R(@@P$*@@CIN @@@@@@@@@a') ; yourself); yourself] |
|
1114 |
! ! |
|
1115 |
||
1116 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'interface specs'! |
|
1117 |
||
1118 |
windowSpec |
|
1119 |
"This resource specification was automatically generated |
|
1120 |
by the UIPainter of ST/X." |
|
1121 |
||
1122 |
"Do not manually edit this!! If it is corrupted, |
|
1123 |
the UIPainter may not be able to read the specification." |
|
1124 |
||
1125 |
" |
|
3951 | 1126 |
UIPainter new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#windowSpec |
1127 |
FileApplicationNoteBook::ArchiveViewApplication new openInterface:#windowSpec |
|
1128 |
FileApplicationNoteBook::ArchiveViewApplication open |
|
3892 | 1129 |
" |
1130 |
||
1131 |
<resource: #canvas> |
|
1132 |
||
1133 |
^ |
|
1134 |
#(#FullSpec |
|
1135 |
#name: #windowSpec |
|
1136 |
#window: |
|
1137 |
#(#WindowSpec |
|
1138 |
#label: 'Archive Application' |
|
1139 |
#name: 'Archive Application' |
|
1140 |
#min: #(#Point 10 10) |
|
1141 |
#max: #(#Point 1024 768) |
|
4803 | 1142 |
#bounds: #(#Rectangle 16 46 692 538) |
3892 | 1143 |
#menu: #mainMenu |
1144 |
) |
|
1145 |
#component: |
|
1146 |
#(#SpecCollection |
|
1147 |
#collection: #( |
|
1148 |
#(#MenuPanelSpec |
|
4261 | 1149 |
#name: 'MenuArchive' |
3892 | 1150 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
1151 |
#level: 0 |
3892 | 1152 |
#menu: #menu |
1153 |
#textDefault: true |
|
1154 |
) |
|
1155 |
#(#'FileBrowserV2UISpecifications::PanelSpec' |
|
1156 |
#name: 'VerticalPanel' |
|
1157 |
#layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0) |
|
4803 | 1158 |
#level: 0 |
3892 | 1159 |
#whichView: #last |
1160 |
#orientation: #vertical |
|
1161 |
#visibility: #errorListVisibilityHolder |
|
1162 |
#component: |
|
1163 |
#(#SpecCollection |
|
1164 |
#collection: #( |
|
1165 |
#(#DataSetSpec |
|
1166 |
#name: 'Table1' |
|
1167 |
#model: #selectionHolder |
|
1168 |
#menu: #fileListMenu |
|
1169 |
#hasHorizontalScrollBar: true |
|
1170 |
#hasVerticalScrollBar: true |
|
1171 |
#dataList: #archiveFileList |
|
1172 |
#useIndex: false |
|
1173 |
#has3Dsepartors: false |
|
1174 |
#doubleClickSelector: #dblClick |
|
1175 |
#columnHolder: #tableColumns |
|
1176 |
#multipleSelectOk: true |
|
1177 |
#verticalSpacing: 0 |
|
1178 |
#postBuildCallback: #postBuildFileTable: |
|
1179 |
#properties: |
|
1180 |
#(#PropertyListDictionary |
|
4803 | 1181 |
#enterSelector: #dropEnter: |
3892 | 1182 |
#dragArgument: #archivApplication |
1183 |
#startDragSelector: #doStartDrag:in: |
|
1184 |
#displayObjectSelector: #getDisplayObjects: |
|
1185 |
#dropObjectSelector: #getDropObjects: |
|
4392 | 1186 |
#overSelector: nil |
3892 | 1187 |
#dropArgument: #archivApplication |
3951 | 1188 |
#canDropSelector: #canDrop: |
1189 |
#leaveSelector: #dropLeave: |
|
4803 | 1190 |
#dropSelector: #doDrop: |
3892 | 1191 |
) |
1192 |
) |
|
1193 |
#(#SequenceViewSpec |
|
1194 |
#name: 'ErrorList' |
|
1195 |
#initiallyDisabled: true |
|
1196 |
#hasHorizontalScrollBar: true |
|
1197 |
#hasVerticalScrollBar: true |
|
1198 |
#backgroundColor: #(#Color 100.0 100.0 100.0) |
|
1199 |
#isMultiSelect: true |
|
1200 |
#useIndex: false |
|
1201 |
#sequenceList: #errorListHolder |
|
1202 |
) |
|
1203 |
) |
|
1204 |
||
1205 |
) |
|
1206 |
#handles: #(#Any 0.5 1.0) |
|
1207 |
) |
|
1208 |
) |
|
1209 |
||
1210 |
) |
|
1211 |
) |
|
1212 |
! ! |
|
1213 |
||
1214 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'menu specs'! |
|
1215 |
||
1216 |
fileListMenu |
|
1217 |
"This resource specification was automatically generated |
|
1218 |
by the MenuEditor of ST/X." |
|
1219 |
||
1220 |
"Do not manually edit this!! If it is corrupted, |
|
1221 |
the MenuEditor may not be able to read the specification." |
|
1222 |
||
1223 |
" |
|
4475 | 1224 |
MenuEditor new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#fileListMenu |
1225 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ArchiveViewApplication fileListMenu)) startUp |
|
3892 | 1226 |
" |
1227 |
||
1228 |
<resource: #menu> |
|
1229 |
||
1230 |
^ |
|
1231 |
#(#Menu |
|
1232 |
#( |
|
1233 |
#(#MenuItem |
|
4475 | 1234 |
#enabled: #hasListEntriesHolder |
1235 |
#label: 'Select All' |
|
1236 |
#itemValue: #selectAll |
|
3892 | 1237 |
#translateLabel: true |
1238 |
) |
|
1239 |
#(#MenuItem |
|
4475 | 1240 |
#label: '-' |
1241 |
) |
|
1242 |
#(#MenuItem |
|
1243 |
#enabled: #hasSelectionInList |
|
1244 |
#label: 'Copy Filenames' |
|
1245 |
#itemValue: #copyFilesToClipboard |
|
3892 | 1246 |
#translateLabel: true |
4475 | 1247 |
) |
1248 |
#(#MenuItem |
|
1249 |
#label: '-' |
|
3892 | 1250 |
) |
1251 |
#(#MenuItem |
|
4475 | 1252 |
#enabled: #hasSelectionInList |
1253 |
#label: 'Extract to Directory...' |
|
1254 |
#itemValue: #extractAll |
|
3892 | 1255 |
#translateLabel: true |
1256 |
) |
|
1257 |
#(#MenuItem |
|
4475 | 1258 |
#enabled: #canDelete |
4476 | 1259 |
#label: 'Delete from Archive' |
4961
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1260 |
#itemValue: #removeFilesFromArchive |
3892 | 1261 |
#translateLabel: true |
4475 | 1262 |
#shortcutKey: #Delete |
3892 | 1263 |
) |
1264 |
#(#MenuItem |
|
4475 | 1265 |
#enabled: #canViewFile |
1266 |
#label: 'View Contents' |
|
1267 |
#itemValue: #viewFile |
|
3892 | 1268 |
#translateLabel: true |
4475 | 1269 |
#isVisible: #isEmbeddedApplication |
3892 | 1270 |
) |
1271 |
) |
|
1272 |
nil |
|
1273 |
nil |
|
1274 |
) |
|
1275 |
! |
|
1276 |
||
1277 |
menu |
|
1278 |
"This resource specification was automatically generated |
|
1279 |
by the MenuEditor of ST/X." |
|
1280 |
||
1281 |
"Do not manually edit this!! If it is corrupted, |
|
1282 |
the MenuEditor may not be able to read the specification." |
|
1283 |
||
1284 |
" |
|
1285 |
MenuEditor new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#menu |
|
1286 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ArchiveViewApplication menu)) startUp |
|
1287 |
" |
|
1288 |
||
1289 |
<resource: #menu> |
|
1290 |
||
1291 |
^ |
|
1292 |
#(#Menu |
|
1293 |
#( |
|
1294 |
#(#MenuItem |
|
4392 | 1295 |
#activeHelpKey: #stopButton |
1296 |
#enabled: #enableStopButton |
|
3892 | 1297 |
#label: 'Stop' |
4392 | 1298 |
#itemValue: #doStopProcess |
1299 |
#nameKey: #Stop |
|
3892 | 1300 |
#translateLabel: true |
1301 |
#isButton: true |
|
1302 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #stop22x22Icon) |
|
1303 |
) |
|
1304 |
#(#MenuItem |
|
4392 | 1305 |
#activeHelpKey: #extractItem |
3892 | 1306 |
#enabled: #hasListEntriesHolder |
4392 | 1307 |
#label: 'Extract' |
1308 |
#itemValue: #extractAll |
|
3892 | 1309 |
#translateLabel: true |
1310 |
#isButton: true |
|
4392 | 1311 |
#labelImage: #(#ResourceRetriever #'FileApplicationNoteBook::ArchiveViewApplication' #extract28x28Icon) |
3892 | 1312 |
) |
1313 |
#(#MenuItem |
|
4392 | 1314 |
#activeHelpKey: #removeOutputButton |
1315 |
#enabled: #enableRemoveErrorOutput |
|
1316 |
#label: 'Remove Output' |
|
1317 |
#itemValue: #removeErrorOutput |
|
3892 | 1318 |
#translateLabel: true |
1319 |
#isButton: true |
|
4392 | 1320 |
#labelImage: #(#ResourceRetriever #'FileApplicationNoteBook::ArchiveViewApplication' #removeBug28x28Icon) |
1321 |
) |
|
1322 |
#(#MenuItem |
|
1323 |
#activeHelpKey: #closeButton |
|
1324 |
#label: 'Close' |
|
1325 |
#itemValue: #doClose |
|
1326 |
#translateLabel: true |
|
1327 |
#isButton: true |
|
1328 |
#startGroup: #right |
|
3892 | 1329 |
#isVisible: #isEmbeddedApplication |
4392 | 1330 |
#hideMenuOnActivated: false |
3892 | 1331 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #closeIcon) |
1332 |
) |
|
1333 |
) |
|
1334 |
nil |
|
1335 |
nil |
|
1336 |
) |
|
1337 |
! ! |
|
1338 |
||
1339 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'queries'! |
|
1340 |
||
1341 |
canOpenItem:aItem |
|
4905 | 1342 |
^ (Archiver classForMimeType:aItem mimeType) notNil and:[OperatingSystem isUNIXlike] |
3892 | 1343 |
! |
1344 |
||
1345 |
wantNewApplicationAnyway |
|
1346 |
||
1347 |
^ false |
|
1348 |
! ! |
|
1349 |
||
1350 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'tableColumns specs'! |
|
1351 |
||
1352 |
tableColumns |
|
1353 |
"This resource specification was automatically generated |
|
1354 |
by the DataSetBuilder of ST/X." |
|
1355 |
||
1356 |
"Do not manually edit this!! If it is corrupted, |
|
1357 |
the DataSetBuilder may not be able to read the specification." |
|
1358 |
||
1359 |
" |
|
1360 |
DataSetBuilder new openOnClass:NoteBookApplication::ArchiveViewApplication andSelector:#tableColumns |
|
1361 |
" |
|
1362 |
||
1363 |
<resource: #tableColumns> |
|
1364 |
||
1365 |
^#( |
|
1366 |
#(#DataSetColumnSpec |
|
1367 |
#id: 'icon' |
|
1368 |
#labelButtonType: #Button |
|
3989 | 1369 |
#labelActionSelector: #sortFileListsBy: |
3892 | 1370 |
#labelActionArgument: 'directory' |
1371 |
#width: 25 |
|
1372 |
#minWidth: 20 |
|
1373 |
#height: 16 |
|
1374 |
#model: #icon |
|
1375 |
#canSelect: false |
|
1376 |
#isResizeable: false |
|
1377 |
#showRowSeparator: false |
|
1378 |
#showColSeparator: false |
|
1379 |
) |
|
1380 |
#(#DataSetColumnSpec |
|
1381 |
#label: 'File Name' |
|
1382 |
#id: 'fileName' |
|
1383 |
#labelAlignment: #left |
|
1384 |
#labelButtonType: #Button |
|
3989 | 1385 |
#labelActionSelector: #sortFileListsBy: |
3892 | 1386 |
#labelActionArgument: 'fileName' |
1387 |
#model: #fileName |
|
1388 |
#canSelect: false |
|
1389 |
#showRowSeparator: false |
|
1390 |
#showColSeparator: false |
|
1391 |
) |
|
1392 |
#(#DataSetColumnSpec |
|
1393 |
#label: 'Perm' |
|
1394 |
#id: 'permissions' |
|
1395 |
#labelButtonType: #Button |
|
3989 | 1396 |
#labelActionSelector: #sortFileListsBy: |
3892 | 1397 |
#labelActionArgument: 'permissions' |
1398 |
#usePreferredWidth: true |
|
1399 |
#width: 75 |
|
1400 |
#model: #permissions |
|
1401 |
#canSelect: false |
|
1402 |
#showRowSeparator: false |
|
1403 |
#showColSeparator: false |
|
1404 |
) |
|
1405 |
#(#DataSetColumnSpec |
|
1406 |
#label: 'Version' |
|
1407 |
#id: 'version' |
|
1408 |
#labelButtonType: #Button |
|
3989 | 1409 |
#labelActionSelector: #sortFileListsBy: |
3892 | 1410 |
#labelActionArgument: 'version' |
1411 |
#columnAlignment: #right |
|
1412 |
#width: 100 |
|
1413 |
#minWidth: 50 |
|
1414 |
#model: #version |
|
1415 |
#canSelect: false |
|
1416 |
#showRowSeparator: false |
|
1417 |
#showColSeparator: false |
|
1418 |
) |
|
1419 |
#(#DataSetColumnSpec |
|
1420 |
#label: 'Type' |
|
1421 |
#id: 'type' |
|
1422 |
#labelButtonType: #Button |
|
3989 | 1423 |
#labelActionSelector: #sortFileListsBy: |
3892 | 1424 |
#labelActionArgument: 'type' |
1425 |
#columnAlignment: #right |
|
1426 |
#width: 100 |
|
1427 |
#minWidth: 50 |
|
1428 |
#model: #type |
|
1429 |
#canSelect: false |
|
1430 |
#showRowSeparator: false |
|
1431 |
#showColSeparator: false |
|
1432 |
) |
|
1433 |
#(#DataSetColumnSpec |
|
1434 |
#label: 'Owner/Group' |
|
1435 |
#id: 'ownerGroup' |
|
1436 |
#labelButtonType: #Button |
|
3989 | 1437 |
#labelActionSelector: #sortFileListsBy: |
3892 | 1438 |
#labelActionArgument: 'ownerGroup' |
1439 |
#columnAlignment: #right |
|
1440 |
#width: 100 |
|
1441 |
#minWidth: 50 |
|
1442 |
#model: #ownerGroup |
|
1443 |
#canSelect: false |
|
1444 |
#showRowSeparator: false |
|
1445 |
#showColSeparator: false |
|
1446 |
) |
|
1447 |
#(#DataSetColumnSpec |
|
1448 |
#label: 'Size' |
|
1449 |
#id: 'size' |
|
1450 |
#labelButtonType: #Button |
|
3989 | 1451 |
#labelActionSelector: #sortFileListsBy: |
3892 | 1452 |
#labelActionArgument: 'sizeAsNumber' |
1453 |
#columnAlignment: #right |
|
1454 |
#width: 80 |
|
1455 |
#model: #size |
|
1456 |
#canSelect: false |
|
1457 |
#showRowSeparator: false |
|
1458 |
#showColSeparator: false |
|
1459 |
) |
|
1460 |
#(#DataSetColumnSpec |
|
1461 |
#label: 'Date & Time' |
|
1462 |
#id: 'dateAndTime' |
|
1463 |
#labelAlignment: #right |
|
1464 |
#labelButtonType: #Button |
|
3989 | 1465 |
#labelActionSelector: #sortFileListsBy: |
3892 | 1466 |
#labelActionArgument: 'dateAndTime' |
1467 |
#columnAlignment: #right |
|
1468 |
#usePreferredWidth: true |
|
1469 |
#width: 140 |
|
1470 |
#model: #dateAndTime |
|
1471 |
#canSelect: false |
|
1472 |
#showRowSeparator: false |
|
1473 |
#showColSeparator: false |
|
1474 |
) |
|
1475 |
#(#DataSetColumnSpec |
|
1476 |
#label: 'Method' |
|
1477 |
#id: 'method' |
|
1478 |
#labelButtonType: #Button |
|
3989 | 1479 |
#labelActionSelector: #sortFileListsBy: |
3892 | 1480 |
#labelActionArgument: 'method' |
1481 |
#columnAlignment: #center |
|
1482 |
#usePreferredWidth: true |
|
1483 |
#width: 140 |
|
1484 |
#model: #method |
|
1485 |
#canSelect: false |
|
1486 |
#showRowSeparator: false |
|
1487 |
#showColSeparator: false |
|
1488 |
) |
|
1489 |
#(#DataSetColumnSpec |
|
1490 |
#label: 'CRC' |
|
1491 |
#id: 'crc' |
|
1492 |
#labelButtonType: #Button |
|
3989 | 1493 |
#labelActionSelector: #sortFileListsBy: |
3892 | 1494 |
#labelActionArgument: 'crc' |
1495 |
#usePreferredWidth: true |
|
1496 |
#width: 140 |
|
1497 |
#model: #crc |
|
1498 |
#canSelect: false |
|
1499 |
#showRowSeparator: false |
|
1500 |
#showColSeparator: false |
|
1501 |
) |
|
1502 |
#(#DataSetColumnSpec |
|
1503 |
#label: 'Compress Size' |
|
1504 |
#id: 'compressSize' |
|
1505 |
#labelButtonType: #Button |
|
3989 | 1506 |
#labelActionSelector: #sortFileListsBy: |
3892 | 1507 |
#labelActionArgument: 'compressSize' |
1508 |
#usePreferredWidth: true |
|
1509 |
#width: 140 |
|
1510 |
#model: #compressSize |
|
1511 |
#canSelect: false |
|
1512 |
#showRowSeparator: false |
|
1513 |
#showColSeparator: false |
|
1514 |
) |
|
1515 |
#(#DataSetColumnSpec |
|
1516 |
#label: 'Ratio' |
|
1517 |
#id: 'ratio' |
|
1518 |
#labelButtonType: #Button |
|
3989 | 1519 |
#labelActionSelector: #sortFileListsBy: |
3892 | 1520 |
#labelActionArgument: 'ratio' |
1521 |
#usePreferredWidth: true |
|
1522 |
#width: 140 |
|
1523 |
#model: #ratio |
|
1524 |
#canSelect: false |
|
1525 |
#showRowSeparator: false |
|
1526 |
#showColSeparator: false |
|
1527 |
) |
|
1528 |
) |
|
1529 |
! ! |
|
1530 |
||
1531 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'accessing'! |
|
1532 |
||
1533 |
archiver |
|
1534 |
"return the value of the instance variable 'archiver' (automatically generated)" |
|
1535 |
||
1536 |
^ archiver |
|
1537 |
! |
|
1538 |
||
1539 |
archiver:something |
|
1540 |
"set the value of the instance variable 'archiver' (automatically generated)" |
|
1541 |
||
1542 |
archiver := something. |
|
1543 |
! |
|
1544 |
||
1545 |
columnDescriptors |
|
1546 |
"return the value of the instance variable 'columnDescriptors' (automatically generated)" |
|
1547 |
||
1548 |
^ columnDescriptors |
|
1549 |
! |
|
1550 |
||
1551 |
columnDescriptors:aListOfColumns |
|
1552 |
"set the value of the instance variable 'columnDescriptors' (automatically generated)" |
|
1553 |
||
1554 |
columnDescriptors = aListOfColumns ifTrue:[ |
|
1555 |
^ self |
|
1556 |
]. |
|
1557 |
||
1558 |
columnDescriptors := OrderedCollection new. |
|
1559 |
||
1560 |
aListOfColumns keysAndValuesDo:[:anIndex :aDesc| |col| |
|
1561 |
col := aDesc isSequenceable ifTrue:[DataSetColumnSpec new fromLiteralArrayEncoding:aDesc] |
|
1562 |
ifFalse:[aDesc]. |
|
1563 |
columnDescriptors add:col. |
|
1564 |
]. |
|
1565 |
! |
|
1566 |
||
1567 |
item:aItem |
|
1568 |
super item:aItem. |
|
4905 | 1569 |
|
4375 | 1570 |
self removeErrorOutput. |
4905 | 1571 |
archiver := Archiver newFor:self fileName. |
1572 |
||
1573 |
archiver notNil ifTrue:[ |
|
4803 | 1574 |
self |
1575 |
makeProcessFor:[ |
|
4905 | 1576 |
self archiver:archiver. |
4803 | 1577 |
self setColumnsForArchiver. |
1578 |
] |
|
1579 |
with:'Setup archive'. |
|
3892 | 1580 |
^ true |
1581 |
]. |
|
1582 |
^ false |
|
1583 |
! |
|
1584 |
||
1585 |
temporaryDirectory |
|
1586 |
"return the value of the instance variable 'temporaryDirectory' (automatically generated)" |
|
1587 |
||
1588 |
temporaryDirectory isNil ifTrue:[ |
|
1589 |
temporaryDirectory := Filename newTemporary. |
|
1590 |
temporaryDirectory makeDirectory. |
|
1591 |
]. |
|
1592 |
^ temporaryDirectory |
|
1593 |
! ! |
|
1594 |
||
1595 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'actions'! |
|
1596 |
||
4803 | 1597 |
changeItem:aItem |
3892 | 1598 |
self item:aItem. |
4803 | 1599 |
self clearFileList. |
4905 | 1600 |
self listAllFiles. |
3892 | 1601 |
^ true |
1602 |
! |
|
1603 |
||
4803 | 1604 |
clearFileList |
1605 |
||
1606 |
self archiveFileList value removeAll. |
|
1607 |
! |
|
1608 |
||
3892 | 1609 |
copyFilesToClipboard |
1610 |
||
1611 |
||
1612 |
|sel list stream| |
|
1613 |
||
1614 |
sel := self selectionHolder value. |
|
1615 |
list := self archiveFileList. |
|
1616 |
(sel notNil and:[sel notEmpty]) ifTrue:[ |
|
1617 |
stream := WriteStream on:''. |
|
1618 |
sel do:[: key | |
|
1619 |
stream nextPutAll:(key fileName asString). |
|
1620 |
stream cr. |
|
1621 |
]. |
|
1622 |
self window setTextSelection:stream contents. |
|
1623 |
stream close. |
|
1624 |
]. |
|
1625 |
! |
|
1626 |
||
1627 |
dblClick |
|
1628 |
||
1629 |
self viewFile. |
|
1630 |
! |
|
1631 |
||
1632 |
doStopProcess |
|
1633 |
||
1634 |
| archiver | |
|
1635 |
self stopProcess. |
|
1636 |
archiver := self archiver. |
|
1637 |
archiver notNil ifTrue:[ |
|
1638 |
self archiver stopProcess. |
|
1639 |
]. |
|
1640 |
self enableStopButton value:false. |
|
1641 |
! |
|
1642 |
||
1643 |
removeErrorOutput |
|
1644 |
||
1645 |
self viewErrorList value:false. |
|
1646 |
self errorListHolder removeAll. |
|
1647 |
! |
|
1648 |
||
1649 |
removeTemporaryDirectory |
|
1650 |
||
1651 |
temporaryDirectory notNil ifTrue:[ |
|
4923
1aced17a14a7
Do not use obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
4913
diff
changeset
|
1652 |
temporaryDirectory removeDirectory. |
3892 | 1653 |
temporaryDirectory := nil. |
1654 |
]. |
|
1655 |
! |
|
1656 |
||
1657 |
selectAll |
|
1658 |
||
1659 |
| sel listOfFiles| |
|
1660 |
||
1661 |
sel := OrderedCollection new. |
|
1662 |
listOfFiles := self archiveFileList value. |
|
1663 |
1 to:(listOfFiles size) do:[ : el | |
|
1664 |
sel add:el |
|
1665 |
]. |
|
1666 |
self selectionHolder value:sel. |
|
1667 |
! |
|
1668 |
||
1669 |
updateFileBrowserIfPresentWith:aDirectory |
|
1670 |
||
1671 |
| master| |
|
1672 |
||
1673 |
master := self masterApplication. |
|
1674 |
master notNil ifTrue:[ |
|
1675 |
master updateAndSelect:(OrderedCollection with:aDirectory). |
|
1676 |
]. |
|
1677 |
! |
|
1678 |
||
1679 |
viewFile |
|
1680 |
||
1681 |
| master item file tempDir| |
|
1682 |
||
4001 | 1683 |
self canViewFile ifFalse:[^ self]. |
3892 | 1684 |
master := self masterApplication. |
1685 |
self selectionHolder value size = 1 ifFalse:[ |
|
1686 |
Dialog warn:'only one file have to be selected'. |
|
1687 |
^ self. |
|
1688 |
]. |
|
1689 |
tempDir := self temporaryDirectory. |
|
1690 |
self extractSelectedFilesTo:tempDir askForExtractOptions:false. |
|
1691 |
process notNil ifTrue:[ |
|
1692 |
process waitUntilTerminated. |
|
1693 |
]. |
|
1694 |
file := tempDir construct:self selectionHolder value first fileName. |
|
1695 |
file exists ifTrue:[ |
|
3982 | 1696 |
item := DirectoryContentsBrowser itemClass fileName:file. |
3892 | 1697 |
]. |
1698 |
master notNil ifTrue:[ |
|
1699 |
master openApplByFileItem:item. |
|
1700 |
]. |
|
1701 |
! ! |
|
1702 |
||
1703 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'aspects'! |
|
1704 |
||
1705 |
archiveFileList |
|
1706 |
||
1707 |
archiveFileList isNil ifTrue:[ |
|
1708 |
archiveFileList := List new. |
|
1709 |
archiveFileList addDependent:self. |
|
1710 |
]. |
|
1711 |
^ archiveFileList. |
|
1712 |
! |
|
1713 |
||
1714 |
enableRemoveErrorOutput |
|
1715 |
"return/create the 'enableRemoveErrorOutput' value holder (automatically generated)" |
|
1716 |
||
1717 |
enableRemoveErrorOutput isNil ifTrue:[ |
|
1718 |
enableRemoveErrorOutput := false asValue. |
|
1719 |
]. |
|
1720 |
^ enableRemoveErrorOutput |
|
1721 |
! |
|
1722 |
||
1723 |
enableStopButton |
|
1724 |
||
1725 |
enableStopButton isNil ifTrue:[ |
|
1726 |
enableStopButton := false asValue. |
|
1727 |
]. |
|
1728 |
^ enableStopButton |
|
1729 |
! |
|
1730 |
||
1731 |
errorListHolder |
|
1732 |
||
1733 |
errorListHolder isNil ifTrue:[ |
|
1734 |
errorListHolder := List new. |
|
1735 |
]. |
|
1736 |
^ errorListHolder. |
|
1737 |
! |
|
1738 |
||
1739 |
errorListVisibilityHolder |
|
1740 |
||
1741 |
errorListVisibilityHolder isNil ifTrue:[ |
|
1742 |
errorListVisibilityHolder := false asValue. |
|
1743 |
]. |
|
1744 |
^ errorListVisibilityHolder |
|
1745 |
! |
|
1746 |
||
1747 |
hasSelectionInList |
|
1748 |
||
1749 |
| sel | |
|
1750 |
sel := self selectionHolder value. |
|
1751 |
^ (sel notNil and:[sel notEmpty]) |
|
1752 |
! |
|
1753 |
||
1754 |
selectionHolder |
|
1755 |
||
1756 |
selectionHolder isNil ifTrue:[ |
|
1757 |
selectionHolder := ValueHolder new. |
|
1758 |
selectionHolder addDependent:self. |
|
1759 |
]. |
|
1760 |
^ selectionHolder. |
|
1761 |
! |
|
1762 |
||
1763 |
tableColumns |
|
1764 |
||
1765 |
tableColumns isNil ifTrue:[ |
|
1766 |
tableColumns := self class tableColumns asValue. |
|
1767 |
]. |
|
1768 |
^ tableColumns. |
|
1769 |
! |
|
1770 |
||
1771 |
viewErrorList |
|
1772 |
"return/create the 'viewErrorList' value holder (automatically generated)" |
|
1773 |
||
1774 |
viewErrorList isNil ifTrue:[ |
|
1775 |
viewErrorList := false asValue. |
|
1776 |
viewErrorList onChangeSend:#viewErrorListChanged to:self. |
|
1777 |
]. |
|
1778 |
^ viewErrorList |
|
1779 |
! ! |
|
1780 |
||
1781 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'change & update'! |
|
1782 |
||
1783 |
update:something with:aParameter from:changedObject |
|
1784 |
"Invoked when an object that I depend upon sends a change notification." |
|
1785 |
||
1786 |
"stub code automatically generated - please change as required" |
|
1787 |
||
1788 |
changedObject == self archiveFileList ifTrue:[ |
|
1789 |
self hasListEntriesHolder value:(changedObject notEmpty). |
|
1790 |
^ self |
|
1791 |
]. |
|
1792 |
super update:something with:aParameter from:changedObject |
|
1793 |
! |
|
1794 |
||
1795 |
viewErrorListChanged |
|
1796 |
||
1797 |
| viewListValue| |
|
1798 |
||
1799 |
viewListValue := self viewErrorList value. |
|
1800 |
self enableRemoveErrorOutput value:viewListValue. |
|
1801 |
self errorListVisibilityHolder value:viewListValue. |
|
1802 |
! ! |
|
1803 |
||
1804 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'command execution'! |
|
1805 |
||
1806 |
getErrorBlock |
|
1807 |
||
1808 |
^ |
|
1809 |
[: x | |
|
1810 |
self viewErrorList value:true. |
|
1811 |
self errorListHolder value add:x. |
|
1812 |
] |
|
1813 |
! |
|
1814 |
||
1815 |
getErrorStream |
|
1816 |
||
1817 |
|errStream| |
|
1818 |
||
1819 |
errStream := ActorStream new. |
|
1820 |
errStream nextPutLineBlock:(self getErrorBlock). |
|
1821 |
^ errStream |
|
1822 |
! |
|
1823 |
||
1824 |
getOutBlock |
|
4961
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1825 |
|archiveOutputParser| |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1826 |
|
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1827 |
archiveOutputParser := archiver listFilesReader. |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1828 |
|
3892 | 1829 |
^ [: line | |
4961
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1830 |
item := archiveOutputParser parseLine:line forItemClass:ArchivItem. |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1831 |
item notNil ifTrue:[ |
3892 | 1832 |
self archiveFileList value add:item |
1833 |
]. |
|
1834 |
] |
|
1835 |
! |
|
1836 |
||
1837 |
getOutStream |
|
1838 |
||
1839 |
|outStream| |
|
1840 |
||
1841 |
outStream := ActorStream new. |
|
1842 |
outStream nextPutLineBlock:(self getOutBlock). |
|
1843 |
^ outStream |
|
1844 |
! |
|
1845 |
||
1846 |
makeProcessFor:aBlock |
|
1847 |
self makeProcessFor:aBlock with:'' |
|
1848 |
! |
|
1849 |
||
1850 |
makeProcessFor:aBlock with:string |
|
1851 |
process notNil ifTrue:[ |
|
1852 |
process waitUntilTerminated. |
|
1853 |
terminateByMe ifTrue:[ |
|
1854 |
terminateByMe := false. |
|
1855 |
^ self |
|
1856 |
]. |
|
1857 |
]. |
|
4803 | 1858 |
|
1859 |
process := [ [ |
|
1860 |
self notify:string. |
|
1861 |
aBlock value. |
|
1862 |
self notify:''. |
|
4890
b3f7edcf4981
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
4880
diff
changeset
|
1863 |
] ensure:[ |
3892 | 1864 |
process := nil. |
1865 |
self enableStopButton value:false. |
|
1866 |
] |
|
4803 | 1867 |
] newProcess. |
3892 | 1868 |
process priority:(Processor systemBackgroundPriority). |
1869 |
process name:'ArchiveApplicationProcess'. |
|
4803 | 1870 |
process resume. |
3892 | 1871 |
self enableStopButton value:true. |
1872 |
! |
|
1873 |
||
1874 |
setColumnsForArchiver |
|
1875 |
||
1876 |
| newColumns archiverColumns allColumns iconColumn| |
|
1877 |
||
4965
a251b39fb4a2
dont use a column-descriptors id-field
Claus Gittinger <cg@exept.de>
parents:
4964
diff
changeset
|
1878 |
archiverColumns := archiver columns collect:[:el| el first]. |
3892 | 1879 |
allColumns := OrderedCollection new. |
1880 |
newColumns := OrderedCollection new. |
|
1881 |
self class tableColumns do:[:el| |
|
1882 |
allColumns add:(DataSetColumnSpec new fromLiteralArrayEncoding:el). |
|
1883 |
]. |
|
4965
a251b39fb4a2
dont use a column-descriptors id-field
Claus Gittinger <cg@exept.de>
parents:
4964
diff
changeset
|
1884 |
iconColumn := allColumns detect:[: col | (col readSelector asSymbol) = #icon] ifNone:[nil]. |
3892 | 1885 |
iconColumn notNil ifTrue:[ |
1886 |
newColumns add:iconColumn. |
|
1887 |
]. |
|
1888 |
allColumns do:[:col| |
|
4965
a251b39fb4a2
dont use a column-descriptors id-field
Claus Gittinger <cg@exept.de>
parents:
4964
diff
changeset
|
1889 |
(archiverColumns includes:(col readSelector asSymbol)) ifTrue:[ |
3892 | 1890 |
newColumns add:col. |
1891 |
]. |
|
1892 |
]. |
|
1893 |
self tableColumns value:newColumns. |
|
1894 |
self columnDescriptors:(self tableColumns value). |
|
1895 |
! |
|
1896 |
||
1897 |
stopProcess |
|
1898 |
||
1899 |
|task| |
|
1900 |
||
1901 |
terminateByMe := true. |
|
1902 |
(task := process) notNil ifTrue:[ |
|
1903 |
process := nil. |
|
1904 |
||
4645
fcf36da5b305
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4626
diff
changeset
|
1905 |
Error handle:[:ex| |
3892 | 1906 |
Dialog warn:ex description. |
4645
fcf36da5b305
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4626
diff
changeset
|
1907 |
] do:[ |
3892 | 1908 |
task isDead ifFalse:[ |
3919 | 1909 |
task terminateWithAllSubprocessesInGroup. |
3892 | 1910 |
task waitUntilTerminated. |
1911 |
] |
|
1912 |
] |
|
1913 |
]. |
|
1914 |
! ! |
|
1915 |
||
1916 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'command helper'! |
|
1917 |
||
1918 |
selectDirectoryDialog |
|
1919 |
||
1920 |
| dir directory haveDirectory| |
|
1921 |
||
1922 |
directory := self fileName directory. |
|
1923 |
haveDirectory := false. |
|
1924 |
[haveDirectory] whileFalse:[ |
|
1925 |
dir := Dialog requestDirectoryName:'Which directory ?' default:dir. |
|
3988 | 1926 |
dir isEmpty ifTrue:[ ^ nil]. |
3892 | 1927 |
dir := dir asFilename. |
1928 |
(dir isExecutable not or:[dir isWritable not]) ifTrue:[ |
|
1929 |
Dialog warn:'cant write to: ', dir asString. |
|
1930 |
]. |
|
1931 |
haveDirectory := true. |
|
1932 |
]. |
|
1933 |
^ dir |
|
3988 | 1934 |
! |
1935 |
||
1936 |
selectDirectoryDialog:message |
|
4981
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
1937 |
|fn dir directory haveDirectory answer| |
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
1938 |
|
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
1939 |
fn := self fileName. |
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
1940 |
fn notNil ifTrue:[ |
5001 | 1941 |
dir := fn asFilename directory. |
4981
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
1942 |
] ifFalse:[ |
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
1943 |
fn := archiver fileName withoutSuffix. |
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
1944 |
(fn exists and:[fn isDirectory]) ifTrue:[ |
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
1945 |
dir := fn |
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
1946 |
] ifFalse:[ |
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
1947 |
dir := fn directory |
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
1948 |
]. |
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
1949 |
]. |
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
1950 |
directory := dir. |
3988 | 1951 |
haveDirectory := false. |
1952 |
[haveDirectory] whileFalse:[ |
|
1953 |
dir := Dialog requestDirectoryName:message default:dir. |
|
1954 |
dir isEmpty ifTrue:[ ^ nil]. |
|
4396
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1955 |
|
3988 | 1956 |
dir := dir asFilename. |
4396
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1957 |
dir exists ifFalse:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1958 |
answer := Dialog confirm:('Directory %1 does not exist. Create ?' bindWith:dir asString). |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1959 |
answer isNil ifTrue:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1960 |
^ nil |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1961 |
]. |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1962 |
answer ifTrue:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1963 |
dir makeDirectory. |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1964 |
dir exists ifFalse:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1965 |
Dialog warn:('Cannot create directory %1' bindWith: dir asString). |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1966 |
] |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1967 |
]. |
3988 | 1968 |
]. |
4396
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1969 |
dir exists ifTrue:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1970 |
(dir isExecutable not or:[dir isWritable not]) ifTrue:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1971 |
Dialog warn:('Cannot write into directory %1' bindWith:dir asString). |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1972 |
] ifFalse:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1973 |
haveDirectory := true. |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1974 |
]. |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
1975 |
]. |
3988 | 1976 |
]. |
1977 |
^ dir |
|
3892 | 1978 |
! ! |
1979 |
||
1980 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands add'! |
|
1981 |
||
4803 | 1982 |
addFilesToArchive:colOfFiles |
1983 |
self archiver |
|
1984 |
outStream:nil |
|
1985 |
errorStream:(self getErrorStream) |
|
1986 |
synchron:true. |
|
1987 |
||
4961
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1988 |
"/ self |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1989 |
"/ makeProcessFor:[ |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1990 |
"/ self archiver addFilesToArchive:colOfFiles. |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1991 |
"/ ] |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1992 |
"/ with:'Adding files to archive'. |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1993 |
"/ synchronous - otherwise list below fails |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1994 |
self archiver addFilesToArchive:colOfFiles. |
4803 | 1995 |
|
1996 |
"/ ugly code alarm. |
|
3892 | 1997 |
(self archiver class == Archiver zipArchive) ifTrue:[ |
4905 | 1998 |
self listAllFiles |
3892 | 1999 |
] ifFalse:[ |
4905 | 2000 |
self listFiles:colOfFiles |
3892 | 2001 |
]. |
4803 | 2002 |
^ true |
3892 | 2003 |
! ! |
2004 |
||
2005 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands extract'! |
|
2006 |
||
2007 |
extractAll |
|
2008 |
||
2009 |
self extractSelectedFilesTo:nil withSelection:#all |
|
2010 |
! |
|
2011 |
||
2012 |
extractSelectedFilesTo:aDirectory askForExtractOptions:askForExtractOptionsBoolean |
|
2013 |
||
2014 |
self extractSelectedFilesTo:aDirectory withSelection:#selection askForExtractOptions:askForExtractOptionsBoolean |
|
2015 |
! |
|
2016 |
||
2017 |
extractSelectedFilesTo:aDirectory withSelection:selectOrAll |
|
2018 |
||
2019 |
self extractSelectedFilesTo:aDirectory withSelection:selectOrAll askForExtractOptions:true. |
|
2020 |
! |
|
2021 |
||
2022 |
extractSelectedFilesTo:aDirectory withSelection:selectOrAll askForExtractOptions:askForExtractOptionsBoolean |
|
2023 |
||
2024 |
| dir| |
|
2025 |
||
2026 |
aDirectory isNil ifTrue:[ |
|
4396
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2027 |
dir := self selectDirectoryDialog:'Extract into which directory ?'. |
3892 | 2028 |
dir isNil ifTrue:[^ self]. |
2029 |
] ifFalse:[ |
|
2030 |
dir := aDirectory. |
|
2031 |
]. |
|
2032 |
selectOrAll == #all ifTrue:[ |
|
2033 |
self extractAllTo:dir. |
|
2034 |
]. |
|
2035 |
selectOrAll == #selection ifTrue:[ |
|
2036 |
self extractSelectionTo:dir askForExtractOptions:askForExtractOptionsBoolean |
|
2037 |
]. |
|
4001 | 2038 |
"/ self updateFileBrowserIfPresentWith:dir. |
3892 | 2039 |
! ! |
2040 |
||
2041 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands extract private'! |
|
2042 |
||
2043 |
extractAllTo:aDirectory |
|
2044 |
||
4803 | 2045 |
self archiver |
2046 |
outStream:nil |
|
2047 |
errorStream:(self getErrorStream) |
|
2048 |
synchron:true. |
|
2049 |
self |
|
4905 | 2050 |
makeProcessFor:[ self archiver extractFilesTo:aDirectory ] |
4803 | 2051 |
with:'Extracting all files'. |
3892 | 2052 |
^ true. |
2053 |
! |
|
2054 |
||
2055 |
extractSelectionTo:aDirectory askForExtractOptions:askForExtractOptionsBoolean |
|
2056 |
||
2057 |
| sel index extractWithDirectoryPart extractAllFilesInSelectedDirectories extractFiles| |
|
2058 |
||
2059 |
extractWithDirectoryPart := true. |
|
2060 |
extractAllFilesInSelectedDirectories := false. |
|
2061 |
sel := self selectionHolder value. |
|
2062 |
(sel isNil or:[sel isEmpty]) ifTrue:[ |
|
2063 |
sel := self archiveFileList value. |
|
2064 |
]. |
|
2065 |
sel := sel do:[:item| |
|
2066 |
item fileName: item fileName |
|
2067 |
]. |
|
2068 |
(askForExtractOptionsBoolean and:[self archiver class ~= Archiver zipArchive]) ifTrue:[ |
|
2069 |
extractFiles := self selRemoveFilesForDirs:sel. |
|
2070 |
] ifFalse:[ |
|
2071 |
extractFiles := sel. |
|
2072 |
]. |
|
2073 |
||
2074 |
askForExtractOptionsBoolean ifTrue:[ |
|
2075 |
index := extractFiles findFirst:[: el | el hasDirectoryPart]. |
|
2076 |
index ~= 0 ifTrue:[ |
|
4964 | 2077 |
extractWithDirectoryPart := (Dialog confirmWithCancel:'Extract with directory part ?\\(I.e. create empty directories as required to preserve relative path)' withCRs default:true). |
3892 | 2078 |
extractWithDirectoryPart isNil ifTrue:[^ false]. |
2079 |
]. |
|
2080 |
]. |
|
2081 |
extractWithDirectoryPart ifTrue:[ |
|
2082 |
self extractWithDirectoryPartTo:aDirectory with:extractFiles. |
|
2083 |
] ifFalse:[ |
|
2084 |
self extractWithOutDirectoryPartTo:aDirectory with:extractFiles. |
|
2085 |
]. |
|
2086 |
^ true |
|
2087 |
! |
|
2088 |
||
2089 |
extractWithDirectoryPartTo:aDirectory with:extractFiles |
|
2090 |
||
4803 | 2091 |
self archiver |
2092 |
outStream:nil |
|
2093 |
errorStream:(self getErrorStream) |
|
2094 |
synchron:true. |
|
2095 |
self |
|
4905 | 2096 |
makeProcessFor:[ self archiver extractFiles:extractFiles to:aDirectory ] |
4803 | 2097 |
with:('Extracting files to %1' bindWith:aDirectory asString). |
3892 | 2098 |
^ true. |
2099 |
! |
|
2100 |
||
2101 |
extractWithOutDirectoryPartTo:aDirectory with:extractFiles |
|
2102 |
||
4803 | 2103 |
self archiver |
2104 |
outStream:nil |
|
2105 |
errorStream:(self getErrorStream) |
|
2106 |
synchron:true. |
|
2107 |
self |
|
2108 |
makeProcessFor:[ |
|
2109 |
self archiver |
|
4905 | 2110 |
extractFiles:(extractFiles collect:[:item| item fileName]) |
2111 |
withoutDirectoryTo:aDirectory. |
|
4803 | 2112 |
] |
2113 |
with:('Extracting files to %1' bindWith:aDirectory asString). |
|
3892 | 2114 |
^ true. |
2115 |
! ! |
|
2116 |
||
2117 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands list'! |
|
2118 |
||
4905 | 2119 |
listAllFiles |
3892 | 2120 |
self archiveFileList value removeAll. |
4905 | 2121 |
self listFiles:nil |
2122 |
! |
|
2123 |
||
2124 |
listFiles:aColOfFilesOrNil |
|
3892 | 2125 |
process notNil ifTrue:[ |
4803 | 2126 |
process waitUntilTerminated |
3892 | 2127 |
]. |
4803 | 2128 |
|
4905 | 2129 |
archiver notNil ifTrue:[ |
2130 |
self archiver |
|
2131 |
outStream:(self getOutStream) |
|
2132 |
errorStream:(self getErrorStream) |
|
2133 |
synchron:true. |
|
2134 |
||
2135 |
self |
|
2136 |
makeProcessFor:[self archiver listFiles:aColOfFilesOrNil] |
|
2137 |
with:'List files' |
|
2138 |
] |
|
3892 | 2139 |
! ! |
2140 |
||
2141 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands remove'! |
|
2142 |
||
4803 | 2143 |
removeFilesFromArchive |
2144 |
|sel realSel list firtsPre stringCol stringRealSel| |
|
3892 | 2145 |
|
2146 |
sel := self selectionHolder value. |
|
4803 | 2147 |
stringCol := sel collect:[:item | item fileName]. |
3892 | 2148 |
firtsPre := stringCol at:1. |
4803 | 2149 |
stringCol from:2 do:[:el | firtsPre := firtsPre commonPrefixWith:el]. |
3892 | 2150 |
list := self archiveFileList value. |
4803 | 2151 |
"/ realSel := OrderedCollection new. |
2152 |
"/ list do:[:item | |
|
2153 |
"/ ((item fileName) startsWith:firtsPre) ifTrue:[ |
|
2154 |
"/ realSel add:item |
|
2155 |
"/ ] |
|
2156 |
"/ ]. |
|
2157 |
realSel := list select:[:item | (item fileName) startsWith:firtsPre]. |
|
2158 |
stringRealSel := realSel collect:[:item | item fileName]. |
|
2159 |
||
2160 |
self archiver |
|
2161 |
outStream:nil |
|
2162 |
errorStream:(self getErrorStream) |
|
2163 |
synchron:true. |
|
2164 |
self |
|
2165 |
makeProcessFor:[ self archiver removeFilesFromArchive:stringCol ] |
|
2166 |
with:'Remove files'. |
|
4462
b14fcc67ff8e
removeAll: changed to removeAllFoundIn:
Michael Beyl <mb@exept.de>
parents:
4417
diff
changeset
|
2167 |
self archiveFileList value removeAllFoundIn:realSel |
3892 | 2168 |
! ! |
2169 |
||
2170 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'drag & drop'! |
|
2171 |
||
3951 | 2172 |
canDrop:aContext |
2173 |
||
2174 |
^ inDropMode |
|
3892 | 2175 |
! |
2176 |
||
4803 | 2177 |
doDrop:aContext |
3892 | 2178 |
|col source arg objects| |
2179 |
||
2180 |
source := aContext dropSource. |
|
2181 |
arg := source argument. |
|
2182 |
objects := aContext dropObjects. |
|
4803 | 2183 |
col := objects collect:[:dropObject | dropObject theObject]. |
2184 |
^ self addFilesToArchive:col |
|
3892 | 2185 |
! |
2186 |
||
2187 |
doStartDrag:aDropSource in:aView |
|
2188 |
"set the cursors before starting the drag & drop operation |
|
2189 |
" |
|
2190 |
|hdl sel| |
|
2191 |
||
4018 | 2192 |
archiver class canDragnDrop ifFalse:[^ self]. |
3892 | 2193 |
sel := self selectionHolder value. |
2194 |
||
2195 |
hdl := DragAndDropManager new. |
|
2196 |
||
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
2197 |
hdl disabledCursor:AbstractFileBrowser disabledCursorImage. |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
2198 |
hdl enabledCursor:AbstractFileBrowser enabledCursorImage. |
3892 | 2199 |
hdl alienCursor:nil. |
2200 |
||
2201 |
hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft |
|
2202 |
! |
|
2203 |
||
3951 | 2204 |
dropEnter:aContext |
2205 |
||
2206 |
| dropedObjects| |
|
2207 |
||
2208 |
inDropMode := false. |
|
2209 |
(aContext dropSource receiver == self) ifTrue:[^ self]. |
|
2210 |
dropedObjects := aContext dropObjects. |
|
2211 |
||
2212 |
||
2213 |
dropedObjects do:[:aObject| |checkObject checkObjectString| |
|
2214 |
aObject isFileObject ifFalse:[^ self]. |
|
2215 |
checkObject := aObject theObject. |
|
2216 |
checkObject isFilename not ifTrue:[^ self]. |
|
2217 |
checkObject isSpecialFile ifTrue:[^ self]. |
|
2218 |
]. |
|
2219 |
inDropMode := true. |
|
2220 |
! |
|
2221 |
||
2222 |
dropLeave:aContext |
|
2223 |
||
2224 |
inDropMode := false. |
|
2225 |
! |
|
2226 |
||
3892 | 2227 |
getDisplayObjects:anArgument |
2228 |
||
2229 |
| sel string size fnName stream| |
|
2230 |
sel := self selectionHolder value. |
|
2231 |
size := sel size. |
|
2232 |
size == 0 ifTrue:[^ '']. |
|
2233 |
stream := WriteStream on:''. |
|
2234 |
stream nextPutAll:(sel first fileName asFilename baseName asString). |
|
2235 |
size == 1 ifTrue:[ |
|
2236 |
fnName := 'ui_menuitem.xpm'. |
|
2237 |
] ifFalse:[ |
|
2238 |
fnName := 'ui_submenu_open.xpm'. |
|
2239 |
stream nextPutAll:' ... '. |
|
2240 |
stream nextPutAll:(sel last fileName asFilename baseName asString). |
|
2241 |
]. |
|
2242 |
string := stream contents. |
|
2243 |
stream close. |
|
2244 |
^ Array with:(LabelAndIcon icon:(Image fromFile:fnName) |
|
2245 |
string:(Text string:string emphasis:#bold) |
|
2246 |
) |
|
2247 |
! |
|
2248 |
||
2249 |
getDropObjects:anArgument |
|
2250 |
||
2251 |
| sel ret| |
|
2252 |
sel := self selectionHolder value. |
|
2253 |
ret := sel collect:[:el| |
|
4964 | 2254 |
DropObject newFileInArchive:(el fileName asFilename) |
3892 | 2255 |
]. |
2256 |
^ ret |
|
2257 |
! ! |
|
2258 |
||
2259 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'event handling'! |
|
2260 |
||
4803 | 2261 |
processEvent:anEvent |
3892 | 2262 |
"filter keyboard events. |
2263 |
Return true, if I have eaten the event" |
|
2264 |
||
2265 |
|focusView key rawKey| |
|
2266 |
||
2267 |
anEvent isKeyPressEvent ifTrue:[ |
|
2268 |
focusView := anEvent targetView. |
|
2269 |
key := anEvent key. |
|
2270 |
rawKey := anEvent rawKey. |
|
2271 |
(focusView isSameOrComponentOf:self window) ifTrue:[ |
|
2272 |
(key == #Delete) ifTrue:[ |
|
4803 | 2273 |
self removeFilesFromArchive. |
3892 | 2274 |
^ true |
4803 | 2275 |
] |
3892 | 2276 |
] |
2277 |
]. |
|
2278 |
^ false |
|
2279 |
! ! |
|
2280 |
||
2281 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'initialization & release'! |
|
2282 |
||
2283 |
postBuildFileTable:aWidget |
|
2284 |
||
2285 |
fileTable := aWidget scrolledView. |
|
2286 |
fileTable wantsFocusWithPointerEnter. |
|
2287 |
"/ FileBrowser icons keysAndValuesDo:[:aKey :anIcon| |
|
2288 |
"/ fileTable registerImage:anIcon key:aKey. |
|
2289 |
"/ ]. |
|
2290 |
self columnDescriptors:(self class tableColumns). |
|
2291 |
! |
|
2292 |
||
4803 | 2293 |
postOpenWith:aBuilder |
2294 |
|currentDir contents suffix fileName file archivItem| |
|
3892 | 2295 |
|
2296 |
self windowGroup addPreEventHook:self. |
|
2297 |
self masterApplication isNil ifTrue:[ |
|
2298 |
self masterApplication:nil. |
|
2299 |
currentDir := Filename homeDirectory. |
|
2300 |
contents := currentDir directoryContents. |
|
4803 | 2301 |
fileName := contents |
2302 |
detect:[:file | |
|
2303 |
suffix := file asFilename suffix asLowercase. |
|
2304 |
suffix = 'tgz' |
|
2305 |
] |
|
2306 |
ifNone:[nil]. |
|
2307 |
fileName isNil ifTrue:[ |
|
2308 |
Dialog warn:'cant find a Zip file in ' , currentDir asString. |
|
3892 | 2309 |
^ self |
2310 |
]. |
|
2311 |
file := currentDir construct:fileName. |
|
3982 | 2312 |
archivItem := DirectoryContentsBrowser itemClass fileName:file. |
3892 | 2313 |
(self item:archivItem) ifFalse:[ |
4803 | 2314 |
Dialog warn:'file type of ' , item fileName asString , ' not supported'. |
2315 |
^ self |
|
2316 |
] |
|
3892 | 2317 |
]. |
4905 | 2318 |
self listAllFiles. |
4803 | 2319 |
^ super postOpenWith:aBuilder |
3892 | 2320 |
! |
2321 |
||
2322 |
release |
|
2323 |
||
2324 |
self archiver release. |
|
2325 |
^ super release. |
|
2326 |
! ! |
|
2327 |
||
2328 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'queries'! |
|
2329 |
||
2330 |
archivType |
|
2331 |
||
2332 |
| file firstsuffix secondsuffix| |
|
2333 |
||
2334 |
file := self fileName. |
|
2335 |
firstsuffix := file withoutSuffix suffix. |
|
2336 |
secondsuffix := file suffix. |
|
2337 |
(secondsuffix = 'tgz' or:[firstsuffix = 'tar' and:[secondsuffix = 'gz']]) ifTrue:[ |
|
2338 |
^ #tarFileCompressed |
|
2339 |
]. |
|
2340 |
(secondsuffix = 'tar') ifTrue:[ |
|
2341 |
^ #tarFile |
|
2342 |
]. |
|
2343 |
(secondsuffix = 'gz') ifTrue:[ |
|
2344 |
^ #gzipFile |
|
2345 |
]. |
|
2346 |
(secondsuffix = 'zip') ifTrue:[ |
|
2347 |
^ #zipFile |
|
2348 |
]. |
|
2349 |
! |
|
2350 |
||
2351 |
canDelete |
|
2352 |
||
2353 |
^ (self hasOneSelectionInList and:[archiver class canRemoveFiles]) |
|
2354 |
! |
|
2355 |
||
4001 | 2356 |
canViewFile |
2357 |
||
2358 |
^ self archiver class canViewFile and:[self hasOneSelectionInList] |
|
2359 |
! |
|
2360 |
||
2361 |
hasListEntriesHolder |
|
2362 |
"return/create the 'hasListEntriesHolder' value holder (automatically generated)" |
|
2363 |
||
2364 |
hasListEntriesHolder isNil ifTrue:[ |
|
2365 |
hasListEntriesHolder := false asValue. |
|
2366 |
]. |
|
2367 |
^ hasListEntriesHolder |
|
2368 |
! |
|
2369 |
||
2370 |
hasOneSelectionInList |
|
2371 |
||
2372 |
| sel | |
|
2373 |
sel := self selectionHolder value. |
|
2374 |
^ (sel notNil and:[sel notEmpty and:[sel size = 1]]) |
|
2375 |
! |
|
2376 |
||
3892 | 2377 |
selRemoveFilesForDirs:aSel |
2378 |
||
2379 |
|stringCol newSel string| |
|
2380 |
||
2381 |
stringCol := (aSel collect:[: item| item fileName]). |
|
2382 |
newSel := aSel copy. |
|
2383 |
aSel do:[:item | |
|
2384 |
item isDirectory ifTrue:[ |
|
2385 |
string := item fileName. |
|
2386 |
stringCol doWithIndex:[:filename : index| |
|
2387 |
(filename ~= string and:[filename startsWith:string]) ifTrue:[ |
|
2388 |
newSel remove:(aSel at:index) ifAbsent:[nil]. |
|
2389 |
] |
|
2390 |
] |
|
2391 |
]. |
|
2392 |
]. |
|
2393 |
^ newSel. |
|
2394 |
! ! |
|
2395 |
||
2396 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'sorting'! |
|
2397 |
||
2398 |
generateSortBlock:instanceName |
|
2399 |
||
2400 |
| aSymbol cmpOp sortCaselessLocal| |
|
2401 |
||
2402 |
aSymbol := instanceName asSymbol. |
|
2403 |
sortCaselessLocal := self sortCaseless value. |
|
2404 |
currentSortOrder isNil ifTrue:[ |
|
2405 |
currentSortOrder := aSymbol. |
|
2406 |
currentSortOrder := Dictionary new. |
|
2407 |
currentSortOrder at:#column put:aSymbol. |
|
2408 |
currentSortOrder at:#reverse put:false. |
|
2409 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
2410 |
] ifFalse:[ |
|
2411 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
2412 |
"/ same column like before - change sort order |
|
2413 |
| isReverse | |
|
2414 |
isReverse := currentSortOrder at:#reverse. |
|
2415 |
currentSortOrder at:#reverse put:(isReverse not). |
|
2416 |
] ifFalse:[ |
|
2417 |
"/ another column - remark column |
|
2418 |
currentSortOrder at:#column put:aSymbol. |
|
2419 |
] |
|
2420 |
]. |
|
2421 |
(currentSortOrder at:#reverse) ifTrue:[ |
|
2422 |
cmpOp := #'>' |
|
2423 |
] ifFalse:[ |
|
2424 |
cmpOp := #'<' |
|
2425 |
]. |
|
2426 |
^ [:a :b | |
|
2427 |
|entry1 entry2| |
|
2428 |
||
2429 |
entry1 := (a perform:aSymbol). |
|
2430 |
entry2 := (b perform:aSymbol). |
|
2431 |
aSymbol = #fileName ifTrue:[ |
|
2432 |
sortCaselessLocal ifTrue:[ |
|
2433 |
entry1 := entry1 asString asLowercase. |
|
2434 |
entry2 := entry2 asString asLowercase. |
|
2435 |
] ifFalse:[ |
|
2436 |
entry1 := entry1 asString. |
|
2437 |
entry2 := entry2 asString. |
|
2438 |
]. |
|
2439 |
]. |
|
2440 |
entry1 perform:cmpOp with:entry2 |
|
2441 |
]. |
|
2442 |
! |
|
2443 |
||
2444 |
sortList:instanceName |
|
2445 |
||
2446 |
||
2447 |
|sortBlock fileList sortCol| |
|
2448 |
||
2449 |
sortBlock := self generateSortBlock:instanceName. |
|
2450 |
fileList := self archiveFileList value. |
|
2451 |
sortCol := SortedCollection sortBlock:sortBlock. |
|
2452 |
sortCol addAll:fileList. |
|
2453 |
fileList removeAll. |
|
2454 |
fileList addAll:sortCol. |
|
2455 |
! ! |
|
2456 |
||
2457 |
!FileApplicationNoteBook::ArchiveViewApplication::ArchivItem methodsFor:'accessing'! |
|
2458 |
||
2459 |
compressSize |
|
2460 |
"return the value of the instance variable 'compressSize' (automatically generated)" |
|
2461 |
||
2462 |
^ compressSize |
|
2463 |
! |
|
2464 |
||
2465 |
compressSize:something |
|
2466 |
"set the value of the instance variable 'compressSize' (automatically generated)" |
|
2467 |
||
2468 |
compressSize := something. |
|
2469 |
! |
|
2470 |
||
2471 |
crc |
|
2472 |
"return the value of the instance variable 'crc' (automatically generated)" |
|
2473 |
||
2474 |
^ crc |
|
2475 |
! |
|
2476 |
||
2477 |
crc:something |
|
2478 |
"set the value of the instance variable 'crc' (automatically generated)" |
|
2479 |
||
2480 |
crc := something. |
|
2481 |
! |
|
2482 |
||
2483 |
dateAndTime |
|
2484 |
"return the value of the instance variable 'dateAndTime' (automatically generated)" |
|
2485 |
||
2486 |
^ dateAndTime |
|
2487 |
! |
|
2488 |
||
2489 |
dateAndTime:something |
|
2490 |
"set the value of the instance variable 'dateAndTime' (automatically generated)" |
|
2491 |
||
2492 |
dateAndTime := something. |
|
2493 |
! |
|
2494 |
||
2495 |
fileName |
|
2496 |
"return the value of the instance variable 'fileName' (automatically generated)" |
|
2497 |
||
2498 |
^ fileName |
|
2499 |
! |
|
2500 |
||
2501 |
fileName:something |
|
2502 |
"set the value of the instance variable 'fileName' (automatically generated)" |
|
2503 |
||
2504 |
fileName := something withoutSpaces. |
|
2505 |
! |
|
2506 |
||
2507 |
icon |
|
2508 |
"return the value of the instance variable 'icon' (automatically generated)" |
|
2509 |
||
2510 |
^ icon |
|
2511 |
! |
|
2512 |
||
2513 |
icon:something |
|
2514 |
"set the value of the instance variable 'icon' (automatically generated)" |
|
2515 |
||
2516 |
icon := something. |
|
2517 |
! |
|
2518 |
||
2519 |
isDirectory |
|
2520 |
"return the value of the instance variable 'directory' (automatically generated)" |
|
2521 |
||
2522 |
^ isDirectory |
|
2523 |
! |
|
2524 |
||
2525 |
isDirectory:something |
|
2526 |
"set the value of the instance variable 'isDirectory' (automatically generated)" |
|
2527 |
||
2528 |
isDirectory := something. |
|
2529 |
! |
|
2530 |
||
2531 |
method |
|
2532 |
"return the value of the instance variable 'method' (automatically generated)" |
|
2533 |
||
2534 |
^ method |
|
2535 |
! |
|
2536 |
||
2537 |
method:something |
|
2538 |
"set the value of the instance variable 'method' (automatically generated)" |
|
2539 |
||
2540 |
method := something. |
|
2541 |
! |
|
2542 |
||
2543 |
ownerGroup |
|
2544 |
"return the value of the instance variable 'owner' (automatically generated)" |
|
2545 |
||
2546 |
^ ownerGroup |
|
2547 |
! |
|
2548 |
||
2549 |
ownerGroup:something |
|
2550 |
"set the value of the instance variable 'owner' (automatically generated)" |
|
2551 |
||
2552 |
ownerGroup := something. |
|
2553 |
! |
|
2554 |
||
2555 |
permissions |
|
2556 |
"return the value of the instance variable 'permissions' (automatically generated)" |
|
2557 |
||
2558 |
^ permissions |
|
2559 |
! |
|
2560 |
||
2561 |
permissions:something |
|
2562 |
"set the value of the instance variable 'permissions' (automatically generated)" |
|
2563 |
||
2564 |
permissions := something. |
|
2565 |
! |
|
2566 |
||
2567 |
ratio |
|
2568 |
"return the value of the instance variable 'ratio' (automatically generated)" |
|
2569 |
||
2570 |
^ ratio |
|
2571 |
! |
|
2572 |
||
2573 |
ratio:something |
|
2574 |
"set the value of the instance variable 'ratio' (automatically generated)" |
|
2575 |
||
2576 |
ratio := something. |
|
2577 |
! |
|
2578 |
||
2579 |
size |
|
2580 |
"return the value of the instance variable 'size' (automatically generated)" |
|
2581 |
||
2582 |
^ size |
|
2583 |
! |
|
2584 |
||
2585 |
size:something |
|
2586 |
"set the value of the instance variable 'size' (automatically generated)" |
|
2587 |
||
2588 |
size := something. |
|
2589 |
! |
|
2590 |
||
2591 |
sizeAsNumber |
|
2592 |
"return the value of the instance variable 'size' (automatically generated)" |
|
2593 |
||
2594 |
^ size asInteger |
|
2595 |
! |
|
2596 |
||
2597 |
type |
|
2598 |
"return the value of the instance variable 'type' (automatically generated)" |
|
2599 |
||
2600 |
^ type |
|
2601 |
! |
|
2602 |
||
2603 |
type:something |
|
2604 |
"set the value of the instance variable 'type' (automatically generated)" |
|
2605 |
||
2606 |
type := something. |
|
2607 |
! |
|
2608 |
||
2609 |
version |
|
2610 |
"return the value of the instance variable 'version' (automatically generated)" |
|
2611 |
||
2612 |
^ version |
|
2613 |
! |
|
2614 |
||
2615 |
version:something |
|
2616 |
"set the value of the instance variable 'version' (automatically generated)" |
|
2617 |
||
2618 |
version := something. |
|
2619 |
! ! |
|
2620 |
||
2621 |
!FileApplicationNoteBook::ArchiveViewApplication::ArchivItem methodsFor:'printing'! |
|
2622 |
||
2623 |
printString |
|
2624 |
||
2625 |
^ self fileName asString |
|
2626 |
! ! |
|
2627 |
||
2628 |
!FileApplicationNoteBook::ArchiveViewApplication::ArchivItem methodsFor:'queries'! |
|
2629 |
||
2630 |
hasDirectoryPart |
|
2631 |
||
2632 |
^ self fileName asFilename components size ~= 1 |
|
2633 |
! ! |
|
2634 |
||
2635 |
!FileApplicationNoteBook::CommandResult class methodsFor:'defaults'! |
|
2636 |
||
2637 |
tabStringFor:aApplicationType |
|
2638 |
||
2639 |
^ 'Execution result' |
|
2640 |
! |
|
2641 |
||
2642 |
wantNewApplicationAnyway |
|
2643 |
||
2644 |
^ false |
|
2645 |
! ! |
|
2646 |
||
2647 |
!FileApplicationNoteBook::CommandResult class methodsFor:'interface specs'! |
|
2648 |
||
2649 |
windowSpec |
|
2650 |
"This resource specification was automatically generated |
|
2651 |
by the UIPainter of ST/X." |
|
2652 |
||
2653 |
"Do not manually edit this!! If it is corrupted, |
|
2654 |
the UIPainter may not be able to read the specification." |
|
2655 |
||
2656 |
" |
|
4169 | 2657 |
UIPainter new openOnClass:FileApplicationNoteBook::CommandResult andSelector:#windowSpec |
2658 |
FileApplicationNoteBook::CommandResult new openInterface:#windowSpec |
|
2659 |
FileApplicationNoteBook::CommandResult open |
|
3892 | 2660 |
" |
2661 |
||
2662 |
<resource: #canvas> |
|
2663 |
||
2664 |
^ |
|
2665 |
#(#FullSpec |
|
2666 |
#name: #windowSpec |
|
2667 |
#window: |
|
2668 |
#(#WindowSpec |
|
2669 |
#label: 'NoteBookApplication::CommandResult' |
|
2670 |
#name: 'NoteBookApplication::CommandResult' |
|
2671 |
#min: #(#Point 10 10) |
|
2672 |
#max: #(#Point 1024 768) |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
2673 |
#bounds: #(#Rectangle 220 193 723 546) |
3892 | 2674 |
#menu: #mainMenu |
2675 |
) |
|
2676 |
#component: |
|
2677 |
#(#SpecCollection |
|
2678 |
#collection: #( |
|
2679 |
#(#MenuPanelSpec |
|
2680 |
#name: 'ToolBar1' |
|
2681 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
2682 |
#level: 0 |
3892 | 2683 |
#menu: #menu |
2684 |
#textDefault: true |
|
2685 |
) |
|
2686 |
#(#ArbitraryComponentSpec |
|
2687 |
#name: 'ArbitraryComponent1' |
|
2688 |
#layout: #(#LayoutFrame 0 0.0 32 0 0 1.0 0 1) |
|
2689 |
#hasHorizontalScrollBar: true |
|
2690 |
#hasVerticalScrollBar: true |
|
2691 |
#hasBorder: false |
|
2692 |
#component: #TextCollector |
|
2693 |
#postBuildCallback: #postBuildTextCollector: |
|
2694 |
) |
|
4169 | 2695 |
#(#ProgressIndicatorSpec |
2696 |
#name: 'ProgressIndicator1' |
|
2697 |
#layout: #(#LayoutFrame 125 0 11 0 231 0 21 0) |
|
4180 | 2698 |
#visibilityChannel: #enableStopButton |
4169 | 2699 |
#backgroundColor: #(#Color 0.0 66.9993 66.9993) |
2700 |
#showPercentage: false |
|
2701 |
#isActivityIndicator: true |
|
3892 | 2702 |
) |
2703 |
) |
|
2704 |
||
2705 |
) |
|
2706 |
) |
|
2707 |
! ! |
|
2708 |
||
2709 |
!FileApplicationNoteBook::CommandResult class methodsFor:'menu specs'! |
|
2710 |
||
2711 |
menu |
|
2712 |
"This resource specification was automatically generated |
|
2713 |
by the MenuEditor of ST/X." |
|
2714 |
||
2715 |
"Do not manually edit this!! If it is corrupted, |
|
2716 |
the MenuEditor may not be able to read the specification." |
|
2717 |
||
2718 |
" |
|
2719 |
MenuEditor new openOnClass:FileApplicationNoteBook::CommandResult andSelector:#menu |
|
2720 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::CommandResult menu)) startUp |
|
2721 |
" |
|
2722 |
||
2723 |
<resource: #menu> |
|
2724 |
||
2725 |
^ |
|
2726 |
#(#Menu |
|
2727 |
#( |
|
2728 |
#(#MenuItem |
|
2729 |
#label: 'Stop' |
|
2730 |
#translateLabel: true |
|
2731 |
#isButton: true |
|
2732 |
#nameKey: #Stop |
|
2733 |
#value: #doStopProcess |
|
2734 |
#enabled: #enableStopButton |
|
2735 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #stop22x22Icon 'Stop') |
|
2736 |
) |
|
2737 |
#(#MenuItem |
|
2738 |
#label: 'Close' |
|
2739 |
#translateLabel: true |
|
2740 |
#isButton: true |
|
2741 |
#nameKey: #Close |
|
2742 |
#isVisible: #isEmbeddedApplication |
|
2743 |
#startGroup: #right |
|
2744 |
#value: #doClose |
|
2745 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #closeIcon) |
|
2746 |
) |
|
2747 |
) |
|
2748 |
nil |
|
2749 |
nil |
|
2750 |
) |
|
2751 |
! ! |
|
2752 |
||
2753 |
!FileApplicationNoteBook::CommandResult methodsFor:'accessing'! |
|
2754 |
||
2755 |
resultStream |
|
2756 |
"return the value of the instance variable 'resultStream' (automatically generated)" |
|
2757 |
||
2758 |
^ resultStream |
|
2759 |
! |
|
2760 |
||
2761 |
resultStream:something |
|
2762 |
"set the value of the instance variable 'resultStream' (automatically generated)" |
|
2763 |
||
2764 |
resultStream := something. |
|
2765 |
! ! |
|
2766 |
||
2767 |
!FileApplicationNoteBook::CommandResult methodsFor:'actions'! |
|
2768 |
||
2769 |
changeTabTo:aString |
|
2770 |
||
2771 |
| masterApplication | |
|
2772 |
||
2773 |
masterApplication := self masterApplication. |
|
2774 |
masterApplication isNil ifFalse:[ |
|
2775 |
masterApplication tabStringChangeTo:aString for:self. |
|
2776 |
]. |
|
2777 |
! |
|
2778 |
||
2779 |
doStopProcess |
|
2780 |
||
2781 |
| myProcess | |
|
2782 |
||
2783 |
myProcess := self process value. |
|
2784 |
myProcess notNil ifTrue:[ |
|
4523 | 2785 |
self notify:('kill ', myProcess name). |
3892 | 2786 |
myProcess terminate. |
2787 |
]. |
|
2788 |
! ! |
|
2789 |
||
2790 |
!FileApplicationNoteBook::CommandResult methodsFor:'aspects'! |
|
2791 |
||
2792 |
enableStopButton |
|
2793 |
||
2794 |
enableStopButton isNil ifTrue:[ |
|
2795 |
enableStopButton := false asValue. |
|
2796 |
]. |
|
2797 |
^ enableStopButton |
|
2798 |
! |
|
2799 |
||
2800 |
process |
|
2801 |
"return/create the 'process' value holder (automatically generated)" |
|
2802 |
||
2803 |
process isNil ifTrue:[ |
|
2804 |
process := ValueHolder new. |
|
2805 |
process addDependent:self. |
|
2806 |
]. |
|
2807 |
^ process |
|
2808 |
! ! |
|
2809 |
||
2810 |
!FileApplicationNoteBook::CommandResult methodsFor:'change & update'! |
|
2811 |
||
2812 |
update:something with:aParameter from:changedObject |
|
2813 |
"Invoked when an object that I depend upon sends a change notification." |
|
2814 |
||
2815 |
"stub code automatically generated - please change as required" |
|
2816 |
||
2817 |
changedObject == self process ifTrue:[ |
|
2818 |
self enableStopButton value:changedObject value notNil. |
|
2819 |
^ self |
|
2820 |
]. |
|
2821 |
super update:something with:aParameter from:changedObject |
|
2822 |
! ! |
|
2823 |
||
2824 |
!FileApplicationNoteBook::CommandResult methodsFor:'initialization & release'! |
|
2825 |
||
2826 |
postBuildTextCollector:aBuilder |
|
2827 |
||
2828 |
self resultStream:aBuilder scrolledView. |
|
2829 |
! |
|
2830 |
||
2831 |
postBuildWith:aBuilder |
|
2832 |
"This is a hook method generated by the Browser. |
|
2833 |
It will be invoked during the initialization of your app/dialog, |
|
2834 |
after all of the visual components have been built, |
|
2835 |
but BEFORE the top window is made visible. |
|
2836 |
Add any app-specific actions here (reading files, setting up values etc.) |
|
2837 |
See also #postOpenWith:, which is invoked after opening." |
|
2838 |
||
2839 |
"/ add any code here ... |
|
2840 |
||
2841 |
^ super postBuildWith:aBuilder |
|
2842 |
! |
|
2843 |
||
2844 |
postOpenWith:aBuilder |
|
2845 |
"This is a hook method generated by the Browser. |
|
2846 |
It will be invoked right after the applications window has been opened. |
|
2847 |
Add any app-specific actions here (starting background processes etc.). |
|
2848 |
See also #postBuildWith:, which is invoked before opening." |
|
2849 |
||
2850 |
"/ add any code here ... |
|
2851 |
||
2852 |
self masterApplication isNil ifTrue:[ |
|
2853 |
self masterApplication:nil. |
|
2854 |
]. |
|
2855 |
^ super postOpenWith:aBuilder |
|
2856 |
! |
|
2857 |
||
2858 |
release |
|
2859 |
||
2860 |
self doStopProcess. |
|
2861 |
^ super release |
|
2862 |
! ! |
|
2863 |
||
2864 |
!FileApplicationNoteBook::CommandResult methodsFor:'printing'! |
|
2865 |
||
2866 |
printString |
|
2867 |
||
2868 |
^ 'CommandResult Application' |
|
2869 |
! ! |
|
2870 |
||
2871 |
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'defaults'! |
|
2872 |
||
2873 |
tabStringFor:aApplicationType |
|
2874 |
||
2875 |
^ 'HTML View for:' |
|
2876 |
! ! |
|
2877 |
||
2878 |
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'interface specs'! |
|
2879 |
||
2880 |
windowSpec |
|
2881 |
"This resource specification was automatically generated |
|
2882 |
by the UIPainter of ST/X." |
|
2883 |
||
2884 |
"Do not manually edit this!! If it is corrupted, |
|
2885 |
the UIPainter may not be able to read the specification." |
|
2886 |
||
2887 |
" |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
2888 |
UIPainter new openOnClass:FileApplicationNoteBook::HtmlViewApplication andSelector:#windowSpec |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
2889 |
FileApplicationNoteBook::HtmlViewApplication new openInterface:#windowSpec |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
2890 |
FileApplicationNoteBook::HtmlViewApplication open |
3892 | 2891 |
" |
2892 |
||
2893 |
<resource: #canvas> |
|
2894 |
||
2895 |
^ |
|
2896 |
#(#FullSpec |
|
2897 |
#name: #windowSpec |
|
2898 |
#window: |
|
2899 |
#(#WindowSpec |
|
2900 |
#label: 'NoteBookApplication::HtmlView' |
|
2901 |
#name: 'NoteBookApplication::HtmlView' |
|
2902 |
#min: #(#Point 10 10) |
|
2903 |
#max: #(#Point 1024 768) |
|
2904 |
#bounds: #(#Rectangle 16 42 692 534) |
|
2905 |
#menu: #mainMenu |
|
2906 |
) |
|
2907 |
#component: |
|
2908 |
#(#SpecCollection |
|
2909 |
#collection: #( |
|
2910 |
#(#MenuPanelSpec |
|
2911 |
#name: 'MenuHtml' |
|
2912 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
2913 |
#level: 0 |
3892 | 2914 |
#visibilityChannel: #isEmbeddedApplication |
2915 |
#menu: #menu |
|
2916 |
#textDefault: true |
|
2917 |
) |
|
2918 |
#(#ArbitraryComponentSpec |
|
2919 |
#name: 'HTMLView' |
|
2920 |
#layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1) |
|
2921 |
#hasHorizontalScrollBar: true |
|
2922 |
#hasVerticalScrollBar: true |
|
2923 |
#miniScrollerHorizontal: false |
|
2924 |
#miniScrollerVertical: false |
|
2925 |
#hasBorder: false |
|
2926 |
#component: #HTMLDocumentView |
|
2927 |
#postBuildCallback: #postBuildHtmlView: |
|
2928 |
) |
|
2929 |
#(#LabelSpec |
|
2930 |
#label: 'FileLabel' |
|
2931 |
#name: 'FileLabel' |
|
2932 |
#layout: #(#LayoutFrame 212 0 2 0 -73 1 30 0) |
|
2933 |
#level: -1 |
|
2934 |
#translateLabel: true |
|
2935 |
#labelChannel: #labelHolder |
|
2936 |
#adjust: #left |
|
2937 |
) |
|
2938 |
) |
|
2939 |
||
2940 |
) |
|
2941 |
) |
|
2942 |
! ! |
|
2943 |
||
2944 |
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'menu specs'! |
|
2945 |
||
2946 |
menu |
|
2947 |
"This resource specification was automatically generated |
|
2948 |
by the MenuEditor of ST/X." |
|
2949 |
||
2950 |
"Do not manually edit this!! If it is corrupted, |
|
2951 |
the MenuEditor may not be able to read the specification." |
|
2952 |
||
2953 |
" |
|
2954 |
MenuEditor new openOnClass:FileApplicationNoteBook::HtmlViewApplication andSelector:#menu |
|
2955 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::HtmlViewApplication menu)) startUp |
|
2956 |
" |
|
2957 |
||
2958 |
<resource: #menu> |
|
2959 |
||
2960 |
^ |
|
2961 |
#(#Menu |
|
2962 |
#( |
|
2963 |
#(#MenuItem |
|
2964 |
#label: 'Reload' |
|
2965 |
#translateLabel: true |
|
2966 |
#isButton: true |
|
2967 |
#value: #doReload |
|
4508 | 2968 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #htmlReloadIcon) |
3892 | 2969 |
) |
2970 |
#(#MenuItem |
|
2971 |
#label: 'Back' |
|
2972 |
#translateLabel: true |
|
2973 |
#isButton: true |
|
2974 |
#value: #doGoBack |
|
2975 |
#labelImage: #(#ResourceRetriever #Icon #leftIcon) |
|
2976 |
) |
|
2977 |
#(#MenuItem |
|
2978 |
#label: 'Print' |
|
2979 |
#translateLabel: true |
|
2980 |
#isButton: true |
|
2981 |
#value: #doPrint |
|
2982 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #printer22x22Icon) |
|
2983 |
) |
|
2984 |
#(#MenuItem |
|
2985 |
#label: 'Close' |
|
2986 |
#translateLabel: true |
|
2987 |
#isButton: true |
|
2988 |
#hideMenuOnActivated: false |
|
2989 |
#startGroup: #right |
|
2990 |
#value: #doClose |
|
2991 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #closeIcon) |
|
2992 |
) |
|
2993 |
) |
|
2994 |
nil |
|
2995 |
nil |
|
2996 |
) |
|
2997 |
! ! |
|
2998 |
||
2999 |
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'queries'! |
|
3000 |
||
3001 |
canOpenItem:aItem |
|
3002 |
||
3003 |
^ (aItem hasMimeType and:[aItem mimeType isHtml]) |
|
3004 |
! |
|
3005 |
||
3006 |
wantNewApplicationAnyway |
|
3007 |
||
3008 |
^ false |
|
3009 |
! ! |
|
3010 |
||
3011 |
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'accessing'! |
|
3012 |
||
3013 |
htmlView |
|
3014 |
"return the value of the instance variable 'imageView' (automatically generated)" |
|
3015 |
||
3016 |
^ htmlView |
|
3017 |
! |
|
3018 |
||
3019 |
htmlView:something |
|
3020 |
"set the value of the instance variable 'imageView' (automatically generated)" |
|
3021 |
||
3022 |
htmlView := something. |
|
3023 |
! |
|
3024 |
||
3025 |
item:aItem |
|
3026 |
||
3027 |
|retVal| |
|
3028 |
||
3029 |
self labelHolder value:aItem fileName asString. |
|
3030 |
retVal := super item:aItem. |
|
3031 |
self setupHtmlView. |
|
3032 |
^ retVal |
|
3033 |
! ! |
|
3034 |
||
3035 |
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'actions'! |
|
3036 |
||
3037 |
doGoBack |
|
3038 |
||
3039 |
self htmlView menu_back. |
|
3040 |
! |
|
3041 |
||
3042 |
doGoHome |
|
3043 |
||
3044 |
self htmlView menu_home. |
|
3045 |
! |
|
3046 |
||
3047 |
doHelp |
|
3048 |
||
3049 |
self htmlView menu_help. |
|
3050 |
! |
|
3051 |
||
3052 |
doPrint |
|
3053 |
||
3054 |
self htmlView menu_print. |
|
3055 |
! |
|
3056 |
||
3057 |
doReload |
|
3058 |
||
3059 |
self htmlView menu_reload. |
|
3060 |
! |
|
3061 |
||
3062 |
setupHtmlView |
|
3063 |
||
3064 |
| html file directory| |
|
3065 |
||
3066 |
html := self htmlView. |
|
3067 |
html isNil ifTrue:[^ self]. |
|
3068 |
file := self fileName. |
|
3069 |
directory := file directoryName. |
|
3070 |
html homeDocument:(file asString). |
|
3071 |
html setTopDirectoryName:directory. |
|
3072 |
html uriHolder:self labelHolder. |
|
3073 |
html infoHolder:self notifyChannel. |
|
3074 |
html linkButtonPanel:nil. |
|
3075 |
^ html |
|
3076 |
! ! |
|
3077 |
||
3078 |
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'aspects'! |
|
3079 |
||
3080 |
labelHolder |
|
3081 |
||
3082 |
labelHolder isNil ifTrue:[ |
|
3083 |
labelHolder := '' asValue. |
|
3084 |
]. |
|
3085 |
^ labelHolder. |
|
3086 |
! ! |
|
3087 |
||
3088 |
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'initialization & release'! |
|
3089 |
||
3090 |
postBuildHtmlView:aWidget |
|
3091 |
||
3092 |
self htmlView: aWidget scrolledView. |
|
3093 |
self htmlView wantsFocusWithPointerEnter. |
|
3094 |
! |
|
3095 |
||
3096 |
postOpenWith:aBuilder |
|
3097 |
" |
|
3098 |
only invoked if the application not started from a master |
|
3099 |
" |
|
3100 |
||
3101 |
|currentDir contents suffix fileName| |
|
3102 |
||
3103 |
self masterApplication isNil ifTrue:[ |
|
3104 |
self masterApplication:nil. |
|
3105 |
currentDir := Filename homeDirectory. |
|
3106 |
||
3107 |
contents := currentDir directoryContents. |
|
3108 |
fileName := contents |
|
3109 |
detect:[:file | |
|
3110 |
suffix := file asFilename suffix asLowercase. |
|
3111 |
suffix = 'html' |
|
3112 |
] |
|
3113 |
ifNone:[nil]. |
|
3114 |
fileName isNil ifTrue:[ |
|
3115 |
Dialog warn:'cant find a HTML file in ' , currentDir asString. |
|
3116 |
^ self |
|
3117 |
]. |
|
4626 | 3118 |
self item:(DirectoryContentsBrowser itemClass fileName:('..', |
3119 |
Filename separator , |
|
3120 |
'..' , |
|
3121 |
Filename separator , |
|
3122 |
'doc', |
|
3123 |
Filename separator , |
|
3124 |
'online', |
|
3125 |
Filename separator , |
|
3126 |
'english', |
|
3127 |
Filename separator , |
|
3128 |
'TOP.html') asFilename asAbsoluteFilename). |
|
3892 | 3129 |
]. |
3130 |
self setupHtmlView. |
|
3131 |
^ super postOpenWith:aBuilder |
|
3132 |
! ! |
|
3133 |
||
3134 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'defaults'! |
|
3135 |
||
3136 |
tabStringFor:aApplicationType |
|
3137 |
||
3138 |
^ 'Image for:' |
|
3139 |
! ! |
|
3140 |
||
3141 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'image specs'! |
|
3142 |
||
3143 |
fitSize20x20Icon |
|
3144 |
"This resource specification was automatically generated |
|
3145 |
by the ImageEditor of ST/X." |
|
3146 |
||
3147 |
"Do not manually edit this!! If it is corrupted, |
|
3148 |
the ImageEditor may not be able to read the specification." |
|
3149 |
||
3150 |
" |
|
3151 |
self fitSize20x20Icon inspect |
|
3152 |
ImageEditor openOnClass:self andSelector:#fitSize20x20Icon |
|
3153 |
" |
|
3154 |
||
3155 |
<resource: #image> |
|
3156 |
||
3157 |
^Icon |
|
3158 |
constantNamed:#'FileApplicationNoteBook::ImageViewApplication class fitSize20x20Icon' |
|
3159 |
ifAbsentPut:[(Depth4Image new) width: 20; height: 20; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
3160 |
@@DQDQDQDQDP@@@PDQDQDQDQ@P@A@ADQDQDQDP@PD@@PDQDQDPD@@QDQ@ADQDQ@@DQDQD@@@@@@@@@DQDQDPQDQDQ@DQDQDQDDQUUTPADQDQDQAEUUUT@QDQ |
|
3161 |
DQDPQEUUQ@DQDQDQDDQFQDPADQDQDQADQ$QD@QDQDQDPL3X3Q@DQDQDQDCL3L3LADQDQD@@@@@@@@@DQDQD@DQDQDP@QDQ@@DADQDQDA@@DA@ADQDQDQDP@P |
|
3162 |
@@@QDQDQDQDA@@@ADQDQDQDQD@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
3163 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
3164 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 0 0 137 0 174 218 230 0 206 0 133 60 36]; mask:((Depth1Image new) width: 20; height: 20; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
3165 |
8@A00@@0(@APE@J@C@L@G?>@A?8@A?8@A?8@A?8@A?8@A?8@A?8@A?8@G?>@C@L@E@J@(@AP0@@08@A0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
3166 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
3167 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
3168 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
3169 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself] |
|
3170 |
! ! |
|
3171 |
||
3172 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'interface specs'! |
|
3173 |
||
3174 |
windowSpec |
|
3175 |
"This resource specification was automatically generated |
|
3176 |
by the UIPainter of ST/X." |
|
3177 |
||
3178 |
"Do not manually edit this!! If it is corrupted, |
|
3179 |
the UIPainter may not be able to read the specification." |
|
3180 |
||
3181 |
" |
|
3182 |
UIPainter new openOnClass:FileApplicationNoteBook::ImageViewApplication andSelector:#windowSpec |
|
3183 |
FileApplicationNoteBook::ImageViewApplication new openInterface:#windowSpec |
|
3184 |
FileApplicationNoteBook::ImageViewApplication open |
|
3185 |
" |
|
3186 |
||
3187 |
<resource: #canvas> |
|
3188 |
||
3189 |
^ |
|
3190 |
#(#FullSpec |
|
3191 |
#name: #windowSpec |
|
3192 |
#window: |
|
3193 |
#(#WindowSpec |
|
3194 |
#label: 'ImageViewer' |
|
3195 |
#name: 'ImageViewer' |
|
3196 |
#min: #(#Point 10 10) |
|
3197 |
#max: #(#Point 1024 768) |
|
3198 |
#bounds: #(#Rectangle 16 42 692 534) |
|
3199 |
#menu: #mainMenu |
|
3200 |
) |
|
3201 |
#component: |
|
3202 |
#(#SpecCollection |
|
3203 |
#collection: #( |
|
3204 |
#(#MenuPanelSpec |
|
4261 | 3205 |
#name: 'MenuImage' |
3892 | 3206 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
3207 |
#level: 0 |
3892 | 3208 |
#visibilityChannel: #isEmbeddedApplication |
3209 |
#menu: #menu |
|
3210 |
#textDefault: true |
|
3211 |
) |
|
3212 |
#(#ArbitraryComponentSpec |
|
4261 | 3213 |
#name: 'ImageView' |
3892 | 3214 |
#layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0) |
3215 |
#hasHorizontalScrollBar: true |
|
3216 |
#hasVerticalScrollBar: true |
|
3217 |
#miniScrollerHorizontal: false |
|
3218 |
#miniScrollerVertical: false |
|
3219 |
#hasBorder: false |
|
3220 |
#component: #ImageView |
|
3221 |
#postBuildCallback: #postBuildImageView: |
|
3222 |
) |
|
3223 |
) |
|
3224 |
||
3225 |
) |
|
3226 |
) |
|
3227 |
! ! |
|
3228 |
||
3229 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'menu specs'! |
|
3230 |
||
3231 |
menu |
|
3232 |
"This resource specification was automatically generated |
|
3233 |
by the MenuEditor of ST/X." |
|
3234 |
||
3235 |
"Do not manually edit this!! If it is corrupted, |
|
3236 |
the MenuEditor may not be able to read the specification." |
|
3237 |
||
3238 |
" |
|
3239 |
MenuEditor new openOnClass:FileApplicationNoteBook::ImageViewApplication andSelector:#menu |
|
3240 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ImageViewApplication menu)) startUp |
|
3241 |
" |
|
3242 |
||
3243 |
<resource: #menu> |
|
3244 |
||
3245 |
^ |
|
3246 |
#(#Menu |
|
3247 |
#( |
|
3248 |
#(#MenuItem |
|
3249 |
#label: 'Edit' |
|
4353 | 3250 |
#itemValue: #editImage |
3251 |
#nameKey: #EditImage |
|
3892 | 3252 |
#translateLabel: true |
3253 |
#isButton: true |
|
3254 |
) |
|
3255 |
#(#MenuItem |
|
3256 |
#label: '-' |
|
3257 |
) |
|
3258 |
#(#MenuItem |
|
4353 | 3259 |
#activeHelpKey: #fitSize |
3892 | 3260 |
#label: 'FitSize' |
3261 |
#translateLabel: true |
|
3262 |
#isButton: true |
|
3263 |
#triggerOnDown: true |
|
4353 | 3264 |
#indication: #fitSize |
3892 | 3265 |
#labelImage: #(#ResourceRetriever #'FileApplicationNoteBook::ImageViewApplication' #fitSize20x20Icon) |
3266 |
) |
|
3267 |
#(#MenuItem |
|
3268 |
#label: '-' |
|
3269 |
) |
|
3270 |
#(#MenuItem |
|
3271 |
#label: 'Close' |
|
4353 | 3272 |
#itemValue: #doClose |
3892 | 3273 |
#translateLabel: true |
3274 |
#isButton: true |
|
4353 | 3275 |
#startGroup: #right |
3892 | 3276 |
#hideMenuOnActivated: false |
3277 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #closeIcon) |
|
3278 |
) |
|
3279 |
) |
|
3280 |
nil |
|
3281 |
nil |
|
3282 |
) |
|
3283 |
! ! |
|
3284 |
||
3285 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'queries'! |
|
3286 |
||
3287 |
canOpenItem:aItem |
|
3288 |
||
3289 |
^ (aItem hasMimeType and:[aItem mimeType isImage]) |
|
3290 |
! |
|
3291 |
||
3292 |
wantNewApplicationAnyway |
|
3293 |
||
3294 |
^ false |
|
3295 |
! ! |
|
3296 |
||
3297 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'accessing'! |
|
3298 |
||
3299 |
image:something |
|
3300 |
"set the value of the instance variable 'image' (automatically generated)" |
|
3301 |
||
3302 |
image := something. |
|
4417 | 3303 |
self updateImageInfo. |
3892 | 3304 |
! |
3305 |
||
3306 |
imageView |
|
3307 |
"return the value of the instance variable 'imageView' (automatically generated)" |
|
3308 |
||
3309 |
^ imageView |
|
3310 |
! |
|
3311 |
||
3312 |
imageView:something |
|
3313 |
"set the value of the instance variable 'imageView' (automatically generated)" |
|
3314 |
||
3315 |
imageView := something. |
|
4417 | 3316 |
! |
3317 |
||
3318 |
updateImageInfo |
|
3319 |
|fn msg| |
|
3320 |
||
3321 |
image notNil ifTrue:[ |
|
3322 |
fn := image fileName. |
|
3323 |
fn isNil ifTrue:[ |
|
3324 |
fn := 'unnamed' |
|
3325 |
] ifFalse:[ |
|
3326 |
fn := fn asFilename baseName. |
|
3327 |
]. |
|
3328 |
msg := '%1 %2x%3 depth:%4' |
|
3329 |
bindWith:fn allBold |
|
3330 |
with:image width |
|
3331 |
with:image height |
|
3332 |
with:image depth. |
|
3333 |
]. |
|
4523 | 3334 |
self notify:msg. |
3892 | 3335 |
! ! |
3336 |
||
3337 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'actions'! |
|
3338 |
||
3339 |
changeItem:aItem |
|
3340 |
||
3341 |
self item:aItem. |
|
3342 |
self setupImageView. |
|
3343 |
^ true |
|
3344 |
! |
|
3345 |
||
3346 |
editImage |
|
3347 |
|img| |
|
3348 |
||
3349 |
img := self image. |
|
3350 |
img notNil ifTrue:[ |
|
4855 | 3351 |
self withWaitCursorDo:[ |
3352 |
img edit. |
|
3353 |
] |
|
3892 | 3354 |
]. |
3355 |
! |
|
3356 |
||
3357 |
image |
|
3358 |
|img fn e| |
|
3359 |
||
3360 |
fn := self fileName. |
|
3361 |
img := Image fromFile:fn. |
|
3362 |
img isNil ifTrue:[ |
|
3363 |
fn exists ifTrue:[ |
|
3364 |
e := 'Unknown/unsupported image format' |
|
3365 |
] ifFalse:[ |
|
3366 |
e := 'No such image' |
|
3367 |
]. |
|
3368 |
Dialog warn:e. |
|
3369 |
^ nil |
|
3370 |
]. |
|
3371 |
^ img. |
|
3372 |
! |
|
3373 |
||
3374 |
setupImageView |
|
4020 | 3375 |
[ |
4744 | 3376 |
|img| |
3377 |
||
3378 |
imageView withCursor:(Cursor wait) do:[ |
|
3379 |
img := self image. |
|
3380 |
img notNil ifTrue:[ |
|
3381 |
self image:img. |
|
3382 |
imageView image:img |
|
3383 |
]. |
|
4020 | 3384 |
]. |
4174 | 3385 |
] fork. |
3892 | 3386 |
! ! |
3387 |
||
3388 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'aspects'! |
|
3389 |
||
3390 |
fitSize |
|
3391 |
"return/create the 'fitSize' value holder (automatically generated)" |
|
3392 |
||
3393 |
fitSize isNil ifTrue:[ |
|
3394 |
fitSize := ValueHolder new. |
|
3395 |
fitSize addDependent:self. |
|
3396 |
]. |
|
3397 |
^ fitSize |
|
3398 |
! ! |
|
3399 |
||
3400 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'change & update'! |
|
3401 |
||
3402 |
update:something with:aParameter from:changedObject |
|
3403 |
changedObject == self fitSize ifTrue:[ |
|
3404 |
changedObject value ifTrue:[ |
|
3405 |
imageView adjust:#fitBig. |
|
3406 |
] ifFalse:[ |
|
3407 |
imageView adjust:nil. |
|
3408 |
]. |
|
3409 |
^ self |
|
3410 |
]. |
|
3411 |
super update:something with:aParameter from:changedObject |
|
3412 |
! ! |
|
3413 |
||
3414 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'initialization & release'! |
|
3415 |
||
3416 |
postBuildImageView:aWidget |
|
3417 |
||
3418 |
self imageView: aWidget scrolledView. |
|
3419 |
self imageView wantsFocusWithPointerEnter. |
|
3420 |
! |
|
3421 |
||
3422 |
postOpenWith:aBuilder |
|
3423 |
" |
|
3424 |
only invoked if the application not started from a master |
|
3425 |
" |
|
3426 |
||
3427 |
|currentDir contents suffix fileName| |
|
3428 |
||
3429 |
self masterApplication isNil ifTrue:[ |
|
3430 |
self masterApplication:nil. |
|
3431 |
currentDir := Filename currentDirectory. |
|
3432 |
contents := currentDir directoryContents. |
|
3433 |
fileName := contents |
|
3434 |
detect:[:file | |
|
3435 |
suffix := file asFilename suffix asLowercase. |
|
3436 |
Image isImageFileSuffix:suffix |
|
3437 |
] |
|
3438 |
ifNone:[nil]. |
|
3439 |
fileName isNil ifTrue:[ |
|
3440 |
Dialog warn:'cant find a Image in ' , currentDir asString. |
|
3441 |
^ self |
|
3442 |
]. |
|
3982 | 3443 |
self item:(DirectoryContentsBrowser itemClass fileName:(currentDir construct:fileName)) |
3892 | 3444 |
]. |
3445 |
self setupImageView. |
|
3446 |
^ super postOpenWith:aBuilder |
|
3447 |
! ! |
|
3448 |
||
3449 |
!FileApplicationNoteBook::Terminal class methodsFor:'defaults'! |
|
3450 |
||
4758 | 3451 |
defaultLineLimit |
3452 |
"the number of buffered lines" |
|
3453 |
||
4759 | 3454 |
^ DefaultLineLimit ? TextCollector defaultLineLimit |
4758 | 3455 |
! |
3456 |
||
3892 | 3457 |
tabStringFor:aApplicationType |
3458 |
||
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
3459 |
^ 'Terminal' |
3892 | 3460 |
! ! |
3461 |
||
3462 |
!FileApplicationNoteBook::Terminal class methodsFor:'interface specs'! |
|
3463 |
||
3464 |
windowSpec |
|
3465 |
"This resource specification was automatically generated |
|
3466 |
by the UIPainter of ST/X." |
|
3467 |
||
3468 |
"Do not manually edit this!! If it is corrupted, |
|
3469 |
the UIPainter may not be able to read the specification." |
|
3470 |
||
3471 |
" |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
3472 |
UIPainter new openOnClass:FileApplicationNoteBook::Terminal andSelector:#windowSpec |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
3473 |
FileApplicationNoteBook::Terminal new openInterface:#windowSpec |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
3474 |
FileApplicationNoteBook::Terminal open |
3892 | 3475 |
" |
3476 |
||
3477 |
<resource: #canvas> |
|
3478 |
||
3479 |
^ |
|
3480 |
#(#FullSpec |
|
3481 |
#name: #windowSpec |
|
3482 |
#window: |
|
3483 |
#(#WindowSpec |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
3484 |
#label: 'Terminal' |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
3485 |
#name: 'Terminal' |
3892 | 3486 |
#min: #(#Point 10 10) |
3487 |
#max: #(#Point 1024 768) |
|
3488 |
#bounds: #(#Rectangle 16 42 692 534) |
|
3489 |
#menu: #mainMenu |
|
3490 |
) |
|
3491 |
#component: |
|
3492 |
#(#SpecCollection |
|
3493 |
#collection: #( |
|
3494 |
#(#MenuPanelSpec |
|
3495 |
#name: 'MenuTerminal' |
|
3496 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
3497 |
#level: 0 |
3892 | 3498 |
#menu: #menu |
3499 |
#textDefault: true |
|
3500 |
) |
|
3501 |
#(#ArbitraryComponentSpec |
|
3502 |
#name: 'TerminalView' |
|
3503 |
#layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0) |
|
3504 |
#hasHorizontalScrollBar: true |
|
3505 |
#hasVerticalScrollBar: true |
|
3506 |
#miniScrollerHorizontal: false |
|
3507 |
#miniScrollerVertical: false |
|
3508 |
#hasBorder: false |
|
3509 |
#component: #terminalView |
|
3510 |
) |
|
3511 |
) |
|
3512 |
||
3513 |
) |
|
3514 |
) |
|
3515 |
! ! |
|
3516 |
||
3517 |
!FileApplicationNoteBook::Terminal class methodsFor:'menu specs'! |
|
3518 |
||
3519 |
menu |
|
3520 |
"This resource specification was automatically generated |
|
3521 |
by the MenuEditor of ST/X." |
|
3522 |
||
3523 |
"Do not manually edit this!! If it is corrupted, |
|
3524 |
the MenuEditor may not be able to read the specification." |
|
3525 |
||
3526 |
" |
|
3527 |
MenuEditor new openOnClass:FileApplicationNoteBook::Terminal andSelector:#menu |
|
3528 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::Terminal menu)) startUp |
|
3529 |
" |
|
3530 |
||
3531 |
<resource: #menu> |
|
3532 |
||
3533 |
^ |
|
3534 |
#(#Menu |
|
3535 |
#( |
|
3536 |
#(#MenuItem |
|
3537 |
#label: 'Save' |
|
3538 |
#translateLabel: true |
|
3539 |
#isButton: true |
|
3540 |
#nameKey: #Save |
|
3541 |
#value: #saveAs |
|
3542 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #saveToFile28x22Icon) |
|
3543 |
) |
|
3544 |
#(#MenuItem |
|
3545 |
#label: 'Close' |
|
3546 |
#translateLabel: true |
|
3547 |
#isButton: true |
|
3548 |
#hideMenuOnActivated: false |
|
3549 |
#isVisible: #isEmbeddedApplication |
|
3550 |
#startGroup: #right |
|
3551 |
#value: #doClose |
|
3552 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #closeIcon) |
|
3553 |
) |
|
3554 |
) |
|
3555 |
nil |
|
3556 |
nil |
|
3557 |
) |
|
3558 |
! ! |
|
3559 |
||
3560 |
!FileApplicationNoteBook::Terminal methodsFor:'accessing'! |
|
3561 |
||
3562 |
terminalView |
|
3563 |
||
3564 |
terminalView isNil ifTrue:[ |
|
3565 |
terminalView := VT100TerminalView new. |
|
4758 | 3566 |
terminalView lineLimit:(self class defaultLineLimit). |
3892 | 3567 |
]. |
3568 |
^ terminalView. |
|
3569 |
! ! |
|
3570 |
||
3571 |
!FileApplicationNoteBook::Terminal methodsFor:'actions'! |
|
3572 |
||
3573 |
saveAs |
|
3574 |
||
3575 |
self terminalView save. |
|
3576 |
! ! |
|
3577 |
||
3578 |
!FileApplicationNoteBook::Terminal methodsFor:'initialization & release'! |
|
3579 |
||
3580 |
postBuildWith:aBuilder |
|
3581 |
||
3582 |
^ super postBuildWith:aBuilder |
|
3583 |
! |
|
3584 |
||
3585 |
shellFinished |
|
3586 |
| master text string| |
|
3587 |
||
3588 |
master := self masterApplication. |
|
3589 |
master notNil ifTrue:[ |
|
3590 |
string := ' - closed'. |
|
3591 |
master tabStringAdd:string for:self. |
|
3592 |
]. |
|
4523 | 3593 |
self notify:'shell in ' , self fileName asString, ' finished'. |
3892 | 3594 |
terminalView cr. |
4515 | 3595 |
|
4961
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
3596 |
text := '>> shell closed' allBold. |
3892 | 3597 |
text colorizeAllWith:Color red. |
3598 |
terminalView nextPutAll:text. |
|
3599 |
! |
|
3600 |
||
3601 |
startShell |
|
3602 |
|vt100| |
|
3603 |
||
3604 |
vt100 := self terminalView. |
|
3605 |
vt100 shellTerminateAction:[ self shellFinished ]. |
|
3606 |
vt100 startShellIn:(self fileName). |
|
3607 |
! ! |
|
3608 |
||
3609 |
!FileApplicationNoteBook::Terminal methodsFor:'printing'! |
|
3610 |
||
3611 |
printString |
|
3612 |
||
3613 |
^ ('Terminal on:', self fileName baseName) |
|
3614 |
! ! |
|
3615 |
||
3616 |
!FileApplicationNoteBook::Terminal methodsFor:'queries'! |
|
3617 |
||
3618 |
getTabStringEnd |
|
3619 |
||
3620 |
" get the tab string from the application list on the class side " |
|
3621 |
||
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
3622 |
^ '' |
3892 | 3623 |
! ! |
3624 |
||
3625 |
!FileApplicationNoteBook::Terminal methodsFor:'startup & release'! |
|
3626 |
||
3627 |
postOpenWith:aBuilder |
|
3628 |
||
3629 |
" |
|
3630 |
only invoked if the application not started from a master |
|
3631 |
" |
|
3632 |
self masterApplication isNil ifTrue:[ |
|
3633 |
self masterApplication:nil. |
|
3982 | 3634 |
self item:(DirectoryContentsBrowser itemClass fileName:(Filename currentDirectory asAbsoluteFilename)). |
3892 | 3635 |
]. |
3636 |
self startShell. |
|
3637 |
^ super postOpenWith:aBuilder. |
|
3638 |
! ! |
|
3639 |
||
3640 |
!FileApplicationNoteBook::TextEditor class methodsFor:'defaults'! |
|
3641 |
||
3642 |
tabStringFor:aApplicationType |
|
3643 |
||
3644 |
aApplicationType == #directoryDescription ifTrue:[ |
|
3645 |
^ 'Directory description for:' |
|
3646 |
] ifFalse:[ |
|
3647 |
^ 'Editor on:' |
|
3648 |
]. |
|
3649 |
! |
|
3650 |
||
3651 |
wantNewApplicationAnyway |
|
3652 |
||
3653 |
^ false |
|
3654 |
! ! |
|
3655 |
||
4913 | 3656 |
!FileApplicationNoteBook::TextEditor class methodsFor:'interface-specs'! |
3892 | 3657 |
|
3658 |
windowSpec |
|
3659 |
"This resource specification was automatically generated |
|
3660 |
by the UIPainter of ST/X." |
|
3661 |
||
3662 |
"Do not manually edit this!! If it is corrupted, |
|
3663 |
the UIPainter may not be able to read the specification." |
|
3664 |
||
3665 |
" |
|
3950 | 3666 |
UIPainter new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#windowSpec |
3667 |
FileApplicationNoteBook::TextEditor new openInterface:#windowSpec |
|
3668 |
FileApplicationNoteBook::TextEditor open |
|
3892 | 3669 |
" |
3670 |
||
3671 |
<resource: #canvas> |
|
3672 |
||
3673 |
^ |
|
3674 |
#(#FullSpec |
|
3675 |
#name: #windowSpec |
|
3676 |
#window: |
|
3677 |
#(#WindowSpec |
|
3678 |
#label: 'TextEditor' |
|
3679 |
#name: 'TextEditor' |
|
3680 |
#min: #(#Point 10 10) |
|
3681 |
#max: #(#Point 1024 768) |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3682 |
#bounds: #(#Rectangle 16 42 666 342) |
3892 | 3683 |
) |
3684 |
#component: |
|
3685 |
#(#SpecCollection |
|
3686 |
#collection: #( |
|
3687 |
#(#MenuPanelSpec |
|
3688 |
#name: 'MenuTextEditor' |
|
3689 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
3690 |
#level: 0 |
3892 | 3691 |
#menu: #menu |
3692 |
#textDefault: true |
|
3693 |
) |
|
3694 |
#(#TextEditorSpec |
|
3695 |
#name: 'TextEditor' |
|
3696 |
#layout: #(#LayoutFrame 0 0.0 32 0 0 1.0 0 1.0) |
|
3697 |
#model: #fileContentsModel |
|
3698 |
#hasHorizontalScrollBar: true |
|
3699 |
#hasVerticalScrollBar: true |
|
4071 | 3700 |
#modifiedChannel: #viewModifiedChannel |
3892 | 3701 |
#acceptCallBack: #accept |
3950 | 3702 |
#allowDoIt: true |
3892 | 3703 |
#postBuildCallback: #postBuildTextEditor: |
3704 |
) |
|
3705 |
) |
|
3706 |
||
3707 |
) |
|
3708 |
) |
|
3709 |
! ! |
|
3710 |
||
3711 |
!FileApplicationNoteBook::TextEditor class methodsFor:'menu specs'! |
|
3712 |
||
3713 |
menu |
|
3714 |
"This resource specification was automatically generated |
|
3715 |
by the MenuEditor of ST/X." |
|
3716 |
||
3717 |
"Do not manually edit this!! If it is corrupted, |
|
3718 |
the MenuEditor may not be able to read the specification." |
|
3719 |
||
3720 |
" |
|
3721 |
MenuEditor new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#menu |
|
3722 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::TextEditor menu)) startUp |
|
3723 |
" |
|
3724 |
||
3725 |
<resource: #menu> |
|
3726 |
||
3727 |
^ |
|
3728 |
#(#Menu |
|
3729 |
#( |
|
3730 |
#(#MenuItem |
|
3731 |
#label: 'Save' |
|
3732 |
#translateLabel: true |
|
3733 |
#isButton: true |
|
3734 |
#nameKey: #Save |
|
3735 |
#value: #accept |
|
3736 |
#enabled: #enableSave |
|
3737 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #saveToFile28x22Icon) |
|
3738 |
) |
|
3739 |
#(#MenuItem |
|
3740 |
#label: 'Reload' |
|
3741 |
#translateLabel: true |
|
3742 |
#isButton: true |
|
3743 |
#nameKey: #Reload |
|
3744 |
#value: #reload |
|
3745 |
#enabled: #enableReload |
|
3746 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #reloadFromFile28x22Icon) |
|
3747 |
) |
|
3748 |
#(#MenuItem |
|
3749 |
#label: '' |
|
3750 |
) |
|
3751 |
#(#MenuItem |
|
3752 |
#label: 'Print' |
|
3753 |
#translateLabel: true |
|
3754 |
#isButton: true |
|
3755 |
#nameKey: #Print |
|
3756 |
#value: #doPrint |
|
3757 |
#enabled: #enableHexToggle |
|
3758 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #printer22x22Icon) |
|
3759 |
) |
|
3760 |
#(#MenuItem |
|
3761 |
#label: '' |
|
3762 |
) |
|
3763 |
#(#MenuItem |
|
3764 |
#label: 'Hex' |
|
3765 |
#translateLabel: true |
|
3766 |
#isButton: true |
|
3767 |
#enabled: #enableHexToggle |
|
3768 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #hexToggle22x22Icon) |
|
3769 |
#indication: #printAsHexDump |
|
3770 |
) |
|
3771 |
#(#MenuItem |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3772 |
#label: '' |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3773 |
) |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3774 |
#(#MenuItem |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3775 |
#label: 'Diff to Current' |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3776 |
#translateLabel: true |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3777 |
#isButton: true |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3778 |
#value: #openDiffView |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3779 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #diffIcon) |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3780 |
) |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3781 |
#(#MenuItem |
3892 | 3782 |
#label: 'Close' |
3783 |
#translateLabel: true |
|
3784 |
#isButton: true |
|
3785 |
#hideMenuOnActivated: false |
|
3786 |
#isVisible: #isEmbeddedApplication |
|
3787 |
#startGroup: #right |
|
3788 |
#value: #doClose |
|
3789 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #closeIcon) |
|
3790 |
) |
|
3791 |
) |
|
3792 |
nil |
|
3793 |
nil |
|
3794 |
) |
|
3795 |
! ! |
|
3796 |
||
3797 |
!FileApplicationNoteBook::TextEditor methodsFor:'accessing'! |
|
3798 |
||
3799 |
item:aDirContentsItem |
|
3800 |
||
4977
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
3801 |
self releaseCheckModify. |
4620 | 3802 |
(self item = aDirContentsItem and:[(self presentation == #hexDump) == self printAsHexDump value]) ifTrue:[^ true]. |
3892 | 3803 |
super item:aDirContentsItem. |
4698 | 3804 |
self printAsHexDump value:(self presentation == #hexDump) withoutNotifying:self. |
3892 | 3805 |
(self askForChange) isNil ifTrue:[ ^ false]. |
4201 | 3806 |
self setContents ifFalse:[ ^ false]. |
4969 | 3807 |
checkModifiedBlock isNil ifTrue:[ |
3808 |
checkModifiedBlock := [ |
|
3809 |
self enqueueMessage:#checkItemForChanges |
|
3810 |
for:self |
|
3811 |
arguments:nil. |
|
3812 |
]. |
|
3813 |
]. |
|
4977
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
3814 |
textEditorModificationTime := self fileName modificationTime. |
4969 | 3815 |
self setupCheckModify. |
3892 | 3816 |
^ true |
3817 |
! |
|
3818 |
||
3819 |
presentation |
|
3820 |
"return the value of the instance variable 'presentation' (automatically generated)" |
|
3821 |
||
3822 |
presentation isNil ifTrue:[ |
|
3823 |
presentation := #asText. |
|
3824 |
]. |
|
3825 |
^ presentation |
|
3826 |
! |
|
3827 |
||
3828 |
presentation:something |
|
3829 |
"set the value of the instance variable 'presentation' (automatically generated)" |
|
3830 |
||
3831 |
presentation := something. |
|
3832 |
! |
|
3833 |
||
3834 |
semaChangeItem |
|
3835 |
||
3836 |
semaChangeItem isNil ifTrue:[ |
|
3837 |
semaChangeItem := Semaphore forMutualExclusion. |
|
3838 |
]. |
|
3839 |
^ semaChangeItem |
|
3840 |
! ! |
|
3841 |
||
3842 |
!FileApplicationNoteBook::TextEditor methodsFor:'actions'! |
|
3843 |
||
3844 |
accept |
|
3845 |
||
4969 | 3846 |
| dir master| |
3847 |
||
3848 |
master := self masterApplication. |
|
3849 |
(master notNil and:[master class openAnotherApplicationOnSameItem]) ifTrue:[ |
|
3892 | 3850 |
self updateSameFiles ifFalse:[ ^ self ]. |
3851 |
]. |
|
4528 | 3852 |
|
3892 | 3853 |
dir := self fileName directory. |
3854 |
dir exists not ifTrue:[ |
|
3855 |
dir recursiveMakeDirectory. |
|
3856 |
]. |
|
3857 |
editView saveAs:(self fileName). |
|
4969 | 3858 |
textEditorModificationTime := self fileName modificationTime. |
4529 | 3859 |
|
4953 | 3860 |
self hasMD5 ifTrue:[ |
3861 |
md5CheckSum := self getHashForContents:self fileContentsModel value. |
|
3862 |
]. |
|
3863 |
self enableReload value:false. |
|
3864 |
self itemChanged value:false. |
|
4969 | 3865 |
self itemRemoved value:false. |
4953 | 3866 |
self modifiedChannel value:false. |
4529 | 3867 |
self notify:self fileName asString, ' saved'. |
3892 | 3868 |
! |
3869 |
||
3870 |
askForChange |
|
3871 |
"ask for save changes |
|
3872 |
" |
|
3873 |
||
4553 | 3874 |
|answer string arg| |
3892 | 3875 |
|
3876 |
answer := false. |
|
3877 |
self modifiedChannel value ifTrue:[ |
|
3878 |
self itemChanged value ifTrue:[ |
|
4553 | 3879 |
arg := self fileName baseName allBold. |
4969 | 3880 |
string := '%1 was changed by someone else.\Save your changes (overwrite someones changes) ?' |
3892 | 3881 |
]. |
3882 |
self itemRemoved value ifTrue:[ |
|
4553 | 3883 |
arg := self fileName baseName allBold. |
4969 | 3884 |
string := '%1 was removed by someone else.\Save your changes anyway (recreate the removed file) ?' |
3892 | 3885 |
]. |
4177 | 3886 |
string isNil ifTrue:[ |
4553 | 3887 |
arg := self fileName baseName allBold. |
3888 |
string := 'Save changed file %1 ?'. |
|
3889 |
]. |
|
3892 | 3890 |
]. |
3891 |
string notNil ifTrue:[ |
|
4553 | 3892 |
answer := (Dialog confirmWithCancel:(resources string:string with:arg) withCRs). |
4953 | 3893 |
answer isNil ifTrue:[^ nil]. |
4553 | 3894 |
answer ifTrue:[ |
3892 | 3895 |
self accept |
3896 |
] ifFalse:[ |
|
3897 |
self setContents. |
|
3898 |
] |
|
3899 |
]. |
|
3900 |
^ answer |
|
3901 |
! |
|
3902 |
||
3903 |
changeInformation |
|
3904 |
||
4621 | 3905 |
| stream win| |
3892 | 3906 |
|
3907 |
stream := WriteStream with:(self getTabString). |
|
3908 |
masterApplication isNil ifTrue:[ |
|
4621 | 3909 |
win := self window. |
3910 |
win notNil ifTrue:[ |
|
3911 |
self window label:stream contents. |
|
3912 |
]. |
|
3892 | 3913 |
] ifFalse:[ |
3914 |
masterApplication tabStringChangeTo:stream contents for:self. |
|
3915 |
]. |
|
3916 |
stream close. |
|
3917 |
! |
|
3918 |
||
4161 | 3919 |
changeInformationForModified:aSymbol |
4045 | 3920 |
|
3921 |
||
3922 |
masterApplication isNil ifTrue:[ ^ self]. |
|
4161 | 3923 |
masterApplication changeModified:aSymbol for:self. |
4045 | 3924 |
! |
3925 |
||
3892 | 3926 |
doClose |
3927 |
||
3928 |
(self askForChange) isNil ifTrue:[ ^ false]. |
|
3929 |
self masterApplication notNil ifTrue:[ |
|
3954 | 3930 |
^ super doClose |
3892 | 3931 |
]. |
3932 |
^ true |
|
3933 |
! |
|
3934 |
||
3935 |
doPrint |
|
3936 |
"print the contents |
|
3937 |
" |
|
4473 | 3938 |
(Dialog confirm:'Print contents of editView ?') ifTrue:[ |
3892 | 3939 |
editView doPrint. |
3940 |
]. |
|
3941 |
! |
|
3942 |
||
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3943 |
getContents |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3944 |
|
4620 | 3945 |
|file contents present| |
3892 | 3946 |
|
3947 |
file := self fileName. |
|
3948 |
RecursionInterruptSignal handle:[ : ex | |
|
3949 |
Dialog warn:file asString, ' is too big to be loaded !!'. |
|
4201 | 3950 |
^ nil. |
3892 | 3951 |
] do:[ |
3952 |
present := self presentation. |
|
3953 |
present == #asText ifTrue:[ |
|
3954 |
contents := file contents. |
|
3955 |
] ifFalse:[ |
|
3956 |
present == #hexDump ifTrue:[ |
|
4677 | 3957 |
self withWaitCursorDo:[ |
3958 |
contents := AbstractFileBrowser contentsOfFileAsHexDump:file. |
|
3959 |
] |
|
3892 | 3960 |
] |
3961 |
] |
|
3962 |
]. |
|
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3963 |
^ contents. |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3964 |
! |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3965 |
|
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3966 |
getHashForContents:contents |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3967 |
| hashStream| |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3968 |
|
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3969 |
self hasMD5 ifFalse:[^ nil]. |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3970 |
|
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3971 |
hashStream := MD5Stream new. |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3972 |
contents isStringCollection ifTrue:[ |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3973 |
contents do:[:eachLine | |
4616 | 3974 |
eachLine notNil ifTrue:[ |
3975 |
hashStream nextPutAll:(eachLine string withTabs). |
|
3976 |
]. |
|
3977 |
hashStream nextPut:Character cr. |
|
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3978 |
]. |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3979 |
] ifFalse:[ |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3980 |
hashStream nextPutAll:(contents string). |
4071 | 3981 |
]. |
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
3982 |
^ hashStream hashValue. |
4071 | 3983 |
! |
3984 |
||
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3985 |
openDiffView |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3986 |
|
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3987 |
|diffView text1 l1 text2 l2| |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3988 |
|
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3989 |
text1 := editView contents asText. |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3990 |
l1 := 'changed version'. |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3991 |
text2 := self getContents. |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3992 |
l2 := 'current version'. |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3993 |
diffView := DiffTextView openOn:text1 label:l1 and:text2 label:l2. |
4060 | 3994 |
diffView topView label:'file differences of ', self fileName asString. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3995 |
! |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3996 |
|
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3997 |
reload |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
3998 |
|
4969 | 3999 |
textEditorModificationTime := self fileName modificationTime. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4000 |
self setContents. |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4001 |
! |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4002 |
|
4146
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4003 |
searchForPattern:aContentsPattern ignoreCase:ign |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4004 |
|
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4005 |
| pattern | |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4006 |
|
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4007 |
pattern := aContentsPattern string withoutSeparators. "/ is that a good idea ? |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4008 |
pattern notEmpty ifTrue:[ |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4009 |
editView rememberSearchPattern:pattern. |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4010 |
editView searchFwd:pattern ignoreCase:ign. |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4011 |
] |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4012 |
! |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4013 |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4014 |
setContents |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4015 |
| text| |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4016 |
|
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4017 |
text := self getContents. |
4201 | 4018 |
text isNil ifTrue:[ ^ false]. |
4953 | 4019 |
self setContentsFor:text. |
4020 |
^ true |
|
4021 |
! |
|
4022 |
||
4023 |
setContentsFor:aText |
|
4024 |
||
4969 | 4025 |
self itemChanged value:false. |
4953 | 4026 |
self fileContentsModel value:aText. |
4071 | 4027 |
self hasMD5 ifTrue:[ |
4953 | 4028 |
md5CheckSum := self getHashForContents:aText. |
4071 | 4029 |
]. |
3892 | 4030 |
self enableReload value:false. |
4031 |
self itemChanged value:false. |
|
4045 | 4032 |
self modifiedChannel value:false. |
3892 | 4033 |
^ true |
4034 |
! |
|
4035 |
||
4036 |
updateSameFiles |
|
4037 |
||
4038 |
| master modifiedApplications stream filename action| |
|
4039 |
||
4040 |
master := self masterApplication. |
|
4041 |
master notNil ifTrue:[ |
|
4042 |
modifiedApplications := master getSameFilesModifiedFor:self. |
|
4043 |
(modifiedApplications isNil or:[modifiedApplications isEmpty]) ifTrue:[^ true ]. |
|
4044 |
filename := self fileName asString. |
|
4045 |
stream := WriteStream on:''. |
|
4046 |
stream nextPutAll:filename. |
|
4047 |
stream nextPutAll:' is modified in tab'. |
|
4048 |
modifiedApplications size > 1 ifTrue:[ |
|
4049 |
stream nextPutAll:'s'. |
|
4050 |
]. |
|
4051 |
stream cr. |
|
4052 |
modifiedApplications do:[ : el | |
|
4053 |
stream space. |
|
4054 |
stream nextPutAll:filename. |
|
4055 |
stream space. |
|
4056 |
el sameFileIndex notNil ifTrue:[ |
|
4057 |
stream nextPutAll:el sameFileIndex asString. |
|
4058 |
]. |
|
4059 |
stream cr. |
|
4060 |
]. |
|
4061 |
stream nextPutAll:'forget changes on other tab'. |
|
4062 |
modifiedApplications size > 1 ifTrue:[ |
|
4063 |
stream nextPutAll:'s'. |
|
4064 |
]. |
|
4065 |
stream nextPutAll:' ?'. |
|
4066 |
action := Dialog |
|
4067 |
choose:stream contents |
|
4068 |
labels:#('cancel' 'no' 'yes') |
|
4069 |
values:#(#cancel #no #yes) |
|
4070 |
default:#cancel. |
|
4071 |
||
4072 |
stream close. |
|
4073 |
action == #cancel ifTrue:[ ^ false ]. |
|
4074 |
action == #yes ifTrue:[ |
|
4075 |
"/ here force reload for other applications |
|
4076 |
modifiedApplications do:[ : el | |
|
4077 |
el reload. |
|
4078 |
] |
|
4079 |
]. |
|
4080 |
]. |
|
4081 |
^ true. |
|
4082 |
! ! |
|
4083 |
||
4084 |
!FileApplicationNoteBook::TextEditor methodsFor:'aspects'! |
|
4085 |
||
4086 |
enableHexToggle |
|
4087 |
||
4088 |
enableHexToggle isNil ifTrue:[ |
|
4089 |
enableHexToggle := true asValue. |
|
4090 |
]. |
|
4091 |
^ enableHexToggle |
|
4092 |
! |
|
4093 |
||
4094 |
enableReload |
|
4095 |
||
4096 |
enableReload isNil ifTrue:[ |
|
4097 |
enableReload := false asValue. |
|
4098 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
4099 |
"/ enableReload addDependent:self. |
|
4100 |
"/ enableReload onChangeSend:#enableReloadChanged to:self. |
|
4101 |
]. |
|
4102 |
^ enableReload. |
|
4103 |
! |
|
4104 |
||
4105 |
enableSave |
|
4106 |
||
4107 |
enableSave isNil ifTrue:[ |
|
4108 |
enableSave := false asValue. |
|
4109 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
4110 |
"/ enableSave addDependent:self. |
|
4111 |
"/ enableSave onChangeSend:#enableSaveChanged to:self. |
|
4112 |
]. |
|
4113 |
^ enableSave. |
|
4114 |
! |
|
4115 |
||
4116 |
fileContentsModel |
|
4117 |
||
4118 |
fileContentsModel isNil ifTrue:[ |
|
4119 |
fileContentsModel := ValueHolder new. |
|
4120 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
4121 |
"/ fileContentsModel addDependent:self. |
|
4122 |
"/ fileContentsModel onChangeSend:#fileContentsModelChanged to:self. |
|
4123 |
]. |
|
4124 |
^ fileContentsModel. |
|
4125 |
! |
|
4126 |
||
4127 |
itemChanged |
|
4128 |
||
4129 |
itemChanged isNil ifTrue:[ |
|
4130 |
itemChanged := false asValue. |
|
4131 |
itemChanged addDependent:self. |
|
4132 |
]. |
|
4133 |
^ itemChanged |
|
4134 |
! |
|
4135 |
||
4136 |
itemRemoved |
|
4137 |
||
4138 |
itemRemoved isNil ifTrue:[ |
|
4139 |
itemRemoved := false asValue. |
|
4140 |
itemRemoved addDependent:self. |
|
4141 |
]. |
|
4142 |
^ itemRemoved |
|
4143 |
! |
|
4144 |
||
4145 |
modifiedChannel |
|
4146 |
||
4147 |
modifiedChannel isNil ifTrue:[ |
|
4148 |
modifiedChannel := false asValue. |
|
4149 |
modifiedChannel addDependent:self. |
|
4150 |
]. |
|
4151 |
^ modifiedChannel. |
|
4152 |
! |
|
4153 |
||
4154 |
printAsHexDump |
|
4155 |
||
4156 |
printAsHexDump isNil ifTrue:[ |
|
4157 |
printAsHexDump := false asValue. |
|
4158 |
printAsHexDump addDependent:self. |
|
4159 |
]. |
|
4160 |
^ printAsHexDump. |
|
4071 | 4161 |
! |
4162 |
||
4163 |
viewModifiedChannel |
|
4164 |
||
4165 |
viewModifiedChannel isNil ifTrue:[ |
|
4166 |
viewModifiedChannel := false asValue. |
|
4167 |
viewModifiedChannel addDependent:self. |
|
4168 |
]. |
|
4169 |
^ viewModifiedChannel. |
|
3892 | 4170 |
! ! |
4171 |
||
4172 |
!FileApplicationNoteBook::TextEditor methodsFor:'change & update'! |
|
4173 |
||
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4174 |
changeTextColorForChanged |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4175 |
|
4969 | 4176 |
|text prevCursorBehavior| |
4177 |
||
4178 |
text := editView contents. |
|
4179 |
prevCursorBehavior := editView cursorMovementWhenUpdating. |
|
4180 |
editView cursorMovementWhenUpdating:nil. |
|
4181 |
||
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4182 |
self itemChanged value ifTrue:[ |
4499 | 4183 |
self fileContentsModel |
4969 | 4184 |
value:(text asText emphasizeAllWith:UserPreferences current emphasisForChangedCode). |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4185 |
[editView flash] fork. |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4186 |
] ifFalse:[ |
4969 | 4187 |
self fileContentsModel value:text string. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4188 |
]. |
4969 | 4189 |
editView cursorMovementWhenUpdating:prevCursorBehavior. |
4190 |
"/ self fileContentsModel changed:#value. |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4191 |
! |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4192 |
|
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4193 |
itemModified |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4194 |
|
4161 | 4195 |
| modified outDated removed| |
3892 | 4196 |
|
4197 |
modified := self modifiedChannel value. |
|
4161 | 4198 |
outDated := self itemChanged value. |
3892 | 4199 |
removed := self itemRemoved value. |
4200 |
||
4161 | 4201 |
((modified or:[outDated]) or:[removed]) ifTrue:[ |
4202 |
modified ifTrue:[ |
|
4203 |
self changeInformationForModified:#modified. |
|
4204 |
]. |
|
4205 |
outDated ifTrue:[ |
|
4206 |
self changeInformationForModified:#outDated. |
|
4207 |
]. |
|
4208 |
removed ifTrue:[ |
|
4209 |
self changeInformationForModified:#removed. |
|
4210 |
]. |
|
4211 |
] ifFalse:[ |
|
4212 |
self changeInformationForModified:#unchanged. |
|
4213 |
]. |
|
4214 |
self enableReload value:((modified or:[outDated]) and:[removed not]). |
|
3892 | 4215 |
! |
4216 |
||
4217 |
update:something with:aParameter from:changedObject |
|
4969 | 4218 |
|itemRem contMd5CheckSum viewModified p| |
4071 | 4219 |
|
4220 |
changedObject == self viewModifiedChannel ifTrue:[ |
|
4221 |
viewModified := changedObject value. |
|
4222 |
self hasMD5 ifTrue:[ |
|
4223 |
self viewModifiedChannel value:false withoutNotifying:self. |
|
4224 |
viewModified ifTrue:[ |
|
4969 | 4225 |
(p := md5HashValueComputationProcess) notNil ifTrue:[ |
4226 |
p terminate. |
|
4227 |
]. |
|
4228 |
md5HashValueComputationProcess := |
|
4229 |
[ |
|
4230 |
contMd5CheckSum := self getHashForContents:(editView list). |
|
4231 |
self modifiedChannel value:(contMd5CheckSum ~= md5CheckSum). |
|
4232 |
md5HashValueComputationProcess := nil. |
|
4233 |
] newProcess. |
|
4234 |
md5HashValueComputationProcess priority:(Processor userBackgroundPriority). |
|
4235 |
md5HashValueComputationProcess resume. |
|
4071 | 4236 |
]. |
4969 | 4237 |
] ifFalse:[ |
4238 |
self modifiedChannel value:viewModified. |
|
4239 |
] |
|
4071 | 4240 |
]. |
3892 | 4241 |
changedObject == self modifiedChannel ifTrue:[ |
4969 | 4242 |
self enableSave value:changedObject value. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4243 |
self itemModified. |
3892 | 4244 |
^ self |
4245 |
]. |
|
4246 |
changedObject == self itemRemoved ifTrue:[ |
|
4247 |
itemRem := changedObject value. |
|
4969 | 4248 |
self enableSave value:(itemRem ? false). |
3892 | 4249 |
self enableHexToggle value:itemRem not. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4250 |
self itemModified. |
3892 | 4251 |
^ self |
4252 |
]. |
|
4253 |
changedObject == self itemChanged ifTrue:[ |
|
4969 | 4254 |
self enqueueMessage:#changeTextColorForChanged for:self arguments:nil. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4255 |
self itemModified. |
3892 | 4256 |
^ self |
4257 |
]. |
|
4258 |
changedObject == self printAsHexDump ifTrue:[ |
|
4259 |
(self askForChange) isNil ifTrue:[ |
|
4260 |
self printAsHexDump value:changedObject value not withoutNotifying:self. |
|
4261 |
^ self |
|
4262 |
]. |
|
4263 |
changedObject value ifTrue:[ |
|
4264 |
self presentation:#hexDump. |
|
4265 |
] ifFalse:[ |
|
4266 |
self presentation:#asText. |
|
4267 |
]. |
|
4268 |
self changeInformation. |
|
4269 |
self setContents. |
|
4621 | 4270 |
editView notNil ifTrue:[ |
4271 |
(self presentation == #hexDump) ifTrue:[ |
|
4272 |
editView readOnly:true. |
|
4273 |
] ifFalse:[ |
|
4274 |
editView readOnly:false. |
|
4275 |
]. |
|
3892 | 4276 |
]. |
4621 | 4277 |
^ self |
3892 | 4278 |
]. |
4279 |
||
4280 |
super update:something with:aParameter from:changedObject |
|
4281 |
! ! |
|
4282 |
||
4283 |
!FileApplicationNoteBook::TextEditor methodsFor:'printing'! |
|
4284 |
||
4285 |
printString |
|
4286 |
||
4287 |
^ ('TextEditor for:', self fileName baseName) |
|
4288 |
! ! |
|
4289 |
||
4290 |
!FileApplicationNoteBook::TextEditor methodsFor:'privat-process'! |
|
4291 |
||
4969 | 4292 |
checkItemForChanges |
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
4293 |
|dir exist myItem| |
3892 | 4294 |
|
4295 |
dir := self fileName directory. |
|
4296 |
myItem := self item. |
|
4297 |
exist := myItem exists. |
|
4298 |
self itemRemoved value:(exist not). |
|
4299 |
exist ifTrue:[ |
|
4969 | 4300 |
|time| |
4301 |
||
4302 |
time := self fileName modificationTime. |
|
4303 |
textEditorModificationTime isNil ifTrue:[ |
|
4304 |
textEditorModificationTime := time. |
|
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
4305 |
]. |
4969 | 4306 |
(textEditorModificationTime ~= time) ifTrue:[ |
4307 |
"/ contents changed by someone else |
|
4308 |
self notify:(resources string:'%1 was changed by someone else.' with:item fileName baseName allBold). |
|
4309 |
self itemChanged value:true. |
|
4310 |
]. |
|
3892 | 4311 |
]. |
4969 | 4312 |
self setupCheckModify. |
4313 |
! |
|
4314 |
||
4977
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
4315 |
releaseCheckModify |
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
4316 |
|
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
4317 |
Processor removeTimedBlock:checkModifiedBlock. |
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
4318 |
! |
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
4319 |
|
4969 | 4320 |
setupCheckModify |
4321 |
||
4322 |
Processor addTimedBlock:checkModifiedBlock afterSeconds:3. |
|
3892 | 4323 |
! ! |
4324 |
||
4325 |
!FileApplicationNoteBook::TextEditor methodsFor:'queries'! |
|
4326 |
||
4071 | 4327 |
hasMD5 |
4328 |
^ ( MD5Stream notNil and:[MD5Stream isLoaded]) |
|
4329 |
! |
|
4330 |
||
3892 | 4331 |
isModified |
4332 |
||
4333 |
^ self modifiedChannel value |
|
4146
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4334 |
! |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4335 |
|
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4336 |
isTextEditor |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4337 |
|
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
4338 |
^ true |
3892 | 4339 |
! ! |
4340 |
||
4341 |
!FileApplicationNoteBook::TextEditor methodsFor:'startup & release'! |
|
4342 |
||
4343 |
closeRequest |
|
4344 |
||
4345 |
(self doClose) ifTrue:[ |
|
4346 |
^ super closeRequest. |
|
4105 | 4347 |
|
3892 | 4348 |
]. |
4349 |
! |
|
4350 |
||
4351 |
postBuildTextEditor:aWidget |
|
4352 |
||
4353 |
editView := aWidget scrolledView. |
|
4354 |
! |
|
4355 |
||
4356 |
postBuildWith:aBuilder |
|
4357 |
||
4358 |
super postBuildWith:aBuilder. |
|
4359 |
! |
|
4360 |
||
4361 |
postOpenWith:aBuilder |
|
4362 |
||
4953 | 4363 |
self item isNil ifTrue:[ |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4364 |
self item:(DirectoryContentsBrowser itemClass fileName:(Filename homeDirectory construct:'.bashrc')). |
3892 | 4365 |
]. |
4366 |
self setUpTextView. |
|
4367 |
self changeInformation. |
|
4368 |
^ super postOpenWith:aBuilder |
|
4369 |
! |
|
4370 |
||
4371 |
release |
|
4372 |
"release my resources |
|
4373 |
" |
|
4977
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
4374 |
self releaseCheckModify. |
4969 | 4375 |
checkModifiedBlock := nil. |
3892 | 4376 |
super release. |
4377 |
! |
|
4378 |
||
4379 |
setUpTextView |
|
4945 | 4380 |
"change the parenthesis-spec of the editor to include $< .. $> if the |
4381 |
shown document is an html- or xml document" |
|
4382 |
||
4383 |
|item mimeType parenthesis col| |
|
4384 |
||
4385 |
item := self item. |
|
4386 |
item notNil ifTrue:[ |
|
4387 |
item hasMimeType ifFalse:[^nil]. |
|
4388 |
mimeType := item mimeType. |
|
4389 |
||
4390 |
(mimeType isHtml or:[mimeType isXml]) ifTrue:[ |
|
4391 |
parenthesis := editView parenthesisSpecification copy. |
|
4392 |
((parenthesis at:#open) includes:$<) ifFalse:[ |
|
4393 |
col := ((parenthesis at:#open) asOrderedCollection). |
|
4392 | 4394 |
col add:$<. |
4945 | 4395 |
parenthesis at:#open put:col. |
4396 |
||
4397 |
col := ((parenthesis at:#close) asOrderedCollection). |
|
4946 | 4398 |
col add:$>. |
4945 | 4399 |
parenthesis at:#close put:col. |
4400 |
||
4401 |
editView parenthesisSpecification:parenthesis |
|
4392 | 4402 |
]. |
3892 | 4403 |
]. |
4392 | 4404 |
] |
3892 | 4405 |
! ! |
4406 |
||
4407 |
!FileApplicationNoteBook::XViewApplication class methodsFor:'defaults'! |
|
4408 |
||
4409 |
maxNumberOfVNCRestarts |
|
4410 |
||
4411 |
^ 10 |
|
4412 |
! |
|
4413 |
||
4414 |
mimeTypeUnixApplicationMapping |
|
4415 |
||
4416 |
" here insert the application and mime type pairs to open by XviewApplication |
|
4417 |
" |
|
4418 |
||
4419 |
^ |
|
4420 |
#( |
|
4421 |
#(#'application/postscript' #gv ) |
|
4422 |
#(#'application/pdf' #acroread ) |
|
4423 |
) |
|
4424 |
! |
|
4425 |
||
4426 |
tabStringFor:aApplicationType |
|
4427 |
||
4428 |
^ 'VNC for:' |
|
4429 |
! |
|
4430 |
||
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4431 |
unixVNCCommand |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4432 |
|
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4433 |
^ 'Xvnc' |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4434 |
! |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4435 |
|
3892 | 4436 |
wantNewApplicationAnyway |
4437 |
||
4500
9f0b8d6ae2be
make a new XView for a new item if an XView already open
penk
parents:
4499
diff
changeset
|
4438 |
^ true |
3892 | 4439 |
! ! |
4440 |
||
4441 |
!FileApplicationNoteBook::XViewApplication class methodsFor:'interface specs'! |
|
4442 |
||
4443 |
windowSpec |
|
4444 |
"This resource specification was automatically generated |
|
4445 |
by the UIPainter of ST/X." |
|
4446 |
||
4447 |
"Do not manually edit this!! If it is corrupted, |
|
4448 |
the UIPainter may not be able to read the specification." |
|
4449 |
||
4450 |
" |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4451 |
UIPainter new openOnClass:FileApplicationNoteBook::XViewApplication andSelector:#windowSpec |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4452 |
FileApplicationNoteBook::XViewApplication new openInterface:#windowSpec |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4453 |
FileApplicationNoteBook::XViewApplication open |
3892 | 4454 |
" |
4455 |
||
4456 |
<resource: #canvas> |
|
4457 |
||
4458 |
^ |
|
4459 |
#(#FullSpec |
|
4460 |
#name: #windowSpec |
|
4461 |
#window: |
|
4462 |
#(#WindowSpec |
|
4463 |
#label: 'XView' |
|
4464 |
#name: 'XView' |
|
4465 |
#min: #(#Point 10 10) |
|
4466 |
#max: #(#Point 1024 768) |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4467 |
#bounds: #(#Rectangle 16 42 692 534) |
3892 | 4468 |
#menu: #mainMenu |
4469 |
) |
|
4470 |
#component: |
|
4471 |
#(#SpecCollection |
|
4472 |
#collection: #( |
|
4473 |
#(#MenuPanelSpec |
|
4261 | 4474 |
#name: 'MenuVNC' |
3892 | 4475 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4476 |
#level: 0 |
3892 | 4477 |
#visibilityChannel: #isEmbeddedApplication |
4478 |
#menu: #menu |
|
4479 |
#textDefault: true |
|
4480 |
) |
|
4481 |
#(#ArbitraryComponentSpec |
|
4261 | 4482 |
#name: 'VNCView' |
3892 | 4483 |
#layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0) |
4484 |
#hasHorizontalScrollBar: true |
|
4485 |
#hasVerticalScrollBar: true |
|
4486 |
#miniScrollerHorizontal: false |
|
4487 |
#miniScrollerVertical: false |
|
4488 |
#hasBorder: false |
|
4489 |
#component: #VNCFrameBufferView |
|
4490 |
#postBuildCallback: #postBuildXView: |
|
4491 |
) |
|
4492 |
) |
|
4493 |
||
4494 |
) |
|
4495 |
) |
|
4496 |
! ! |
|
4497 |
||
4498 |
!FileApplicationNoteBook::XViewApplication class methodsFor:'menu specs'! |
|
4499 |
||
4500 |
menu |
|
4501 |
"This resource specification was automatically generated |
|
4502 |
by the MenuEditor of ST/X." |
|
4503 |
||
4504 |
"Do not manually edit this!! If it is corrupted, |
|
4505 |
the MenuEditor may not be able to read the specification." |
|
4506 |
||
4507 |
" |
|
4508 |
MenuEditor new openOnClass:NoteBookApplication::ImageViewApplication andSelector:#menu |
|
4509 |
(Menu new fromLiteralArrayEncoding:(NoteBookApplication::ImageViewApplication menu)) startUp |
|
4510 |
" |
|
4511 |
||
4512 |
<resource: #menu> |
|
4513 |
||
4514 |
^ |
|
4515 |
#(#Menu |
|
4516 |
#( |
|
4517 |
#(#MenuItem |
|
4518 |
#label: 'Close' |
|
4519 |
#translateLabel: true |
|
4520 |
#isButton: true |
|
4521 |
#hideMenuOnActivated: false |
|
4522 |
#startGroup: #right |
|
4523 |
#value: #doClose |
|
4524 |
#labelImage: #(#ResourceRetriever #AbstractFileBrowser #closeIcon) |
|
4525 |
) |
|
4526 |
) |
|
4527 |
nil |
|
4528 |
nil |
|
4529 |
) |
|
4530 |
! ! |
|
4531 |
||
4532 |
!FileApplicationNoteBook::XViewApplication class methodsFor:'queries'! |
|
4533 |
||
4534 |
canOpenItem:aItem |
|
4535 |
||
4536 |
| keySym canOpen| |
|
4537 |
||
4538 |
keySym := aItem mimeType asSymbol. |
|
4539 |
(OperatingSystem isUNIXlike) not ifTrue:[^ false]. |
|
4540 |
canOpen := self mimeTypeUnixApplicationMapping detect:[ : el | (el at:1) == keySym ] ifNone:[nil]. |
|
4541 |
canOpen isNil ifTrue:[^ false]. |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4542 |
(OperatingSystem executeCommand:('which ', self unixVNCCommand)) ifTrue:[ |
3892 | 4543 |
^ true |
4544 |
] ifFalse:[ |
|
4545 |
(Dialog warn:'cant start viewer for ' |
|
4546 |
, aItem fileName baseName |
|
4547 |
) |
|
4548 |
]. |
|
4549 |
^ false. |
|
4550 |
! ! |
|
4551 |
||
4552 |
!FileApplicationNoteBook::XViewApplication methodsFor:'accessing'! |
|
4553 |
||
4554 |
xView |
|
4555 |
"return the value of the instance variable 'imageView' (automatically generated)" |
|
4556 |
||
4557 |
^ xView |
|
4558 |
! |
|
4559 |
||
4560 |
xView:something |
|
4561 |
"set the value of the instance variable 'imageView' (automatically generated)" |
|
4562 |
||
4563 |
xView := something. |
|
4564 |
! ! |
|
4565 |
||
4566 |
!FileApplicationNoteBook::XViewApplication methodsFor:'actions'! |
|
4567 |
||
4568 |
changeInformation |
|
4569 |
||
4570 |
| stream| |
|
4571 |
||
4572 |
stream := WriteStream on:''. |
|
4573 |
stream nextPutAll:'XView on: '. |
|
4574 |
stream nextPutAll:self fileName baseName. |
|
4575 |
masterApplication isNil ifTrue:[ |
|
4576 |
self window label:stream contents. |
|
4577 |
||
4578 |
] ifFalse:[ |
|
4579 |
masterApplication tabStringChangeTo:stream contents for:self. |
|
4580 |
]. |
|
4581 |
stream close. |
|
4582 |
! |
|
4583 |
||
4584 |
setupXView |
|
4585 |
||
3906 | 4586 |
|xExt yExt mainView| |
3892 | 4587 |
|
4588 |
self startVNCserver. |
|
4589 |
xExt := self xView width asString. |
|
3906 | 4590 |
self masterApplication notNil ifTrue:[ |
4591 |
mainView := self builder windowGroup mainView. |
|
4592 |
"/ if the mainView is a FileBrowser take them y extent because size of notebook can be changed |
|
4593 |
(mainView application class == (Smalltalk at:#FileBrowserV2 ifAbsent:nil)) notNil ifTrue:[ |
|
4594 |
yExt := mainView height asString. |
|
4595 |
]. |
|
4596 |
]. |
|
4597 |
yExt isNil ifTrue:[ |
|
3892 | 4598 |
yExt := self xView height asString. |
4599 |
]. |
|
4600 |
ext := xExt, 'x', yExt. |
|
4601 |
self startViewer. |
|
4602 |
! ! |
|
4603 |
||
4604 |
!FileApplicationNoteBook::XViewApplication methodsFor:'actions VNC'! |
|
4605 |
||
4606 |
setupView |
|
4607 |
| renderer view| |
|
4608 |
||
4609 |
view := xView. |
|
4610 |
renderer := VNCRenderer for:vncConnection targetWindow:view device:xView device. |
|
4611 |
||
4612 |
view renderer:renderer. |
|
4613 |
view connection:vncConnection. |
|
4614 |
||
4615 |
VNCException handle:[:ex| |
|
4616 |
self stopViewer. |
|
4617 |
] do:[ |
|
4618 |
vncConnection |
|
4619 |
startMessageHandlerProcessForRenderer:renderer |
|
4620 |
errorHandler:[:ex | self stopViewer]. |
|
4621 |
]. |
|
4622 |
! |
|
4623 |
||
4624 |
startVNCserver |
|
4625 |
|cmd blocked connected numberOfVncStarts| |
|
4626 |
||
4627 |
connected := false. |
|
4628 |
numberOfVncStarts isNil ifTrue:[ |
|
4629 |
numberOfVncStarts := 1. |
|
4630 |
] ifFalse:[ |
|
4631 |
numberOfVncStarts := numberOfVncStarts + 1. |
|
4632 |
]. |
|
4633 |
||
4634 |
vncLock isNil ifTrue:[vncLock := Semaphore forMutualExclusion]. |
|
4635 |
||
4636 |
vncServerPID isNil ifTrue:[ |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4637 |
cmd := ('/usr/X11R6/bin/', self class unixVNCCommand). |
3892 | 4638 |
cmd asFilename exists ifFalse:[ |
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4639 |
cmd := self class unixVNCCommand. |
3892 | 4640 |
]. |
4641 |
vncPortNr isNil ifTrue:[ |
|
4642 |
vncPortNr := 29 |
|
4643 |
]. |
|
4644 |
cmd := cmd , ' :' , vncPortNr printString , ' nologo -nevershared -localhost -depth 16 -geometry 1024x1024'. |
|
4645 |
||
4646 |
blocked := OperatingSystem blockInterrupts. |
|
4647 |
||
4648 |
vncServerPID := Processor |
|
4649 |
monitor:[ |
|
4650 |
vncServerIsTerminated := false. |
|
4651 |
OperatingSystem |
|
4652 |
exec:'/bin/sh' |
|
4653 |
withArguments:(Array with:'sh' with:'-c' with:cmd) |
|
4622
857bbc5a9d47
Cleanup filedescriptor closing on #exec:withArguments:....
Stefan Vogel <sv@exept.de>
parents:
4621
diff
changeset
|
4654 |
environment:nil |
3892 | 4655 |
fileDescriptors:#() |
4656 |
fork:true |
|
4657 |
newPgrp:true |
|
4658 |
inDirectory:nil. |
|
4659 |
] |
|
4660 |
action:[:status | |
|
4661 |
status stillAlive ifFalse:[ |
|
4662 |
OperatingSystem closePid:vncServerPID. |
|
4663 |
vncLock critical:[ |
|
4664 |
vncServerPID := nil. |
|
4665 |
self vncServerTerminated. |
|
4666 |
]. |
|
4667 |
]. |
|
4668 |
]. |
|
4669 |
||
4670 |
blocked ifFalse:[ |
|
4671 |
OperatingSystem unblockInterrupts |
|
4672 |
]. |
|
4673 |
]. |
|
4674 |
||
4675 |
self waitForTerminationOfServer ifTrue:[ |
|
4676 |
"/ Transcript showCR:'server has terminated really - try with next port'. |
|
4677 |
(numberOfVncStarts < self class maxNumberOfVNCRestarts) ifTrue:[ |
|
4678 |
vncPortNr := vncPortNr + 1. |
|
4679 |
"/ Transcript showCR:'try next port ', vncPortNr asString. |
|
4680 |
self startVNCserver. |
|
4681 |
] ifFalse:[ |
|
4682 |
Dialog warn:'have started servers from port ' |
|
4683 |
, (vncPortNr - self class maxNumberOfVNCRestarts) asString |
|
4684 |
, ' to ' |
|
4685 |
, vncPortNr |
|
4686 |
, ' - cant connect anyway'. |
|
4687 |
"/ Transcript showCR:'have started servers from port ', vncPortNr - self class maxNumberOfVNCRestarts, ' to ', vncPortNr. |
|
4688 |
]. |
|
4689 |
] ifFalse:[ |
|
4690 |
vncLock critical:[ |
|
4691 |
vncServerPID isNil ifTrue:[ |
|
4692 |
Dialog warn:'Cannot start Xvnc'. |
|
4693 |
] ifFalse:[ |
|
4694 |
VNCAuthenticationFailure handle:[:ex | |
|
4695 |
Dialog warn:'Wrong password'. |
|
4696 |
] do:[ |
|
4697 |
connected := self vncConnect. |
|
4698 |
]. |
|
4699 |
connected ifTrue:[self setupView]. |
|
4700 |
]. |
|
4701 |
]. |
|
4702 |
]. |
|
4703 |
! |
|
4704 |
||
4705 |
stopVNCServer |
|
4706 |
||
4707 |
vncServerPID notNil ifTrue:[ |
|
4708 |
OperatingSystem terminateProcess:vncServerPID. |
|
4709 |
Delay waitForSeconds:0.2. |
|
4710 |
vncServerPID notNil ifTrue:[ |
|
4711 |
OperatingSystem killProcess:vncServerPID. |
|
4712 |
vncServerPID := nil. |
|
4713 |
]. |
|
4714 |
]. |
|
4715 |
self vncServerTerminated. |
|
4716 |
! |
|
4717 |
||
4718 |
vncConnect |
|
4719 |
| tryConnects| |
|
4720 |
||
4721 |
vncConnection notNil ifTrue:[ |
|
4722 |
vncConnection close |
|
4723 |
]. |
|
4724 |
||
4725 |
vncConnection := VNCServerConnection new. |
|
4726 |
tryConnects := 1. |
|
4727 |
[tryConnects < 3] whileTrue:[ |
|
4728 |
VNCConnectionFailure handle:[:ex | |
|
4729 |
Delay waitForSeconds:0.5. |
|
4730 |
tryConnects := tryConnects + 1. |
|
4731 |
] do:[ |
|
4732 |
vncConnection connectTo:'localhost' port:vncPortNr. |
|
4733 |
^ true. |
|
4734 |
]. |
|
4735 |
]. |
|
4736 |
^ false |
|
4737 |
! |
|
4738 |
||
4739 |
vncServerTerminated |
|
4740 |
"/ Transcript showCR:'vnc server has terminated'. |
|
4741 |
"/ 'vnc server has terminated' errorPrintCR. |
|
4742 |
"/ Dialog information:'vnc server has terminated'. |
|
4743 |
||
4744 |
self stopViewer. |
|
4745 |
vncConnection notNil ifTrue:[ |
|
4746 |
vncConnection close. |
|
4747 |
vncConnection := nil |
|
4748 |
]. |
|
4749 |
vncServerIsTerminated := true. |
|
4750 |
! |
|
4751 |
||
4752 |
waitForTerminationOfServer |
|
4753 |
| cycles | |
|
4754 |
||
4755 |
cycles := 1. |
|
4756 |
[vncServerIsTerminated] whileFalse:[ |
|
4757 |
(cycles > 3) ifTrue:[^ false]. |
|
4758 |
cycles := cycles + 1. |
|
4759 |
Delay waitForSeconds:0.5. |
|
4760 |
]. |
|
4761 |
^ true |
|
4762 |
! ! |
|
4763 |
||
4764 |
!FileApplicationNoteBook::XViewApplication methodsFor:'actions viewer'! |
|
4765 |
||
4766 |
startViewer |
|
4767 |
|cmd keySym applItem | |
|
4768 |
||
4769 |
keySym := self item mimeType asSymbol. |
|
4770 |
applItem := self class mimeTypeUnixApplicationMapping detect:[ : el | (el at:1) == keySym ] ifNone:[nil]. |
|
4771 |
applItem isNil ifTrue:[ ^ self]. |
|
4772 |
||
4773 |
cmd := (applItem at:2) asString, ' -geometry ', ext, ' -display :' , vncPortNr printString , ' ' , self fileName asString. |
|
4774 |
self startViewer:cmd |
|
4775 |
! |
|
4776 |
||
4777 |
startViewer:viewerCommand |
|
4778 |
|blocked| |
|
4779 |
||
4780 |
viewerPID notNil ifTrue:[ |
|
4781 |
^ self |
|
4782 |
]. |
|
4783 |
||
4784 |
blocked := OperatingSystem blockInterrupts. |
|
4785 |
||
4786 |
viewerPID := Processor |
|
4787 |
monitor:[ |
|
4788 |
OperatingSystem |
|
4789 |
exec:'/bin/sh' |
|
4790 |
withArguments:(Array with:'sh' with:'-c' with:viewerCommand) |
|
4622
857bbc5a9d47
Cleanup filedescriptor closing on #exec:withArguments:....
Stefan Vogel <sv@exept.de>
parents:
4621
diff
changeset
|
4791 |
environment:nil |
3892 | 4792 |
fileDescriptors:#() |
4793 |
fork:true |
|
4794 |
newPgrp:true |
|
4795 |
inDirectory:nil. |
|
4796 |
] |
|
4797 |
action:[:status | |
|
4798 |
status stillAlive ifFalse:[ |
|
4799 |
OperatingSystem closePid:viewerPID. |
|
4800 |
viewerPID := nil. |
|
4801 |
self viewerTerminated. |
|
4802 |
]. |
|
4803 |
]. |
|
4804 |
||
4805 |
blocked ifFalse:[ |
|
4806 |
OperatingSystem unblockInterrupts |
|
4807 |
]. |
|
4808 |
||
4809 |
viewerPID isNil ifTrue:[ |
|
4810 |
Dialog warn:'Cannot start ', viewerCommand. |
|
4811 |
]. |
|
4812 |
! |
|
4813 |
||
4814 |
startXterm |
|
4815 |
|cmd| |
|
4816 |
||
4817 |
cmd := 'xterm -geometry 600x800 -display :' , vncPortNr printString. |
|
4818 |
self startViewer:cmd |
|
4819 |
! |
|
4820 |
||
4821 |
stopViewer |
|
4822 |
viewerPID notNil ifTrue:[ |
|
4823 |
OperatingSystem terminateProcess:viewerPID. |
|
4824 |
Delay waitForSeconds:0.2. |
|
4825 |
viewerPID notNil ifTrue:[ |
|
4826 |
OperatingSystem killProcess:viewerPID. |
|
4827 |
viewerPID := nil. |
|
4828 |
] |
|
4829 |
]. |
|
4830 |
! |
|
4831 |
||
4832 |
viewerTerminated |
|
4833 |
"/ Transcript showCR:'viewer has terminated'. |
|
4834 |
"/ 'viewer has terminated' errorPrintCR. |
|
4835 |
"/ Dialog information:'viewer has terminated'. |
|
4836 |
! ! |
|
4837 |
||
4838 |
!FileApplicationNoteBook::XViewApplication methodsFor:'initialization & release'! |
|
4839 |
||
4840 |
postBuildXView:aWidget |
|
4841 |
||
4842 |
self xView:aWidget scrolledView. |
|
4843 |
self xView wantsFocusWithPointerEnter. |
|
4844 |
aWidget autoHideScrollBars:true. |
|
4845 |
! |
|
4846 |
||
4847 |
postOpenWith:aBuilder |
|
4848 |
" |
|
4849 |
only invoked if the application not started from a master |
|
4850 |
" |
|
4851 |
||
4852 |
|currentDir contents suffix fileName| |
|
4853 |
||
4854 |
self masterApplication isNil ifTrue:[ |
|
4855 |
self masterApplication:nil. |
|
4856 |
currentDir := Filename homeDirectory. |
|
4857 |
contents := currentDir directoryContents. |
|
4858 |
fileName := contents |
|
4859 |
detect:[:file | |
|
4860 |
suffix := file asFilename suffix asLowercase. |
|
4861 |
suffix = 'pdf' |
|
4862 |
] |
|
4863 |
ifNone:[nil]. |
|
4864 |
fileName isNil ifTrue:[ |
|
4865 |
Dialog warn:'cant find a PDF File in ' , currentDir asString. |
|
4866 |
^ self |
|
4867 |
]. |
|
3982 | 4868 |
self item:(DirectoryContentsBrowser itemClass fileName:(currentDir construct:fileName)). |
3892 | 4869 |
]. |
4870 |
self changeInformation. |
|
4871 |
self setupXView. |
|
4872 |
^ super postOpenWith:aBuilder |
|
4873 |
! |
|
4874 |
||
4875 |
release |
|
4876 |
"/Transcript showCR:'release'. |
|
4877 |
self stopViewer. |
|
4878 |
self stopVNCServer. |
|
4879 |
^ super release |
|
4880 |
! ! |
|
4881 |
||
4882 |
!FileApplicationNoteBook class methodsFor:'documentation'! |
|
4883 |
||
4884 |
version |
|
5007 | 4885 |
^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.97 2003-06-30 09:38:05 cg Exp $' |
3892 | 4886 |
! ! |