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