author | Claus Gittinger <cg@exept.de> |
Fri, 19 Jan 2018 19:49:35 +0100 | |
changeset 17950 | d63391605406 |
parent 17900 | fafb77eead65 |
child 17951 | ea5c9eaf94de |
permissions | -rw-r--r-- |
17950 | 1 |
"{ Encoding: utf8 }" |
2 |
||
5140 | 3 |
" |
4 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
3892 | 14 |
"{ Package: 'stx:libtool' }" |
15 |
||
15112
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
16 |
"{ NameSpace: Smalltalk }" |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
17 |
|
3892 | 18 |
AbstractFileBrowser subclass:#FileApplicationNoteBook |
9951 | 19 |
instanceVariableNames:'canvasHolder selectedEditorPage listOfApplications tabMenuIndex |
20 |
tabList selectionHistoryList privateTabList' |
|
21 |
classVariableNames:'' |
|
22 |
poolDictionaries:'' |
|
23 |
category:'Interface-Tools-File' |
|
3892 | 24 |
! |
25 |
||
26 |
AbstractFileApplicationNoteBookComponent subclass:#ArchiveViewApplication |
|
9951 | 27 |
instanceVariableNames:'archiveFileList enableStopButton fileTable currentSortOrder |
28 |
selectionHolder tableColumns commandProcess errorListHolder |
|
29 |
viewErrorList temporaryDirectory enableRemoveErrorOutput |
|
30 |
errorListVisibilityHolder hasListEntriesHolder archiver process |
|
31 |
terminateByMe columnDescriptors inDropMode' |
|
32 |
classVariableNames:'' |
|
33 |
poolDictionaries:'' |
|
34 |
privateIn:FileApplicationNoteBook |
|
3892 | 35 |
! |
36 |
||
37 |
Object subclass:#ArchivItem |
|
9951 | 38 |
instanceVariableNames:'fileName size dateAndTime permissions icon ownerGroup method crc |
39 |
compressSize ratio version type isDirectory' |
|
40 |
classVariableNames:'' |
|
41 |
poolDictionaries:'' |
|
42 |
privateIn:FileApplicationNoteBook::ArchiveViewApplication |
|
3892 | 43 |
! |
44 |
||
45 |
AbstractFileApplicationNoteBookComponent subclass:#CommandResult |
|
9951 | 46 |
instanceVariableNames:'resultStream enableStopButton process labelHolder' |
47 |
classVariableNames:'' |
|
48 |
poolDictionaries:'' |
|
49 |
privateIn:FileApplicationNoteBook |
|
3892 | 50 |
! |
51 |
||
7909 | 52 |
AbstractFileApplicationNoteBookComponent subclass:#DigitalNotepadFileViewApplication |
9951 | 53 |
instanceVariableNames:'imageView image fitSize fitMode' |
54 |
classVariableNames:'' |
|
55 |
poolDictionaries:'' |
|
56 |
privateIn:FileApplicationNoteBook |
|
7909 | 57 |
! |
58 |
||
3892 | 59 |
AbstractFileApplicationNoteBookComponent subclass:#HtmlViewApplication |
10566 | 60 |
instanceVariableNames:'htmlView labelHolder infoLabelHolder webBrowserPage' |
9951 | 61 |
classVariableNames:'' |
62 |
poolDictionaries:'' |
|
63 |
privateIn:FileApplicationNoteBook |
|
3892 | 64 |
! |
65 |
||
66 |
AbstractFileApplicationNoteBookComponent subclass:#ImageViewApplication |
|
17639 | 67 |
instanceVariableNames:'imageFile imageView image fitSize fitMode imageReadProcess' |
9951 | 68 |
classVariableNames:'' |
69 |
poolDictionaries:'' |
|
70 |
privateIn:FileApplicationNoteBook |
|
3892 | 71 |
! |
72 |
||
73 |
AbstractFileApplicationNoteBookComponent subclass:#Terminal |
|
14801
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
74 |
instanceVariableNames:'terminalView scrollLockedHolder' |
9951 | 75 |
classVariableNames:'DefaultLineLimit' |
76 |
poolDictionaries:'' |
|
77 |
privateIn:FileApplicationNoteBook |
|
3892 | 78 |
! |
79 |
||
80 |
AbstractFileApplicationNoteBookComponent subclass:#TextEditor |
|
9951 | 81 |
instanceVariableNames:'fileContentsModel modifiedChannel editView enableSave |
17747 | 82 |
enableReload changeItemProcess closeApplication semaChangeItem |
83 |
wantToPrintAsHexDump printAsHexDump itemChanged itemRemoved |
|
84 |
enableHexToggle md5CheckSum md5HashValueComputationProcess |
|
85 |
viewModifiedChannel textEditorModificationTime checkModifiedBlock |
|
86 |
fileEncodingHolder doNotShowFontDialog lockFileEncodingHolder |
|
87 |
enableSelectInBrowser tagsBrowserVisibleHolder tagsBrowser |
|
88 |
editorToolBarVisibleHolder editorOperationsToolBarVisibleHolder |
|
89 |
editorOperationsMenuSpecHolder characterEncodingInDump |
|
90 |
radixInDump presentationHolder' |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
91 |
classVariableNames:'DefaultTagsBrowserVisible MaxFileSizeLoadedWithoutAsking |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
92 |
DefaultEditorToolBarVisible DefaultEditorOperationsToolBarVisible' |
9951 | 93 |
poolDictionaries:'' |
94 |
privateIn:FileApplicationNoteBook |
|
5417 | 95 |
! |
96 |
||
9785 | 97 |
AbstractFileApplicationNoteBookComponent subclass:#XMLViewApplication |
9951 | 98 |
instanceVariableNames:'xmlTreeApp labelHolder infoLabelHolder' |
99 |
classVariableNames:'' |
|
100 |
poolDictionaries:'' |
|
101 |
privateIn:FileApplicationNoteBook |
|
9785 | 102 |
! |
103 |
||
3892 | 104 |
AbstractFileApplicationNoteBookComponent subclass:#XViewApplication |
9951 | 105 |
instanceVariableNames:'xView xFile vncServerPID vncPortNr vncConnection viewerPID |
106 |
vncLock vncServerIsTerminated xItem ext' |
|
107 |
classVariableNames:'' |
|
108 |
poolDictionaries:'' |
|
109 |
privateIn:FileApplicationNoteBook |
|
3892 | 110 |
! |
111 |
||
5140 | 112 |
!FileApplicationNoteBook class methodsFor:'documentation'! |
113 |
||
114 |
copyright |
|
115 |
" |
|
116 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
117 |
All Rights Reserved |
|
118 |
||
119 |
This software is furnished under a license and may be used |
|
120 |
only in accordance with the terms of that license and with the |
|
121 |
inclusion of the above copyright notice. This software may not |
|
122 |
be provided or otherwise made available to, or used by, any |
|
123 |
other person. No title to or ownership of the software is |
|
124 |
hereby transferred. |
|
125 |
" |
|
5968 | 126 |
! |
127 |
||
128 |
documentation |
|
129 |
" |
|
130 |
[Author:] |
|
131 |
Christian Penk |
|
132 |
" |
|
5140 | 133 |
! ! |
3892 | 134 |
|
135 |
!FileApplicationNoteBook class methodsFor:'application list'! |
|
136 |
||
137 |
applicationList |
|
7840 | 138 |
" returns a list of all applications to start by the NoteBookApplication with |
3892 | 139 |
#className #type |
140 |
||
141 |
example: |
|
142 |
#( #'FooEditor' nil ) |
|
7840 | 143 |
" |
3892 | 144 |
|
145 |
^ #( |
|
7909 | 146 |
#( #'TextEditor' #file ) |
147 |
#( #'TextEditor' #directoryDescription ) |
|
148 |
#( #'HtmlViewApplication' nil ) |
|
149 |
#( #'FindFileApplication' nil ) |
|
150 |
#( #'Terminal' nil ) |
|
151 |
#( #'ImageViewApplication' nil ) |
|
152 |
#( #'ArchiveViewApplication' nil ) |
|
153 |
#( #'CommandResult' nil ) |
|
154 |
#( #'XViewApplication' nil ) |
|
155 |
#( #'DigitalNotepadFileViewApplication' nil ) |
|
12121
57a6e8face3b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12115
diff
changeset
|
156 |
#( #'XMLViewApplication' nil ) |
3892 | 157 |
) |
7840 | 158 |
|
9788 | 159 |
"Modified: / 21-02-2011 / 17:21:54 / cg" |
3892 | 160 |
! |
161 |
||
162 |
classFor:aApplicationListItem |
|
163 |
|rawName cls| |
|
164 |
||
165 |
rawName := aApplicationListItem at:1. |
|
166 |
(cls := self privateClassesAt:rawName) isNil ifTrue:[ |
|
167 |
cls := Smalltalk at:rawName. |
|
168 |
]. |
|
169 |
^ cls |
|
170 |
! |
|
171 |
||
172 |
defaultApplication |
|
173 |
" returns the application to be started if no itemQuery returns true or no supportedSuffix is supported |
|
174 |
" |
|
175 |
||
176 |
^ self applicationList detect:[: applItem| |
|
177 |
(((self classFor:applItem) == self textEditorClass) |
|
178 |
and:[(self typeFor:applItem) == #file]) |
|
179 |
] ifNone:[nil]. |
|
180 |
! |
|
181 |
||
182 |
typeFor:aApplicationListItem |
|
183 |
||
184 |
^ aApplicationListItem at:2 |
|
185 |
! ! |
|
186 |
||
187 |
!FileApplicationNoteBook class methodsFor:'classAccess'! |
|
188 |
||
189 |
textEditorClass |
|
190 |
||
191 |
^ TextEditor |
|
192 |
! ! |
|
193 |
||
194 |
!FileApplicationNoteBook class methodsFor:'defaults'! |
|
195 |
||
196 |
openAnotherApplicationOnSameItem |
|
197 |
||
198 |
^ false |
|
199 |
! ! |
|
200 |
||
201 |
!FileApplicationNoteBook class methodsFor:'interface specs'! |
|
202 |
||
203 |
windowSpec |
|
204 |
"This resource specification was automatically generated |
|
205 |
by the UIPainter of ST/X." |
|
206 |
||
207 |
"Do not manually edit this!! If it is corrupted, |
|
208 |
the UIPainter may not be able to read the specification." |
|
209 |
||
210 |
" |
|
6484 | 211 |
UIPainter new openOnClass:FileApplicationNoteBook andSelector:#windowSpec |
212 |
FileApplicationNoteBook new openInterface:#windowSpec |
|
213 |
FileApplicationNoteBook open |
|
3892 | 214 |
" |
215 |
||
216 |
<resource: #canvas> |
|
217 |
||
218 |
^ |
|
6484 | 219 |
#(FullSpec |
220 |
name: windowSpec |
|
221 |
window: |
|
222 |
(WindowSpec |
|
223 |
label: 'FileBrowserV2TextEditor' |
|
224 |
name: 'FileBrowserV2TextEditor' |
|
225 |
min: (Point 10 10) |
|
226 |
bounds: (Rectangle 0 0 300 300) |
|
3892 | 227 |
) |
6484 | 228 |
component: |
229 |
(SpecCollection |
|
230 |
collection: ( |
|
231 |
(NoteBookViewSpec |
|
232 |
name: 'CommandAndTextEditor' |
|
233 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
234 |
model: selectedEditorPage |
|
235 |
menu: tabList |
|
236 |
useIndex: true |
|
237 |
accessTabMenuAction: tabMenuAt: |
|
11099 | 238 |
destroyTabAction: destroyTabAt: |
6484 | 239 |
canvas: canvasHolder |
240 |
keepCanvasAlive: true |
|
3892 | 241 |
) |
242 |
) |
|
243 |
||
244 |
) |
|
245 |
) |
|
246 |
! ! |
|
247 |
||
248 |
!FileApplicationNoteBook class methodsFor:'menu specs'! |
|
249 |
||
250 |
tabMenu |
|
251 |
"This resource specification was automatically generated |
|
252 |
by the MenuEditor of ST/X." |
|
253 |
||
254 |
"Do not manually edit this!! If it is corrupted, |
|
255 |
the MenuEditor may not be able to read the specification." |
|
256 |
||
257 |
" |
|
258 |
MenuEditor new openOnClass:FileApplicationNoteBook andSelector:#tabMenu |
|
259 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook tabMenu)) startUp |
|
260 |
" |
|
261 |
||
262 |
<resource: #menu> |
|
263 |
||
264 |
^ |
|
6214 | 265 |
#(Menu |
266 |
( |
|
267 |
(MenuItem |
|
268 |
label: 'Add Text Editor' |
|
269 |
itemValue: newTextEditor |
|
270 |
translateLabel: true |
|
4392 | 271 |
) |
6214 | 272 |
(MenuItem |
273 |
label: '-' |
|
5307 | 274 |
) |
6214 | 275 |
(MenuItem |
276 |
label: 'Select in Filelist' |
|
277 |
itemValue: doSelectInList |
|
278 |
translateLabel: true |
|
4045 | 279 |
) |
6214 | 280 |
(MenuItem |
281 |
label: '-' |
|
5186 | 282 |
) |
6214 | 283 |
(MenuItem |
7765 | 284 |
label: 'Rename Tab...' |
6214 | 285 |
itemValue: doRenameTab |
286 |
translateLabel: true |
|
4572 | 287 |
) |
6214 | 288 |
(MenuItem |
289 |
label: '-' |
|
4572 | 290 |
) |
6214 | 291 |
(MenuItem |
7765 | 292 |
label: 'Close Tab' |
6214 | 293 |
itemValue: doCloseApplication |
294 |
translateLabel: true |
|
3892 | 295 |
) |
6214 | 296 |
(MenuItem |
297 |
enabled: closeAllApplicationsEnabled |
|
7765 | 298 |
label: 'Close all Tabs' |
6214 | 299 |
itemValue: doCloseAllApplications |
300 |
translateLabel: true |
|
301 |
) |
|
302 |
(MenuItem |
|
303 |
enabled: closeAllApplicationsEnabled |
|
7765 | 304 |
label: 'Close all but this Tab' |
6214 | 305 |
itemValue: doCloseAllOtherApplications |
306 |
translateLabel: true |
|
5307 | 307 |
) |
3892 | 308 |
) |
309 |
nil |
|
310 |
nil |
|
311 |
) |
|
7765 | 312 |
|
313 |
"Modified: / 27-03-2007 / 11:13:52 / cg" |
|
3892 | 314 |
! ! |
315 |
||
316 |
!FileApplicationNoteBook methodsFor:'accessing'! |
|
317 |
||
318 |
listOfApplications |
|
319 |
"return the value of the instance variable 'listOfApplications' (automatically generated)" |
|
320 |
||
321 |
listOfApplications isNil ifTrue:[ |
|
322 |
listOfApplications := OrderedCollection new. |
|
323 |
]. |
|
324 |
^ listOfApplications |
|
325 |
! |
|
326 |
||
327 |
selectionHistoryList |
|
328 |
||
329 |
selectionHistoryList isNil ifTrue:[ |
|
330 |
selectionHistoryList := OrderedCollection new. |
|
331 |
]. |
|
332 |
^ selectionHistoryList |
|
333 |
! |
|
334 |
||
335 |
selectionHistoryList:aCol |
|
336 |
||
337 |
selectionHistoryList := aCol |
|
338 |
! ! |
|
339 |
||
4360 | 340 |
!FileApplicationNoteBook methodsFor:'accessing-applications'! |
3892 | 341 |
|
342 |
getAllApplicationsByClass:aClass andType:aType |
|
10922 | 343 |
^ self listOfApplications |
344 |
select:[ : appl | |
|
345 |
((appl class = aClass) |
|
346 |
"and:[appl type = aType]") |
|
347 |
]. |
|
348 |
||
349 |
"Modified (format): / 29-11-2011 / 19:08:20 / cg" |
|
3892 | 350 |
! |
351 |
||
352 |
getApplicationByType:aType |
|
353 |
||
354 |
^ self listOfApplications detect:[ : appl | |
|
355 |
(appl type == aType) |
|
356 |
] ifNone:[nil]. |
|
357 |
! |
|
358 |
||
359 |
getIndexFor:aApplication |
|
360 |
||
361 |
| index | |
|
362 |
||
363 |
index := self listOfApplications indexOf:aApplication. |
|
364 |
index ~~ 0 ifTrue:[ |
|
365 |
^ index. |
|
366 |
]. |
|
367 |
^ nil. |
|
368 |
! |
|
369 |
||
8513 | 370 |
getSameApplicationsFor:anApplication |
3892 | 371 |
|
8514 | 372 |
^ self listOfApplications |
373 |
select:[:appl | |
|
374 |
( (appl ~= anApplication) |
|
375 |
and:[ (appl isKindOf:(anApplication class)) |
|
376 |
and:[ (appl item = (anApplication item)) |
|
377 |
and:[ (appl type == anApplication type) ]]]) |
|
378 |
]. |
|
3892 | 379 |
! ! |
380 |
||
381 |
!FileApplicationNoteBook methodsFor:'actions-app-common'! |
|
382 |
||
9819 | 383 |
changeItem:anItem for:anAppl |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
384 |
| applIndex string isDirectory iconOrNil tabItem| |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
385 |
|
5010 | 386 |
anItem notNil ifTrue:[ |
387 |
isDirectory := anItem isDirectory or:[anItem linkTargetIsDirectory ]. |
|
4989 | 388 |
|
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6214
diff
changeset
|
389 |
isDirectory ifFalse:[ |
9819 | 390 |
(anAppl changeItem:anItem) ifFalse:[ ^ self]. |
391 |
self fileHistory addFirst:anItem. |
|
4989 | 392 |
self enableFileHistory value:true. |
393 |
]. |
|
3892 | 394 |
]. |
9819 | 395 |
string := anAppl getTabString. |
14839
2be01fe4903c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14836
diff
changeset
|
396 |
tabItem := Text string:string. |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
397 |
|
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
398 |
iconOrNil := anAppl getTabIcon. |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
399 |
iconOrNil notNil ifTrue:[ |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
400 |
tabItem := LabelAndIcon icon:iconOrNil string:tabItem. |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
401 |
]. |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
402 |
applIndex := self getIndexFor:anAppl. |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
403 |
self privateTabList at:applIndex put:tabItem. |
9882 | 404 |
"/ self doSelect:anAppl. |
3892 | 405 |
! |
406 |
||
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
407 |
changeModified:aSymbol for:anAppl |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
408 |
|text stream| |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
409 |
|
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
410 |
stream := WriteStream with:anAppl getTabString. |
4161 | 411 |
aSymbol ~~ #unchanged ifTrue:[ |
412 |
stream space. |
|
413 |
stream nextPut:$[. |
|
414 |
stream nextPutAll:aSymbol asString. |
|
415 |
stream nextPut:$]. |
|
416 |
text := stream contents asText. |
|
4499 | 417 |
text emphasizeAllWith:UserPreferences current emphasisForModifiedBuffer. |
4161 | 418 |
] ifFalse:[ |
419 |
text := stream contents asText. |
|
420 |
]. |
|
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
421 |
|
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
422 |
self tabStringChangeTo:text for:anAppl. |
4045 | 423 |
! |
424 |
||
3892 | 425 |
closeSubCanvas:aApplication |
426 |
||
3929 | 427 |
| applIndex historyList localHistoryList selectedPage| |
3892 | 428 |
|
429 |
applIndex := self getIndexFor:aApplication. |
|
430 |
applIndex notNil ifTrue:[ |
|
431 |
"/ "/ UPDATE THE LAST SELECTION BECAUSE SEL INDEX IS DECREMENTED FOR HIGHER INDEXES |
|
432 |
"/ self lastSelection:applIndex. |
|
433 |
||
434 |
historyList := self selectionHistoryList. |
|
435 |
historyList remove:applIndex ifAbsent:nil. |
|
436 |
localHistoryList := OrderedCollection new. |
|
437 |
historyList notEmpty ifTrue:[ |
|
3929 | 438 |
selectedPage := historyList last. |
3892 | 439 |
] ifFalse:[ |
3929 | 440 |
selectedPage := 1. |
441 |
]. |
|
442 |
self selectedEditorPage value:selectedPage. |
|
443 |
||
3892 | 444 |
historyList do:[ : index | |
445 |
index <= applIndex ifTrue:[ |
|
446 |
localHistoryList add:index |
|
447 |
] ifFalse:[ |
|
448 |
localHistoryList add:(index - 1) |
|
449 |
] |
|
450 |
]. |
|
451 |
self selectionHistoryList:localHistoryList. |
|
452 |
self listOfApplications removeIndex:applIndex. |
|
453 |
self privateTabList removeIndex:applIndex. |
|
454 |
self privateTabList isEmpty ifTrue:[ |
|
455 |
self viewNoteBookApplicationHolder value:false. |
|
456 |
self enableViewNoteBookApplication value:false. |
|
4375 | 457 |
self changeFileBrowserTitleTo:'FileBrowser V2'. |
458 |
||
3892 | 459 |
] ifFalse:[ |
460 |
historyList notEmpty ifTrue:[ |
|
461 |
self selectedEditorPage value:(self selectionHistoryList last). |
|
462 |
] |
|
463 |
] |
|
464 |
]. |
|
465 |
||
466 |
"/ because subCanvas was configured to keep its view, |
|
467 |
"/ we must destroy it here. |
|
3987 | 468 |
aApplication window destroy. |
3892 | 469 |
! |
470 |
||
6484 | 471 |
destroyTab:tabIndex |
472 |
(self listOfApplications at:tabIndex) doClose |
|
473 |
! |
|
474 |
||
5307 | 475 |
doCloseAllApplications |
476 |
| appl | |
|
477 |
||
478 |
(Dialog confirm:(resources string:'Really close all Tabs ?')) ifFalse:[^ self]. |
|
479 |
||
480 |
appl := self listOfApplications copy do:[:eachApp | eachApp doClose.]. |
|
481 |
! |
|
482 |
||
6214 | 483 |
doCloseAllOtherApplications |
484 |
| appl currentApp | |
|
485 |
||
486 |
"/ (Dialog confirm:(resources string:'Really close all Tabs ?')) ifFalse:[^ self]. |
|
487 |
||
488 |
currentApp := self currentTabMenusApplication. |
|
489 |
appl := self listOfApplications copy do: |
|
490 |
[:eachApp | |
|
491 |
eachApp ~~ currentApp ifTrue:[ |
|
492 |
eachApp doClose. |
|
493 |
]. |
|
494 |
] |
|
495 |
! |
|
496 |
||
3892 | 497 |
doCloseApplication |
5324 | 498 |
self currentTabMenusApplication doClose. |
3892 | 499 |
! |
500 |
||
4572 | 501 |
doRenameTab |
502 |
| newLabel | |
|
503 |
||
5335 | 504 |
newLabel := Dialog |
505 |
request:'New Tab Label:' |
|
506 |
initialAnswer:(self privateTabList at:tabMenuIndex). |
|
4572 | 507 |
newLabel size == 0 ifTrue:[^ self ]. |
508 |
self privateTabList at:tabMenuIndex put:newLabel |
|
509 |
! |
|
510 |
||
4045 | 511 |
doSelectInList |
5323 | 512 |
| fileName| |
513 |
||
5324 | 514 |
fileName := self currentTabMenusApplication fileName. |
4045 | 515 |
fileName notNil ifTrue:[ |
516 |
self gotoFile:fileName. |
|
517 |
]. |
|
518 |
! |
|
519 |
||
5010 | 520 |
openApplByFileItem:anItem |
14517
65a293fbfe93
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14516
diff
changeset
|
521 |
"open a new embedded app, or a standard system command (for example pdf reader). |
65a293fbfe93
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14516
diff
changeset
|
522 |
return the new app or nil, if none was embedded. |
65a293fbfe93
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14516
diff
changeset
|
523 |
Uses the default class list for open of applications by item " |
3892 | 524 |
|
5290 | 525 |
| applList applItem itemClass itemType appl| |
3892 | 526 |
|
14516
805d42ab3c16
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14498
diff
changeset
|
527 |
anItem isNil ifTrue:[ ^ nil ]. |
5279 | 528 |
anItem isDirectory ifTrue:[ |
529 |
self warn:'No Application to open for directory:', anItem fileName asString, ' found'. |
|
530 |
^ nil. |
|
531 |
]. |
|
10706
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
532 |
|
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
533 |
self openAlwaysInTextEditor value ifFalse:[ |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
534 |
applList := self applicationList. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
535 |
applItem := applList |
14496
4c671a13ba46
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14462
diff
changeset
|
536 |
detect:[:eachApplItem| |
4c671a13ba46
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14462
diff
changeset
|
537 |
itemClass := self class classFor:eachApplItem. |
10706
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
538 |
(itemClass canOpenItem:anItem). |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
539 |
] ifNone:[nil]. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
540 |
|
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
541 |
applItem notNil ifTrue:[ |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
542 |
itemType := self class typeFor:applItem. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
543 |
itemClass := self class classFor:applItem. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
544 |
Error handle:[:ex | |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
545 |
"/ catching the error, so we can still show text |
17556 | 546 |
('[FileApplication] ignored error: ',ex description,' - showing text') errorPrintCR. |
10706
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
547 |
] do:[ |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
548 |
appl := self openApplicationClass:itemClass withItem:anItem withType:itemType. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
549 |
appl notNil ifTrue:[ ^ appl]. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
550 |
]. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
551 |
]. |
15112
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
552 |
self alwaysUseSmalltalkTools value ifFalse:[ |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
553 |
((anItem fileName mimeTypeOfContents ? '') startsWith:'text') ifFalse:[ |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
554 |
"/ fallback: open a system utility |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
555 |
OperatingSystem |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
556 |
openApplicationForDocument:anItem fileName |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
557 |
operation:#open |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
558 |
mimeType:nil |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
559 |
ifNone:[self openDefaultApplicationByItem:anItem]. |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
560 |
^ nil. |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
561 |
]. |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
562 |
]. |
10706
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
563 |
]. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
564 |
|
9786
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
565 |
^ self openDefaultApplicationByItem:anItem. |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
566 |
|
17556 | 567 |
"Modified: / 22-06-2017 / 18:43:15 / cg" |
3892 | 568 |
! |
569 |
||
5010 | 570 |
openApplicationClass:aClass withItem:anItem withType:aType |
571 |
||
11104
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
572 |
^ self |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
573 |
openApplicationClass:aClass |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
574 |
withItem:anItem |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
575 |
withType:aType |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
576 |
checkExisting:true |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
577 |
|
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
578 |
"Modified (format): / 12-01-2012 / 01:10:50 / cg" |
5010 | 579 |
! |
580 |
||
10922 | 581 |
openApplicationClass:aClass withItem:anItem withType:aType checkExisting:checkExisting |
582 |
^ self |
|
583 |
openApplicationClass:aClass |
|
584 |
withItem:anItem |
|
585 |
withType:aType |
|
586 |
checkExisting:checkExisting |
|
587 |
preSetItem:nil |
|
588 |
||
589 |
"Modified (format): / 29-11-2011 / 19:06:27 / cg" |
|
4620 | 590 |
! |
591 |
||
5010 | 592 |
openApplicationClass:aClass withItem:anItem withType:aType checkExisting:checkExisting preSetItem:aBlock |
4774 | 593 |
|existingAppl newAppl| |
594 |
||
595 |
"do not open unreadable items" |
|
4392 | 596 |
checkExisting ifTrue:[ |
5010 | 597 |
(anItem notNil and:[anItem isDirectory not and:[anItem fileName isReadable not]]) ifTrue:[ |
15489
b7255ae67cff
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15465
diff
changeset
|
598 |
Dialog warn:(resources string:'Can not open unreadable file "%1"' with:anItem fileName baseName). |
9819 | 599 |
AbortOperationRequest raise. |
4392 | 600 |
]. |
5010 | 601 |
existingAppl := self tryToGetExistingApplFor:aClass withItem:anItem withType:aType preSetItem:aBlock. |
4392 | 602 |
existingAppl notNil ifTrue:[ |
603 |
self doSelect:existingAppl. |
|
604 |
^ existingAppl |
|
605 |
]. |
|
3892 | 606 |
]. |
10922 | 607 |
|
3892 | 608 |
newAppl := aClass new. |
5737 | 609 |
newAppl masterApplication:self. |
4620 | 610 |
aBlock notNil ifTrue:[ |
611 |
aBlock value:newAppl. |
|
612 |
]. |
|
3892 | 613 |
newAppl type:aType. |
5737 | 614 |
|
615 |
newAppl isTextEditor ifTrue:[ |
|
616 |
newAppl fileEncoding:(self fileEncodingHolder value). |
|
617 |
newAppl lockFileEncoding:(self lockFileEncodingHolder value). |
|
618 |
]. |
|
5010 | 619 |
(newAppl item:anItem) ifFalse:[ ^ nil ]. |
620 |
(anItem notNil and:[(anItem isDirectory not) and:[aType ~= #directoryDescription]]) ifTrue:[ |
|
9819 | 621 |
self fileHistory addFirst:anItem. |
3892 | 622 |
self enableFileHistory value:true. |
623 |
]. |
|
624 |
self setSameFileIndexFor:newAppl. |
|
625 |
self startApplication:newAppl. |
|
626 |
^ newAppl |
|
10922 | 627 |
|
628 |
"Modified (format): / 29-11-2011 / 19:06:47 / cg" |
|
3892 | 629 |
! |
630 |
||
5010 | 631 |
openDefaultApplicationByItem:anItem |
3892 | 632 |
" open the default application if no application for item is available or the start of the |
633 |
available application failed |
|
634 |
" |
|
635 |
| applItem | |
|
636 |
||
637 |
applItem := self class defaultApplication. |
|
638 |
applItem notNil ifTrue:[ |
|
639 |
| itemType itemClass| |
|
640 |
itemType := self class typeFor:applItem. |
|
641 |
itemClass := self class classFor:applItem. |
|
5010 | 642 |
^ self openApplicationClass:itemClass withItem:anItem withType:itemType. |
3892 | 643 |
]. |
644 |
^ nil |
|
645 |
! |
|
646 |
||
647 |
setSameFileIndexFor:anAppl |
|
648 |
|sameFiles index item| |
|
649 |
||
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6214
diff
changeset
|
650 |
self class openAnotherApplicationOnSameItem ifFalse:[ |
3892 | 651 |
anAppl sameFileIndex:nil. |
652 |
^ self. |
|
653 |
]. |
|
10382
edf3a0e5ea8a
changed: #setSameFileIndexFor:
Claus Gittinger <cg@exept.de>
parents:
9951
diff
changeset
|
654 |
|
3892 | 655 |
item := anAppl item. |
656 |
item notNil ifTrue:[ |
|
657 |
sameFiles := self getSameApplicationsFor:anAppl. |
|
10382
edf3a0e5ea8a
changed: #setSameFileIndexFor:
Claus Gittinger <cg@exept.de>
parents:
9951
diff
changeset
|
658 |
(sameFiles notEmpty) ifTrue:[ |
3892 | 659 |
(sameFiles size == 1 and:[sameFiles first sameFileIndex isNil]) ifTrue:[ |
660 |
anAppl sameFileIndex:1. |
|
661 |
] ifFalse:[ |
|
662 |
index := (sameFiles collect:[:el | (el sameFileIndex ? 1)]) max. |
|
663 |
anAppl sameFileIndex:index + 1. |
|
10382
edf3a0e5ea8a
changed: #setSameFileIndexFor:
Claus Gittinger <cg@exept.de>
parents:
9951
diff
changeset
|
664 |
]. |
edf3a0e5ea8a
changed: #setSameFileIndexFor:
Claus Gittinger <cg@exept.de>
parents:
9951
diff
changeset
|
665 |
^ self |
3892 | 666 |
]. |
667 |
anAppl sameFileIndex:nil. |
|
668 |
]. |
|
10382
edf3a0e5ea8a
changed: #setSameFileIndexFor:
Claus Gittinger <cg@exept.de>
parents:
9951
diff
changeset
|
669 |
|
edf3a0e5ea8a
changed: #setSameFileIndexFor:
Claus Gittinger <cg@exept.de>
parents:
9951
diff
changeset
|
670 |
"Modified (format): / 24-07-2011 / 08:22:03 / cg" |
3892 | 671 |
! |
672 |
||
5007 | 673 |
startApplication:anApplication |
14444
cea130516cc0
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14412
diff
changeset
|
674 |
"start a subapplication in the lower panel (terminal, finder, archive viewer or text editor)" |
cea130516cc0
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14412
diff
changeset
|
675 |
|
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
676 |
| window tabItem iconOrNil| |
3892 | 677 |
|
7582 | 678 |
anApplication window isNil ifTrue:[ |
3892 | 679 |
window := ApplicationSubView new. |
5007 | 680 |
anApplication createBuilder. |
681 |
window client:anApplication. |
|
3892 | 682 |
]. |
5007 | 683 |
self listOfApplications add:anApplication. |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
684 |
|
14839
2be01fe4903c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14836
diff
changeset
|
685 |
tabItem := Text string:(anApplication getTabString). |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
686 |
iconOrNil := anApplication getTabIcon. |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
687 |
iconOrNil notNil ifTrue:[ |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
688 |
tabItem := LabelAndIcon icon:iconOrNil string:tabItem. |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
689 |
]. |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
690 |
self privateTabList add:tabItem. |
3892 | 691 |
self viewNoteBookApplicationHolder value:true. |
692 |
self enableViewNoteBookApplication value:true. |
|
9885 | 693 |
self withWaitCursorDo:[ |
694 |
self doSelect:anApplication. |
|
695 |
]. |
|
14444
cea130516cc0
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14412
diff
changeset
|
696 |
anApplication postOpenWith:anApplication builder. |
3892 | 697 |
! |
698 |
||
15594
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
699 |
tabStringAdd:aString for:anAppl |
3892 | 700 |
| index text stream| |
701 |
||
15594
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
702 |
index := self getIndexFor:anAppl. |
3892 | 703 |
index isNil ifTrue:[ ^ self]. |
704 |
text := self privateTabList at:index. |
|
15594
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
705 |
stream := CharacterWriteStream new. |
15668
aaaddffbefe0
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15594
diff
changeset
|
706 |
stream nextPutAll:text string. |
3892 | 707 |
stream space. |
708 |
stream nextPutAll:aString. |
|
14839
2be01fe4903c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14836
diff
changeset
|
709 |
self privateTabList at:index put:(Text string:(stream contents)). |
3892 | 710 |
! |
711 |
||
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
712 |
tabStringChangeTo:aString for:anAppl |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
713 |
|
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
714 |
| index text tabItem | |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
715 |
|
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
716 |
index := self getIndexFor:anAppl. |
3892 | 717 |
index isNil ifTrue:[ ^ self]. |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
718 |
|
14839
2be01fe4903c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14836
diff
changeset
|
719 |
text := Text string:aString. |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
720 |
|
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
721 |
tabItem := self privateTabList at:index. |
17324 | 722 |
tabItem isLabelAndIcon ifTrue:[ |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
723 |
text := LabelAndIcon icon:(tabItem icon) string:text. |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
724 |
]. |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
725 |
|
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
726 |
self privateTabList at:index put:text. |
4180 | 727 |
self selectedEditorPage value == index ifTrue:[ |
728 |
self changeFileBrowserTitleTo:aString. |
|
729 |
]. |
|
17324 | 730 |
|
731 |
"Modified: / 04-02-2017 / 22:11:05 / cg" |
|
3892 | 732 |
! |
733 |
||
5010 | 734 |
tryToGetExistingApplFor:aClass withItem:anItem withType:aType preSetItem:aBlock |
4549 | 735 |
| sameAppls changeAppl selAppl| |
3892 | 736 |
|
737 |
aClass wantNewApplicationAnyway ifTrue:[^ nil]. |
|
4549 | 738 |
sameAppls := self getAllApplicationsByClass:aClass andType:aType. |
739 |
sameAppls isEmpty ifTrue:[^ nil]. |
|
3892 | 740 |
((aType == #directoryDescription) or:[aType == #commandResult]) ifTrue:[ |
4549 | 741 |
"/ sameAppls := sameAppl first. |
3892 | 742 |
] ifFalse:[ |
743 |
(self openMultipleApplicationsForType value) ifTrue:[ |
|
744 |
"/ open more than one application for a class and a type |
|
745 |
(self class openAnotherApplicationOnSameItem) ifTrue:[ |
|
746 |
"/ open a new application anyway, no matters if item already open |
|
747 |
^ nil |
|
748 |
] ifFalse:[ |
|
749 |
"/ if item already changed select the application |
|
10922 | 750 |
selAppl := sameAppls detect:[:appl | (appl item = anItem) ] ifNone:[nil]. |
3892 | 751 |
]. |
752 |
] ifFalse:[ |
|
753 |
"/ keep in same application change the first application of the same class and type - if item not changed otherwise open new |
|
12830
7c993d3f4519
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12480
diff
changeset
|
754 |
sameAppls := sameAppls reject:[:appl | appl isModified ]. |
3892 | 755 |
]. |
756 |
]. |
|
4393 | 757 |
sameAppls size ~~ 0 ifTrue:[ |
4392 | 758 |
" take first all applications which have nil items |
759 |
second the selected |
|
760 |
third the first |
|
761 |
" |
|
762 |
| nilItemAppls | |
|
10922 | 763 |
|
4392 | 764 |
nilItemAppls := sameAppls select:[:appl| appl item == nil ]. |
765 |
nilItemAppls notEmpty ifTrue:[sameAppls := nilItemAppls]. |
|
766 |
(sameAppls includes:self selectedApplication) ifTrue:[ |
|
767 |
changeAppl := self selectedApplication. |
|
768 |
] ifFalse:[ |
|
769 |
changeAppl := sameAppls first. |
|
770 |
]. |
|
4620 | 771 |
aBlock notNil ifTrue:[ |
772 |
aBlock value:changeAppl. |
|
773 |
]. |
|
5459 | 774 |
changeAppl type:aType. |
5010 | 775 |
self changeItem:anItem for:changeAppl. |
3892 | 776 |
selAppl := changeAppl. |
777 |
]. |
|
778 |
^ selAppl. |
|
10922 | 779 |
|
780 |
"Modified (format): / 29-11-2011 / 19:07:57 / cg" |
|
3892 | 781 |
! ! |
782 |
||
783 |
!FileApplicationNoteBook methodsFor:'actions-app-spec'! |
|
784 |
||
4774 | 785 |
addTerminalIn:aDirectory |
786 |
|item| |
|
787 |
||
788 |
item := DirectoryContentsBrowser itemClass fileName:aDirectory. |
|
789 |
self openTerminalApplication:item. |
|
790 |
! |
|
791 |
||
3892 | 792 |
changeDirectoryDescription |
17745 | 793 |
(self getInfoItem) isNil ifTrue:[ |
794 |
^ self closeDirectoryDescription |
|
795 |
]. |
|
3892 | 796 |
self openDirectoryDescription. |
17745 | 797 |
|
798 |
"Modified: / 12-11-2017 / 11:19:10 / cg" |
|
3892 | 799 |
! |
800 |
||
5307 | 801 |
closeAllApplicationsEnabled |
802 |
^ tabList value size > 1 |
|
803 |
! |
|
804 |
||
3892 | 805 |
closeDirectoryDescription |
17745 | 806 |
|dirContApll| |
3892 | 807 |
|
808 |
dirContApll := self getApplicationByType:#directoryDescription. |
|
809 |
dirContApll notNil ifTrue:[ |
|
810 |
dirContApll doClose. |
|
811 |
]. |
|
17745 | 812 |
|
813 |
"Modified (format): / 12-11-2017 / 11:18:40 / cg" |
|
3892 | 814 |
! |
815 |
||
10922 | 816 |
doAddArchiverOn:aFilename |
817 |
|item| |
|
818 |
||
819 |
item := DirectoryContentsBrowser itemClass fileName:aFilename. |
|
820 |
self openArchiveViewApplication:item. |
|
821 |
||
822 |
"Created: / 29-11-2011 / 19:05:49 / cg" |
|
823 |
! |
|
824 |
||
4392 | 825 |
newTextEditor |
17745 | 826 |
^ self |
827 |
openApplicationClass:TextEditor |
|
828 |
withItem:nil |
|
829 |
withType:#file |
|
830 |
checkExisting:false |
|
831 |
||
832 |
"Modified (format): / 12-11-2017 / 11:18:35 / cg" |
|
833 |
! |
|
834 |
||
835 |
openArchiveViewApplication:anItem |
|
836 |
|result| |
|
837 |
||
838 |
result := self |
|
839 |
openApplicationClass:ArchiveViewApplication |
|
840 |
withItem:anItem |
|
841 |
withType:nil. |
|
3892 | 842 |
result isNil ifTrue:[ |
17745 | 843 |
Dialog warn:'file type of ' , anItem fileName baseName , ' not yet supported'. |
3892 | 844 |
^ self. |
845 |
]. |
|
10922 | 846 |
|
17745 | 847 |
"Modified (format): / 12-11-2017 / 11:18:31 / cg" |
3892 | 848 |
! |
849 |
||
850 |
openCommandResultApplication |
|
17745 | 851 |
^ self |
852 |
openApplicationClass:CommandResult |
|
853 |
withItem:nil |
|
854 |
withType:#commandResult |
|
855 |
||
856 |
"Modified (format): / 12-11-2017 / 11:18:19 / cg" |
|
3892 | 857 |
! |
858 |
||
11104
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
859 |
openCompareDirectory:directory1 with:directory2 |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
860 |
|newAppl| |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
861 |
|
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
862 |
newAppl := DirectoryDifferenceViewApplication new. |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
863 |
newAppl masterApplication:self. |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
864 |
newAppl directory1:directory1 directory2:directory2. |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
865 |
|
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
866 |
self setSameFileIndexFor:newAppl. |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
867 |
self startApplication:newAppl. |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
868 |
^ newAppl |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
869 |
|
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
870 |
"Created: / 12-01-2012 / 01:10:05 / cg" |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
871 |
! |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
872 |
|
3892 | 873 |
openDirectoryDescription |
874 |
||
875 |
| appl aInfoItem| |
|
876 |
||
877 |
aInfoItem := self getInfoItem. |
|
878 |
aInfoItem notNil ifTrue:[ |
|
879 |
appl := self openTextEditorOn:aInfoItem type:#directoryDescription. |
|
880 |
]. |
|
881 |
! |
|
882 |
||
5010 | 883 |
openNewTextEditorOn:anItem |
17745 | 884 |
^ self |
885 |
openApplicationClass:TextEditor |
|
886 |
withItem:anItem |
|
887 |
withType:#file |
|
888 |
checkExisting:false. |
|
889 |
||
890 |
"Modified (format): / 12-11-2017 / 11:18:11 / cg" |
|
5010 | 891 |
! |
892 |
||
893 |
openSearchFileOn:anItem |
|
894 |
||
11104
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
895 |
^ self |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
896 |
openApplicationClass:FindFileApplication |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
897 |
withItem:anItem |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
898 |
withType:nil |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
899 |
checkExisting:false |
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
900 |
|
6f9259e46cb0
added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents:
11099
diff
changeset
|
901 |
"Modified (format): / 12-01-2012 / 01:02:30 / cg" |
5010 | 902 |
! |
903 |
||
904 |
openTerminalApplication:anItem |
|
905 |
||
906 |
^ self openApplicationClass:Terminal withItem:anItem withType:nil |
|
3892 | 907 |
! |
908 |
||
4392 | 909 |
openTextEditor |
910 |
||
911 |
^ self openTextEditorOn:nil |
|
912 |
! |
|
913 |
||
4146
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
914 |
openTextEditorForFile:aFilename |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
915 |
|
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
916 |
^ 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
|
917 |
! |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
918 |
|
5010 | 919 |
openTextEditorOn:anItem |
920 |
||
921 |
^ self openTextEditorOn:anItem type:#file |
|
922 |
! |
|
923 |
||
924 |
openTextEditorOn:anItem type:aDirDescrOrFile |
|
925 |
||
926 |
^ self openApplicationClass:TextEditor withItem:anItem withType:aDirDescrOrFile |
|
927 |
! |
|
928 |
||
929 |
openTextEditorWithHexPresentationOn:anItem |
|
4620 | 930 |
|
17745 | 931 |
^ self |
932 |
openApplicationClass:TextEditor |
|
933 |
withItem:anItem |
|
934 |
withType:#file |
|
935 |
checkExisting:true |
|
936 |
preSetItem:[:aTextEditor | aTextEditor presentation:#hexDump]. |
|
937 |
||
938 |
"Modified (format): / 12-11-2017 / 11:18:06 / cg" |
|
3892 | 939 |
! ! |
940 |
||
941 |
!FileApplicationNoteBook methodsFor:'applicationlist access'! |
|
942 |
||
943 |
applicationList |
|
944 |
^ self class applicationList |
|
945 |
! ! |
|
946 |
||
947 |
!FileApplicationNoteBook methodsFor:'aspects'! |
|
948 |
||
949 |
canvasHolder |
|
950 |
||
951 |
canvasHolder isNil ifTrue:[ |
|
952 |
canvasHolder := ValueHolder new. |
|
5120 | 953 |
canvasHolder addDependent:self. |
3892 | 954 |
]. |
955 |
^ canvasHolder. |
|
956 |
! |
|
957 |
||
5120 | 958 |
cursorColLabelHolder |
959 |
^ self |
|
960 |
aspectFor:#cursorColLabelHolder |
|
961 |
ifAbsent:[ |
|
962 |
IndirectValue for:(' ' asValue) |
|
963 |
] |
|
964 |
! |
|
965 |
||
15821
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
966 |
cursorLineAndColumnLabelHolder |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
967 |
^ self |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
968 |
aspectFor:#cursorLineAndColumnLabelHolder |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
969 |
ifAbsent:[ |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
970 |
IndirectValue for:(' ' asValue) |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
971 |
] |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
972 |
! |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
973 |
|
5120 | 974 |
cursorLineLabelHolder |
975 |
^ self |
|
976 |
aspectFor:#cursorLineLabelHolder |
|
977 |
ifAbsent:[ |
|
978 |
IndirectValue for:(' ' asValue) |
|
979 |
] |
|
980 |
! |
|
981 |
||
5528 | 982 |
fileEncodingHolder |
983 |
^ self |
|
984 |
aspectFor:#fileEncodingHolder |
|
985 |
ifAbsent:[ |
|
5567 | 986 |
IndirectValue for:('iso8859-1' asValue) |
5528 | 987 |
] |
988 |
! |
|
989 |
||
11056 | 990 |
inputTabColumnConversionHolder |
991 |
^ self |
|
992 |
aspectFor:#inputTabColumnConversionHolder |
|
993 |
ifAbsent:[ |
|
994 |
IndirectValue for:(8 asValue) |
|
995 |
] |
|
996 |
||
997 |
"Created: / 06-01-2012 / 15:26:32 / cg" |
|
998 |
! |
|
999 |
||
1000 |
lineEndConventionHolder |
|
1001 |
^ self |
|
1002 |
aspectFor:#lineEndConventionHolder |
|
1003 |
ifAbsent:[ |
|
15209
f7f21b82d7eb
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15112
diff
changeset
|
1004 |
IndirectValue for:(#'nl' asValue) |
11056 | 1005 |
] |
1006 |
||
1007 |
"Created: / 06-01-2012 / 13:03:24 / cg" |
|
1008 |
! |
|
1009 |
||
5737 | 1010 |
lockFileEncodingHolder |
1011 |
^ self |
|
1012 |
aspectFor:#lockFileEncodingHolder |
|
1013 |
ifAbsent:[ |
|
1014 |
IndirectValue for:(false asValue) |
|
1015 |
] |
|
1016 |
! |
|
1017 |
||
5120 | 1018 |
modeLabelHolder |
1019 |
^ self |
|
1020 |
aspectFor:#modeLabelHolder |
|
1021 |
ifAbsent:[ |
|
1022 |
IndirectValue for:(' ' asValue) |
|
1023 |
] |
|
1024 |
! |
|
1025 |
||
7103 | 1026 |
modeLabelMenu |
1027 |
|app| |
|
1028 |
||
1029 |
(app := self selectedApplication) notNil ifTrue:[ |
|
1030 |
^ app modeLabelMenu |
|
1031 |
]. |
|
1032 |
^ nil |
|
1033 |
||
1034 |
"Created: / 11-09-2006 / 12:33:27 / cg" |
|
1035 |
! |
|
1036 |
||
1037 |
modeLabelMenuHolder |
|
1038 |
^ self |
|
1039 |
aspectFor:#modeLabelMenuHolder |
|
1040 |
ifAbsent:[ |
|
1041 |
IndirectValue for:(nil asValue) |
|
1042 |
] |
|
1043 |
||
1044 |
"Created: / 11-09-2006 / 12:28:08 / cg" |
|
1045 |
! |
|
1046 |
||
3892 | 1047 |
privateTabList |
1048 |
||
1049 |
privateTabList isNil ifTrue:[ |
|
1050 |
privateTabList := List new. |
|
1051 |
privateTabList addDependent:self. |
|
1052 |
]. |
|
1053 |
^ privateTabList. |
|
1054 |
! |
|
1055 |
||
1056 |
selectedEditorPage |
|
1057 |
||
1058 |
selectedEditorPage isNil ifTrue:[ |
|
1059 |
selectedEditorPage := ValueHolder new. |
|
1060 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
1061 |
selectedEditorPage addDependent:self. |
|
1062 |
"/ selectedEditorPage onChangeSend:#selectedEditorPageChanged to:self. |
|
1063 |
]. |
|
1064 |
^ selectedEditorPage. |
|
1065 |
! |
|
1066 |
||
1067 |
tabList |
|
1068 |
||
1069 |
tabList isNil ifTrue:[ |
|
1070 |
tabList := (List new) asValue. |
|
1071 |
]. |
|
1072 |
^ tabList. |
|
1073 |
! |
|
1074 |
||
1075 |
tabList:aValue |
|
1076 |
||
1077 |
tabList := aValue. |
|
1078 |
! ! |
|
1079 |
||
1080 |
!FileApplicationNoteBook methodsFor:'change & update'! |
|
1081 |
||
5120 | 1082 |
canvasChanged |
1083 |
"invoked when the contentsView has been changed" |
|
1084 |
||
1085 |
|app| |
|
1086 |
||
7103 | 1087 |
app := self selectedApplication. |
5120 | 1088 |
|
1089 |
self cursorLineLabelHolder valueHolder: (app cursorLineLabelHolder). |
|
1090 |
self cursorColLabelHolder valueHolder: (app cursorColLabelHolder). |
|
15821
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
1091 |
self cursorLineAndColumnLabelHolder valueHolder: (app cursorLineAndColumnLabelHolder). |
5120 | 1092 |
self modeLabelHolder valueHolder: (app modeLabelHolder). |
5528 | 1093 |
self fileEncodingHolder valueHolder: (app fileEncodingHolder). |
7288 | 1094 |
|
1095 |
app lockFileEncodingHolder isBoolean ifTrue:[ |
|
8366 | 1096 |
self breakPoint:#cg |
7288 | 1097 |
] ifFalse:[ |
1098 |
self lockFileEncodingHolder valueHolder: (app lockFileEncodingHolder). |
|
1099 |
]. |
|
7103 | 1100 |
|
1101 |
"Modified: / 11-09-2006 / 12:44:07 / cg" |
|
5120 | 1102 |
! |
1103 |
||
3892 | 1104 |
update:something with:aParameter from:changedObject |
4071 | 1105 |
| appl sel| |
3892 | 1106 |
|
5120 | 1107 |
changedObject == canvasHolder ifTrue:[ |
1108 |
self canvasChanged. |
|
1109 |
^ self. |
|
1110 |
]. |
|
3892 | 1111 |
changedObject == self currentDirectories ifTrue:[ |
1112 |
self viewDirectoryDescription value ifTrue:[ |
|
1113 |
self changeDirectoryDescription. |
|
1114 |
]. |
|
1115 |
^ self. |
|
1116 |
]. |
|
1117 |
changedObject == self viewDirectoryDescription ifTrue:[ |
|
4071 | 1118 |
self viewDirectoryDescriptionChanged. |
3892 | 1119 |
^ self. |
1120 |
]. |
|
1121 |
changedObject == self privateTabList ifTrue:[ |
|
1122 |
| privateListOfTabs | |
|
1123 |
privateListOfTabs := changedObject. |
|
1124 |
privateListOfTabs size > 1 ifTrue:[ |
|
1125 |
self tabList value:privateListOfTabs. |
|
1126 |
self tabList changed. |
|
1127 |
] ifFalse:[ |
|
1128 |
self tabList value:nil. |
|
1129 |
]. |
|
1130 |
^ self |
|
1131 |
]. |
|
1132 |
changedObject == self selectedEditorPage ifTrue:[ |
|
1133 |
| listOfEdits indexOfLastSel list | |
|
1134 |
||
1135 |
sel := changedObject value. |
|
17031 | 1136 |
"/ don't want the tabs with one application - that's why i have to change my tablist |
3892 | 1137 |
"/ sel goes to if - i want select the last selection |
1138 |
sel = 0 ifTrue:[ |
|
1139 |
^ self. |
|
1140 |
]. |
|
1141 |
list := self selectionHistoryList. |
|
1142 |
(list includes:sel) ifTrue:[ |
|
1143 |
list remove:sel |
|
1144 |
]. |
|
1145 |
list add:sel. |
|
1146 |
self selectionHistoryList:list. |
|
1147 |
appl := self listOfApplications at:sel. |
|
1148 |
self doSelect:appl. |
|
1149 |
]. |
|
1150 |
||
1151 |
^ super update:something with:aParameter from:changedObject |
|
4071 | 1152 |
! |
1153 |
||
1154 |
viewDirectoryDescriptionChanged |
|
1155 |
||
1156 |
||
1157 |
|viewDirDescr| |
|
1158 |
||
1159 |
viewDirDescr := self viewDirectoryDescription value. |
|
1160 |
viewDirDescr ifTrue:[ |
|
1161 |
self openDirectoryDescription. |
|
1162 |
] ifFalse:[ |
|
1163 |
self closeDirectoryDescription. |
|
1164 |
]. |
|
1165 |
^ self. |
|
3892 | 1166 |
! ! |
1167 |
||
1168 |
!FileApplicationNoteBook methodsFor:'menu & actions'! |
|
1169 |
||
11099 | 1170 |
destroyTabAt:idx |
1171 |
|app| |
|
1172 |
||
1173 |
app := listOfApplications at:idx. |
|
1174 |
self closeSubCanvas:app. |
|
1175 |
app release. |
|
1176 |
||
1177 |
"Created: / 11-01-2012 / 23:46:09 / cg" |
|
1178 |
! |
|
1179 |
||
3892 | 1180 |
tabMenuAt:aTab |
1181 |
|menu| |
|
1182 |
||
7765 | 1183 |
menu := Menu decodeFromLiteralArray:self class tabMenu. |
3892 | 1184 |
tabMenuIndex := aTab. |
7765 | 1185 |
menu findGuiResourcesIn:self. |
3892 | 1186 |
^ menu |
7765 | 1187 |
|
1188 |
"Modified: / 27-03-2007 / 10:57:25 / cg" |
|
3892 | 1189 |
! ! |
1190 |
||
1191 |
!FileApplicationNoteBook methodsFor:'queries'! |
|
1192 |
||
1193 |
getSameFilesModifiedFor:aAppl |
|
1194 |
||
1195 |
| sameFileAppl colOfChanged | |
|
1196 |
||
1197 |
sameFileAppl := self getSameApplicationsFor:aAppl. |
|
1198 |
sameFileAppl notEmpty ifTrue:[ |
|
1199 |
colOfChanged := OrderedCollection new. |
|
1200 |
sameFileAppl do:[ : el | |
|
1201 |
el modifiedChannel value ifTrue:[ |
|
1202 |
colOfChanged add:el. |
|
1203 |
] |
|
1204 |
] |
|
1205 |
]. |
|
1206 |
^ colOfChanged |
|
1207 |
! ! |
|
1208 |
||
1209 |
!FileApplicationNoteBook methodsFor:'selection'! |
|
1210 |
||
5324 | 1211 |
currentTabMenusApplication |
1212 |
"only valid within menu processing" |
|
1213 |
||
1214 |
^ self listOfApplications at:tabMenuIndex |
|
1215 |
! |
|
1216 |
||
3892 | 1217 |
doSelect:anAppl |
1218 |
||
7467 | 1219 |
| index fileName additionalInfo| |
3892 | 1220 |
|
1221 |
fileName := anAppl fileName. |
|
4161 | 1222 |
index := self getIndexFor:anAppl. |
4180 | 1223 |
self changeFileBrowserTitleTo:(self privateTabList at:index ifAbsent:nil). |
4523 | 1224 |
|
7467 | 1225 |
additionalInfo := anAppl additionalInfo. |
1226 |
self notify:(fileName isNil |
|
1227 |
ifTrue:[additionalInfo] |
|
1228 |
ifFalse:[(fileName asString contractAtBeginningTo:80),' ',additionalInfo]). |
|
3982 | 1229 |
"/ self gotoFile:fileName. |
3892 | 1230 |
index notNil ifTrue:[ |
1231 |
canvasHolder value:(anAppl window). |
|
1232 |
self selectedEditorPage value:index. |
|
1233 |
] |
|
7467 | 1234 |
|
1235 |
"Modified: / 24-10-2006 / 12:32:53 / cg" |
|
4392 | 1236 |
! |
1237 |
||
1238 |
selectedApplication |
|
5324 | 1239 |
| canvas | |
1240 |
||
1241 |
canvas := self canvasHolder value. |
|
1242 |
canvas isNil ifTrue:[ ^ nil]. |
|
1243 |
^ canvas application. |
|
3892 | 1244 |
! ! |
1245 |
||
1246 |
!FileApplicationNoteBook methodsFor:'startup & release'! |
|
1247 |
||
3954 | 1248 |
closeRequest |
6626 | 1249 |
"asks for permission before closing" |
3954 | 1250 |
|
4082 | 1251 |
self tryCloseApplications ifTrue:[ |
1252 |
super closeRequest. |
|
1253 |
^ true |
|
3954 | 1254 |
]. |
4082 | 1255 |
^ false. |
3954 | 1256 |
! |
1257 |
||
3892 | 1258 |
makeDependent |
1259 |
||
1260 |
self viewDirectoryDescription addDependent:self. |
|
1261 |
self currentDirectories addDependent:self. |
|
1262 |
! |
|
1263 |
||
1264 |
postOpenAsSubcanvasWith:aBuilder |
|
1265 |
||
4071 | 1266 |
self viewDirectoryDescriptionChanged. |
14444
cea130516cc0
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14412
diff
changeset
|
1267 |
super postOpenAsSubcanvasWith:aBuilder. |
3892 | 1268 |
! |
1269 |
||
1270 |
postOpenWith:aBuilder |
|
6626 | 1271 |
"only invoked if the application not started from a master" |
1272 |
||
3982 | 1273 |
self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:(Filename homeDirectory construct:'.bashrc')). |
6626 | 1274 |
super postOpenWith:aBuilder |
3892 | 1275 |
! |
1276 |
||
1277 |
preBuildWith:aBuilder |
|
1278 |
||
1279 |
self masterApplication isNil ifTrue:[ |
|
1280 |
self masterApplication:nil. |
|
1281 |
]. |
|
14444
cea130516cc0
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14412
diff
changeset
|
1282 |
super preBuildWith:aBuilder. |
4082 | 1283 |
! |
1284 |
||
1285 |
tryCloseApplications |
|
1286 |
||
1287 |
self listOfApplications do:[:appl| |
|
5197 | 1288 |
appl doClose ifFalse:[ |
4082 | 1289 |
^ false. |
1290 |
]. |
|
1291 |
]. |
|
1292 |
^ true |
|
3892 | 1293 |
! ! |
1294 |
||
1295 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'defaults'! |
|
1296 |
||
1297 |
tabStringFor:aApplicationType |
|
7687 | 1298 |
"the formatString shown in a tab (language translated)" |
1299 |
||
1300 |
^ 'Archive %1' |
|
1301 |
||
1302 |
"Modified: / 01-03-2007 / 21:43:13 / cg" |
|
3892 | 1303 |
! ! |
1304 |
||
4392 | 1305 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'help specs'! |
1306 |
||
1307 |
helpSpec |
|
1308 |
"This resource specification was automatically generated |
|
1309 |
by the UIHelpTool of ST/X." |
|
1310 |
||
1311 |
"Do not manually edit this!! If it is corrupted, |
|
1312 |
the UIHelpTool may not be able to read the specification." |
|
1313 |
||
1314 |
" |
|
1315 |
UIHelpTool openOnClass:FileApplicationNoteBook::ArchiveViewApplication |
|
1316 |
" |
|
1317 |
||
1318 |
<resource: #help> |
|
1319 |
||
1320 |
^super helpSpec addPairsFrom:#( |
|
1321 |
||
17900 | 1322 |
#closeTabButton |
1323 |
'Close Archiver Tab' |
|
1324 |
||
4392 | 1325 |
#closeButton |
1326 |
'Close Archiver' |
|
1327 |
||
1328 |
#extractItem |
|
1329 |
'Extract...' |
|
1330 |
||
1331 |
#removeOutputButton |
|
1332 |
'Remove Error Output' |
|
1333 |
||
1334 |
#stopButton |
|
1335 |
'Stop' |
|
1336 |
||
1337 |
) |
|
1338 |
! ! |
|
1339 |
||
3892 | 1340 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'image specs'! |
1341 |
||
4392 | 1342 |
extract28x28Icon |
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1343 |
<resource: #image> |
4392 | 1344 |
"This resource specification was automatically generated |
1345 |
by the ImageEditor of ST/X." |
|
1346 |
"Do not manually edit this!! If it is corrupted, |
|
1347 |
the ImageEditor may not be able to read the specification." |
|
1348 |
" |
|
1349 |
self extract28x28Icon inspect |
|
1350 |
ImageEditor openOnClass:self andSelector:#extract28x28Icon |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1351 |
Icon flushCachedIcons" |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1352 |
|
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1353 |
^ Icon |
4392 | 1354 |
constantNamed:#'FileApplicationNoteBook::ArchiveViewApplication class extract28x28Icon' |
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1355 |
ifAbsentPut:[ |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1356 |
(Depth4Image new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1357 |
width:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1358 |
height:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1359 |
photometric:(#palette); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1360 |
bitsPerSample:(#( 4 )); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1361 |
samplesPerPixel:(1); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1362 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1363 |
fromPackedString:' |
4392 | 1364 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
1365 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@3L3L3L@@@@@@@@@@@@CQDMDP0@@@@@EUUAP@@L3L3L3@@@ @PUUTA@@@4QCQDL@@BHAAUUPD@@CL3L3L"H"H"DEUU |
|
1366 |
@P@@MDP4QBH"H"H @@@A@@@3L3L3H"H"H!!DQDQD@@CQDMDP0@@H DP@@@P@@L3L3L3@@@ @Q@ETA@@@4QCQDL@@@@AD@UPD@@CL3L3L0@@@@@@@@@@@@MDP4 |
|
1367 |
QC@@@@@@@@@@@@@3L3L3L@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1368 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1369 |
colorMapFromArray:#[ 0 0 0 129 129 129 255 0 0 255 255 255 105 133 190 194 194 194 ]; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1370 |
mask:((ImageMask new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1371 |
width:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1372 |
height:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1373 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1374 |
fromPackedString:' |
4392 | 1375 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@G?0@@A?<G? _?A?8G?1_>A?<_? _???8G???>A???? _?G?8G?1_>A?<G? _?@?0G?0@@A?<@@@_?@@@@@@ |
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1376 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1377 |
yourself); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1378 |
yourself |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1379 |
] |
4392 | 1380 |
! |
1381 |
||
1382 |
removeBug28x28Icon |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1383 |
<resource: #image> |
4392 | 1384 |
"This resource specification was automatically generated |
1385 |
by the ImageEditor of ST/X." |
|
1386 |
"Do not manually edit this!! If it is corrupted, |
|
1387 |
the ImageEditor may not be able to read the specification." |
|
1388 |
" |
|
1389 |
self removeBug28x28Icon inspect |
|
1390 |
ImageEditor openOnClass:self andSelector:#removeBug28x28Icon |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1391 |
Icon flushCachedIcons" |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1392 |
|
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1393 |
^ Icon |
4392 | 1394 |
constantNamed:#'FileApplicationNoteBook::ArchiveViewApplication class removeBug28x28Icon' |
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1395 |
ifAbsentPut:[ |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1396 |
(Depth2Image new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1397 |
width:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1398 |
height:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1399 |
photometric:(#palette); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1400 |
bitsPerSample:(#( 2 )); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1401 |
samplesPerPixel:(1); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1402 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1403 |
fromPackedString:' |
4392 | 1404 |
UUUUUUUUT@@@@@@@@@@@@@@@@@@@B*@@@@@J(@J(@@@@J(@@* @@@J(@@B*@@@J(@@@J(@@J(@@@@* @J(@@@@B(@J+0@@@@J :*+@@@@B*:**,@@@O***** |
1405 |
0@@C:****,@@@N**@@@@@@O*****0@@@>+***<@@@B(N*?0@@@B*@J+0@@@B*@@* @@@B*@@B*@@@B*@@@J(@@B*@@@@* @B*@@@@B*@B*@@@@@J(@@@@@@@ |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1406 |
@@@@@@@@@@@@@@@@@@@@@@@a'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1407 |
colorMapFromArray:#[ 0 0 0 192 192 192 255 0 0 128 0 0 ]; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1408 |
mask:((ImageMask new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1409 |
width:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1410 |
height:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1411 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1412 |
fromPackedString:' |
4392 | 1413 |
@@@@@@@@@@@@@@@@O@@C0A8@A8@O@@<@A80^@@O#O0@A>_1@@N/>@@A??0@@??>@G??? BG??8@A??>@G??? @???8@@_?<@@O/>@@G9?D@C83<@A80^@@<@ |
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1414 |
C0@^@@^@O@@C0@@@@@@@@@@@@@@@@@@a'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1415 |
yourself); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1416 |
yourself |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1417 |
] |
4392 | 1418 |
! |
1419 |
||
3892 | 1420 |
removeError |
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1421 |
<resource: #image> |
3892 | 1422 |
"This resource specification was automatically generated |
1423 |
by the ImageEditor of ST/X." |
|
1424 |
"Do not manually edit this!! If it is corrupted, |
|
1425 |
the ImageEditor may not be able to read the specification." |
|
1426 |
" |
|
1427 |
self removeError inspect |
|
1428 |
ImageEditor openOnClass:self andSelector:#removeError |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1429 |
Icon flushCachedIcons" |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1430 |
|
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1431 |
^ Icon |
3892 | 1432 |
constantNamed:#'FileApplicationNoteBook::ArchiveViewApplication class removeError' |
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1433 |
ifAbsentPut:[ |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1434 |
(Depth8Image new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1435 |
width:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1436 |
height:22; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1437 |
photometric:(#palette); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1438 |
bitsPerSample:(#( 8 )); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1439 |
samplesPerPixel:(1); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1440 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1441 |
fromPackedString:' |
3892 | 1442 |
@@@@@@@@@@@FA @@@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@@@A X@@@XF@@@@@@@@@@@@@@@@@@@@@@@@ |
1443 |
@@@@@@@FA XF@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@XFA X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@XF |
|
1444 |
@@@FA @@@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@@@A X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
1445 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
1446 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
1447 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1448 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1449 |
colorMapFromArray:#[ 0 0 0 8 4 8 105 133 190 121 133 157 129 129 129 194 194 194 255 0 0 ]; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1450 |
mask:((ImageMask new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1451 |
width:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1452 |
height:22; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1453 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1454 |
fromPackedString:'@LC@@@A!! @@@L0@@@A8@@@@L@@@@G @@@CL@@@A!! @@@0L@@@@@@@BY=5LAIUUT S5UU8D!!UUPAFU\#@@@@@@@LR9@@D)J @A:R(@@P$*@@CIN @@@@@@@@@a'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1455 |
yourself); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1456 |
yourself |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1457 |
] |
3892 | 1458 |
! ! |
1459 |
||
1460 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'interface specs'! |
|
1461 |
||
1462 |
windowSpec |
|
1463 |
"This resource specification was automatically generated |
|
1464 |
by the UIPainter of ST/X." |
|
1465 |
||
1466 |
"Do not manually edit this!! If it is corrupted, |
|
1467 |
the UIPainter may not be able to read the specification." |
|
1468 |
||
1469 |
" |
|
3951 | 1470 |
UIPainter new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#windowSpec |
1471 |
FileApplicationNoteBook::ArchiveViewApplication new openInterface:#windowSpec |
|
1472 |
FileApplicationNoteBook::ArchiveViewApplication open |
|
3892 | 1473 |
" |
1474 |
||
1475 |
<resource: #canvas> |
|
1476 |
||
1477 |
^ |
|
1478 |
#(#FullSpec |
|
1479 |
#name: #windowSpec |
|
1480 |
#window: |
|
1481 |
#(#WindowSpec |
|
1482 |
#label: 'Archive Application' |
|
1483 |
#name: 'Archive Application' |
|
1484 |
#min: #(#Point 10 10) |
|
4803 | 1485 |
#bounds: #(#Rectangle 16 46 692 538) |
3892 | 1486 |
#menu: #mainMenu |
1487 |
) |
|
1488 |
#component: |
|
1489 |
#(#SpecCollection |
|
1490 |
#collection: #( |
|
1491 |
#(#MenuPanelSpec |
|
4261 | 1492 |
#name: 'MenuArchive' |
3892 | 1493 |
#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
|
1494 |
#level: 0 |
3892 | 1495 |
#menu: #menu |
1496 |
#textDefault: true |
|
1497 |
) |
|
1498 |
#(#'FileBrowserV2UISpecifications::PanelSpec' |
|
1499 |
#name: 'VerticalPanel' |
|
1500 |
#layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0) |
|
4803 | 1501 |
#level: 0 |
3892 | 1502 |
#whichView: #last |
1503 |
#orientation: #vertical |
|
1504 |
#visibility: #errorListVisibilityHolder |
|
1505 |
#component: |
|
1506 |
#(#SpecCollection |
|
1507 |
#collection: #( |
|
1508 |
#(#DataSetSpec |
|
1509 |
#name: 'Table1' |
|
1510 |
#model: #selectionHolder |
|
1511 |
#menu: #fileListMenu |
|
1512 |
#hasHorizontalScrollBar: true |
|
1513 |
#hasVerticalScrollBar: true |
|
1514 |
#dataList: #archiveFileList |
|
1515 |
#useIndex: false |
|
1516 |
#has3Dsepartors: false |
|
1517 |
#doubleClickSelector: #dblClick |
|
1518 |
#columnHolder: #tableColumns |
|
1519 |
#multipleSelectOk: true |
|
1520 |
#verticalSpacing: 0 |
|
1521 |
#postBuildCallback: #postBuildFileTable: |
|
1522 |
#properties: |
|
1523 |
#(#PropertyListDictionary |
|
4803 | 1524 |
#enterSelector: #dropEnter: |
3892 | 1525 |
#dragArgument: #archivApplication |
1526 |
#startDragSelector: #doStartDrag:in: |
|
1527 |
#displayObjectSelector: #getDisplayObjects: |
|
1528 |
#dropObjectSelector: #getDropObjects: |
|
4392 | 1529 |
#overSelector: nil |
3892 | 1530 |
#dropArgument: #archivApplication |
3951 | 1531 |
#canDropSelector: #canDrop: |
1532 |
#leaveSelector: #dropLeave: |
|
4803 | 1533 |
#dropSelector: #doDrop: |
3892 | 1534 |
) |
1535 |
) |
|
1536 |
#(#SequenceViewSpec |
|
1537 |
#name: 'ErrorList' |
|
1538 |
#initiallyDisabled: true |
|
1539 |
#hasHorizontalScrollBar: true |
|
1540 |
#hasVerticalScrollBar: true |
|
1541 |
#backgroundColor: #(#Color 100.0 100.0 100.0) |
|
1542 |
#isMultiSelect: true |
|
1543 |
#useIndex: false |
|
1544 |
#sequenceList: #errorListHolder |
|
1545 |
) |
|
1546 |
) |
|
1547 |
||
1548 |
) |
|
1549 |
#handles: #(#Any 0.5 1.0) |
|
1550 |
) |
|
1551 |
) |
|
1552 |
||
1553 |
) |
|
1554 |
) |
|
1555 |
! ! |
|
1556 |
||
1557 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'menu specs'! |
|
1558 |
||
1559 |
fileListMenu |
|
1560 |
"This resource specification was automatically generated |
|
1561 |
by the MenuEditor of ST/X." |
|
1562 |
||
1563 |
"Do not manually edit this!! If it is corrupted, |
|
1564 |
the MenuEditor may not be able to read the specification." |
|
1565 |
||
1566 |
" |
|
4475 | 1567 |
MenuEditor new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#fileListMenu |
1568 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ArchiveViewApplication fileListMenu)) startUp |
|
3892 | 1569 |
" |
1570 |
||
1571 |
<resource: #menu> |
|
1572 |
||
1573 |
^ |
|
1574 |
#(#Menu |
|
1575 |
#( |
|
1576 |
#(#MenuItem |
|
4475 | 1577 |
#enabled: #hasListEntriesHolder |
1578 |
#label: 'Select All' |
|
1579 |
#itemValue: #selectAll |
|
3892 | 1580 |
#translateLabel: true |
1581 |
) |
|
1582 |
#(#MenuItem |
|
4475 | 1583 |
#label: '-' |
1584 |
) |
|
1585 |
#(#MenuItem |
|
1586 |
#enabled: #hasSelectionInList |
|
1587 |
#label: 'Copy Filenames' |
|
1588 |
#itemValue: #copyFilesToClipboard |
|
3892 | 1589 |
#translateLabel: true |
4475 | 1590 |
) |
1591 |
#(#MenuItem |
|
1592 |
#label: '-' |
|
3892 | 1593 |
) |
1594 |
#(#MenuItem |
|
4475 | 1595 |
#enabled: #hasSelectionInList |
1596 |
#label: 'Extract to Directory...' |
|
5415
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1597 |
#itemValue: #extractSelection |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1598 |
#translateLabel: true |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1599 |
) |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1600 |
#(#MenuItem |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1601 |
#label: 'Extract All to Directory...' |
4475 | 1602 |
#itemValue: #extractAll |
3892 | 1603 |
#translateLabel: true |
1604 |
) |
|
1605 |
#(#MenuItem |
|
4475 | 1606 |
#enabled: #canDelete |
4476 | 1607 |
#label: 'Delete from Archive' |
4961
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1608 |
#itemValue: #removeFilesFromArchive |
3892 | 1609 |
#translateLabel: true |
4475 | 1610 |
#shortcutKey: #Delete |
3892 | 1611 |
) |
1612 |
#(#MenuItem |
|
5415
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1613 |
#label: '-' |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1614 |
) |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1615 |
#(#MenuItem |
4475 | 1616 |
#enabled: #canViewFile |
5415
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1617 |
#label: 'Show Contents' |
4475 | 1618 |
#itemValue: #viewFile |
3892 | 1619 |
#translateLabel: true |
11099 | 1620 |
#isVisible: #closeButtonShown |
3892 | 1621 |
) |
1622 |
) |
|
1623 |
nil |
|
1624 |
nil |
|
1625 |
) |
|
11099 | 1626 |
|
1627 |
"Modified: / 12-01-2012 / 00:34:13 / cg" |
|
3892 | 1628 |
! |
1629 |
||
1630 |
menu |
|
1631 |
"This resource specification was automatically generated |
|
1632 |
by the MenuEditor of ST/X." |
|
1633 |
||
1634 |
"Do not manually edit this!! If it is corrupted, |
|
1635 |
the MenuEditor may not be able to read the specification." |
|
1636 |
||
1637 |
" |
|
1638 |
MenuEditor new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#menu |
|
1639 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ArchiveViewApplication menu)) startUp |
|
1640 |
" |
|
1641 |
||
1642 |
<resource: #menu> |
|
1643 |
||
1644 |
^ |
|
1645 |
#(#Menu |
|
1646 |
#( |
|
1647 |
#(#MenuItem |
|
4392 | 1648 |
#activeHelpKey: #stopButton |
1649 |
#enabled: #enableStopButton |
|
3892 | 1650 |
#label: 'Stop' |
4392 | 1651 |
#itemValue: #doStopProcess |
1652 |
#nameKey: #Stop |
|
3892 | 1653 |
#translateLabel: true |
1654 |
#isButton: true |
|
1655 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #stop22x22Icon) |
|
1656 |
) |
|
1657 |
#(#MenuItem |
|
4392 | 1658 |
#activeHelpKey: #extractItem |
3892 | 1659 |
#enabled: #hasListEntriesHolder |
4392 | 1660 |
#label: 'Extract' |
1661 |
#itemValue: #extractAll |
|
3892 | 1662 |
#translateLabel: true |
1663 |
#isButton: true |
|
4392 | 1664 |
#labelImage: #(#ResourceRetriever #'FileApplicationNoteBook::ArchiveViewApplication' #extract28x28Icon) |
3892 | 1665 |
) |
1666 |
#(#MenuItem |
|
4392 | 1667 |
#activeHelpKey: #removeOutputButton |
1668 |
#enabled: #enableRemoveErrorOutput |
|
1669 |
#label: 'Remove Output' |
|
1670 |
#itemValue: #removeErrorOutput |
|
3892 | 1671 |
#translateLabel: true |
1672 |
#isButton: true |
|
4392 | 1673 |
#labelImage: #(#ResourceRetriever #'FileApplicationNoteBook::ArchiveViewApplication' #removeBug28x28Icon) |
1674 |
) |
|
1675 |
#(#MenuItem |
|
6100 | 1676 |
#activeHelpKey: #closeTabButton |
4392 | 1677 |
#label: 'Close' |
1678 |
#itemValue: #doClose |
|
1679 |
#translateLabel: true |
|
1680 |
#isButton: true |
|
1681 |
#startGroup: #right |
|
11099 | 1682 |
#isVisible: #closeButtonShown |
4392 | 1683 |
#hideMenuOnActivated: false |
6093 | 1684 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #removeTabIcon) |
3892 | 1685 |
) |
1686 |
) |
|
1687 |
nil |
|
1688 |
nil |
|
1689 |
) |
|
11099 | 1690 |
|
1691 |
"Modified: / 12-01-2012 / 00:34:06 / cg" |
|
3892 | 1692 |
! ! |
1693 |
||
1694 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'queries'! |
|
1695 |
||
5010 | 1696 |
canOpenItem:anItem |
5287
693e3ca577aa
avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents:
5279
diff
changeset
|
1697 |
|suffix mimeType| |
693e3ca577aa
avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents:
5279
diff
changeset
|
1698 |
|
17402 | 1699 |
"/ "avoid autoloading the archiver if it's definitely not an archive" |
10706
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
1700 |
"/ OperatingSystem isUNIXlike ifFalse:[ |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
1701 |
"/ "until Archiver supports windows archives..." |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
1702 |
"/ ^ false. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
1703 |
"/ ]. |
6518 | 1704 |
|
5287
693e3ca577aa
avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents:
5279
diff
changeset
|
1705 |
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
|
1706 |
( #('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
|
1707 |
|
10922 | 1708 |
( #('xlsx' 'ets') includes:suffix) ifTrue:[^ true]. |
1709 |
||
5287
693e3ca577aa
avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents:
5279
diff
changeset
|
1710 |
mimeType := anItem mimeType. |
693e3ca577aa
avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents:
5279
diff
changeset
|
1711 |
( #('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
|
1712 |
|
5315 | 1713 |
Archiver isNil ifTrue:[^ false]. |
6518 | 1714 |
^ (Archiver classForMimeType:mimeType fileName:anItem fileName) notNil |
10706
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
1715 |
|
10922 | 1716 |
"Modified: / 29-11-2011 / 18:59:35 / cg" |
17402 | 1717 |
"Modified (format): / 13-02-2017 / 20:12:23 / cg" |
3892 | 1718 |
! |
1719 |
||
1720 |
wantNewApplicationAnyway |
|
1721 |
||
1722 |
^ false |
|
1723 |
! ! |
|
1724 |
||
1725 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'tableColumns specs'! |
|
1726 |
||
1727 |
tableColumns |
|
1728 |
"This resource specification was automatically generated |
|
1729 |
by the DataSetBuilder of ST/X." |
|
1730 |
||
1731 |
"Do not manually edit this!! If it is corrupted, |
|
1732 |
the DataSetBuilder may not be able to read the specification." |
|
1733 |
||
1734 |
" |
|
5008 | 1735 |
DataSetBuilder new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#tableColumns |
3892 | 1736 |
" |
1737 |
||
1738 |
<resource: #tableColumns> |
|
1739 |
||
1740 |
^#( |
|
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1741 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1742 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1743 |
labelActionSelector: sortFileListsBy: |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1744 |
labelActionArgument: 'directory' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1745 |
width: 25 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1746 |
minWidth: 20 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1747 |
height: 16 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1748 |
model: icon |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1749 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1750 |
isResizeable: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1751 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1752 |
showColSeparator: false |
3892 | 1753 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1754 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1755 |
label: 'File Name' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1756 |
id: 'fileName' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1757 |
labelAlignment: left |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1758 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1759 |
model: fileName |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1760 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1761 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1762 |
showColSeparator: false |
3892 | 1763 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1764 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1765 |
label: 'Perm' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1766 |
id: 'permissions' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1767 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1768 |
usePreferredWidth: true |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1769 |
width: 75 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1770 |
model: permissions |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1771 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1772 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1773 |
showColSeparator: false |
3892 | 1774 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1775 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1776 |
label: 'Version' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1777 |
id: 'version' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1778 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1779 |
columnAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1780 |
width: 100 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1781 |
minWidth: 50 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1782 |
model: version |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1783 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1784 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1785 |
showColSeparator: false |
3892 | 1786 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1787 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1788 |
label: 'Type' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1789 |
id: 'type' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1790 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1791 |
columnAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1792 |
width: 100 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1793 |
minWidth: 50 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1794 |
model: type |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1795 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1796 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1797 |
showColSeparator: false |
3892 | 1798 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1799 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1800 |
label: 'Owner/Group' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1801 |
id: 'ownerGroup' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1802 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1803 |
columnAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1804 |
width: 100 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1805 |
minWidth: 50 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1806 |
model: ownerGroup |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1807 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1808 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1809 |
showColSeparator: false |
3892 | 1810 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1811 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1812 |
label: 'Size' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1813 |
id: 'size' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1814 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1815 |
columnAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1816 |
width: 80 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1817 |
model: size |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1818 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1819 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1820 |
showColSeparator: false |
3892 | 1821 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1822 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1823 |
label: 'Date & Time' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1824 |
id: 'dateAndTime' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1825 |
labelAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1826 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1827 |
columnAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1828 |
usePreferredWidth: true |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1829 |
width: 140 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1830 |
model: dateAndTime |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1831 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1832 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1833 |
showColSeparator: false |
3892 | 1834 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1835 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1836 |
label: 'Method' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1837 |
id: 'method' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1838 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1839 |
columnAlignment: center |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1840 |
usePreferredWidth: true |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1841 |
width: 140 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1842 |
model: method |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1843 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1844 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1845 |
showColSeparator: false |
3892 | 1846 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1847 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1848 |
label: 'CRC' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1849 |
id: 'crc' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1850 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1851 |
usePreferredWidth: true |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1852 |
width: 140 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1853 |
model: crc |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1854 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1855 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1856 |
showColSeparator: false |
3892 | 1857 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1858 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1859 |
label: 'Compress Size' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1860 |
id: 'compressSize' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1861 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1862 |
columnAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1863 |
usePreferredWidth: true |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1864 |
width: 140 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1865 |
model: compressSize |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1866 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1867 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1868 |
showColSeparator: false |
3892 | 1869 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1870 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1871 |
label: 'Ratio' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1872 |
id: 'ratio' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1873 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1874 |
columnAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1875 |
usePreferredWidth: true |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1876 |
width: 140 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1877 |
model: ratio |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1878 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1879 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1880 |
showColSeparator: false |
3892 | 1881 |
) |
1882 |
) |
|
5008 | 1883 |
|
3892 | 1884 |
! ! |
1885 |
||
1886 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'accessing'! |
|
1887 |
||
1888 |
archiver |
|
1889 |
"return the value of the instance variable 'archiver' (automatically generated)" |
|
1890 |
||
1891 |
^ archiver |
|
1892 |
! |
|
1893 |
||
1894 |
archiver:something |
|
1895 |
"set the value of the instance variable 'archiver' (automatically generated)" |
|
1896 |
||
1897 |
archiver := something. |
|
1898 |
! |
|
1899 |
||
1900 |
columnDescriptors |
|
1901 |
"return the value of the instance variable 'columnDescriptors' (automatically generated)" |
|
1902 |
||
1903 |
^ columnDescriptors |
|
1904 |
! |
|
1905 |
||
1906 |
columnDescriptors:aListOfColumns |
|
1907 |
"set the value of the instance variable 'columnDescriptors' (automatically generated)" |
|
1908 |
||
1909 |
columnDescriptors = aListOfColumns ifTrue:[ |
|
1910 |
^ self |
|
1911 |
]. |
|
1912 |
||
1913 |
columnDescriptors := OrderedCollection new. |
|
1914 |
||
1915 |
aListOfColumns keysAndValuesDo:[:anIndex :aDesc| |col| |
|
7765 | 1916 |
col := aDesc isSequenceable ifTrue:[DataSetColumnSpec decodeFromLiteralArray:aDesc] |
3892 | 1917 |
ifFalse:[aDesc]. |
1918 |
columnDescriptors add:col. |
|
1919 |
]. |
|
7765 | 1920 |
|
1921 |
"Modified: / 27-03-2007 / 08:46:06 / cg" |
|
3892 | 1922 |
! |
1923 |
||
5010 | 1924 |
item:anItem |
1925 |
super item:anItem. |
|
4905 | 1926 |
|
4375 | 1927 |
self removeErrorOutput. |
4905 | 1928 |
archiver := Archiver newFor:self fileName. |
1929 |
||
1930 |
archiver notNil ifTrue:[ |
|
4803 | 1931 |
self |
1932 |
makeProcessFor:[ |
|
4905 | 1933 |
self archiver:archiver. |
4803 | 1934 |
self setColumnsForArchiver. |
1935 |
] |
|
1936 |
with:'Setup archive'. |
|
3892 | 1937 |
^ true |
1938 |
]. |
|
1939 |
^ false |
|
1940 |
! |
|
1941 |
||
1942 |
temporaryDirectory |
|
1943 |
"return the value of the instance variable 'temporaryDirectory' (automatically generated)" |
|
1944 |
||
1945 |
temporaryDirectory isNil ifTrue:[ |
|
13112
ade9575b2a32
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
12830
diff
changeset
|
1946 |
temporaryDirectory := Filename newTemporaryDirectory. |
3892 | 1947 |
]. |
1948 |
^ temporaryDirectory |
|
1949 |
! ! |
|
1950 |
||
1951 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'actions'! |
|
1952 |
||
5010 | 1953 |
changeItem:anItem |
1954 |
self item:anItem. |
|
4803 | 1955 |
self clearFileList. |
4905 | 1956 |
self listAllFiles. |
3892 | 1957 |
^ true |
1958 |
! |
|
1959 |
||
4803 | 1960 |
clearFileList |
1961 |
||
1962 |
self archiveFileList value removeAll. |
|
1963 |
! |
|
1964 |
||
3892 | 1965 |
copyFilesToClipboard |
1966 |
|sel list stream| |
|
1967 |
||
1968 |
sel := self selectionHolder value. |
|
1969 |
list := self archiveFileList. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6481
diff
changeset
|
1970 |
(sel notEmptyOrNil) ifTrue:[ |
15594
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
1971 |
stream := CharacterWriteStream new. |
3892 | 1972 |
sel do:[: key | |
1973 |
stream nextPutAll:(key fileName asString). |
|
1974 |
stream cr. |
|
1975 |
]. |
|
6033 | 1976 |
self window setClipboardText:stream contents. |
3892 | 1977 |
]. |
10922 | 1978 |
|
1979 |
"Modified (format): / 29-11-2011 / 18:57:40 / cg" |
|
3892 | 1980 |
! |
1981 |
||
1982 |
dblClick |
|
1983 |
||
1984 |
self viewFile. |
|
1985 |
! |
|
1986 |
||
1987 |
doStopProcess |
|
1988 |
| archiver | |
|
10922 | 1989 |
|
3892 | 1990 |
self stopProcess. |
1991 |
archiver := self archiver. |
|
1992 |
archiver notNil ifTrue:[ |
|
1993 |
self archiver stopProcess. |
|
1994 |
]. |
|
1995 |
self enableStopButton value:false. |
|
10922 | 1996 |
|
1997 |
"Modified (format): / 29-11-2011 / 18:57:50 / cg" |
|
3892 | 1998 |
! |
1999 |
||
2000 |
removeErrorOutput |
|
2001 |
||
2002 |
self viewErrorList value:false. |
|
2003 |
self errorListHolder removeAll. |
|
2004 |
! |
|
2005 |
||
2006 |
removeTemporaryDirectory |
|
2007 |
||
2008 |
temporaryDirectory notNil ifTrue:[ |
|
4923
1aced17a14a7
Do not use obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
4913
diff
changeset
|
2009 |
temporaryDirectory removeDirectory. |
3892 | 2010 |
temporaryDirectory := nil. |
2011 |
]. |
|
2012 |
! |
|
2013 |
||
2014 |
selectAll |
|
2015 |
||
2016 |
| sel listOfFiles| |
|
2017 |
||
2018 |
sel := OrderedCollection new. |
|
2019 |
listOfFiles := self archiveFileList value. |
|
2020 |
1 to:(listOfFiles size) do:[ : el | |
|
2021 |
sel add:el |
|
2022 |
]. |
|
2023 |
self selectionHolder value:sel. |
|
2024 |
! |
|
2025 |
||
2026 |
updateFileBrowserIfPresentWith:aDirectory |
|
2027 |
||
2028 |
| master| |
|
2029 |
||
2030 |
master := self masterApplication. |
|
2031 |
master notNil ifTrue:[ |
|
2032 |
master updateAndSelect:(OrderedCollection with:aDirectory). |
|
2033 |
]. |
|
2034 |
! |
|
2035 |
||
2036 |
viewFile |
|
2037 |
||
2038 |
| master item file tempDir| |
|
2039 |
||
4001 | 2040 |
self canViewFile ifFalse:[^ self]. |
3892 | 2041 |
master := self masterApplication. |
2042 |
self selectionHolder value size = 1 ifFalse:[ |
|
2043 |
Dialog warn:'only one file have to be selected'. |
|
2044 |
^ self. |
|
2045 |
]. |
|
2046 |
tempDir := self temporaryDirectory. |
|
2047 |
self extractSelectedFilesTo:tempDir askForExtractOptions:false. |
|
2048 |
process notNil ifTrue:[ |
|
2049 |
process waitUntilTerminated. |
|
2050 |
]. |
|
2051 |
file := tempDir construct:self selectionHolder value first fileName. |
|
2052 |
file exists ifTrue:[ |
|
3982 | 2053 |
item := DirectoryContentsBrowser itemClass fileName:file. |
3892 | 2054 |
]. |
2055 |
master notNil ifTrue:[ |
|
2056 |
master openApplByFileItem:item. |
|
2057 |
]. |
|
2058 |
! ! |
|
2059 |
||
2060 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'aspects'! |
|
2061 |
||
2062 |
archiveFileList |
|
2063 |
||
2064 |
archiveFileList isNil ifTrue:[ |
|
2065 |
archiveFileList := List new. |
|
2066 |
archiveFileList addDependent:self. |
|
2067 |
]. |
|
2068 |
^ archiveFileList. |
|
2069 |
! |
|
2070 |
||
2071 |
enableRemoveErrorOutput |
|
2072 |
"return/create the 'enableRemoveErrorOutput' value holder (automatically generated)" |
|
2073 |
||
2074 |
enableRemoveErrorOutput isNil ifTrue:[ |
|
2075 |
enableRemoveErrorOutput := false asValue. |
|
2076 |
]. |
|
2077 |
^ enableRemoveErrorOutput |
|
2078 |
! |
|
2079 |
||
2080 |
enableStopButton |
|
2081 |
||
2082 |
enableStopButton isNil ifTrue:[ |
|
2083 |
enableStopButton := false asValue. |
|
2084 |
]. |
|
2085 |
^ enableStopButton |
|
2086 |
! |
|
2087 |
||
2088 |
errorListHolder |
|
2089 |
||
2090 |
errorListHolder isNil ifTrue:[ |
|
2091 |
errorListHolder := List new. |
|
2092 |
]. |
|
2093 |
^ errorListHolder. |
|
2094 |
! |
|
2095 |
||
2096 |
errorListVisibilityHolder |
|
2097 |
||
2098 |
errorListVisibilityHolder isNil ifTrue:[ |
|
2099 |
errorListVisibilityHolder := false asValue. |
|
2100 |
]. |
|
2101 |
^ errorListVisibilityHolder |
|
2102 |
! |
|
2103 |
||
2104 |
hasSelectionInList |
|
2105 |
| sel | |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6481
diff
changeset
|
2106 |
|
3892 | 2107 |
sel := self selectionHolder value. |
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6481
diff
changeset
|
2108 |
^ sel notEmptyOrNil |
3892 | 2109 |
! |
2110 |
||
2111 |
selectionHolder |
|
2112 |
selectionHolder isNil ifTrue:[ |
|
2113 |
selectionHolder := ValueHolder new. |
|
2114 |
selectionHolder addDependent:self. |
|
2115 |
]. |
|
2116 |
^ selectionHolder. |
|
2117 |
! |
|
2118 |
||
2119 |
tableColumns |
|
2120 |
||
2121 |
tableColumns isNil ifTrue:[ |
|
2122 |
tableColumns := self class tableColumns asValue. |
|
2123 |
]. |
|
2124 |
^ tableColumns. |
|
2125 |
! |
|
2126 |
||
2127 |
viewErrorList |
|
2128 |
"return/create the 'viewErrorList' value holder (automatically generated)" |
|
2129 |
||
2130 |
viewErrorList isNil ifTrue:[ |
|
2131 |
viewErrorList := false asValue. |
|
2132 |
viewErrorList onChangeSend:#viewErrorListChanged to:self. |
|
2133 |
]. |
|
2134 |
^ viewErrorList |
|
2135 |
! ! |
|
2136 |
||
2137 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'change & update'! |
|
2138 |
||
2139 |
update:something with:aParameter from:changedObject |
|
2140 |
changedObject == self archiveFileList ifTrue:[ |
|
2141 |
self hasListEntriesHolder value:(changedObject notEmpty). |
|
2142 |
^ self |
|
2143 |
]. |
|
2144 |
super update:something with:aParameter from:changedObject |
|
2145 |
! |
|
2146 |
||
2147 |
viewErrorListChanged |
|
2148 |
||
2149 |
| viewListValue| |
|
2150 |
||
2151 |
viewListValue := self viewErrorList value. |
|
2152 |
self enableRemoveErrorOutput value:viewListValue. |
|
2153 |
self errorListVisibilityHolder value:viewListValue. |
|
2154 |
! ! |
|
2155 |
||
2156 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'command execution'! |
|
2157 |
||
2158 |
getErrorBlock |
|
2159 |
||
2160 |
^ |
|
2161 |
[: x | |
|
2162 |
self viewErrorList value:true. |
|
2163 |
self errorListHolder value add:x. |
|
2164 |
] |
|
2165 |
! |
|
2166 |
||
2167 |
getErrorStream |
|
2168 |
||
2169 |
|errStream| |
|
2170 |
||
2171 |
errStream := ActorStream new. |
|
2172 |
errStream nextPutLineBlock:(self getErrorBlock). |
|
2173 |
^ errStream |
|
2174 |
! |
|
2175 |
||
2176 |
getOutBlock |
|
4961
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2177 |
|archiveOutputParser| |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2178 |
|
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2179 |
archiveOutputParser := archiver listFilesReader. |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2180 |
|
5413 | 2181 |
^ [: line | |item| |
4961
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2182 |
item := archiveOutputParser parseLine:line forItemClass:ArchivItem. |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2183 |
item notNil ifTrue:[ |
3892 | 2184 |
self archiveFileList value add:item |
2185 |
]. |
|
2186 |
] |
|
2187 |
! |
|
2188 |
||
2189 |
getOutStream |
|
2190 |
||
2191 |
|outStream| |
|
2192 |
||
2193 |
outStream := ActorStream new. |
|
2194 |
outStream nextPutLineBlock:(self getOutBlock). |
|
2195 |
^ outStream |
|
2196 |
! |
|
2197 |
||
2198 |
makeProcessFor:aBlock |
|
2199 |
self makeProcessFor:aBlock with:'' |
|
2200 |
! |
|
2201 |
||
2202 |
makeProcessFor:aBlock with:string |
|
2203 |
process notNil ifTrue:[ |
|
6054 | 2204 |
(process waitUntilTerminatedWithTimeout:10) ifTrue:[ |
2205 |
(Dialog confirm:'Terminate the current active archive operation ?') ifFalse:[^ self]. |
|
2206 |
process terminate. |
|
2207 |
]. |
|
3892 | 2208 |
terminateByMe ifTrue:[ |
2209 |
terminateByMe := false. |
|
2210 |
^ self |
|
2211 |
]. |
|
2212 |
]. |
|
4803 | 2213 |
|
2214 |
process := [ [ |
|
2215 |
self notify:string. |
|
2216 |
aBlock value. |
|
6190 | 2217 |
self notify:nil. |
4890
b3f7edcf4981
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
4880
diff
changeset
|
2218 |
] ensure:[ |
3892 | 2219 |
process := nil. |
2220 |
self enableStopButton value:false. |
|
2221 |
] |
|
4803 | 2222 |
] newProcess. |
15465
74d2b7497f7c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15232
diff
changeset
|
2223 |
process priority:(Processor userBackgroundPriority). |
3892 | 2224 |
process name:'ArchiveApplicationProcess'. |
4803 | 2225 |
process resume. |
3892 | 2226 |
self enableStopButton value:true. |
2227 |
! |
|
2228 |
||
2229 |
setColumnsForArchiver |
|
2230 |
||
2231 |
| newColumns archiverColumns allColumns iconColumn| |
|
2232 |
||
4965
a251b39fb4a2
dont use a column-descriptors id-field
Claus Gittinger <cg@exept.de>
parents:
4964
diff
changeset
|
2233 |
archiverColumns := archiver columns collect:[:el| el first]. |
3892 | 2234 |
allColumns := OrderedCollection new. |
2235 |
newColumns := OrderedCollection new. |
|
2236 |
self class tableColumns do:[:el| |
|
7765 | 2237 |
allColumns add:(DataSetColumnSpec decodeFromLiteralArray:el). |
3892 | 2238 |
]. |
4965
a251b39fb4a2
dont use a column-descriptors id-field
Claus Gittinger <cg@exept.de>
parents:
4964
diff
changeset
|
2239 |
iconColumn := allColumns detect:[: col | (col readSelector asSymbol) = #icon] ifNone:[nil]. |
3892 | 2240 |
iconColumn notNil ifTrue:[ |
2241 |
newColumns add:iconColumn. |
|
2242 |
]. |
|
2243 |
allColumns do:[:col| |
|
4965
a251b39fb4a2
dont use a column-descriptors id-field
Claus Gittinger <cg@exept.de>
parents:
4964
diff
changeset
|
2244 |
(archiverColumns includes:(col readSelector asSymbol)) ifTrue:[ |
3892 | 2245 |
newColumns add:col. |
2246 |
]. |
|
2247 |
]. |
|
2248 |
self tableColumns value:newColumns. |
|
2249 |
self columnDescriptors:(self tableColumns value). |
|
7765 | 2250 |
|
2251 |
"Modified: / 27-03-2007 / 08:46:03 / cg" |
|
3892 | 2252 |
! |
2253 |
||
2254 |
stopProcess |
|
2255 |
||
2256 |
|task| |
|
2257 |
||
2258 |
terminateByMe := true. |
|
2259 |
(task := process) notNil ifTrue:[ |
|
2260 |
process := nil. |
|
2261 |
||
4645
fcf36da5b305
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4626
diff
changeset
|
2262 |
Error handle:[:ex| |
3892 | 2263 |
Dialog warn:ex description. |
4645
fcf36da5b305
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4626
diff
changeset
|
2264 |
] do:[ |
3892 | 2265 |
task isDead ifFalse:[ |
3919 | 2266 |
task terminateWithAllSubprocessesInGroup. |
3892 | 2267 |
task waitUntilTerminated. |
2268 |
] |
|
2269 |
] |
|
2270 |
]. |
|
2271 |
! ! |
|
2272 |
||
2273 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'command helper'! |
|
2274 |
||
2275 |
selectDirectoryDialog |
|
2276 |
||
2277 |
| dir directory haveDirectory| |
|
2278 |
||
2279 |
directory := self fileName directory. |
|
2280 |
haveDirectory := false. |
|
2281 |
[haveDirectory] whileFalse:[ |
|
2282 |
dir := Dialog requestDirectoryName:'Which directory ?' default:dir. |
|
3988 | 2283 |
dir isEmpty ifTrue:[ ^ nil]. |
3892 | 2284 |
dir := dir asFilename. |
2285 |
(dir isExecutable not or:[dir isWritable not]) ifTrue:[ |
|
2286 |
Dialog warn:'cant write to: ', dir asString. |
|
2287 |
]. |
|
2288 |
haveDirectory := true. |
|
2289 |
]. |
|
2290 |
^ dir |
|
3988 | 2291 |
! |
2292 |
||
2293 |
selectDirectoryDialog:message |
|
5413 | 2294 |
|dir haveDirectory answer| |
2295 |
||
2296 |
dir := self masterApplication currentDirectory. |
|
2297 |
dir isNil ifTrue:[ |
|
2298 |
dir := archiver fileName withoutSuffix. |
|
5221 | 2299 |
"/ (fn exists and:[fn isDirectory]) ifTrue:[ |
2300 |
"/ dir := fn |
|
2301 |
"/ ] ifFalse:[ |
|
2302 |
"/ dir := fn directory |
|
2303 |
"/ ]. |
|
4981
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
2304 |
]. |
5221 | 2305 |
|
3988 | 2306 |
haveDirectory := false. |
2307 |
[haveDirectory] whileFalse:[ |
|
2308 |
dir := Dialog requestDirectoryName:message default:dir. |
|
2309 |
dir isEmpty ifTrue:[ ^ nil]. |
|
4396
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2310 |
|
3988 | 2311 |
dir := dir asFilename. |
4396
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2312 |
dir exists ifFalse:[ |
5610 | 2313 |
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
|
2314 |
answer isNil ifTrue:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2315 |
^ nil |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2316 |
]. |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2317 |
answer ifTrue:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2318 |
dir makeDirectory. |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2319 |
dir exists ifFalse:[ |
5610 | 2320 |
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
|
2321 |
] |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2322 |
]. |
3988 | 2323 |
]. |
4396
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2324 |
dir exists ifTrue:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2325 |
(dir isExecutable not or:[dir isWritable not]) ifTrue:[ |
5610 | 2326 |
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
|
2327 |
] ifFalse:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2328 |
haveDirectory := true. |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2329 |
]. |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2330 |
]. |
3988 | 2331 |
]. |
2332 |
^ dir |
|
3892 | 2333 |
! ! |
2334 |
||
2335 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands add'! |
|
2336 |
||
4803 | 2337 |
addFilesToArchive:colOfFiles |
2338 |
self archiver |
|
2339 |
outStream:nil |
|
2340 |
errorStream:(self getErrorStream) |
|
2341 |
synchron:true. |
|
2342 |
||
4961
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2343 |
"/ self |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2344 |
"/ makeProcessFor:[ |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2345 |
"/ self archiver addFilesToArchive:colOfFiles. |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2346 |
"/ ] |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2347 |
"/ with:'Adding files to archive'. |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2348 |
"/ synchronous - otherwise list below fails |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2349 |
self archiver addFilesToArchive:colOfFiles. |
4803 | 2350 |
|
2351 |
"/ ugly code alarm. |
|
3892 | 2352 |
(self archiver class == Archiver zipArchive) ifTrue:[ |
4905 | 2353 |
self listAllFiles |
3892 | 2354 |
] ifFalse:[ |
4905 | 2355 |
self listFiles:colOfFiles |
3892 | 2356 |
]. |
4803 | 2357 |
^ true |
3892 | 2358 |
! ! |
2359 |
||
2360 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands extract'! |
|
2361 |
||
2362 |
extractAll |
|
2363 |
||
2364 |
self extractSelectedFilesTo:nil withSelection:#all |
|
2365 |
! |
|
2366 |
||
2367 |
extractSelectedFilesTo:aDirectory askForExtractOptions:askForExtractOptionsBoolean |
|
2368 |
||
2369 |
self extractSelectedFilesTo:aDirectory withSelection:#selection askForExtractOptions:askForExtractOptionsBoolean |
|
2370 |
! |
|
2371 |
||
2372 |
extractSelectedFilesTo:aDirectory withSelection:selectOrAll |
|
2373 |
||
2374 |
self extractSelectedFilesTo:aDirectory withSelection:selectOrAll askForExtractOptions:true. |
|
2375 |
! |
|
2376 |
||
2377 |
extractSelectedFilesTo:aDirectory withSelection:selectOrAll askForExtractOptions:askForExtractOptionsBoolean |
|
2378 |
||
2379 |
| dir| |
|
2380 |
||
2381 |
aDirectory isNil ifTrue:[ |
|
5413 | 2382 |
dir := self selectDirectoryDialog:'Extract into Directory?'. |
3892 | 2383 |
dir isNil ifTrue:[^ self]. |
2384 |
] ifFalse:[ |
|
2385 |
dir := aDirectory. |
|
2386 |
]. |
|
2387 |
selectOrAll == #all ifTrue:[ |
|
2388 |
self extractAllTo:dir. |
|
2389 |
]. |
|
2390 |
selectOrAll == #selection ifTrue:[ |
|
2391 |
self extractSelectionTo:dir askForExtractOptions:askForExtractOptionsBoolean |
|
2392 |
]. |
|
4001 | 2393 |
"/ self updateFileBrowserIfPresentWith:dir. |
3892 | 2394 |
! ! |
2395 |
||
2396 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands extract private'! |
|
2397 |
||
2398 |
extractAllTo:aDirectory |
|
2399 |
||
4803 | 2400 |
self archiver |
2401 |
outStream:nil |
|
2402 |
errorStream:(self getErrorStream) |
|
2403 |
synchron:true. |
|
2404 |
self |
|
4905 | 2405 |
makeProcessFor:[ self archiver extractFilesTo:aDirectory ] |
4803 | 2406 |
with:'Extracting all files'. |
3892 | 2407 |
^ true. |
2408 |
! |
|
2409 |
||
5415
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
2410 |
extractSelection |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
2411 |
self extractSelectedFilesTo:nil withSelection:#selection askForExtractOptions:true |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
2412 |
! |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
2413 |
|
3892 | 2414 |
extractSelectionTo:aDirectory askForExtractOptions:askForExtractOptionsBoolean |
2415 |
| sel index extractWithDirectoryPart extractAllFilesInSelectedDirectories extractFiles| |
|
2416 |
||
2417 |
extractWithDirectoryPart := true. |
|
2418 |
extractAllFilesInSelectedDirectories := false. |
|
2419 |
sel := self selectionHolder value. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6481
diff
changeset
|
2420 |
(sel isEmptyOrNil) ifTrue:[ |
3892 | 2421 |
sel := self archiveFileList value. |
2422 |
]. |
|
2423 |
sel := sel do:[:item| |
|
2424 |
item fileName: item fileName |
|
2425 |
]. |
|
2426 |
(askForExtractOptionsBoolean and:[self archiver class ~= Archiver zipArchive]) ifTrue:[ |
|
2427 |
extractFiles := self selRemoveFilesForDirs:sel. |
|
2428 |
] ifFalse:[ |
|
2429 |
extractFiles := sel. |
|
2430 |
]. |
|
2431 |
||
2432 |
askForExtractOptionsBoolean ifTrue:[ |
|
2433 |
index := extractFiles findFirst:[: el | el hasDirectoryPart]. |
|
2434 |
index ~= 0 ifTrue:[ |
|
4964 | 2435 |
extractWithDirectoryPart := (Dialog confirmWithCancel:'Extract with directory part ?\\(I.e. create empty directories as required to preserve relative path)' withCRs default:true). |
3892 | 2436 |
extractWithDirectoryPart isNil ifTrue:[^ false]. |
2437 |
]. |
|
2438 |
]. |
|
2439 |
extractWithDirectoryPart ifTrue:[ |
|
2440 |
self extractWithDirectoryPartTo:aDirectory with:extractFiles. |
|
2441 |
] ifFalse:[ |
|
2442 |
self extractWithOutDirectoryPartTo:aDirectory with:extractFiles. |
|
2443 |
]. |
|
2444 |
^ true |
|
10922 | 2445 |
|
2446 |
"Modified (format): / 29-11-2011 / 18:57:54 / cg" |
|
3892 | 2447 |
! |
2448 |
||
2449 |
extractWithDirectoryPartTo:aDirectory with:extractFiles |
|
4803 | 2450 |
self archiver |
2451 |
outStream:nil |
|
2452 |
errorStream:(self getErrorStream) |
|
2453 |
synchron:true. |
|
2454 |
self |
|
4905 | 2455 |
makeProcessFor:[ self archiver extractFiles:extractFiles to:aDirectory ] |
4803 | 2456 |
with:('Extracting files to %1' bindWith:aDirectory asString). |
3892 | 2457 |
^ true. |
10922 | 2458 |
|
2459 |
"Modified (format): / 29-11-2011 / 18:57:58 / cg" |
|
3892 | 2460 |
! |
2461 |
||
2462 |
extractWithOutDirectoryPartTo:aDirectory with:extractFiles |
|
4803 | 2463 |
self archiver |
2464 |
outStream:nil |
|
2465 |
errorStream:(self getErrorStream) |
|
2466 |
synchron:true. |
|
2467 |
self |
|
2468 |
makeProcessFor:[ |
|
2469 |
self archiver |
|
4905 | 2470 |
extractFiles:(extractFiles collect:[:item| item fileName]) |
2471 |
withoutDirectoryTo:aDirectory. |
|
4803 | 2472 |
] |
2473 |
with:('Extracting files to %1' bindWith:aDirectory asString). |
|
3892 | 2474 |
^ true. |
10922 | 2475 |
|
2476 |
"Modified (format): / 29-11-2011 / 18:58:01 / cg" |
|
3892 | 2477 |
! ! |
2478 |
||
2479 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands list'! |
|
2480 |
||
4905 | 2481 |
listAllFiles |
3892 | 2482 |
self archiveFileList value removeAll. |
4905 | 2483 |
self listFiles:nil |
2484 |
! |
|
2485 |
||
17556 | 2486 |
listFiles:aColOfFilesOrNil |
2487 |
|a| |
|
2488 |
||
3892 | 2489 |
process notNil ifTrue:[ |
4803 | 2490 |
process waitUntilTerminated |
3892 | 2491 |
]. |
4803 | 2492 |
|
17556 | 2493 |
(a := archiver) notNil ifTrue:[ |
2494 |
a |
|
4905 | 2495 |
outStream:(self getOutStream) |
2496 |
errorStream:(self getErrorStream) |
|
2497 |
synchron:true. |
|
2498 |
||
2499 |
self |
|
17556 | 2500 |
makeProcessFor:[a listFiles:aColOfFilesOrNil] |
4905 | 2501 |
with:'List files' |
2502 |
] |
|
17556 | 2503 |
|
2504 |
"Modified: / 22-06-2017 / 18:44:15 / cg" |
|
3892 | 2505 |
! ! |
2506 |
||
2507 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands remove'! |
|
2508 |
||
4803 | 2509 |
removeFilesFromArchive |
2510 |
|sel realSel list firtsPre stringCol stringRealSel| |
|
3892 | 2511 |
|
2512 |
sel := self selectionHolder value. |
|
4803 | 2513 |
stringCol := sel collect:[:item | item fileName]. |
3892 | 2514 |
firtsPre := stringCol at:1. |
4803 | 2515 |
stringCol from:2 do:[:el | firtsPre := firtsPre commonPrefixWith:el]. |
3892 | 2516 |
list := self archiveFileList value. |
4803 | 2517 |
"/ realSel := OrderedCollection new. |
2518 |
"/ list do:[:item | |
|
2519 |
"/ ((item fileName) startsWith:firtsPre) ifTrue:[ |
|
2520 |
"/ realSel add:item |
|
2521 |
"/ ] |
|
2522 |
"/ ]. |
|
2523 |
realSel := list select:[:item | (item fileName) startsWith:firtsPre]. |
|
2524 |
stringRealSel := realSel collect:[:item | item fileName]. |
|
2525 |
||
2526 |
self archiver |
|
2527 |
outStream:nil |
|
2528 |
errorStream:(self getErrorStream) |
|
2529 |
synchron:true. |
|
2530 |
self |
|
2531 |
makeProcessFor:[ self archiver removeFilesFromArchive:stringCol ] |
|
2532 |
with:'Remove files'. |
|
4462
b14fcc67ff8e
removeAll: changed to removeAllFoundIn:
Michael Beyl <mb@exept.de>
parents:
4417
diff
changeset
|
2533 |
self archiveFileList value removeAllFoundIn:realSel |
3892 | 2534 |
! ! |
2535 |
||
2536 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'drag & drop'! |
|
2537 |
||
3951 | 2538 |
canDrop:aContext |
2539 |
||
2540 |
^ inDropMode |
|
3892 | 2541 |
! |
2542 |
||
4803 | 2543 |
doDrop:aContext |
3892 | 2544 |
|col source arg objects| |
2545 |
||
2546 |
source := aContext dropSource. |
|
2547 |
arg := source argument. |
|
2548 |
objects := aContext dropObjects. |
|
4803 | 2549 |
col := objects collect:[:dropObject | dropObject theObject]. |
2550 |
^ self addFilesToArchive:col |
|
3892 | 2551 |
! |
2552 |
||
2553 |
doStartDrag:aDropSource in:aView |
|
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2554 |
"set the cursors before starting the drag & drop operation" |
3892 | 2555 |
|
4018 | 2556 |
archiver class canDragnDrop ifFalse:[^ self]. |
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2557 |
super doStartDrag:aDropSource in:aView |
3892 | 2558 |
! |
2559 |
||
3951 | 2560 |
dropEnter:aContext |
6377 | 2561 |
| dropObjects| |
3951 | 2562 |
|
2563 |
inDropMode := false. |
|
2564 |
(aContext dropSource receiver == self) ifTrue:[^ self]. |
|
6377 | 2565 |
dropObjects := aContext dropObjects. |
2566 |
||
17755 | 2567 |
dropObjects do:[:eachDropObject| |
2568 |
|checkObject checkObjectString| |
|
2569 |
||
2570 |
eachDropObject isFileObject ifFalse:[^ self]. |
|
2571 |
checkObject := eachDropObject theObject. |
|
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6214
diff
changeset
|
2572 |
checkObject isFilename ifFalse:[^ self]. |
3951 | 2573 |
checkObject isSpecialFile ifTrue:[^ self]. |
2574 |
]. |
|
2575 |
inDropMode := true. |
|
17755 | 2576 |
|
2577 |
"Modified (format): / 15-11-2017 / 11:10:07 / cg" |
|
3951 | 2578 |
! |
2579 |
||
2580 |
dropLeave:aContext |
|
2581 |
||
2582 |
inDropMode := false. |
|
2583 |
! |
|
2584 |
||
3892 | 2585 |
getDisplayObjects:anArgument |
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2586 |
"retrieve the objects displayed during a drag" |
3892 | 2587 |
|
2588 |
| sel string size fnName stream| |
|
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2589 |
|
3892 | 2590 |
sel := self selectionHolder value. |
2591 |
size := sel size. |
|
2592 |
size == 0 ifTrue:[^ '']. |
|
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2593 |
|
15594
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
2594 |
stream := CharacterWriteStream new. |
3892 | 2595 |
stream nextPutAll:(sel first fileName asFilename baseName asString). |
2596 |
size == 1 ifTrue:[ |
|
2597 |
fnName := 'ui_menuitem.xpm'. |
|
2598 |
] ifFalse:[ |
|
2599 |
fnName := 'ui_submenu_open.xpm'. |
|
2600 |
stream nextPutAll:' ... '. |
|
2601 |
stream nextPutAll:(sel last fileName asFilename baseName asString). |
|
2602 |
]. |
|
2603 |
string := stream contents. |
|
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2604 |
|
17538 | 2605 |
^ Array with:(LabelAndIcon icon:(Image fromFile:fnName) string:(string allBold)) |
2606 |
||
2607 |
"Modified: / 20-06-2017 / 08:18:07 / cg" |
|
3892 | 2608 |
! |
2609 |
||
2610 |
getDropObjects:anArgument |
|
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2611 |
"common code, used in subclasses" |
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2612 |
|
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2613 |
|sel| |
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2614 |
|
3892 | 2615 |
sel := self selectionHolder value. |
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2616 |
^ sel collect:[:el| DropObject newFileInArchive:(el fileName asFilename) ]. |
3892 | 2617 |
! ! |
2618 |
||
2619 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'event handling'! |
|
2620 |
||
4803 | 2621 |
processEvent:anEvent |
3892 | 2622 |
"filter keyboard events. |
2623 |
Return true, if I have eaten the event" |
|
2624 |
||
12115 | 2625 |
<resource: #keyboard (#Delete )> |
2626 |
||
3892 | 2627 |
|focusView key rawKey| |
2628 |
||
2629 |
anEvent isKeyPressEvent ifTrue:[ |
|
2630 |
focusView := anEvent targetView. |
|
2631 |
key := anEvent key. |
|
2632 |
rawKey := anEvent rawKey. |
|
2633 |
(focusView isSameOrComponentOf:self window) ifTrue:[ |
|
2634 |
(key == #Delete) ifTrue:[ |
|
4803 | 2635 |
self removeFilesFromArchive. |
3892 | 2636 |
^ true |
4803 | 2637 |
] |
3892 | 2638 |
] |
2639 |
]. |
|
2640 |
^ false |
|
2641 |
! ! |
|
2642 |
||
2643 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'initialization & release'! |
|
2644 |
||
2645 |
postBuildFileTable:aWidget |
|
2646 |
||
2647 |
fileTable := aWidget scrolledView. |
|
2648 |
fileTable wantsFocusWithPointerEnter. |
|
2649 |
"/ FileBrowser icons keysAndValuesDo:[:aKey :anIcon| |
|
2650 |
"/ fileTable registerImage:anIcon key:aKey. |
|
2651 |
"/ ]. |
|
2652 |
self columnDescriptors:(self class tableColumns). |
|
2653 |
! |
|
2654 |
||
4803 | 2655 |
postOpenWith:aBuilder |
2656 |
|currentDir contents suffix fileName file archivItem| |
|
3892 | 2657 |
|
2658 |
self windowGroup addPreEventHook:self. |
|
2659 |
self masterApplication isNil ifTrue:[ |
|
2660 |
self masterApplication:nil. |
|
2661 |
currentDir := Filename homeDirectory. |
|
2662 |
contents := currentDir directoryContents. |
|
4803 | 2663 |
fileName := contents |
2664 |
detect:[:file | |
|
2665 |
suffix := file asFilename suffix asLowercase. |
|
2666 |
suffix = 'tgz' |
|
2667 |
] |
|
2668 |
ifNone:[nil]. |
|
2669 |
fileName isNil ifTrue:[ |
|
2670 |
Dialog warn:'cant find a Zip file in ' , currentDir asString. |
|
3892 | 2671 |
^ self |
2672 |
]. |
|
2673 |
file := currentDir construct:fileName. |
|
3982 | 2674 |
archivItem := DirectoryContentsBrowser itemClass fileName:file. |
3892 | 2675 |
(self item:archivItem) ifFalse:[ |
4803 | 2676 |
Dialog warn:'file type of ' , item fileName asString , ' not supported'. |
2677 |
^ self |
|
2678 |
] |
|
3892 | 2679 |
]. |
4905 | 2680 |
self listAllFiles. |
6626 | 2681 |
super postOpenWith:aBuilder |
3892 | 2682 |
! |
2683 |
||
2684 |
release |
|
2685 |
self archiver release. |
|
14065
a6da1191dfc5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13905
diff
changeset
|
2686 |
super release. |
3892 | 2687 |
! ! |
2688 |
||
2689 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'queries'! |
|
2690 |
||
2691 |
canDelete |
|
2692 |
||
2693 |
^ (self hasOneSelectionInList and:[archiver class canRemoveFiles]) |
|
2694 |
! |
|
2695 |
||
4001 | 2696 |
canViewFile |
2697 |
||
2698 |
^ self archiver class canViewFile and:[self hasOneSelectionInList] |
|
2699 |
! |
|
2700 |
||
2701 |
hasListEntriesHolder |
|
2702 |
"return/create the 'hasListEntriesHolder' value holder (automatically generated)" |
|
2703 |
||
2704 |
hasListEntriesHolder isNil ifTrue:[ |
|
2705 |
hasListEntriesHolder := false asValue. |
|
2706 |
]. |
|
2707 |
^ hasListEntriesHolder |
|
2708 |
! |
|
2709 |
||
2710 |
hasOneSelectionInList |
|
2711 |
||
2712 |
| sel | |
|
2713 |
sel := self selectionHolder value. |
|
2714 |
^ (sel notNil and:[sel notEmpty and:[sel size = 1]]) |
|
2715 |
! |
|
2716 |
||
3892 | 2717 |
selRemoveFilesForDirs:aSel |
2718 |
||
2719 |
|stringCol newSel string| |
|
2720 |
||
2721 |
stringCol := (aSel collect:[: item| item fileName]). |
|
2722 |
newSel := aSel copy. |
|
2723 |
aSel do:[:item | |
|
2724 |
item isDirectory ifTrue:[ |
|
2725 |
string := item fileName. |
|
2726 |
stringCol doWithIndex:[:filename : index| |
|
2727 |
(filename ~= string and:[filename startsWith:string]) ifTrue:[ |
|
2728 |
newSel remove:(aSel at:index) ifAbsent:[nil]. |
|
2729 |
] |
|
2730 |
] |
|
2731 |
]. |
|
2732 |
]. |
|
2733 |
^ newSel. |
|
2734 |
! ! |
|
2735 |
||
2736 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'sorting'! |
|
2737 |
||
2738 |
generateSortBlock:instanceName |
|
2739 |
||
2740 |
| aSymbol cmpOp sortCaselessLocal| |
|
2741 |
||
2742 |
aSymbol := instanceName asSymbol. |
|
2743 |
sortCaselessLocal := self sortCaseless value. |
|
2744 |
currentSortOrder isNil ifTrue:[ |
|
2745 |
currentSortOrder := aSymbol. |
|
2746 |
currentSortOrder := Dictionary new. |
|
2747 |
currentSortOrder at:#column put:aSymbol. |
|
2748 |
currentSortOrder at:#reverse put:false. |
|
2749 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
2750 |
] ifFalse:[ |
|
2751 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
2752 |
"/ same column like before - change sort order |
|
2753 |
| isReverse | |
|
2754 |
isReverse := currentSortOrder at:#reverse. |
|
2755 |
currentSortOrder at:#reverse put:(isReverse not). |
|
2756 |
] ifFalse:[ |
|
2757 |
"/ another column - remark column |
|
2758 |
currentSortOrder at:#column put:aSymbol. |
|
2759 |
] |
|
2760 |
]. |
|
2761 |
(currentSortOrder at:#reverse) ifTrue:[ |
|
2762 |
cmpOp := #'>' |
|
2763 |
] ifFalse:[ |
|
2764 |
cmpOp := #'<' |
|
2765 |
]. |
|
2766 |
^ [:a :b | |
|
2767 |
|entry1 entry2| |
|
2768 |
||
2769 |
entry1 := (a perform:aSymbol). |
|
2770 |
entry2 := (b perform:aSymbol). |
|
2771 |
aSymbol = #fileName ifTrue:[ |
|
2772 |
sortCaselessLocal ifTrue:[ |
|
2773 |
entry1 := entry1 asString asLowercase. |
|
2774 |
entry2 := entry2 asString asLowercase. |
|
2775 |
] ifFalse:[ |
|
2776 |
entry1 := entry1 asString. |
|
2777 |
entry2 := entry2 asString. |
|
2778 |
]. |
|
2779 |
]. |
|
2780 |
entry1 perform:cmpOp with:entry2 |
|
2781 |
]. |
|
2782 |
! |
|
2783 |
||
2784 |
sortList:instanceName |
|
2785 |
||
2786 |
||
2787 |
|sortBlock fileList sortCol| |
|
2788 |
||
2789 |
sortBlock := self generateSortBlock:instanceName. |
|
2790 |
fileList := self archiveFileList value. |
|
2791 |
sortCol := SortedCollection sortBlock:sortBlock. |
|
2792 |
sortCol addAll:fileList. |
|
2793 |
fileList removeAll. |
|
2794 |
fileList addAll:sortCol. |
|
2795 |
! ! |
|
2796 |
||
2797 |
!FileApplicationNoteBook::ArchiveViewApplication::ArchivItem methodsFor:'accessing'! |
|
2798 |
||
2799 |
compressSize |
|
2800 |
"return the value of the instance variable 'compressSize' (automatically generated)" |
|
2801 |
||
2802 |
^ compressSize |
|
2803 |
! |
|
2804 |
||
2805 |
compressSize:something |
|
2806 |
"set the value of the instance variable 'compressSize' (automatically generated)" |
|
2807 |
||
2808 |
compressSize := something. |
|
2809 |
! |
|
2810 |
||
2811 |
crc |
|
2812 |
"return the value of the instance variable 'crc' (automatically generated)" |
|
2813 |
||
2814 |
^ crc |
|
2815 |
! |
|
2816 |
||
2817 |
crc:something |
|
2818 |
"set the value of the instance variable 'crc' (automatically generated)" |
|
2819 |
||
2820 |
crc := something. |
|
2821 |
! |
|
2822 |
||
2823 |
dateAndTime |
|
2824 |
"return the value of the instance variable 'dateAndTime' (automatically generated)" |
|
2825 |
||
2826 |
^ dateAndTime |
|
2827 |
! |
|
2828 |
||
2829 |
dateAndTime:something |
|
2830 |
"set the value of the instance variable 'dateAndTime' (automatically generated)" |
|
2831 |
||
2832 |
dateAndTime := something. |
|
2833 |
! |
|
2834 |
||
5414 | 2835 |
day:day |
9402 | 2836 |
|ts| |
5414 | 2837 |
|
2838 |
dateAndTime isNil ifTrue:[ |
|
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
2839 |
ts := Timestamp now. |
5414 | 2840 |
] ifFalse:[ |
2841 |
ts := dateAndTime |
|
2842 |
]. |
|
2843 |
||
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
2844 |
dateAndTime := Timestamp |
9402 | 2845 |
year:ts year |
2846 |
month:ts month |
|
5414 | 2847 |
day:day |
9402 | 2848 |
hour:ts hour |
2849 |
minute:ts minutes |
|
2850 |
second:ts minutes |
|
5414 | 2851 |
! |
2852 |
||
2853 |
dayString:dayString |
|
2854 |
self day:(Integer readFrom:dayString) |
|
2855 |
! |
|
2856 |
||
3892 | 2857 |
fileName |
2858 |
"return the value of the instance variable 'fileName' (automatically generated)" |
|
2859 |
||
2860 |
^ fileName |
|
2861 |
! |
|
2862 |
||
2863 |
fileName:something |
|
2864 |
"set the value of the instance variable 'fileName' (automatically generated)" |
|
2865 |
||
2866 |
fileName := something withoutSpaces. |
|
2867 |
! |
|
2868 |
||
2869 |
icon |
|
2870 |
"return the value of the instance variable 'icon' (automatically generated)" |
|
2871 |
||
2872 |
^ icon |
|
2873 |
! |
|
2874 |
||
2875 |
icon:something |
|
2876 |
"set the value of the instance variable 'icon' (automatically generated)" |
|
2877 |
||
2878 |
icon := something. |
|
2879 |
! |
|
2880 |
||
2881 |
isDirectory |
|
2882 |
"return the value of the instance variable 'directory' (automatically generated)" |
|
2883 |
||
2884 |
^ isDirectory |
|
2885 |
! |
|
2886 |
||
2887 |
isDirectory:something |
|
2888 |
"set the value of the instance variable 'isDirectory' (automatically generated)" |
|
2889 |
||
2890 |
isDirectory := something. |
|
2891 |
! |
|
2892 |
||
2893 |
method |
|
2894 |
"return the value of the instance variable 'method' (automatically generated)" |
|
2895 |
||
2896 |
^ method |
|
2897 |
! |
|
2898 |
||
2899 |
method:something |
|
2900 |
"set the value of the instance variable 'method' (automatically generated)" |
|
2901 |
||
2902 |
method := something. |
|
2903 |
! |
|
2904 |
||
5414 | 2905 |
month:month |
9402 | 2906 |
|ts| |
5414 | 2907 |
|
2908 |
dateAndTime isNil ifTrue:[ |
|
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
2909 |
ts := Timestamp now. |
5414 | 2910 |
] ifFalse:[ |
2911 |
ts := dateAndTime |
|
2912 |
]. |
|
2913 |
||
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
2914 |
dateAndTime := Timestamp |
9402 | 2915 |
year:ts year |
5414 | 2916 |
month:month |
9402 | 2917 |
day:ts day |
2918 |
hour:ts hour |
|
2919 |
minute:ts minutes |
|
2920 |
second:ts minutes |
|
5414 | 2921 |
! |
2922 |
||
2923 |
monthName:monthName |
|
2924 |
self month:(Date indexOfMonth:monthName) |
|
2925 |
! |
|
2926 |
||
3892 | 2927 |
ownerGroup |
2928 |
"return the value of the instance variable 'owner' (automatically generated)" |
|
2929 |
||
2930 |
^ ownerGroup |
|
2931 |
! |
|
2932 |
||
2933 |
ownerGroup:something |
|
2934 |
"set the value of the instance variable 'owner' (automatically generated)" |
|
2935 |
||
2936 |
ownerGroup := something. |
|
2937 |
! |
|
2938 |
||
2939 |
permissions |
|
2940 |
"return the value of the instance variable 'permissions' (automatically generated)" |
|
2941 |
||
2942 |
^ permissions |
|
2943 |
! |
|
2944 |
||
2945 |
permissions:something |
|
2946 |
"set the value of the instance variable 'permissions' (automatically generated)" |
|
2947 |
||
2948 |
permissions := something. |
|
2949 |
! |
|
2950 |
||
2951 |
ratio |
|
2952 |
"return the value of the instance variable 'ratio' (automatically generated)" |
|
2953 |
||
2954 |
^ ratio |
|
2955 |
! |
|
2956 |
||
2957 |
ratio:something |
|
2958 |
"set the value of the instance variable 'ratio' (automatically generated)" |
|
2959 |
||
2960 |
ratio := something. |
|
2961 |
! |
|
2962 |
||
2963 |
size |
|
2964 |
"return the value of the instance variable 'size' (automatically generated)" |
|
2965 |
||
2966 |
^ size |
|
2967 |
! |
|
2968 |
||
2969 |
size:something |
|
2970 |
"set the value of the instance variable 'size' (automatically generated)" |
|
2971 |
||
2972 |
size := something. |
|
2973 |
! |
|
2974 |
||
2975 |
sizeAsNumber |
|
2976 |
"return the value of the instance variable 'size' (automatically generated)" |
|
2977 |
||
2978 |
^ size asInteger |
|
2979 |
! |
|
2980 |
||
5414 | 2981 |
time:time |
9402 | 2982 |
|ts| |
5414 | 2983 |
|
2984 |
dateAndTime isNil ifTrue:[ |
|
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
2985 |
ts := Timestamp now. |
5414 | 2986 |
] ifFalse:[ |
2987 |
ts := dateAndTime |
|
2988 |
]. |
|
2989 |
||
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
2990 |
dateAndTime := Timestamp |
9402 | 2991 |
year:ts day |
2992 |
month:ts day |
|
2993 |
day:ts day |
|
5414 | 2994 |
hour:time hours |
9402 | 2995 |
minute:time minutes |
2996 |
second:time seconds |
|
5414 | 2997 |
! |
2998 |
||
2999 |
timeString:timeString |
|
3000 |
self time:(Time readFrom:timeString) |
|
3001 |
! |
|
3002 |
||
3892 | 3003 |
type |
3004 |
"return the value of the instance variable 'type' (automatically generated)" |
|
3005 |
||
3006 |
^ type |
|
3007 |
! |
|
3008 |
||
3009 |
type:something |
|
3010 |
"set the value of the instance variable 'type' (automatically generated)" |
|
3011 |
||
3012 |
type := something. |
|
3013 |
! |
|
3014 |
||
3015 |
version |
|
3016 |
"return the value of the instance variable 'version' (automatically generated)" |
|
3017 |
||
3018 |
^ version |
|
3019 |
! |
|
3020 |
||
3021 |
version:something |
|
3022 |
"set the value of the instance variable 'version' (automatically generated)" |
|
3023 |
||
3024 |
version := something. |
|
5414 | 3025 |
! |
3026 |
||
3027 |
year:year |
|
9402 | 3028 |
|ts| |
5414 | 3029 |
|
3030 |
dateAndTime isNil ifTrue:[ |
|
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
3031 |
ts := Timestamp now. |
5414 | 3032 |
] ifFalse:[ |
3033 |
ts := dateAndTime |
|
3034 |
]. |
|
3035 |
||
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
3036 |
dateAndTime := Timestamp |
5414 | 3037 |
year:year |
9402 | 3038 |
month:ts month |
3039 |
day:ts day |
|
3040 |
hour:ts hour |
|
3041 |
minute:ts minutes |
|
3042 |
second:ts minutes |
|
5414 | 3043 |
! |
3044 |
||
3045 |
yearString:yearString |
|
3046 |
self year:(Integer readFrom:yearString) |
|
3892 | 3047 |
! ! |
3048 |
||
3049 |
!FileApplicationNoteBook::ArchiveViewApplication::ArchivItem methodsFor:'printing'! |
|
3050 |
||
8002
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
3051 |
printOn:aStream |
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
3052 |
aStream nextPutAll:self fileName asString |
3892 | 3053 |
! ! |
3054 |
||
3055 |
!FileApplicationNoteBook::ArchiveViewApplication::ArchivItem methodsFor:'queries'! |
|
3056 |
||
3057 |
hasDirectoryPart |
|
3058 |
||
3059 |
^ self fileName asFilename components size ~= 1 |
|
3060 |
! ! |
|
3061 |
||
3062 |
!FileApplicationNoteBook::CommandResult class methodsFor:'defaults'! |
|
3063 |
||
3064 |
tabStringFor:aApplicationType |
|
7687 | 3065 |
"the formatString shown in a tab (language translated)" |
3066 |
||
3067 |
^ 'Command Output' |
|
3068 |
||
3069 |
"Modified: / 01-03-2007 / 21:43:31 / cg" |
|
3892 | 3070 |
! |
3071 |
||
3072 |
wantNewApplicationAnyway |
|
3073 |
||
3074 |
^ false |
|
3075 |
! ! |
|
3076 |
||
3077 |
!FileApplicationNoteBook::CommandResult class methodsFor:'interface specs'! |
|
3078 |
||
3079 |
windowSpec |
|
3080 |
"This resource specification was automatically generated |
|
3081 |
by the UIPainter of ST/X." |
|
3082 |
||
3083 |
"Do not manually edit this!! If it is corrupted, |
|
3084 |
the UIPainter may not be able to read the specification." |
|
3085 |
||
3086 |
" |
|
4169 | 3087 |
UIPainter new openOnClass:FileApplicationNoteBook::CommandResult andSelector:#windowSpec |
3088 |
FileApplicationNoteBook::CommandResult new openInterface:#windowSpec |
|
3089 |
FileApplicationNoteBook::CommandResult open |
|
3892 | 3090 |
" |
3091 |
||
3092 |
<resource: #canvas> |
|
3093 |
||
3094 |
^ |
|
3095 |
#(#FullSpec |
|
3096 |
#name: #windowSpec |
|
3097 |
#window: |
|
3098 |
#(#WindowSpec |
|
3099 |
#label: 'NoteBookApplication::CommandResult' |
|
3100 |
#name: 'NoteBookApplication::CommandResult' |
|
3101 |
#min: #(#Point 10 10) |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
3102 |
#bounds: #(#Rectangle 220 193 723 546) |
3892 | 3103 |
#menu: #mainMenu |
3104 |
) |
|
3105 |
#component: |
|
3106 |
#(#SpecCollection |
|
3107 |
#collection: #( |
|
3108 |
#(#MenuPanelSpec |
|
3109 |
#name: 'ToolBar1' |
|
3110 |
#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
|
3111 |
#level: 0 |
3892 | 3112 |
#menu: #menu |
3113 |
#textDefault: true |
|
3114 |
) |
|
3115 |
#(#ArbitraryComponentSpec |
|
3116 |
#name: 'ArbitraryComponent1' |
|
3117 |
#layout: #(#LayoutFrame 0 0.0 32 0 0 1.0 0 1) |
|
3118 |
#hasHorizontalScrollBar: true |
|
3119 |
#hasVerticalScrollBar: true |
|
3120 |
#hasBorder: false |
|
3121 |
#component: #TextCollector |
|
3122 |
#postBuildCallback: #postBuildTextCollector: |
|
3123 |
) |
|
4169 | 3124 |
#(#ProgressIndicatorSpec |
3125 |
#name: 'ProgressIndicator1' |
|
3126 |
#layout: #(#LayoutFrame 125 0 11 0 231 0 21 0) |
|
4180 | 3127 |
#visibilityChannel: #enableStopButton |
4169 | 3128 |
#backgroundColor: #(#Color 0.0 66.9993 66.9993) |
3129 |
#showPercentage: false |
|
3130 |
#isActivityIndicator: true |
|
3892 | 3131 |
) |
3132 |
) |
|
3133 |
||
3134 |
) |
|
3135 |
) |
|
3136 |
! ! |
|
3137 |
||
3138 |
!FileApplicationNoteBook::CommandResult class methodsFor:'menu specs'! |
|
3139 |
||
3140 |
menu |
|
3141 |
"This resource specification was automatically generated |
|
3142 |
by the MenuEditor of ST/X." |
|
3143 |
||
3144 |
"Do not manually edit this!! If it is corrupted, |
|
3145 |
the MenuEditor may not be able to read the specification." |
|
3146 |
||
3147 |
" |
|
3148 |
MenuEditor new openOnClass:FileApplicationNoteBook::CommandResult andSelector:#menu |
|
3149 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::CommandResult menu)) startUp |
|
3150 |
" |
|
3151 |
||
3152 |
<resource: #menu> |
|
3153 |
||
3154 |
^ |
|
3155 |
#(#Menu |
|
3156 |
#( |
|
3157 |
#(#MenuItem |
|
3158 |
#label: 'Stop' |
|
3159 |
#translateLabel: true |
|
3160 |
#isButton: true |
|
3161 |
#nameKey: #Stop |
|
3162 |
#value: #doStopProcess |
|
3163 |
#enabled: #enableStopButton |
|
3164 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #stop22x22Icon 'Stop') |
|
3165 |
) |
|
3166 |
#(#MenuItem |
|
6100 | 3167 |
#activeHelpKey: #closeTabButton |
3892 | 3168 |
#label: 'Close' |
3169 |
#translateLabel: true |
|
3170 |
#isButton: true |
|
3171 |
#nameKey: #Close |
|
11099 | 3172 |
#isVisible: #closeButtonShown |
3892 | 3173 |
#startGroup: #right |
3174 |
#value: #doClose |
|
6093 | 3175 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #removeTabIcon) |
3892 | 3176 |
) |
3177 |
) |
|
3178 |
nil |
|
3179 |
nil |
|
3180 |
) |
|
11099 | 3181 |
|
3182 |
"Modified: / 12-01-2012 / 00:33:56 / cg" |
|
3892 | 3183 |
! ! |
3184 |
||
3185 |
!FileApplicationNoteBook::CommandResult methodsFor:'accessing'! |
|
3186 |
||
3187 |
resultStream |
|
3188 |
"return the value of the instance variable 'resultStream' (automatically generated)" |
|
3189 |
||
3190 |
^ resultStream |
|
3191 |
! |
|
3192 |
||
3193 |
resultStream:something |
|
3194 |
"set the value of the instance variable 'resultStream' (automatically generated)" |
|
3195 |
||
3196 |
resultStream := something. |
|
3197 |
! ! |
|
3198 |
||
3199 |
!FileApplicationNoteBook::CommandResult methodsFor:'actions'! |
|
3200 |
||
3201 |
changeTabTo:aString |
|
3202 |
||
3203 |
| masterApplication | |
|
3204 |
||
3205 |
masterApplication := self masterApplication. |
|
3206 |
masterApplication isNil ifFalse:[ |
|
3207 |
masterApplication tabStringChangeTo:aString for:self. |
|
3208 |
]. |
|
3209 |
! |
|
3210 |
||
3211 |
doStopProcess |
|
3212 |
||
3213 |
| myProcess | |
|
3214 |
||
3215 |
myProcess := self process value. |
|
3216 |
myProcess notNil ifTrue:[ |
|
4523 | 3217 |
self notify:('kill ', myProcess name). |
3892 | 3218 |
myProcess terminate. |
3219 |
]. |
|
3220 |
! ! |
|
3221 |
||
3222 |
!FileApplicationNoteBook::CommandResult methodsFor:'aspects'! |
|
3223 |
||
3224 |
enableStopButton |
|
3225 |
||
3226 |
enableStopButton isNil ifTrue:[ |
|
3227 |
enableStopButton := false asValue. |
|
3228 |
]. |
|
3229 |
^ enableStopButton |
|
3230 |
! |
|
3231 |
||
3232 |
process |
|
3233 |
"return/create the 'process' value holder (automatically generated)" |
|
3234 |
||
3235 |
process isNil ifTrue:[ |
|
3236 |
process := ValueHolder new. |
|
3237 |
process addDependent:self. |
|
3238 |
]. |
|
3239 |
^ process |
|
3240 |
! ! |
|
3241 |
||
3242 |
!FileApplicationNoteBook::CommandResult methodsFor:'change & update'! |
|
3243 |
||
3244 |
update:something with:aParameter from:changedObject |
|
3245 |
changedObject == self process ifTrue:[ |
|
3246 |
self enableStopButton value:changedObject value notNil. |
|
3247 |
^ self |
|
3248 |
]. |
|
3249 |
super update:something with:aParameter from:changedObject |
|
3250 |
! ! |
|
3251 |
||
3252 |
!FileApplicationNoteBook::CommandResult methodsFor:'initialization & release'! |
|
3253 |
||
3254 |
postBuildTextCollector:aBuilder |
|
3255 |
||
3256 |
self resultStream:aBuilder scrolledView. |
|
3257 |
! |
|
3258 |
||
3259 |
postOpenWith:aBuilder |
|
3260 |
"This is a hook method generated by the Browser. |
|
3261 |
It will be invoked right after the applications window has been opened. |
|
3262 |
Add any app-specific actions here (starting background processes etc.). |
|
3263 |
See also #postBuildWith:, which is invoked before opening." |
|
3264 |
||
3265 |
"/ add any code here ... |
|
3266 |
||
3267 |
self masterApplication isNil ifTrue:[ |
|
3268 |
self masterApplication:nil. |
|
3269 |
]. |
|
6626 | 3270 |
super postOpenWith:aBuilder |
3892 | 3271 |
! |
3272 |
||
3273 |
release |
|
3274 |
||
3275 |
self doStopProcess. |
|
14065
a6da1191dfc5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13905
diff
changeset
|
3276 |
super release |
3892 | 3277 |
! ! |
3278 |
||
3279 |
!FileApplicationNoteBook::CommandResult methodsFor:'printing'! |
|
3280 |
||
8002
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
3281 |
printOn:aStream |
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
3282 |
aStream nextPutAll:'CommandResult Application'. |
3892 | 3283 |
! ! |
3284 |
||
7909 | 3285 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'defaults'! |
3286 |
||
3287 |
tabStringFor:anApplicationType |
|
3288 |
"the formatString shown in a tab (language translated)" |
|
3289 |
||
3290 |
^ 'Note in %1' |
|
3291 |
||
3292 |
"Modified: / 01-03-2007 / 21:43:23 / cg" |
|
3293 |
! ! |
|
3294 |
||
3295 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'documentation'! |
|
3296 |
||
3297 |
documentation |
|
3298 |
" |
|
3299 |
a previewer-plugin for digital-notepad recordings as |
|
3300 |
provided by the waltop (tevion) MD85276 digital ink notepad. |
|
3301 |
" |
|
3302 |
! ! |
|
3303 |
||
3304 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'help specs'! |
|
3305 |
||
17900 | 3306 |
helpSpec |
7909 | 3307 |
"This resource specification was automatically generated |
3308 |
by the UIHelpTool of ST/X." |
|
3309 |
||
3310 |
"Do not manually edit this!! If it is corrupted, |
|
3311 |
the UIHelpTool may not be able to read the specification." |
|
3312 |
||
3313 |
" |
|
3314 |
UIHelpTool openOnClass:FileApplicationNoteBook::HtmlViewApplication |
|
3315 |
" |
|
3316 |
||
3317 |
<resource: #help> |
|
3318 |
||
17900 | 3319 |
^ super helpSpec addPairsFrom:#( |
7909 | 3320 |
|
3321 |
#'fitImageSize' |
|
3322 |
'Shrink to Fit View' |
|
3323 |
||
3324 |
) |
|
3325 |
! ! |
|
3326 |
||
3327 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'interface specs'! |
|
3328 |
||
3329 |
windowSpec |
|
3330 |
"This resource specification was automatically generated |
|
3331 |
by the UIPainter of ST/X." |
|
3332 |
||
3333 |
"Do not manually edit this!! If it is corrupted, |
|
3334 |
the UIPainter may not be able to read the specification." |
|
3335 |
||
3336 |
" |
|
3337 |
UIPainter new openOnClass:FileApplicationNoteBook::DigitalNotepadFileViewApplication andSelector:#windowSpec |
|
3338 |
FileApplicationNoteBook::DigitalNotepadFileViewApplication new openInterface:#windowSpec |
|
3339 |
FileApplicationNoteBook::DigitalNotepadFileViewApplication open |
|
3340 |
" |
|
3341 |
||
3342 |
<resource: #canvas> |
|
3343 |
||
3344 |
^ |
|
3345 |
#(FullSpec |
|
3346 |
name: windowSpec |
|
3347 |
window: |
|
3348 |
(WindowSpec |
|
3349 |
label: 'NotepadViewer' |
|
3350 |
name: 'NotepadViewer' |
|
3351 |
min: (Point 10 10) |
|
3352 |
bounds: (Rectangle 0 0 676 492) |
|
3353 |
menu: mainMenu |
|
3354 |
) |
|
3355 |
component: |
|
3356 |
(SpecCollection |
|
3357 |
collection: ( |
|
3358 |
(MenuPanelSpec |
|
3359 |
name: 'Menu' |
|
3360 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
3361 |
level: 0 |
|
3362 |
visibilityChannel: isEmbeddedApplication |
|
3363 |
menu: menu |
|
3364 |
textDefault: true |
|
3365 |
) |
|
3366 |
(ArbitraryComponentSpec |
|
3367 |
name: 'TOPFileView' |
|
3368 |
layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0) |
|
3369 |
hasHorizontalScrollBar: true |
|
3370 |
hasVerticalScrollBar: true |
|
3371 |
miniScrollerHorizontal: false |
|
3372 |
miniScrollerVertical: false |
|
3373 |
hasBorder: false |
|
3374 |
component: TOPFileViewer |
|
3375 |
postBuildCallback: postBuildImageView: |
|
3376 |
) |
|
3377 |
) |
|
3378 |
||
3379 |
) |
|
3380 |
) |
|
3381 |
! ! |
|
3382 |
||
3383 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'menu specs'! |
|
3384 |
||
3385 |
menu |
|
3386 |
"This resource specification was automatically generated |
|
3387 |
by the MenuEditor of ST/X." |
|
3388 |
||
3389 |
"Do not manually edit this!! If it is corrupted, |
|
3390 |
the MenuEditor may not be able to read the specification." |
|
3391 |
||
3392 |
" |
|
3393 |
MenuEditor new openOnClass:FileApplicationNoteBook::ImageViewApplication andSelector:#menu |
|
3394 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ImageViewApplication menu)) startUp |
|
3395 |
" |
|
3396 |
||
3397 |
<resource: #menu> |
|
3398 |
||
3399 |
^ |
|
3400 |
#(#Menu |
|
3401 |
#( |
|
3402 |
"/ #(#MenuItem |
|
3403 |
"/ #label: 'Edit' |
|
3404 |
"/ #itemValue: #editImage |
|
3405 |
"/ #nameKey: #EditImage |
|
3406 |
"/ #translateLabel: true |
|
3407 |
"/ #isButton: true |
|
3408 |
"/ #labelImage: #(#ResourceRetriever #ToolbarIconLibrary #startImageEditorIcon) |
|
3409 |
"/ ) |
|
3410 |
"/ #(#MenuItem |
|
3411 |
"/ #label: '-' |
|
3412 |
"/ ) |
|
3413 |
#(#MenuItem |
|
3414 |
#activeHelpKey: #fitImageSize |
|
3415 |
#label: 'FitSize' |
|
3416 |
#translateLabel: true |
|
3417 |
#isButton: true |
|
3418 |
#triggerOnDown: true |
|
3419 |
#indication: #fitSize |
|
3420 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #fitImageSizeToViewIcon) |
|
3421 |
) |
|
3422 |
#(#MenuItem |
|
3423 |
#label: '-' |
|
3424 |
) |
|
3425 |
#(#MenuItem |
|
3426 |
#activeHelpKey: #closeTabButton |
|
3427 |
#label: 'Close' |
|
3428 |
#itemValue: #doClose |
|
3429 |
#translateLabel: true |
|
3430 |
#isButton: true |
|
3431 |
#startGroup: #right |
|
3432 |
#hideMenuOnActivated: false |
|
3433 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #removeTabIcon) |
|
3434 |
) |
|
3435 |
) |
|
3436 |
nil |
|
3437 |
nil |
|
3438 |
) |
|
3439 |
! ! |
|
3440 |
||
3441 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'queries'! |
|
3442 |
||
3443 |
canOpenItem:anItem |
|
3444 |
^ anItem mimeType = 'application/x-waltop-digital-notepad' |
|
3445 |
! |
|
3446 |
||
3447 |
wantNewApplicationAnyway |
|
3448 |
||
3449 |
^ false |
|
3450 |
! ! |
|
3451 |
||
3452 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'accessing'! |
|
3453 |
||
3454 |
imageView |
|
3455 |
^ imageView |
|
3456 |
! |
|
3457 |
||
3458 |
imageView:something |
|
3459 |
imageView := something. |
|
3460 |
! |
|
3461 |
||
3462 |
updateImageInfo |
|
3463 |
"/ |fn msg| |
|
3464 |
"/ |
|
3465 |
"/ image notNil ifTrue:[ |
|
3466 |
"/ fn := image fileName. |
|
3467 |
"/ fn isNil ifTrue:[ |
|
3468 |
"/ fn := 'unnamed' |
|
3469 |
"/ ] ifFalse:[ |
|
3470 |
"/ fn := fn asFilename baseName. |
|
3471 |
"/ ]. |
|
3472 |
"/ msg := '%1 %2x%3 depth:%4' |
|
3473 |
"/ bindWith:fn allBold |
|
3474 |
"/ with:image width |
|
3475 |
"/ with:image height |
|
3476 |
"/ with:image depth. |
|
3477 |
"/ ]. |
|
3478 |
"/ self notify:msg. |
|
3479 |
! ! |
|
3480 |
||
3481 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'actions'! |
|
3482 |
||
3483 |
changeItem:anItem |
|
3484 |
||
3485 |
self item:anItem. |
|
3486 |
self setupImageView. |
|
3487 |
^ true |
|
3488 |
! |
|
3489 |
||
3490 |
setupImageView |
|
3491 |
imageView readFile:self fileName |
|
3492 |
! ! |
|
3493 |
||
3494 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'aspects'! |
|
3495 |
||
3496 |
fitSize |
|
3497 |
"return/create the 'fitSize' value holder (automatically generated)" |
|
3498 |
||
3499 |
fitSize isNil ifTrue:[ |
|
3500 |
fitSize := ValueHolder new. |
|
3501 |
fitSize addDependent:self. |
|
3502 |
]. |
|
3503 |
^ fitSize |
|
3504 |
! ! |
|
3505 |
||
3506 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'change & update'! |
|
3507 |
||
3508 |
update:something with:aParameter from:changedObject |
|
3509 |
changedObject == self fitSize ifTrue:[ |
|
7910 | 3510 |
changedObject value ifTrue:[ |
3511 |
imageView adjust:#fit. |
|
3512 |
] ifFalse:[ |
|
3513 |
imageView adjust:nil. |
|
3514 |
]. |
|
7909 | 3515 |
^ self |
3516 |
]. |
|
3517 |
super update:something with:aParameter from:changedObject |
|
3518 |
! ! |
|
3519 |
||
3520 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'initialization & release'! |
|
3521 |
||
3522 |
postBuildImageView:aWidget |
|
3523 |
||
3524 |
self imageView: aWidget scrolledView. |
|
3525 |
"/ self imageView wantsFocusWithPointerEnter. |
|
3526 |
! |
|
3527 |
||
3528 |
postOpenWith:aBuilder |
|
3529 |
"only invoked if the application is not started from a master" |
|
3530 |
||
3531 |
|currentDir contents fileName| |
|
3532 |
||
3533 |
self masterApplication isNil ifTrue:[ |
|
3534 |
self masterApplication:nil. |
|
3535 |
currentDir := Filename currentDirectory. |
|
3536 |
contents := currentDir directoryContents. |
|
3537 |
fileName := contents |
|
3538 |
detect:[:file | |
|
3539 |
file asFilename mimeTypeOfContents = 'application/x-waltop-digital-notepad' |
|
3540 |
] |
|
3541 |
ifNone:[nil]. |
|
3542 |
fileName isNil ifTrue:[ |
|
3543 |
Dialog warn:'Cant find a TOP-file in ' , currentDir asString. |
|
3544 |
^ self |
|
3545 |
]. |
|
3546 |
self item:(DirectoryContentsBrowser itemClass fileName:(currentDir construct:fileName)) |
|
3547 |
]. |
|
3548 |
self setupImageView. |
|
3549 |
super postOpenWith:aBuilder |
|
3550 |
! ! |
|
3551 |
||
3892 | 3552 |
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'defaults'! |
3553 |
||
3554 |
tabStringFor:aApplicationType |
|
7687 | 3555 |
"the formatString shown in a tab (language translated)" |
3556 |
||
3557 |
^ 'HTML View for %1' |
|
3558 |
||
3559 |
"Modified: / 01-03-2007 / 21:43:18 / cg" |
|
3892 | 3560 |
! ! |
3561 |
||
5406 | 3562 |
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'help specs'! |
3563 |
||
3564 |
helpSpec |
|
3565 |
"This resource specification was automatically generated |
|
3566 |
by the UIHelpTool of ST/X." |
|
3567 |
||
3568 |
"Do not manually edit this!! If it is corrupted, |
|
3569 |
the UIHelpTool may not be able to read the specification." |
|
3570 |
||
3571 |
" |
|
3572 |
UIHelpTool openOnClass:FileApplicationNoteBook::HtmlViewApplication |
|
3573 |
" |
|
3574 |
||
3575 |
<resource: #help> |
|
3576 |
||
3577 |
^ super helpSpec addPairsFrom:#( |
|
3578 |
||
3579 |
#'Edit Source' |
|
3580 |
'' |
|
3581 |
||
3582 |
) |
|
3583 |
! ! |
|
3584 |
||
3892 | 3585 |
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'interface specs'! |
3586 |
||
3587 |
windowSpec |
|
10566 | 3588 |
|
3589 |
| webKitView | |
|
3590 |
||
3591 |
^((webKitView := (Smalltalk at:#WebKitView)) notNil |
|
3592 |
and:[webKitView isAvailable]) |
|
3593 |
ifTrue:[self windowSpec_WebBrowserPage] |
|
3594 |
ifFalse:[self windowSpec_HTMLView] |
|
3595 |
||
3596 |
"Modified: / 11-08-2011 / 00:33:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3597 |
! |
|
3598 |
||
3599 |
windowSpec_HTMLView |
|
3892 | 3600 |
"This resource specification was automatically generated |
3601 |
by the UIPainter of ST/X." |
|
3602 |
||
3603 |
"Do not manually edit this!! If it is corrupted, |
|
3604 |
the UIPainter may not be able to read the specification." |
|
3605 |
||
3606 |
" |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
3607 |
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
|
3608 |
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
|
3609 |
FileApplicationNoteBook::HtmlViewApplication open |
3892 | 3610 |
" |
3611 |
||
3612 |
<resource: #canvas> |
|
3613 |
||
3614 |
^ |
|
3615 |
#(#FullSpec |
|
3616 |
#name: #windowSpec |
|
3617 |
#window: |
|
3618 |
#(#WindowSpec |
|
3619 |
#label: 'NoteBookApplication::HtmlView' |
|
3620 |
#name: 'NoteBookApplication::HtmlView' |
|
3621 |
#min: #(#Point 10 10) |
|
3622 |
#bounds: #(#Rectangle 16 42 692 534) |
|
3623 |
#menu: #mainMenu |
|
3624 |
) |
|
3625 |
#component: |
|
3626 |
#(#SpecCollection |
|
3627 |
#collection: #( |
|
3628 |
#(#MenuPanelSpec |
|
3629 |
#name: 'MenuHtml' |
|
3630 |
#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
|
3631 |
#level: 0 |
3892 | 3632 |
#visibilityChannel: #isEmbeddedApplication |
3633 |
#menu: #menu |
|
3634 |
#textDefault: true |
|
3635 |
) |
|
3636 |
#(#ArbitraryComponentSpec |
|
3637 |
#name: 'HTMLView' |
|
3638 |
#layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1) |
|
3639 |
#hasHorizontalScrollBar: true |
|
3640 |
#hasVerticalScrollBar: true |
|
3641 |
#miniScrollerHorizontal: false |
|
3642 |
#miniScrollerVertical: false |
|
3643 |
#hasBorder: false |
|
3644 |
#component: #HTMLDocumentView |
|
3645 |
#postBuildCallback: #postBuildHtmlView: |
|
3646 |
) |
|
3647 |
#(#LabelSpec |
|
3648 |
#label: 'FileLabel' |
|
3649 |
#name: 'FileLabel' |
|
3650 |
#layout: #(#LayoutFrame 212 0 2 0 -73 1 30 0) |
|
3651 |
#level: -1 |
|
3652 |
#translateLabel: true |
|
3653 |
#labelChannel: #labelHolder |
|
3654 |
#adjust: #left |
|
3655 |
) |
|
3656 |
) |
|
3657 |
||
3658 |
) |
|
3659 |
) |
|
10566 | 3660 |
|
3661 |
"Created: / 11-08-2011 / 00:19:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3662 |
! |
|
3663 |
||
3664 |
windowSpec_WebBrowserPage |
|
3665 |
"This resource specification was automatically generated |
|
3666 |
by the UIPainter of ST/X." |
|
3667 |
||
3668 |
"Do not manually edit this!! If it is corrupted, |
|
3669 |
the UIPainter may not be able to read the specification." |
|
3670 |
||
3671 |
" |
|
3672 |
UIPainter new openOnClass:FileApplicationNoteBook::HtmlViewApplication andSelector:#windowSpec_WebBrowserPage |
|
3673 |
FileApplicationNoteBook::HtmlViewApplication new openInterface:#windowSpec_WebBrowserPage |
|
3674 |
" |
|
3675 |
||
3676 |
<resource: #canvas> |
|
3677 |
||
3678 |
^ |
|
3679 |
#(FullSpec |
|
3680 |
name: #'windowSpec_WebBrowserPage' |
|
3681 |
window: |
|
3682 |
(WindowSpec |
|
3683 |
label: 'NoteBookApplication::HtmlView' |
|
3684 |
name: 'NoteBookApplication::HtmlView' |
|
3685 |
min: (Point 10 10) |
|
3686 |
bounds: (Rectangle 0 0 676 492) |
|
3687 |
menu: menuJustClose |
|
3688 |
) |
|
3689 |
component: |
|
3690 |
(SpecCollection |
|
3691 |
collection: ( |
|
3692 |
(MenuPanelSpec |
|
3693 |
name: 'MenuClose' |
|
3694 |
layout: (LayoutFrame -25 1 0 0 0 1.0 30 0) |
|
3695 |
level: 0 |
|
3696 |
visibilityChannel: isEmbeddedApplication |
|
3697 |
menu: menuJustClose |
|
3698 |
textDefault: true |
|
3699 |
) |
|
3700 |
(SubCanvasSpec |
|
3701 |
name: 'ToolBar' |
|
3702 |
layout: (LayoutFrame 0 0 0 0 -25 1 30 0) |
|
3703 |
hasHorizontalScrollBar: false |
|
3704 |
hasVerticalScrollBar: false |
|
3705 |
minorKey: toolBarSpec |
|
3706 |
clientKey: webBrowserPage |
|
3707 |
createNewBuilder: false |
|
3708 |
) |
|
3709 |
(SubCanvasSpec |
|
3710 |
name: 'Content' |
|
3711 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
3712 |
hasHorizontalScrollBar: false |
|
3713 |
hasVerticalScrollBar: false |
|
3714 |
minorKey: contentSpec |
|
3715 |
clientKey: webBrowserPage |
|
3716 |
createNewBuilder: false |
|
3717 |
) |
|
3718 |
) |
|
3719 |
||
3720 |
) |
|
3721 |
) |
|
3722 |
||
3723 |
"Modified: / 11-08-2011 / 00:34:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3892 | 3724 |
! ! |
3725 |
||
3726 |
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'menu specs'! |
|
3727 |
||
3728 |
menu |
|
3729 |
"This resource specification was automatically generated |
|
3730 |
by the MenuEditor of ST/X." |
|
3731 |
||
3732 |
"Do not manually edit this!! If it is corrupted, |
|
3733 |
the MenuEditor may not be able to read the specification." |
|
3734 |
||
3735 |
" |
|
3736 |
MenuEditor new openOnClass:FileApplicationNoteBook::HtmlViewApplication andSelector:#menu |
|
3737 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::HtmlViewApplication menu)) startUp |
|
3738 |
" |
|
3739 |
||
3740 |
<resource: #menu> |
|
3741 |
||
3742 |
^ |
|
5406 | 3743 |
#(Menu |
3744 |
( |
|
3745 |
(MenuItem |
|
3746 |
label: 'Reload' |
|
3747 |
itemValue: doReload |
|
3748 |
translateLabel: true |
|
3749 |
isButton: true |
|
6286 | 3750 |
labelImage: (ResourceRetriever ToolbarIconLibrary reloadTextFromFileIcon) |
3892 | 3751 |
) |
5406 | 3752 |
(MenuItem |
3753 |
label: 'Back' |
|
3754 |
itemValue: doGoBack |
|
3755 |
translateLabel: true |
|
3756 |
isButton: true |
|
6286 | 3757 |
labelImage: (ResourceRetriever ToolbarIconLibrary historyBackIcon) |
3892 | 3758 |
) |
5406 | 3759 |
(MenuItem |
8087 | 3760 |
label: '-' |
3761 |
) |
|
3762 |
(MenuItem |
|
5406 | 3763 |
label: 'Print' |
3764 |
itemValue: doPrint |
|
3765 |
translateLabel: true |
|
3766 |
isButton: true |
|
6286 | 3767 |
labelImage: (ResourceRetriever ToolbarIconLibrary printerIcon) |
3892 | 3768 |
) |
5406 | 3769 |
(MenuItem |
8087 | 3770 |
label: '-' |
3771 |
) |
|
3772 |
(MenuItem |
|
5406 | 3773 |
activeHelpKey: #'Edit Source' |
3774 |
label: 'Edit' |
|
3775 |
itemValue: doEdit |
|
3776 |
translateLabel: true |
|
3777 |
isButton: true |
|
6093 | 3778 |
labelImage: (ResourceRetriever ToolbarIconLibrary editFileIcon) |
5406 | 3779 |
) |
3780 |
(MenuItem |
|
8087 | 3781 |
activeHelpKey: closeTabButton |
5406 | 3782 |
label: 'Close' |
3783 |
itemValue: doClose |
|
3784 |
translateLabel: true |
|
3785 |
isButton: true |
|
3786 |
startGroup: right |
|
3787 |
hideMenuOnActivated: false |
|
6093 | 3788 |
labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon) |
3892 | 3789 |
) |
3790 |
) |
|
3791 |
nil |
|
3792 |
nil |
|
3793 |
) |
|
10566 | 3794 |
! |
3795 |
||
3796 |
menuJustClose |
|
3797 |
"This resource specification was automatically generated |
|
3798 |
by the MenuEditor of ST/X." |
|
3799 |
||
3800 |
"Do not manually edit this!! If it is corrupted, |
|
3801 |
the MenuEditor may not be able to read the specification." |
|
3802 |
||
3803 |
" |
|
3804 |
MenuEditor new openOnClass:FileApplicationNoteBook::HtmlViewApplication andSelector:#menuJustClose |
|
3805 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::HtmlViewApplication menuJustClose)) startUp |
|
3806 |
" |
|
3807 |
||
3808 |
<resource: #menu> |
|
3809 |
||
3810 |
^ |
|
3811 |
#(Menu |
|
3812 |
( |
|
3813 |
(MenuItem |
|
3814 |
activeHelpKey: closeTabButton |
|
3815 |
label: 'Close' |
|
3816 |
itemValue: doClose |
|
3817 |
translateLabel: true |
|
3818 |
isButton: true |
|
3819 |
startGroup: right |
|
3820 |
hideMenuOnActivated: false |
|
3821 |
labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon) |
|
3822 |
) |
|
3823 |
) |
|
3824 |
nil |
|
3825 |
nil |
|
3826 |
) |
|
3892 | 3827 |
! ! |
3828 |
||
3829 |
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'queries'! |
|
3830 |
||
5010 | 3831 |
canOpenItem:anItem |
3832 |
||
13715
dab7e512b771
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13406
diff
changeset
|
3833 |
^ (anItem hasMimeType and:[anItem mimeType isHtmlType]) |
3892 | 3834 |
! |
3835 |
||
3836 |
wantNewApplicationAnyway |
|
3837 |
||
3838 |
^ false |
|
3839 |
! ! |
|
3840 |
||
3841 |
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'accessing'! |
|
3842 |
||
3843 |
htmlView |
|
3844 |
"return the value of the instance variable 'imageView' (automatically generated)" |
|
3845 |
||
3846 |
^ htmlView |
|
3847 |
! |
|
3848 |
||
3849 |
htmlView:something |
|
3850 |
"set the value of the instance variable 'imageView' (automatically generated)" |
|
3851 |
||
3852 |
htmlView := something. |
|
3853 |
! |
|
3854 |
||
5010 | 3855 |
item:anItem |
3892 | 3856 |
|
3857 |
|retVal| |
|
3858 |
||
5010 | 3859 |
self labelHolder value:anItem fileName asString. |
3860 |
retVal := super item:anItem. |
|
3892 | 3861 |
self setupHtmlView. |
3862 |
^ retVal |
|
3863 |
! ! |
|
3864 |
||
15232
0e892557798d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15230
diff
changeset
|
3865 |
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'accessing-subApps'! |
10566 | 3866 |
|
3867 |
webBrowserPage |
|
3868 |
||
3869 |
webBrowserPage isNil ifTrue:[ |
|
3870 |
webBrowserPage := Tools::WebBrowserPage new. |
|
3871 |
webBrowserPage urlHolder: self labelHolder |
|
3872 |
]. |
|
3873 |
^webBrowserPage |
|
3874 |
||
3875 |
"Created: / 11-08-2011 / 00:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3876 |
! ! |
|
3877 |
||
3892 | 3878 |
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'actions'! |
3879 |
||
5406 | 3880 |
doEdit |
7540
69a739c09f2c
edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents:
7487
diff
changeset
|
3881 |
self masterApplication |
69a739c09f2c
edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents:
7487
diff
changeset
|
3882 |
openTextEditorForFile:(htmlView currentDocument) |
69a739c09f2c
edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents:
7487
diff
changeset
|
3883 |
"/ openTextEditorOn:item. |
69a739c09f2c
edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents:
7487
diff
changeset
|
3884 |
|
69a739c09f2c
edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents:
7487
diff
changeset
|
3885 |
"Modified: / 24-11-2006 / 11:14:51 / cg" |
5406 | 3886 |
! |
3887 |
||
3892 | 3888 |
doGoBack |
3889 |
||
3890 |
self htmlView menu_back. |
|
3891 |
! |
|
3892 |
||
3893 |
doGoHome |
|
3894 |
||
3895 |
self htmlView menu_home. |
|
3896 |
! |
|
3897 |
||
3898 |
doHelp |
|
3899 |
||
3900 |
self htmlView menu_help. |
|
3901 |
! |
|
3902 |
||
3903 |
doPrint |
|
3904 |
||
3905 |
self htmlView menu_print. |
|
3906 |
! |
|
3907 |
||
3908 |
doReload |
|
3909 |
||
3910 |
self htmlView menu_reload. |
|
3911 |
! |
|
3912 |
||
3913 |
setupHtmlView |
|
3914 |
||
3915 |
| html file directory| |
|
3916 |
||
3917 |
html := self htmlView. |
|
3918 |
html isNil ifTrue:[^ self]. |
|
9785 | 3919 |
|
3892 | 3920 |
file := self fileName. |
3921 |
directory := file directoryName. |
|
3922 |
html homeDocument:(file asString). |
|
3923 |
html setTopDirectoryName:directory. |
|
3924 |
html uriHolder:self labelHolder. |
|
3925 |
html infoHolder:self notifyChannel. |
|
3926 |
html linkButtonPanel:nil. |
|
3927 |
^ html |
|
9785 | 3928 |
|
3929 |
"Modified: / 17-02-2011 / 14:01:35 / cg" |
|
3892 | 3930 |
! ! |
3931 |
||
3932 |
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'aspects'! |
|
3933 |
||
3934 |
labelHolder |
|
3935 |
||
3936 |
labelHolder isNil ifTrue:[ |
|
3937 |
labelHolder := '' asValue. |
|
3938 |
]. |
|
3939 |
^ labelHolder. |
|
3940 |
! ! |
|
3941 |
||
3942 |
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'initialization & release'! |
|
3943 |
||
3944 |
postBuildHtmlView:aWidget |
|
3945 |
||
3946 |
self htmlView: aWidget scrolledView. |
|
3947 |
self htmlView wantsFocusWithPointerEnter. |
|
3948 |
! |
|
3949 |
||
3950 |
postOpenWith:aBuilder |
|
6626 | 3951 |
"only invoked if the application not started from a master" |
3892 | 3952 |
|
3953 |
|currentDir contents suffix fileName| |
|
3954 |
||
3955 |
self masterApplication isNil ifTrue:[ |
|
3956 |
self masterApplication:nil. |
|
3957 |
currentDir := Filename homeDirectory. |
|
3958 |
||
3959 |
contents := currentDir directoryContents. |
|
3960 |
fileName := contents |
|
3961 |
detect:[:file | |
|
3962 |
suffix := file asFilename suffix asLowercase. |
|
3963 |
suffix = 'html' |
|
3964 |
] |
|
3965 |
ifNone:[nil]. |
|
3966 |
fileName isNil ifTrue:[ |
|
3967 |
Dialog warn:'cant find a HTML file in ' , currentDir asString. |
|
3968 |
^ self |
|
3969 |
]. |
|
9785 | 3970 |
self item:(DirectoryContentsBrowser itemClass |
3971 |
fileName:('../../doc/online/english/TOP.html') asFilename asAbsoluteFilename). |
|
3892 | 3972 |
]. |
3973 |
self setupHtmlView. |
|
6626 | 3974 |
super postOpenWith:aBuilder |
9785 | 3975 |
|
3976 |
"Modified: / 17-02-2011 / 13:27:12 / cg" |
|
3892 | 3977 |
! ! |
3978 |
||
3979 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'defaults'! |
|
3980 |
||
3981 |
tabStringFor:aApplicationType |
|
7687 | 3982 |
"the formatString shown in a tab (language translated)" |
3983 |
||
3984 |
^ 'Image in %1' |
|
3985 |
||
3986 |
"Modified: / 01-03-2007 / 21:43:23 / cg" |
|
3892 | 3987 |
! ! |
3988 |
||
7909 | 3989 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'documentation'! |
3990 |
||
3991 |
documentation |
|
3992 |
" |
|
3993 |
a previewer-plugin for bitmap images (jpg, xpm, tiff, gif, etc.) |
|
3994 |
Offers edit and adjust-size button functions. |
|
3995 |
" |
|
3996 |
! ! |
|
3997 |
||
6100 | 3998 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'help specs'! |
3999 |
||
17900 | 4000 |
helpSpec |
6100 | 4001 |
"This resource specification was automatically generated |
4002 |
by the UIHelpTool of ST/X." |
|
4003 |
||
4004 |
"Do not manually edit this!! If it is corrupted, |
|
4005 |
the UIHelpTool may not be able to read the specification." |
|
4006 |
||
4007 |
" |
|
4008 |
UIHelpTool openOnClass:FileApplicationNoteBook::HtmlViewApplication |
|
4009 |
" |
|
4010 |
||
4011 |
<resource: #help> |
|
4012 |
||
17900 | 4013 |
^ super helpSpec addPairsFrom:#( |
6100 | 4014 |
|
4015 |
#'fitImageSize' |
|
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4016 |
'Shrink image to fit view' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4017 |
|
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4018 |
#'showHex' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4019 |
'Show a hex dump of the file''s contents' |
6100 | 4020 |
|
4021 |
) |
|
4022 |
! ! |
|
4023 |
||
3892 | 4024 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'image specs'! |
4025 |
||
4026 |
fitSize20x20Icon |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4027 |
<resource: #image> |
3892 | 4028 |
"This resource specification was automatically generated |
4029 |
by the ImageEditor of ST/X." |
|
4030 |
"Do not manually edit this!! If it is corrupted, |
|
4031 |
the ImageEditor may not be able to read the specification." |
|
4032 |
" |
|
4033 |
self fitSize20x20Icon inspect |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4034 |
ImageEditor openOnClass:self andSelector:#fitSize20x20Icon" |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4035 |
|
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4036 |
^ Icon |
3892 | 4037 |
constantNamed:#'FileApplicationNoteBook::ImageViewApplication class fitSize20x20Icon' |
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4038 |
ifAbsentPut:[ |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4039 |
(Depth4Image new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4040 |
width:20; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4041 |
height:20; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4042 |
photometric:(#palette); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4043 |
bitsPerSample:(#( 4 )); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4044 |
samplesPerPixel:(1); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4045 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4046 |
fromPackedString:' |
3892 | 4047 |
@@DQDQDQDQDP@@@PDQDQDQDQ@P@A@ADQDQDQDP@PD@@PDQDQDPD@@QDQ@ADQDQ@@DQDQD@@@@@@@@@DQDQDPQDQDQ@DQDQDQDDQUUTPADQDQDQAEUUUT@QDQ |
4048 |
DQDPQEUUQ@DQDQDQDDQFQDPADQDQDQADQ$QD@QDQDQDPL3X3Q@DQDQDQDCL3L3LADQDQD@@@@@@@@@DQDQD@DQDQDP@QDQ@@DADQDQDA@@DA@ADQDQDQDP@P |
|
4049 |
@@@QDQDQDQDA@@@ADQDQDQDQD@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
4050 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4051 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4052 |
colorMapFromArray:#[ 0 0 0 255 255 255 0 0 0 0 137 0 174 218 230 0 206 0 133 60 36 ]; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4053 |
mask:((ImageMask new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4054 |
width:20; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4055 |
height:20; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4056 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4057 |
fromPackedString:' |
3892 | 4058 |
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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
4059 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
4060 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
4061 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4062 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4063 |
yourself); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4064 |
yourself |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4065 |
] |
3892 | 4066 |
! ! |
4067 |
||
4068 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'interface specs'! |
|
4069 |
||
4070 |
windowSpec |
|
4071 |
"This resource specification was automatically generated |
|
4072 |
by the UIPainter of ST/X." |
|
4073 |
||
4074 |
"Do not manually edit this!! If it is corrupted, |
|
4075 |
the UIPainter may not be able to read the specification." |
|
4076 |
||
4077 |
" |
|
4078 |
UIPainter new openOnClass:FileApplicationNoteBook::ImageViewApplication andSelector:#windowSpec |
|
4079 |
FileApplicationNoteBook::ImageViewApplication new openInterface:#windowSpec |
|
4080 |
FileApplicationNoteBook::ImageViewApplication open |
|
4081 |
" |
|
4082 |
||
4083 |
<resource: #canvas> |
|
4084 |
||
4085 |
^ |
|
4086 |
#(#FullSpec |
|
4087 |
#name: #windowSpec |
|
4088 |
#window: |
|
4089 |
#(#WindowSpec |
|
4090 |
#label: 'ImageViewer' |
|
4091 |
#name: 'ImageViewer' |
|
4092 |
#min: #(#Point 10 10) |
|
4093 |
#bounds: #(#Rectangle 16 42 692 534) |
|
4094 |
#menu: #mainMenu |
|
4095 |
) |
|
4096 |
#component: |
|
4097 |
#(#SpecCollection |
|
4098 |
#collection: #( |
|
4099 |
#(#MenuPanelSpec |
|
4261 | 4100 |
#name: 'MenuImage' |
3892 | 4101 |
#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
|
4102 |
#level: 0 |
3892 | 4103 |
#visibilityChannel: #isEmbeddedApplication |
4104 |
#menu: #menu |
|
4105 |
#textDefault: true |
|
4106 |
) |
|
4107 |
#(#ArbitraryComponentSpec |
|
4261 | 4108 |
#name: 'ImageView' |
3892 | 4109 |
#layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0) |
4110 |
#hasHorizontalScrollBar: true |
|
4111 |
#hasVerticalScrollBar: true |
|
4112 |
#miniScrollerHorizontal: false |
|
4113 |
#miniScrollerVertical: false |
|
4114 |
#hasBorder: false |
|
4115 |
#component: #ImageView |
|
4116 |
#postBuildCallback: #postBuildImageView: |
|
4117 |
) |
|
4118 |
) |
|
4119 |
||
4120 |
) |
|
4121 |
) |
|
4122 |
! ! |
|
4123 |
||
4124 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'menu specs'! |
|
4125 |
||
4126 |
menu |
|
4127 |
"This resource specification was automatically generated |
|
4128 |
by the MenuEditor of ST/X." |
|
4129 |
||
4130 |
"Do not manually edit this!! If it is corrupted, |
|
4131 |
the MenuEditor may not be able to read the specification." |
|
4132 |
||
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4133 |
|
3892 | 4134 |
" |
4135 |
MenuEditor new openOnClass:FileApplicationNoteBook::ImageViewApplication andSelector:#menu |
|
4136 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ImageViewApplication menu)) startUp |
|
4137 |
" |
|
4138 |
||
4139 |
<resource: #menu> |
|
4140 |
||
4141 |
^ |
|
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4142 |
#(Menu |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4143 |
( |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4144 |
(MenuItem |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4145 |
label: 'Edit' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4146 |
itemValue: editImage |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4147 |
nameKey: EditImage |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4148 |
isButton: true |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4149 |
labelImage: (ResourceRetriever ToolbarIconLibrary startImageEditorIcon) |
3892 | 4150 |
) |
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4151 |
(MenuItem |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4152 |
label: '-' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4153 |
) |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4154 |
(MenuItem |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4155 |
activeHelpKey: fitImageSize |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4156 |
label: 'FitSize' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4157 |
isButton: true |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4158 |
triggerOnDown: true |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4159 |
indication: fitSize |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4160 |
labelImage: (ResourceRetriever ToolbarIconLibrary fitImageSizeToViewIcon) |
3892 | 4161 |
) |
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4162 |
(MenuItem |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4163 |
label: '-' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4164 |
) |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4165 |
(MenuItem |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4166 |
activeHelpKey: showHex |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4167 |
label: 'ShowHex' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4168 |
itemValue: showHex |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4169 |
isButton: true |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4170 |
triggerOnDown: true |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4171 |
labelImage: (ResourceRetriever ToolbarIconLibrary hexToggleIcon) |
3892 | 4172 |
) |
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4173 |
(MenuItem |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4174 |
label: '' |
3892 | 4175 |
) |
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4176 |
(MenuItem |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4177 |
activeHelpKey: closeTabButton |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4178 |
label: 'Close' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4179 |
itemValue: doClose |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4180 |
isButton: true |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4181 |
startGroup: right |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4182 |
hideMenuOnActivated: false |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4183 |
labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon) |
3892 | 4184 |
) |
4185 |
) |
|
4186 |
nil |
|
4187 |
nil |
|
4188 |
) |
|
4189 |
! ! |
|
4190 |
||
4191 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'queries'! |
|
4192 |
||
5010 | 4193 |
canOpenItem:anItem |
17950 | 4194 |
|mimeType imageReader| |
4195 |
||
4196 |
^ (anItem hasMimeType |
|
4197 |
and:[(mimeType := anItem mimeType) isImageType |
|
4198 |
"/ do not trust the mimetype - the contents may not correspond to its mimetype... |
|
4199 |
and:[(imageReader := MIMETypes imageReaderForType:mimeType) notNil |
|
4200 |
and:[imageReader isValidImageFile:anItem fileName]]]) |
|
3892 | 4201 |
! |
4202 |
||
4203 |
wantNewApplicationAnyway |
|
4204 |
||
4205 |
^ false |
|
4206 |
! ! |
|
4207 |
||
4208 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'accessing'! |
|
4209 |
||
4210 |
image:something |
|
4211 |
image := something. |
|
4417 | 4212 |
self updateImageInfo. |
3892 | 4213 |
! |
4214 |
||
4215 |
imageView |
|
4216 |
^ imageView |
|
4217 |
! |
|
4218 |
||
4219 |
imageView:something |
|
4220 |
imageView := something. |
|
4417 | 4221 |
! |
4222 |
||
4223 |
updateImageInfo |
|
17639 | 4224 |
|fn msg depth imageType| |
4417 | 4225 |
|
4226 |
image notNil ifTrue:[ |
|
4227 |
fn := image fileName. |
|
4228 |
fn isNil ifTrue:[ |
|
4229 |
fn := 'unnamed' |
|
4230 |
] ifFalse:[ |
|
4231 |
fn := fn asFilename baseName. |
|
4232 |
]. |
|
17639 | 4233 |
|
4234 |
depth := image depth. |
|
4235 |
imageType := image photometric. |
|
4236 |
||
4237 |
(imageType == #blackIs0 or:[ imageType == #whiteIs0 ]) ifTrue:[ |
|
4238 |
imageType := #grayscale. |
|
4239 |
depth == 1 ifTrue:[ |
|
4240 |
imageType := 'monochrome' |
|
4241 |
]. |
|
4242 |
]. |
|
4243 |
||
4244 |
msg := '%1 %2x%3 depth:%4 (%5)' |
|
4417 | 4245 |
bindWith:fn allBold |
4246 |
with:image width |
|
4247 |
with:image height |
|
17639 | 4248 |
with:depth |
4249 |
with:imageType. |
|
4417 | 4250 |
]. |
4523 | 4251 |
self notify:msg. |
17637 | 4252 |
|
17639 | 4253 |
"Modified: / 29-08-2017 / 12:37:27 / cg" |
3892 | 4254 |
! ! |
4255 |
||
4256 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'actions'! |
|
4257 |
||
5010 | 4258 |
changeItem:anItem |
4259 |
||
4260 |
self item:anItem. |
|
3892 | 4261 |
self setupImageView. |
4262 |
^ true |
|
4263 |
! |
|
4264 |
||
4265 |
editImage |
|
4266 |
|img| |
|
4267 |
||
4268 |
img := self image. |
|
4269 |
img notNil ifTrue:[ |
|
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
4270 |
"/ self withWaitCursorDo:[ |
4855 | 4271 |
img edit. |
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
4272 |
"/ ] |
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
4273 |
]. |
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
4274 |
|
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
4275 |
"Modified: / 25-07-2006 / 09:09:20 / cg" |
3892 | 4276 |
! |
4277 |
||
4278 |
image |
|
17640 | 4279 |
|img fn e firstTry| |
3892 | 4280 |
|
4281 |
fn := self fileName. |
|
17640 | 4282 |
firstTry := true. |
14819
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4283 |
Image badImageFormatQuerySignal handle:[:ex | |
17640 | 4284 |
|reader| |
4285 |
||
4286 |
firstTry ifTrue:[ |
|
4287 |
firstTry := false. |
|
4288 |
||
4289 |
"/ autoload image readers and retry |
|
4290 |
(fn suffix = 'pcx') ifTrue:[ |
|
4291 |
reader := PCXReader. |
|
4292 |
]. |
|
4293 |
(#('ppm' 'pgm' 'pbm' ) includes:fn suffix) ifTrue:[ |
|
4294 |
reader := PBMReader. |
|
4295 |
]. |
|
4296 |
(fn suffix = 'tga') ifTrue:[ |
|
4297 |
reader := TargaReader. |
|
4298 |
]. |
|
4299 |
(fn suffix = 'bmp') ifTrue:[ |
|
4300 |
reader := WindowsIconReader. |
|
4301 |
]. |
|
4302 |
reader notNil ifTrue:[ |
|
4303 |
reader autoload. ex restart. |
|
4304 |
] |
|
4305 |
]. |
|
4306 |
||
14819
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4307 |
e := ex description. |
17635 | 4308 |
Dialog warn:('Error while reading image:\n\n%s' printfWith:e). |
16146 | 4309 |
"/ ex mayProceed ifTrue:[ ex proceed ]. |
14819
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4310 |
] do:[ |
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4311 |
img := Image fromFile:fn. |
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4312 |
]. |
17640 | 4313 |
|
3892 | 4314 |
img isNil ifTrue:[ |
14819
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4315 |
e isNil ifTrue:[ |
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4316 |
fn exists ifTrue:[ |
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4317 |
e := 'Unknown/unsupported image format' |
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4318 |
] ifFalse:[ |
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4319 |
e := 'No such image' |
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4320 |
]. |
17411 | 4321 |
Dialog warn:('Error while reading image:\n%s' printfWith:e). |
3892 | 4322 |
]. |
4323 |
^ nil |
|
4324 |
]. |
|
14907
647b035e2f5f
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14906
diff
changeset
|
4325 |
e notNil ifTrue:[ |
647b035e2f5f
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14906
diff
changeset
|
4326 |
Dialog information:'An error occurred while decoding some parts of the image.\However, some image data was retrieved...' withCRs. |
647b035e2f5f
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14906
diff
changeset
|
4327 |
]. |
3892 | 4328 |
^ img. |
17411 | 4329 |
|
17640 | 4330 |
"Modified: / 29-08-2017 / 22:42:35 / cg" |
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4331 |
! |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4332 |
|
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4333 |
showHex |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4334 |
masterApplication openTextEditorWithHexPresentationOn:item |
3892 | 4335 |
! ! |
4336 |
||
4337 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'aspects'! |
|
4338 |
||
4339 |
fitSize |
|
4340 |
"return/create the 'fitSize' value holder (automatically generated)" |
|
4341 |
||
4342 |
fitSize isNil ifTrue:[ |
|
4343 |
fitSize := ValueHolder new. |
|
4344 |
fitSize addDependent:self. |
|
4345 |
]. |
|
4346 |
^ fitSize |
|
4347 |
! ! |
|
4348 |
||
4349 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'change & update'! |
|
4350 |
||
4351 |
update:something with:aParameter from:changedObject |
|
4352 |
changedObject == self fitSize ifTrue:[ |
|
4353 |
changedObject value ifTrue:[ |
|
17683 | 4354 |
"/ imageView adjust:#smoothFitBig. |
3892 | 4355 |
imageView adjust:#fitBig. |
4356 |
] ifFalse:[ |
|
4357 |
imageView adjust:nil. |
|
4358 |
]. |
|
4359 |
^ self |
|
4360 |
]. |
|
4361 |
super update:something with:aParameter from:changedObject |
|
17683 | 4362 |
|
4363 |
"Modified: / 11-09-2017 / 09:06:40 / cg" |
|
3892 | 4364 |
! ! |
4365 |
||
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4366 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'event handling'! |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4367 |
|
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4368 |
processEvent:anEvent |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4369 |
|view rawKey key| |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4370 |
|
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4371 |
view := anEvent view. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4372 |
anEvent isKeyPressEvent ifTrue:[ |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4373 |
(imageView notNil |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4374 |
and:[view notNil |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4375 |
and:[(view == imageView)]] |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4376 |
) ifTrue:[ |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4377 |
rawKey := anEvent rawKey. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4378 |
key := anEvent key. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4379 |
(rawKey == #CursorDown) ifTrue:[ |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4380 |
masterApplication selectNextFile; enterAction. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4381 |
^ true. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4382 |
]. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4383 |
(rawKey == #CursorUp) ifTrue:[ |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4384 |
masterApplication selectPreviousFile; enterAction. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4385 |
^ true. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4386 |
]. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4387 |
key == $q ifTrue:[ |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4388 |
self doClose. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4389 |
^ true. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4390 |
]. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4391 |
((key == #Escape) or:[key == $x]) ifTrue:[ |
17683 | 4392 |
self topView perform:#collapse ifNotUnderstood:[]. |
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4393 |
^ true. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4394 |
]. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4395 |
((key == #Cut) |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4396 |
or:[(key == #BackSpace) |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4397 |
or:[key == #Delete]]) ifTrue:[ |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4398 |
masterApplication deleteFiles. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4399 |
^ true |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4400 |
]. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4401 |
^ false |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4402 |
] |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4403 |
]. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4404 |
^ false |
17683 | 4405 |
|
4406 |
"Modified: / 10-09-2017 / 16:52:40 / cg" |
|
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4407 |
! ! |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4408 |
|
3892 | 4409 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'initialization & release'! |
4410 |
||
4411 |
postBuildImageView:aWidget |
|
4412 |
||
4413 |
self imageView: aWidget scrolledView. |
|
4414 |
self imageView wantsFocusWithPointerEnter. |
|
4415 |
! |
|
4416 |
||
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4417 |
postOpenAsSubcanvasWith:aBuilder |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4418 |
"invoked if the application is embedded in some other view" |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4419 |
|
16049 | 4420 |
|wg| |
4421 |
||
4422 |
(wg := self imageView windowGroup) notNil ifTrue:[ |
|
4423 |
wg addPreEventHook:self. |
|
4424 |
]. |
|
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4425 |
super postOpenAsSubcanvasWith:aBuilder |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4426 |
! |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4427 |
|
3892 | 4428 |
postOpenWith:aBuilder |
7909 | 4429 |
"only invoked if the application is not started from a master" |
3892 | 4430 |
|
4431 |
|currentDir contents suffix fileName| |
|
4432 |
||
4433 |
self masterApplication isNil ifTrue:[ |
|
4434 |
self masterApplication:nil. |
|
4435 |
currentDir := Filename currentDirectory. |
|
4436 |
contents := currentDir directoryContents. |
|
4437 |
fileName := contents |
|
4438 |
detect:[:file | |
|
4439 |
suffix := file asFilename suffix asLowercase. |
|
4440 |
Image isImageFileSuffix:suffix |
|
4441 |
] |
|
4442 |
ifNone:[nil]. |
|
4443 |
fileName isNil ifTrue:[ |
|
4444 |
Dialog warn:'cant find a Image in ' , currentDir asString. |
|
4445 |
^ self |
|
4446 |
]. |
|
3982 | 4447 |
self item:(DirectoryContentsBrowser itemClass fileName:(currentDir construct:fileName)) |
3892 | 4448 |
]. |
4449 |
self setupImageView. |
|
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4450 |
self imageView windowGroup addPreEventHook:self. |
6626 | 4451 |
super postOpenWith:aBuilder |
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4452 |
! |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4453 |
|
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4454 |
setupImageView |
17639 | 4455 |
|p| |
4456 |
||
4457 |
(p := imageReadProcess) notNil ifTrue:[ |
|
4458 |
imageReadProcess := nil. |
|
4459 |
p terminate. |
|
4460 |
]. |
|
4461 |
||
4462 |
imageReadProcess := |
|
4463 |
[ |
|
4464 |
|img| |
|
4465 |
||
4466 |
imageView withCursor:(Cursor wait) do:[ |
|
4467 |
img := self image. |
|
4468 |
img notNil ifTrue:[ |
|
4469 |
self image:img. |
|
4470 |
imageView image:img |
|
4471 |
]. |
|
4472 |
imageReadProcess := nil. |
|
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4473 |
]. |
17639 | 4474 |
] fork. |
4475 |
||
4476 |
"Modified: / 29-08-2017 / 12:31:00 / cg" |
|
3892 | 4477 |
! ! |
4478 |
||
4479 |
!FileApplicationNoteBook::Terminal class methodsFor:'defaults'! |
|
4480 |
||
4758 | 4481 |
defaultLineLimit |
4482 |
"the number of buffered lines" |
|
4483 |
||
4759 | 4484 |
^ DefaultLineLimit ? TextCollector defaultLineLimit |
7787 | 4485 |
|
4486 |
" |
|
4487 |
DefaultLineLimit := 30000 |
|
4488 |
" |
|
4489 |
||
4490 |
"Modified: / 05-04-2007 / 17:03:11 / cg" |
|
4758 | 4491 |
! |
4492 |
||
3892 | 4493 |
tabStringFor:aApplicationType |
7687 | 4494 |
"the formatString shown in a tab (language translated)" |
3892 | 4495 |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4496 |
^ 'Terminal' |
7687 | 4497 |
|
4498 |
"Modified: / 01-03-2007 / 21:43:38 / cg" |
|
3892 | 4499 |
! ! |
4500 |
||
11099 | 4501 |
!FileApplicationNoteBook::Terminal class methodsFor:'help specs'! |
4502 |
||
4503 |
helpSpec |
|
4504 |
"This resource specification was automatically generated |
|
4505 |
by the UIHelpTool of ST/X." |
|
4506 |
||
4507 |
"Do not manually edit this!! If it is corrupted, |
|
4508 |
the UIHelpTool may not be able to read the specification." |
|
4509 |
||
4510 |
" |
|
4511 |
UIHelpTool openOnClass:FileApplicationNoteBook::Terminal |
|
4512 |
" |
|
4513 |
||
4514 |
<resource: #help> |
|
4515 |
||
4516 |
^ super helpSpec addPairsFrom:#( |
|
4517 |
||
4518 |
#closeTabButton |
|
4519 |
'' |
|
4520 |
||
4521 |
) |
|
4522 |
! ! |
|
4523 |
||
3892 | 4524 |
!FileApplicationNoteBook::Terminal class methodsFor:'interface specs'! |
4525 |
||
4526 |
windowSpec |
|
4527 |
"This resource specification was automatically generated |
|
4528 |
by the UIPainter of ST/X." |
|
4529 |
||
4530 |
"Do not manually edit this!! If it is corrupted, |
|
4531 |
the UIPainter may not be able to read the specification." |
|
4532 |
||
4533 |
" |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4534 |
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
|
4535 |
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
|
4536 |
FileApplicationNoteBook::Terminal open |
3892 | 4537 |
" |
4538 |
||
4539 |
<resource: #canvas> |
|
4540 |
||
4541 |
^ |
|
5661
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4542 |
#(FullSpec |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4543 |
name: windowSpec |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4544 |
window: |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4545 |
(WindowSpec |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4546 |
label: 'Terminal' |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4547 |
name: 'Terminal' |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4548 |
min: (Point 10 10) |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4549 |
bounds: (Rectangle 0 0 692 537) |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4550 |
"/ menu: mainMenu |
3892 | 4551 |
) |
5661
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4552 |
component: |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4553 |
(SpecCollection |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4554 |
collection: ( |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4555 |
(MenuPanelSpec |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4556 |
name: 'MenuTerminal' |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4557 |
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
|
4558 |
level: 0 |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4559 |
menu: toolbarMenu |
5661
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4560 |
textDefault: true |
3892 | 4561 |
) |
5661
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4562 |
(ArbitraryComponentSpec |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4563 |
name: 'TerminalView' |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4564 |
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
|
4565 |
hasHorizontalScrollBar: true |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4566 |
hasVerticalScrollBar: true |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4567 |
miniScrollerHorizontal: true |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4568 |
miniScrollerVertical: false |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4569 |
autoHideScrollBars: false |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4570 |
hasBorder: false |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4571 |
component: terminalView |
3892 | 4572 |
) |
4573 |
) |
|
4574 |
||
4575 |
) |
|
4576 |
) |
|
4577 |
! ! |
|
4578 |
||
4579 |
!FileApplicationNoteBook::Terminal class methodsFor:'menu specs'! |
|
4580 |
||
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4581 |
toolbarMenu |
3892 | 4582 |
"This resource specification was automatically generated |
4583 |
by the MenuEditor of ST/X." |
|
4584 |
||
4585 |
"Do not manually edit this!! If it is corrupted, |
|
4586 |
the MenuEditor may not be able to read the specification." |
|
4587 |
||
11099 | 4588 |
|
3892 | 4589 |
" |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4590 |
MenuEditor new openOnClass:FileApplicationNoteBook::Terminal andSelector:#toolbarMenu |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4591 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::Terminal toolbarMenu)) startUp |
3892 | 4592 |
" |
4593 |
||
4594 |
<resource: #menu> |
|
4595 |
||
4596 |
^ |
|
11099 | 4597 |
#(Menu |
4598 |
( |
|
4599 |
(MenuItem |
|
4600 |
label: 'Save As...' |
|
4601 |
itemValue: saveAs |
|
4602 |
nameKey: Save |
|
4603 |
isButton: true |
|
4604 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveToFileAsIcon) |
|
3892 | 4605 |
) |
11099 | 4606 |
(MenuItem |
4607 |
activeHelpKey: closeTabButton |
|
4608 |
label: 'Close' |
|
4609 |
itemValue: doClose |
|
4610 |
isButton: true |
|
4611 |
startGroup: right |
|
4612 |
isVisible: closeButtonShown |
|
4613 |
hideMenuOnActivated: false |
|
4614 |
labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon) |
|
3892 | 4615 |
) |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4616 |
(MenuItem |
14801
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4617 |
label: 'Scroll Lock' |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4618 |
itemValue: scrollLockedChanged |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4619 |
isButton: true |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4620 |
startGroup: right |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4621 |
indication: scrollLockedHolder |
14802
99e863c55e0f
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
4622 |
labelImage: (ResourceRetriever ToolbarIconLibrary scrollLockIcon) |
14801
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4623 |
) |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4624 |
(MenuItem |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4625 |
label: 'Clear Console Output' |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4626 |
itemValue: menuClearConsole |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4627 |
isButton: true |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4628 |
startGroup: right |
14802
99e863c55e0f
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
4629 |
labelImage: (ResourceRetriever ToolbarIconLibrary clearConsoleIcon) |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4630 |
) |
3892 | 4631 |
) |
4632 |
nil |
|
4633 |
nil |
|
4634 |
) |
|
4635 |
! ! |
|
4636 |
||
4637 |
!FileApplicationNoteBook::Terminal methodsFor:'accessing'! |
|
4638 |
||
4639 |
terminalView |
|
4640 |
||
4641 |
terminalView isNil ifTrue:[ |
|
13905
519c20b1a23c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13812
diff
changeset
|
4642 |
(OperatingSystem isUNIXlike |
14458
bba439082438
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14444
diff
changeset
|
4643 |
"/ mhm - xterm embedding seems to no longer work; the default from user prefs is therefore false |
bba439082438
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14444
diff
changeset
|
4644 |
and:[UserPreferences current useXTermViewIfAvailable |
13905
519c20b1a23c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13812
diff
changeset
|
4645 |
and:[XTermView notNil |
519c20b1a23c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13812
diff
changeset
|
4646 |
and:[XTermView isAvailable]]]) ifTrue:[ |
13812 | 4647 |
terminalView := XTermView new. |
13905
519c20b1a23c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13812
diff
changeset
|
4648 |
terminalView workingDirectory: item fileName pathName. |
519c20b1a23c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13812
diff
changeset
|
4649 |
terminalView lineLimit:(self class defaultLineLimit). |
13812 | 4650 |
] ifFalse:[ |
4651 |
VT100TerminalView isNil ifTrue:[ |
|
4652 |
Dialog warn:('Missing class: ' , 'VT100TerminalView' allBold). |
|
4653 |
AbortOperationRequest raise |
|
4654 |
]. |
|
4655 |
terminalView := VT100TerminalView new. |
|
6435 | 4656 |
]. |
3892 | 4657 |
]. |
4658 |
^ terminalView. |
|
13812 | 4659 |
|
4660 |
"Modified: / 05-04-2012 / 15:58:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3892 | 4661 |
! ! |
4662 |
||
4663 |
!FileApplicationNoteBook::Terminal methodsFor:'actions'! |
|
4664 |
||
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4665 |
menuClearConsole |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4666 |
terminalView clear. |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4667 |
! |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4668 |
|
3892 | 4669 |
saveAs |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4670 |
"open a save-as dialog" |
3892 | 4671 |
|
4672 |
self terminalView save. |
|
14801
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4673 |
! |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4674 |
|
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4675 |
scrollLockedChanged |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4676 |
terminalView scrollLock:scrollLockedHolder value. |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4677 |
! |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4678 |
|
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4679 |
scrollLockedHolder |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4680 |
scrollLockedHolder isNil ifTrue:[ |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4681 |
scrollLockedHolder := false asValue |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4682 |
]. |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4683 |
^ scrollLockedHolder. |
3892 | 4684 |
! ! |
4685 |
||
4686 |
!FileApplicationNoteBook::Terminal methodsFor:'initialization & release'! |
|
4687 |
||
14462
293b9728e748
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14458
diff
changeset
|
4688 |
doClose |
293b9728e748
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14458
diff
changeset
|
4689 |
terminalView closeDownShell. |
293b9728e748
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14458
diff
changeset
|
4690 |
^ super doClose. |
293b9728e748
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14458
diff
changeset
|
4691 |
! |
293b9728e748
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14458
diff
changeset
|
4692 |
|
3892 | 4693 |
shellFinished |
4694 |
| master text string| |
|
4695 |
||
4696 |
master := self masterApplication. |
|
4697 |
master notNil ifTrue:[ |
|
4698 |
string := ' - closed'. |
|
4699 |
master tabStringAdd:string for:self. |
|
4700 |
]. |
|
4523 | 4701 |
self notify:'shell in ' , self fileName asString, ' finished'. |
3892 | 4702 |
terminalView cr. |
4515 | 4703 |
|
16513 | 4704 |
text := '>> shell terminated.' allBold withColor:#red. |
3892 | 4705 |
terminalView nextPutAll:text. |
4706 |
! |
|
4707 |
||
4708 |
startShell |
|
4709 |
|vt100| |
|
4710 |
||
4711 |
vt100 := self terminalView. |
|
4712 |
vt100 shellTerminateAction:[ self shellFinished ]. |
|
4713 |
vt100 startShellIn:(self fileName). |
|
4714 |
! ! |
|
4715 |
||
4716 |
!FileApplicationNoteBook::Terminal methodsFor:'printing'! |
|
4717 |
||
8002
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
4718 |
printOn:aStream |
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
4719 |
aStream nextPutAll:'Terminal on:'. |
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
4720 |
self fileName baseName printOn:aStream. |
3892 | 4721 |
! ! |
4722 |
||
4723 |
!FileApplicationNoteBook::Terminal methodsFor:'queries'! |
|
4724 |
||
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4725 |
getTabIcon |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4726 |
"the item shown in a tab" |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4727 |
|
14802
99e863c55e0f
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
4728 |
^ ToolbarIconLibrary console13x13Icon |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4729 |
! |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4730 |
|
7687 | 4731 |
getTabValueString |
4732 |
"the item shown in a tab (not language translated)" |
|
4733 |
||
4734 |
^ nil |
|
4735 |
||
4736 |
"Created: / 01-03-2007 / 21:39:56 / cg" |
|
3892 | 4737 |
! ! |
4738 |
||
4739 |
!FileApplicationNoteBook::Terminal methodsFor:'startup & release'! |
|
4740 |
||
4741 |
postOpenWith:aBuilder |
|
6626 | 4742 |
"only invoked if the application not started from a master" |
4743 |
||
3892 | 4744 |
self masterApplication isNil ifTrue:[ |
4745 |
self masterApplication:nil. |
|
3982 | 4746 |
self item:(DirectoryContentsBrowser itemClass fileName:(Filename currentDirectory asAbsoluteFilename)). |
3892 | 4747 |
]. |
4748 |
self startShell. |
|
6626 | 4749 |
super postOpenWith:aBuilder. |
14444
cea130516cc0
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14412
diff
changeset
|
4750 |
terminalView requestFocus. |
3892 | 4751 |
! ! |
4752 |
||
4753 |
!FileApplicationNoteBook::TextEditor class methodsFor:'defaults'! |
|
4754 |
||
5461 | 4755 |
checkModifiedDelayTime |
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
4756 |
^ 30 "seconds" |
5461 | 4757 |
! |
4758 |
||
10761 | 4759 |
defaultTagsBrowserVisible |
4760 |
^ DefaultTagsBrowserVisible ? true |
|
4761 |
||
4762 |
"Created: / 06-10-2011 / 12:45:58 / cg" |
|
4763 |
! |
|
4764 |
||
3892 | 4765 |
tabStringFor:aApplicationType |
7687 | 4766 |
"the formatString shown in a tab (language translated)" |
3892 | 4767 |
|
4768 |
aApplicationType == #directoryDescription ifTrue:[ |
|
7687 | 4769 |
^ 'Directory Description of %1' |
4770 |
]. |
|
4771 |
^ '%1' |
|
4772 |
||
4773 |
"Modified: / 01-03-2007 / 21:46:24 / cg" |
|
3892 | 4774 |
! |
4775 |
||
4776 |
wantNewApplicationAnyway |
|
4777 |
||
4778 |
^ false |
|
4779 |
! ! |
|
4780 |
||
7909 | 4781 |
!FileApplicationNoteBook::TextEditor class methodsFor:'documentation'! |
4782 |
||
4783 |
documentation |
|
4784 |
" |
|
4785 |
a previewer-plugin for plain text |
|
4786 |
Offers edit, hex-display and diff functions. |
|
4787 |
" |
|
4788 |
! ! |
|
4789 |
||
11099 | 4790 |
!FileApplicationNoteBook::TextEditor class methodsFor:'help specs'! |
4791 |
||
4792 |
helpSpec |
|
4793 |
"This resource specification was automatically generated |
|
4794 |
by the UIHelpTool of ST/X." |
|
4795 |
||
4796 |
"Do not manually edit this!! If it is corrupted, |
|
4797 |
the UIHelpTool may not be able to read the specification." |
|
4798 |
||
4799 |
" |
|
4800 |
UIHelpTool openOnClass:FileApplicationNoteBook::TextEditor |
|
4801 |
" |
|
4802 |
||
4803 |
<resource: #help> |
|
4804 |
||
4805 |
^ super helpSpec addPairsFrom:#( |
|
4806 |
||
4807 |
#closeTabButton |
|
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4808 |
'Close this tab' |
11099 | 4809 |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4810 |
#hideEditorOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4811 |
'Hide the additional editor operations menu' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4812 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4813 |
#indentCode |
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4814 |
'Indent the selected lines (or the cursor line) by 4' |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4815 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4816 |
#showEditOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4817 |
'Show the additional editor operations menu' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4818 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4819 |
#undentCode |
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4820 |
'Undent the selected lines (or the cursor line) by 4' |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4821 |
|
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4822 |
#toggleBold |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4823 |
'Toggle the selection''s bold attribute (if bold, turn off; if not, turn on)' |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4824 |
|
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4825 |
#toggleItalic |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4826 |
'Toggle the selection''s italic attribute (if italic, turn off; if not, turn on)' |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4827 |
|
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4828 |
#toggleCode |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4829 |
'Toggle the selection''s code+pre attribute (if code, turn off; if not, turn on)' |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4830 |
|
14808
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
4831 |
#toggleEscape |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
4832 |
'Escape the selected characters with &; escape sequences.\(i.e. change "<" into "<")' |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
4833 |
|
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4834 |
#addAnchor |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4835 |
'Make the selection an an anchor element' |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4836 |
|
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4837 |
#addImage |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4838 |
'Insert a bitmap image element' |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4839 |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4840 |
|
11099 | 4841 |
) |
4842 |
! ! |
|
4843 |
||
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4844 |
!FileApplicationNoteBook::TextEditor class methodsFor:'image specs'! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4845 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4846 |
hideToolBarIcon |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4847 |
<resource: #programImage> |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4848 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4849 |
^ ToolbarIconLibrary hideToolBarIcon |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4850 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4851 |
"Created: / 02-08-2013 / 16:03:09 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4852 |
! ! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4853 |
|
8912 | 4854 |
!FileApplicationNoteBook::TextEditor class methodsFor:'interface specs'! |
3892 | 4855 |
|
4856 |
windowSpec |
|
4857 |
"This resource specification was automatically generated |
|
4858 |
by the UIPainter of ST/X." |
|
4859 |
||
4860 |
"Do not manually edit this!! If it is corrupted, |
|
4861 |
the UIPainter may not be able to read the specification." |
|
4862 |
||
4863 |
" |
|
3950 | 4864 |
UIPainter new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#windowSpec |
4865 |
FileApplicationNoteBook::TextEditor new openInterface:#windowSpec |
|
4866 |
FileApplicationNoteBook::TextEditor open |
|
3892 | 4867 |
" |
4868 |
||
4869 |
<resource: #canvas> |
|
4870 |
||
4871 |
^ |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4872 |
#(FullSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4873 |
name: windowSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4874 |
window: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4875 |
(WindowSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4876 |
label: 'TextEditor' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4877 |
name: 'TextEditor' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4878 |
min: (Point 10 10) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4879 |
bounds: (Rectangle 0 0 650 300) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4880 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4881 |
component: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4882 |
(SpecCollection |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4883 |
collection: ( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4884 |
(VariableHorizontalPanelSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4885 |
name: 'Panel' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4886 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4887 |
showHandle: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4888 |
snapMode: max |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4889 |
component: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4890 |
(SpecCollection |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4891 |
collection: ( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4892 |
(ViewSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4893 |
name: 'EditorBox' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4894 |
component: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4895 |
(SpecCollection |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4896 |
collection: ( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4897 |
(MenuPanelSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4898 |
name: 'MenuTextEditor' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4899 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 30 0) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4900 |
level: 1 |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4901 |
menu: menu |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4902 |
textDefault: true |
9949
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
4903 |
) |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4904 |
(ViewSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4905 |
name: 'EditorOperationsToolBar' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4906 |
layout: (LayoutFrame 0 0 30 0 0 1 60 0) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4907 |
level: 0 |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4908 |
visibilityChannel: editorOperationsToolBarVisibleHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4909 |
component: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4910 |
(SpecCollection |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4911 |
collection: ( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4912 |
(ActionButtonSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4913 |
label: 'hideToolBarIcon' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4914 |
name: 'HideEditorOperationsToolBarButton' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4915 |
layout: (LayoutFrame 0 0 0 0 13 0 0 1) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4916 |
activeHelpKey: hideEditorOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4917 |
level: 1 |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4918 |
hasCharacterOrientedLabel: false |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4919 |
translateLabel: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4920 |
model: hideEditorOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4921 |
postBuildCallback: hideEditorOperationsToolBarButtonCreated: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4922 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4923 |
(MenuPanelSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4924 |
name: 'EditorOperationsToolBarMenu' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4925 |
layout: (LayoutFrame 13 0 0 0 0 1 30 0) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4926 |
level: 1 |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4927 |
menu: editorOperationsMenuSpecHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4928 |
textDefault: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4929 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4930 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4931 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4932 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4933 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4934 |
(TextEditorSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4935 |
name: 'TextEditor' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4936 |
layout: (LayoutFrame 0 0.0 59 0 0 1.0 0 1.0) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4937 |
model: fileContentsModel |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4938 |
hasHorizontalScrollBar: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4939 |
hasVerticalScrollBar: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4940 |
modifiedChannel: viewModifiedChannel |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4941 |
acceptCallBack: accept |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4942 |
allowDoIt: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4943 |
hasKeyboardFocusInitially: false |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4944 |
postBuildCallback: postBuildTextEditor: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4945 |
viewClassName: 'getEditorClass' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4946 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4947 |
(ActionButtonSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4948 |
label: '...' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4949 |
name: 'Button1' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4950 |
layout: (LayoutFrame -56 1 5 0 -36 1 27 0) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4951 |
activeHelpKey: showEditOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4952 |
visibilityChannel: editorOperationsToolBarNotVisibleHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4953 |
translateLabel: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4954 |
model: showEditorOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4955 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4956 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4957 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4958 |
) |
9946 | 4959 |
) |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4960 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4961 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4962 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4963 |
handles: (Any 1.0) |
5417 | 4964 |
) |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4965 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4966 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4967 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4968 |
) |
5417 | 4969 |
! |
4970 |
||
4971 |
xwindowSpec |
|
4972 |
"This resource specification was automatically generated |
|
4973 |
by the UIPainter of ST/X." |
|
4974 |
||
4975 |
"Do not manually edit this!! If it is corrupted, |
|
4976 |
the UIPainter may not be able to read the specification." |
|
4977 |
||
4978 |
" |
|
4979 |
UIPainter new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#windowSpec |
|
4980 |
FileApplicationNoteBook::TextEditor new openInterface:#windowSpec |
|
4981 |
FileApplicationNoteBook::TextEditor open |
|
4982 |
" |
|
4983 |
||
4984 |
<resource: #canvas> |
|
4985 |
||
4986 |
^ |
|
3892 | 4987 |
#(#FullSpec |
4988 |
#name: #windowSpec |
|
4989 |
#window: |
|
4990 |
#(#WindowSpec |
|
4991 |
#label: 'TextEditor' |
|
4992 |
#name: 'TextEditor' |
|
4993 |
#min: #(#Point 10 10) |
|
4994 |
#max: #(#Point 1024 768) |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
4995 |
#bounds: #(#Rectangle 16 42 666 342) |
3892 | 4996 |
) |
4997 |
#component: |
|
4998 |
#(#SpecCollection |
|
4999 |
#collection: #( |
|
5000 |
#(#MenuPanelSpec |
|
5001 |
#name: 'MenuTextEditor' |
|
5002 |
#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
|
5003 |
#level: 0 |
3892 | 5004 |
#menu: #menu |
5005 |
#textDefault: true |
|
5006 |
) |
|
5007 |
#(#TextEditorSpec |
|
5008 |
#name: 'TextEditor' |
|
5009 |
#layout: #(#LayoutFrame 0 0.0 32 0 0 1.0 0 1.0) |
|
5010 |
#model: #fileContentsModel |
|
5011 |
#hasHorizontalScrollBar: true |
|
5012 |
#hasVerticalScrollBar: true |
|
4071 | 5013 |
#modifiedChannel: #viewModifiedChannel |
3892 | 5014 |
#acceptCallBack: #accept |
3950 | 5015 |
#allowDoIt: true |
3892 | 5016 |
#postBuildCallback: #postBuildTextEditor: |
5017 |
) |
|
5018 |
) |
|
5019 |
||
5020 |
) |
|
5021 |
) |
|
5022 |
! ! |
|
5023 |
||
5024 |
!FileApplicationNoteBook::TextEditor class methodsFor:'menu specs'! |
|
5025 |
||
5026 |
menu |
|
5027 |
"This resource specification was automatically generated |
|
5028 |
by the MenuEditor of ST/X." |
|
5029 |
||
5030 |
"Do not manually edit this!! If it is corrupted, |
|
5031 |
the MenuEditor may not be able to read the specification." |
|
5032 |
||
11099 | 5033 |
|
3892 | 5034 |
" |
5035 |
MenuEditor new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#menu |
|
5036 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::TextEditor menu)) startUp |
|
5037 |
" |
|
5038 |
||
5039 |
<resource: #menu> |
|
5040 |
||
5041 |
^ |
|
5197 | 5042 |
#(Menu |
5043 |
( |
|
5044 |
(MenuItem |
|
8087 | 5045 |
activeHelpKey: saveFile |
5197 | 5046 |
enabled: enableSave |
5429 | 5047 |
label: 'Save' |
5048 |
itemValue: accept |
|
5049 |
nameKey: Save |
|
5050 |
isButton: true |
|
11099 | 5051 |
isVisible: saveButtonVisible |
6117 | 5052 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveTextToFileIcon) |
5429 | 5053 |
) |
5054 |
(MenuItem |
|
8684 | 5055 |
activeHelpKey: saveFileAs |
5056 |
enabled: enableSaveAs |
|
5057 |
label: 'Save As...' |
|
5058 |
itemValue: saveFileAs |
|
5059 |
nameKey: SaveAs |
|
5060 |
isButton: true |
|
11099 | 5061 |
isVisible: saveAsButtonVisible |
8684 | 5062 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveToFileAsIcon) |
5063 |
) |
|
5064 |
(MenuItem |
|
8087 | 5065 |
activeHelpKey: reloadFile |
5197 | 5066 |
enabled: enableReload |
5067 |
label: 'Reload' |
|
5068 |
itemValue: reload |
|
5069 |
nameKey: Reload |
|
5070 |
isButton: true |
|
11099 | 5071 |
isVisible: reloadButtonVisible |
6117 | 5072 |
labelImage: (ResourceRetriever ToolbarIconLibrary reloadTextFromFileIcon) |
3892 | 5073 |
) |
5197 | 5074 |
(MenuItem |
8087 | 5075 |
activeHelpKey: findInBrowser |
5076 |
enabled: enableSelectInBrowser |
|
5077 |
label: 'Select in Browser' |
|
5078 |
itemValue: selectInBrowser |
|
5079 |
nameKey: SelectInBrowser |
|
5080 |
isButton: true |
|
11099 | 5081 |
isVisible: selectInBrowserButtonVisible |
8087 | 5082 |
labelImage: (ResourceRetriever ToolbarIconLibrary searchFileIcon) |
5083 |
) |
|
5084 |
(MenuItem |
|
6681 | 5085 |
label: '-' |
3892 | 5086 |
) |
5197 | 5087 |
(MenuItem |
8087 | 5088 |
activeHelpKey: print |
5197 | 5089 |
enabled: enableHexToggle |
5090 |
label: 'Print' |
|
5091 |
itemValue: doPrint |
|
5092 |
nameKey: Print |
|
5093 |
isButton: true |
|
6117 | 5094 |
labelImage: (ResourceRetriever ToolbarIconLibrary printerIcon) |
3892 | 5095 |
) |
5197 | 5096 |
(MenuItem |
6681 | 5097 |
label: '-' |
3892 | 5098 |
) |
5197 | 5099 |
(MenuItem |
15815
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5100 |
activeHelpKey: showDifferences |
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5101 |
label: 'Diff to Current' |
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5102 |
itemValue: openDiffView |
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5103 |
isButton: true |
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5104 |
isVisible: diffTextButtonVisible |
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5105 |
labelImage: (ResourceRetriever ToolbarIconLibrary diffIcon) |
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5106 |
) |
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5107 |
(MenuItem |
8087 | 5108 |
activeHelpKey: toggleHexDisplay |
5197 | 5109 |
enabled: enableHexToggle |
5110 |
label: 'Hex' |
|
5111 |
isButton: true |
|
5112 |
indication: printAsHexDump |
|
17747 | 5113 |
submenu: |
5114 |
(Menu |
|
5115 |
( |
|
5116 |
(MenuItem |
|
17752 | 5117 |
label: 'Character Decoding in Dump' |
17747 | 5118 |
submenu: |
5119 |
(Menu |
|
5120 |
( |
|
5121 |
(MenuItem |
|
5122 |
label: 'Iso8859-1' |
|
5123 |
itemValue: characterEncodingInDump: |
|
5124 |
argument: #'iso8859-1' |
|
5125 |
) |
|
5126 |
(MenuItem |
|
5127 |
label: 'Ascii7' |
|
5128 |
itemValue: characterEncodingInDump: |
|
17748 | 5129 |
argument: ascii7 |
17747 | 5130 |
) |
5131 |
(MenuItem |
|
17749 | 5132 |
label: 'EBCDIC-037' |
17747 | 5133 |
itemValue: characterEncodingInDump: |
17749 | 5134 |
argument: #'ebcdic-037' |
17747 | 5135 |
) |
5136 |
) |
|
5137 |
nil |
|
5138 |
nil |
|
5139 |
) |
|
5140 |
) |
|
5141 |
(MenuItem |
|
5142 |
label: '-' |
|
5143 |
) |
|
5144 |
(MenuItem |
|
5145 |
label: 'Hex' |
|
5146 |
itemValue: radixInDump: |
|
5147 |
argument: 16 |
|
5148 |
) |
|
5149 |
(MenuItem |
|
5150 |
label: 'Octal' |
|
5151 |
itemValue: radixInDump: |
|
5152 |
argument: 8 |
|
5153 |
) |
|
5154 |
(MenuItem |
|
5155 |
label: 'Decimal' |
|
5156 |
itemValue: radixInDump: |
|
5157 |
argument: 10 |
|
5158 |
) |
|
5159 |
(MenuItem |
|
5160 |
label: 'Binary' |
|
5161 |
itemValue: radixInDump: |
|
5162 |
argument: 2 |
|
5163 |
) |
|
5164 |
) |
|
5165 |
nil |
|
5166 |
nil |
|
5167 |
) |
|
6096 | 5168 |
labelImage: (ResourceRetriever ToolbarIconLibrary hexToggleIcon) |
3892 | 5169 |
) |
5197 | 5170 |
(MenuItem |
5171 |
label: '' |
|
8684 | 5172 |
isVisible: diffTextButtonVisible |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
5173 |
) |
5197 | 5174 |
(MenuItem |
6681 | 5175 |
activeHelpKey: closeTabButton |
5197 | 5176 |
label: 'Close' |
5177 |
itemValue: doClose |
|
5178 |
isButton: true |
|
5179 |
startGroup: right |
|
11099 | 5180 |
isVisible: closeButtonShown |
5197 | 5181 |
hideMenuOnActivated: false |
6093 | 5182 |
labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon) |
3892 | 5183 |
) |
5184 |
) |
|
5185 |
nil |
|
5186 |
nil |
|
5187 |
) |
|
17747 | 5188 |
|
17752 | 5189 |
"Modified: / 14-11-2017 / 00:17:49 / cg" |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5190 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5191 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5192 |
menuEditorOperationsForHTML |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5193 |
"This resource specification was automatically generated |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5194 |
by the MenuEditor of ST/X." |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5195 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5196 |
"Do not manually edit this!! If it is corrupted, |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5197 |
the MenuEditor may not be able to read the specification." |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5198 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5199 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5200 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5201 |
MenuEditor new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#menuEditorOperationsForHTML |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5202 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::TextEditor menuEditorOperationsForHTML)) startUp |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5203 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5204 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5205 |
<resource: #menu> |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5206 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5207 |
^ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5208 |
#(Menu |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5209 |
( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5210 |
(MenuItem |
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5211 |
activeHelpKey: toggleBold |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5212 |
label: 'bold' |
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5213 |
itemValue: editOperationToggleBoldHTML |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5214 |
labelImage: (ResourceRetriever ToolbarIconLibrary #'edit_bold_15x15') |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5215 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5216 |
(MenuItem |
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5217 |
activeHelpKey: toggleItalic |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5218 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5219 |
label: 'italic' |
14808
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5220 |
itemValue: editOperationToggleItalicHTML |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5221 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5222 |
labelImage: (ResourceRetriever ToolbarIconLibrary #'edit_italic_15x15') |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5223 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5224 |
(MenuItem |
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5225 |
activeHelpKey: toggleCode |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5226 |
enabled: canEdit |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5227 |
label: 'code' |
14808
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5228 |
itemValue: editOperationToggleCodeHTML |
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5229 |
isButton: true |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5230 |
labelImage: (ResourceRetriever ToolbarIconLibrary #'edit_code_15x15') |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5231 |
) |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5232 |
(MenuItem |
14808
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5233 |
activeHelpKey: toggleEscape |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5234 |
enabled: canEdit |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5235 |
label: 'escape' |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5236 |
itemValue: editOperationEscapeSpecialCharactersHTML |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5237 |
isButton: true |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5238 |
labelImage: (ResourceRetriever ToolbarIconLibrary #'edit_escapeHTMLCharacters') |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5239 |
) |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5240 |
(MenuItem |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5241 |
activeHelpKey: addAnchor |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5242 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5243 |
label: 'anchor' |
14808
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5244 |
itemValue: editOperationAddAnchorHTML |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5245 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5246 |
labelImage: (ResourceRetriever ToolbarIconLibrary #'edit_anchor15x15') |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5247 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5248 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5249 |
activeHelpKey: addImage |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5250 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5251 |
label: 'image' |
14808
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5252 |
itemValue: editOperationAddImageHTML |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5253 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5254 |
labelImage: (ResourceRetriever ToolbarIconLibrary #'edit_image_15x15') |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5255 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5256 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5257 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5258 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5259 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5260 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5261 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5262 |
menuEditorOperationsForNormalText |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5263 |
"This resource specification was automatically generated |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5264 |
by the MenuEditor of ST/X." |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5265 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5266 |
"Do not manually edit this!! If it is corrupted, |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5267 |
the MenuEditor may not be able to read the specification." |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5268 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5269 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5270 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5271 |
MenuEditor new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#menuEditorOperationsForNormalText |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5272 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::TextEditor menuEditorOperationsForNormalText)) startUp |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5273 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5274 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5275 |
<resource: #menu> |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5276 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5277 |
^ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5278 |
#(Menu |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5279 |
( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5280 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5281 |
activeHelpKey: undentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5282 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5283 |
label: 'Undent' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5284 |
itemValue: editOperationUndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5285 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5286 |
startGroup: right |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5287 |
labelImage: (ResourceRetriever ToolbarIconLibrary undent16x16Icon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5288 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5289 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5290 |
activeHelpKey: indentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5291 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5292 |
label: 'Indent' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5293 |
itemValue: editOperationIndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5294 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5295 |
startGroup: right |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5296 |
labelImage: (ResourceRetriever ToolbarIconLibrary indent16x16Icon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5297 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5298 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5299 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5300 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5301 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5302 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5303 |
"Modified: / 02-08-2013 / 18:21:42 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5304 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5305 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5306 |
menuEditorOperationsForOther |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5307 |
"This resource specification was automatically generated |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5308 |
by the MenuEditor of ST/X." |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5309 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5310 |
"Do not manually edit this!! If it is corrupted, |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5311 |
the MenuEditor may not be able to read the specification." |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5312 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5313 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5314 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5315 |
MenuEditor new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#menuEditorOperationsForNormalText |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5316 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::TextEditor menuEditorOperationsForNormalText)) startUp |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5317 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5318 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5319 |
<resource: #menu> |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5320 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5321 |
^ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5322 |
#(Menu |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5323 |
( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5324 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5325 |
activeHelpKey: undentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5326 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5327 |
label: 'Undent' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5328 |
itemValue: editOperationUndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5329 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5330 |
startGroup: right |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5331 |
labelImage: (ResourceRetriever ToolbarIconLibrary undent16x16Icon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5332 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5333 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5334 |
activeHelpKey: indentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5335 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5336 |
label: 'Indent' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5337 |
itemValue: editOperationIndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5338 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5339 |
startGroup: right |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5340 |
labelImage: (ResourceRetriever ToolbarIconLibrary indent16x16Icon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5341 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5342 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5343 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5344 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5345 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5346 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5347 |
"Created: / 02-08-2013 / 17:09:31 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5348 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5349 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5350 |
menuEditorOperationsForSourceCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5351 |
"This resource specification was automatically generated |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5352 |
by the MenuEditor of ST/X." |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5353 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5354 |
"Do not manually edit this!! If it is corrupted, |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5355 |
the MenuEditor may not be able to read the specification." |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5356 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5357 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5358 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5359 |
MenuEditor new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#menuEditorOperationsForSourceCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5360 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::TextEditor menuEditorOperationsForSourceCode)) startUp |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5361 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5362 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5363 |
<resource: #menu> |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5364 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5365 |
^ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5366 |
#(Menu |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5367 |
( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5368 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5369 |
activeHelpKey: #'help_doIt' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5370 |
label: 'DoIt' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5371 |
itemValue: doIt |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5372 |
isButton: true |
13729
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
5373 |
isVisible: doItMenuButtonVisible |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5374 |
labelImage: (ResourceRetriever ToolbarIconLibrary doItIcon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5375 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5376 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5377 |
activeHelpKey: #'help_printIt' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5378 |
label: 'PrintIt' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5379 |
itemValue: printIt |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5380 |
isButton: true |
13729
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
5381 |
isVisible: printItMenuButtonVisible |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5382 |
labelImage: (ResourceRetriever ToolbarIconLibrary printItIcon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5383 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5384 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5385 |
activeHelpKey: #'help_inspectIt' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5386 |
label: 'InspectIt' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5387 |
itemValue: inspectIt |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5388 |
isButton: true |
13729
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
5389 |
isVisible: inspectItMenuButtonVisible |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5390 |
labelImage: (ResourceRetriever ToolbarIconLibrary inspectItIcon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5391 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5392 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5393 |
activeHelpKey: undentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5394 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5395 |
label: 'Undent' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5396 |
itemValue: editOperationUndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5397 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5398 |
startGroup: right |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5399 |
labelImage: (ResourceRetriever ToolbarIconLibrary undent16x16Icon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5400 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5401 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5402 |
activeHelpKey: indentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5403 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5404 |
label: 'Indent' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5405 |
itemValue: editOperationIndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5406 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5407 |
startGroup: right |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5408 |
labelImage: (ResourceRetriever ToolbarIconLibrary indent16x16Icon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5409 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5410 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5411 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5412 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5413 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5414 |
|
13729
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
5415 |
"Modified: / 17-12-2013 / 16:37:59 / cg" |
3892 | 5416 |
! ! |
5417 |
||
5418 |
!FileApplicationNoteBook::TextEditor methodsFor:'accessing'! |
|
5419 |
||
5528 | 5420 |
fileEncoding |
5421 |
^ self fileEncodingHolder value |
|
5422 |
! |
|
5423 |
||
5534 | 5424 |
fileEncoding:newEncoding |
5425 |
self fileEncodingHolder value:newEncoding. |
|
5528 | 5426 |
|
5427 |
editView notNil ifTrue:[ |
|
5705 | 5428 |
self enableReload value:true. |
5534 | 5429 |
editView externalEncoding:newEncoding. |
5528 | 5430 |
]. |
5431 |
! |
|
5432 |
||
3892 | 5433 |
item:aDirContentsItem |
5434 |
||
4977
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
5435 |
self releaseCheckModify. |
4620 | 5436 |
(self item = aDirContentsItem and:[(self presentation == #hexDump) == self printAsHexDump value]) ifTrue:[^ true]. |
7947 | 5437 |
|
5534 | 5438 |
self askForChangeWithReload:false "true". |
5197 | 5439 |
|
3892 | 5440 |
super item:aDirContentsItem. |
4698 | 5441 |
self printAsHexDump value:(self presentation == #hexDump) withoutNotifying:self. |
9946 | 5442 |
self updateTagsBrowser. |
4201 | 5443 |
self setContents ifFalse:[ ^ false]. |
5528 | 5444 |
|
5445 |
self setUpTextView. |
|
5446 |
||
4977
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
5447 |
textEditorModificationTime := self fileName modificationTime. |
5417 | 5448 |
self releaseCheckModify. |
4969 | 5449 |
self setupCheckModify. |
5417 | 5450 |
self changeInformation. |
3892 | 5451 |
^ true |
9946 | 5452 |
|
5453 |
"Modified: / 23-06-2011 / 16:45:13 / cg" |
|
3892 | 5454 |
! |
5455 |
||
5737 | 5456 |
lockFileEncoding:aBoolean |
5457 |
self lockFileEncodingHolder value:aBoolean. |
|
5458 |
! |
|
5459 |
||
3892 | 5460 |
presentation |
17747 | 5461 |
"return the current presentation (either #hexDump or #asText)" |
5462 |
||
5463 |
^ self presentationHolder value |
|
5464 |
||
5465 |
"Modified: / 12-11-2017 / 12:33:43 / cg" |
|
5466 |
! |
|
5467 |
||
5468 |
presentation:aSymbol |
|
5469 |
"change the presentation (either #hexDump or #asText)" |
|
5470 |
||
5471 |
"/ self assert:((aSymbol == #asText) or:[aSymbol == #hexDump]). |
|
5472 |
self presentationHolder value:aSymbol. |
|
5473 |
||
5474 |
"Modified (comment): / 12-11-2017 / 12:34:44 / cg" |
|
3892 | 5475 |
! |
5476 |
||
5477 |
semaChangeItem |
|
5478 |
^ semaChangeItem |
|
5459 | 5479 |
! |
5480 |
||
5481 |
type:aType |
|
5482 |
||
5483 |
super type:aType. |
|
5484 |
self changeInformation. |
|
3892 | 5485 |
! ! |
5486 |
||
5487 |
!FileApplicationNoteBook::TextEditor methodsFor:'actions'! |
|
5488 |
||
5489 |
accept |
|
5417 | 5490 |
self saveWithAskForFilename:false. |
3892 | 5491 |
! |
5492 |
||
5198
ea3f838e1353
do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents:
5197
diff
changeset
|
5493 |
askForChangeWithReload:doReload |
5197 | 5494 |
"ask for save changes; |
5495 |
if modified and answered true, the current contents is written back (accepted) |
|
3892 | 5496 |
" |
5497 |
||
5578 | 5498 |
self askForChangeWithReload:doReload forClose:false |
5499 |
! |
|
5500 |
||
5501 |
askForChangeWithReload:doReload forClose:forClose |
|
5502 |
"ask for save changes; |
|
5503 |
if modified and answered true, the current contents is written back (accepted) |
|
5504 |
" |
|
5505 |
||
5471
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5506 |
|fn answer string arg| |
3892 | 5507 |
|
5197 | 5508 |
self modifiedChannel value ifFalse:[ ^ false]. |
5509 |
||
5471
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5510 |
fn := self fileName. |
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5511 |
fn isNil ifTrue:[ |
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5512 |
fn := 'unknown' |
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5513 |
] ifFalse:[ |
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5514 |
fn := fn baseName. |
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5515 |
]. |
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5516 |
arg := fn allBold. |
5197 | 5517 |
|
5578 | 5518 |
string := 'Save changed file "%1" ?'. |
5519 |
||
5520 |
forClose ifTrue:[ |
|
5521 |
self itemChanged value ifTrue:[ |
|
9568 | 5522 |
string := 'Modified %1 was changed by someone else.\\Save your changes (overwrite someone''s changes) ?' |
5578 | 5523 |
] ifFalse:[ |
5524 |
self itemRemoved value ifTrue:[ |
|
6376 | 5525 |
string := 'Modified %1 was removed by someone else.\\Save your changes (recreate the removed file) ?' |
5578 | 5526 |
] |
5527 |
]. |
|
5197 | 5528 |
] ifFalse:[ |
5578 | 5529 |
self itemChanged value ifTrue:[ |
9568 | 5530 |
string := '%1 was changed by someone else.\\Save your changes anyway (overwrite someon''es changes) ?' |
5197 | 5531 |
] ifFalse:[ |
5578 | 5532 |
self itemRemoved value ifTrue:[ |
6376 | 5533 |
string := '%1 was removed by someone else.\\Save your changes anyway (recreate the removed file) ?' |
5578 | 5534 |
] |
5535 |
]. |
|
3892 | 5536 |
]. |
5197 | 5537 |
|
5199
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5538 |
answer := OptionBox |
6376 | 5539 |
request:(resources stringWithCRs:string with:arg) |
5199
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5540 |
buttonLabels:(resources array:#('Cancel' 'Show Diffs' 'No' 'Yes')) |
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5541 |
values:#(nil showDiffs false true) |
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5542 |
default:nil. |
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5543 |
|
5197 | 5544 |
answer isNil ifTrue:[^ AbortOperationRequest raise ]. |
5545 |
||
5199
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5546 |
answer == #showDiffs ifTrue:[ |
5201 | 5547 |
self openDiffView. |
5199
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5548 |
AbortOperationRequest raise |
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5549 |
]. |
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5550 |
|
5197 | 5551 |
answer ifTrue:[ |
5552 |
self accept |
|
5553 |
] ifFalse:[ |
|
5198
ea3f838e1353
do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents:
5197
diff
changeset
|
5554 |
doReload ifTrue:[ |
ea3f838e1353
do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents:
5197
diff
changeset
|
5555 |
self setContents. |
ea3f838e1353
do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents:
5197
diff
changeset
|
5556 |
] |
3892 | 5557 |
]. |
5558 |
^ answer |
|
9568 | 5559 |
|
5560 |
"Modified: / 11-09-2010 / 13:07:37 / cg" |
|
3892 | 5561 |
! |
5562 |
||
5563 |
changeInformation |
|
5564 |
||
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
5565 |
|string win| |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
5566 |
|
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
5567 |
string := self getTabString. |
3892 | 5568 |
masterApplication isNil ifTrue:[ |
4621 | 5569 |
win := self window. |
5570 |
win notNil ifTrue:[ |
|
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
5571 |
self window label:string asString string. |
4621 | 5572 |
]. |
3892 | 5573 |
] ifFalse:[ |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
5574 |
masterApplication tabStringChangeTo:string for:self. |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
5575 |
]. |
3892 | 5576 |
! |
5577 |
||
4161 | 5578 |
changeInformationForModified:aSymbol |
4045 | 5579 |
masterApplication isNil ifTrue:[ ^ self]. |
4161 | 5580 |
masterApplication changeModified:aSymbol for:self. |
4045 | 5581 |
! |
5582 |
||
17747 | 5583 |
characterEncodingInDump:anEencodingSymbol |
5584 |
characterEncodingInDump ~~ anEencodingSymbol ifTrue:[ |
|
5585 |
characterEncodingInDump := anEencodingSymbol. |
|
5586 |
||
5587 |
self presentation == #hexDump ifTrue:[ |
|
5588 |
self changeInformation. |
|
5589 |
self setContents. |
|
5590 |
]. |
|
5591 |
]. |
|
5592 |
||
5593 |
"Created: / 12-11-2017 / 12:22:43 / cg" |
|
5594 |
! |
|
5595 |
||
3892 | 5596 |
doClose |
5597 |
||
5578 | 5598 |
self askForChangeWithReload:false forClose:true. |
3892 | 5599 |
self masterApplication notNil ifTrue:[ |
3954 | 5600 |
^ super doClose |
3892 | 5601 |
]. |
5602 |
^ true |
|
5603 |
! |
|
5604 |
||
5605 |
doPrint |
|
5606 |
"print the contents |
|
5607 |
" |
|
4473 | 5608 |
(Dialog confirm:'Print contents of editView ?') ifTrue:[ |
3892 | 5609 |
editView doPrint. |
5610 |
]. |
|
5611 |
! |
|
5612 |
||
5417 | 5613 |
doSaveAs |
5614 |
self saveWithAskForFilename:true. |
|
5615 |
! |
|
5616 |
||
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5617 |
editOperationAddAnchorHTML |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5618 |
|sel new| |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5619 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5620 |
sel := editView selectionAsString. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5621 |
sel isNil ifTrue:[^ self]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5622 |
|
16000 | 5623 |
new := '<A HREF="http://www.exept.de">',editView selectionAsString,'</A>'. |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5624 |
editView |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5625 |
undoableDo:[ |
13298
0e2817ce7e77
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13295
diff
changeset
|
5626 |
editView replaceSelectionBy:new keepCursor:false select:true |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5627 |
] |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5628 |
info:'Add Anchor' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5629 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5630 |
"Created: / 02-08-2013 / 18:16:44 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5631 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5632 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5633 |
editOperationAddImageHTML |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5634 |
|new| |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5635 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5636 |
new := '<IMG NOPRINT ALIGN="middle" SRC="xxx.png">'. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5637 |
editView |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5638 |
undoableDo:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5639 |
editView insertStringAtCursor:new |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5640 |
] |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5641 |
info:'Add Image' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5642 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5643 |
"Created: / 02-08-2013 / 18:17:26 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5644 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5645 |
|
14808
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5646 |
editOperationEscapeSpecialCharactersHTML |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5647 |
|sel escaped| |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5648 |
|
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5649 |
sel := editView selectionAsString. |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5650 |
sel isNil ifTrue:[^ self]. |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5651 |
|
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5652 |
escaped := HTMLUtilities withSpecialHTMLCharactersEscaped:sel. |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5653 |
editView |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5654 |
undoableDo:[ |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5655 |
editView replaceSelectionBy:escaped keepCursor:false select:true |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5656 |
] |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5657 |
info:'Escape HTML characters' |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5658 |
! |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5659 |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5660 |
editOperationIndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5661 |
editView indentBy4 |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5662 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5663 |
"Created: / 02-08-2013 / 18:20:18 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5664 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5665 |
|
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5666 |
editOperationToggleBoldHTML |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5667 |
self editOperationToggleHTML:'Toggle Bold' start:'<b>' end:'</b>' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5668 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5669 |
"Created: / 02-08-2013 / 18:04:27 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5670 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5671 |
|
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5672 |
editOperationToggleCodeHTML |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5673 |
self editOperationToggleHTML:'Toggle Code' start:'<code><pre>' end:'</pre></code>' |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5674 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5675 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5676 |
editOperationToggleHTML:info start:whatStart end:whatEnd |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5677 |
|sel new| |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5678 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5679 |
sel := editView selectionAsString. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5680 |
sel isNil ifTrue:[^ self]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5681 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5682 |
(sel asLowercase startsWith:whatStart) ifTrue:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5683 |
new := sel copyFrom: whatStart size+1. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5684 |
(new asLowercase endsWith:whatEnd) ifTrue:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5685 |
new := new copyButLast:whatEnd size. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5686 |
] |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5687 |
] ifFalse:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5688 |
new := whatStart,editView selectionAsString,whatEnd |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5689 |
]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5690 |
editView |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5691 |
undoableDo:[ |
13298
0e2817ce7e77
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13295
diff
changeset
|
5692 |
editView replaceSelectionBy:new keepCursor:false select:true |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5693 |
] |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5694 |
info:info |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5695 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5696 |
"Created: / 02-08-2013 / 18:14:25 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5697 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5698 |
|
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5699 |
editOperationToggleItalicHTML |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5700 |
self editOperationToggleHTML:'Toggle Italic' start:'<i>' end:'</i>' |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5701 |
|
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5702 |
"Created: / 02-08-2013 / 18:14:55 / cg" |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5703 |
! |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5704 |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5705 |
editOperationUndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5706 |
editView undentBy4 |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5707 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5708 |
"Created: / 02-08-2013 / 18:22:47 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5709 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5710 |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
5711 |
getContents |
12346
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5712 |
|file fileSize contents presentation alreadyConfirmed answer sizeLimit showLastPart |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5713 |
dontAskAgainHolder| |
3892 | 5714 |
|
5715 |
file := self fileName. |
|
5831
6db521464804
care for no-selection when toggling hex-mode
Claus Gittinger <cg@exept.de>
parents:
5784
diff
changeset
|
5716 |
file isNil ifTrue:[ |
6db521464804
care for no-selection when toggling hex-mode
Claus Gittinger <cg@exept.de>
parents:
5784
diff
changeset
|
5717 |
^ nil |
6db521464804
care for no-selection when toggling hex-mode
Claus Gittinger <cg@exept.de>
parents:
5784
diff
changeset
|
5718 |
]. |
7487 | 5719 |
fileSize := file fileSize. |
5720 |
fileSize isNil ifTrue:[ |
|
5721 |
^ nil |
|
5722 |
]. |
|
5831
6db521464804
care for no-selection when toggling hex-mode
Claus Gittinger <cg@exept.de>
parents:
5784
diff
changeset
|
5723 |
|
8087 | 5724 |
self enableSelectInBrowser value:true. |
5725 |
||
6295 | 5726 |
presentation := self presentation. |
5727 |
presentation == #asText ifTrue:[ |
|
12346
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5728 |
fileSize > (MaxFileSizeLoadedWithoutAsking ? (8 * 1024 * 1024)) ifTrue:[ |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5729 |
dontAskAgainHolder := false asValue. |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5730 |
answer := Dialog |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5731 |
confirmWithCancel:(resources |
8471 | 5732 |
stringWithCRs:'%1 is very large (%2).\\Show all or only the first 8 Mb ?' |
5733 |
with:file baseName allBold |
|
5734 |
with:(UnitConverter fileSizeStringFor:fileSize)) |
|
12346
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5735 |
labels:(resources array:#('Cancel' 'Show All' 'Show Last Part' 'Show First Part' )) |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5736 |
values:#(#abort #all #last #first) |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5737 |
default:#abort |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5738 |
check:(resources string:'Don''t ask again up to this size') on:dontAskAgainHolder |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5739 |
title:(resources string:'Large File'). |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5740 |
|
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5741 |
answer == #all ifTrue:[ |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5742 |
dontAskAgainHolder value ifTrue:[ |
12348
bf878489e196
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12346
diff
changeset
|
5743 |
MaxFileSizeLoadedWithoutAsking := fileSize + 4096 |
12346
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5744 |
] |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5745 |
]. |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5746 |
|
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5747 |
"/ old |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5748 |
"/ answer := OptionBox |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5749 |
"/ request:(resources |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5750 |
"/ stringWithCRs:'%1 is very large (%2).\\Show all or only the first 8 Mb ?' |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5751 |
"/ with:file baseName allBold |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5752 |
"/ with:(UnitConverter fileSizeStringFor:fileSize)) |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5753 |
"/ label:(resources string:'Large File') |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5754 |
"/ buttonLabels:(resources array:#('Cancel' 'Show All' 'Show Last Part' 'Show First Part' )) |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5755 |
"/ values:#(#abort #all #last #first) |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5756 |
"/ default:#abort. |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5757 |
|
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5758 |
"/ very old |
8471 | 5759 |
"/ answer := Dialog |
5760 |
"/ confirmWithCancel:(resources |
|
5761 |
"/ stringWithCRs:'%1 is very large (%2).\\Show all or only the first 4 Mb ?' |
|
5762 |
"/ with:file baseName allBold |
|
5763 |
"/ with:(UnitConverter fileSizeStringFor:fileSize)) |
|
5764 |
"/ labels:#('Cancel' 'Show All' 'Show First Part' ). |
|
5765 |
"/ answer isNil ifTrue:[^ nil]. |
|
5766 |
"/ answer ifTrue:[ |
|
5767 |
"/ sizeLimit := 4 * 1024 * 1024 |
|
5768 |
"/ ]. |
|
5769 |
answer == #abort ifTrue:[^ nil ]. |
|
5770 |
answer ~~ #all ifTrue:[ |
|
5771 |
sizeLimit := 4 * 1024 * 1024. |
|
5772 |
showLastPart := (answer == #last). |
|
6295 | 5773 |
]. |
5774 |
]. |
|
5775 |
]. |
|
5776 |
||
5037 | 5777 |
ExternalStream readErrorSignal handle:[:ex | |
5778 |
(Dialog confirm:('Read Error.\\Retry ?' withCRs)) |
|
5019 | 5779 |
ifTrue:[ |
5037 | 5780 |
^ ex restart |
5019 | 5781 |
]. |
5037 | 5782 |
] do:[ |
5783 |
ExternalStream lineTooLongErrorSignal handle:[ :ex | |
|
5784 |
(alreadyConfirmed==true |
|
5785 |
or:[ Dialog confirm:(file asString, ' contains very long line(s).\\Load anyway ?' withCRs)]) |
|
5786 |
ifTrue:[ |
|
5787 |
alreadyConfirmed := true. |
|
5788 |
^ ex parameter second , ex parameter first nextLine |
|
5789 |
]. |
|
5790 |
^ nil. |
|
5791 |
] do:[ |
|
6295 | 5792 |
presentation == #asText ifTrue:[ |
8471 | 5793 |
contents := self getContentsAsTextWithSizeLimit:sizeLimit lastPart:showLastPart. |
5037 | 5794 |
] ifFalse:[ |
6295 | 5795 |
presentation == #hexDump ifTrue:[ |
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
5796 |
"/ self withWaitCursorDo:[ |
8471 | 5797 |
contents := AbstractFileBrowser |
17747 | 5798 |
contentsOfFileAsDump:file base:radixInDump |
8471 | 5799 |
withLimit:sizeLimit |
17745 | 5800 |
lastPart:showLastPart |
17747 | 5801 |
characterEncoding:characterEncodingInDump. |
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
5802 |
"/ ] |
4677 | 5803 |
] |
3892 | 5804 |
] |
5037 | 5805 |
]. |
3892 | 5806 |
]. |
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5807 |
^ contents. |
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
5808 |
|
17747 | 5809 |
"Modified: / 12-11-2017 / 12:26:40 / cg" |
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5810 |
! |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5811 |
|
6295 | 5812 |
getContentsAsTextWithSizeLimit:sizeLimitOrNil |
5540 | 5813 |
"returns the contents as unicode" |
5814 |
||
8471 | 5815 |
^ self getContentsAsTextWithSizeLimit:sizeLimitOrNil lastPart:false |
5816 |
! |
|
5817 |
||
15908 | 5818 |
getContentsAsTextWithSizeLimit:sizeLimitOrNilArg lastPart:showLastPartOrNil |
8471 | 5819 |
"returns the contents as unicode" |
5820 |
||
15908 | 5821 |
|text guessedEncoding s sizeLimitOrNil| |
5822 |
||
5823 |
sizeLimitOrNil := sizeLimitOrNilArg. |
|
8390 | 5824 |
(self lockFileEncodingHolder value ? false) ifFalse:[ |
6173
4ba4589e4952
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
6120
diff
changeset
|
5825 |
guessedEncoding := CharacterEncoder guessEncodingOfFile:item fileName asFilename. |
11589 | 5826 |
guessedEncoding := guessedEncoding ? #'iso8859-1' "(self fileEncoding)". |
5827 |
self fileEncoding:guessedEncoding asSymbol. |
|
5737 | 5828 |
]. |
5528 | 5829 |
|
5830 |
editView notNil ifTrue:[ |
|
5540 | 5831 |
"/ self validateEditViewsFontEncoding. |
5528 | 5832 |
editView externalEncoding:self fileEncoding. |
5833 |
]. |
|
5834 |
||
5835 |
s := self fileName readStream. |
|
7594 | 5836 |
[ |
8471 | 5837 |
showLastPartOrNil == true ifTrue:[ |
11590 | 5838 |
s position:(s fileSize - sizeLimitOrNil). |
15908 | 5839 |
sizeLimitOrNil := nil. |
8471 | 5840 |
]. |
5841 |
||
7594 | 5842 |
text := self |
5843 |
readStream:s |
|
5844 |
lineDelimiter:(Character cr) |
|
5845 |
sizeLimit:sizeLimitOrNil |
|
5846 |
encoding:self fileEncoding. |
|
5847 |
] ensure:[ |
|
5848 |
s close. |
|
5849 |
]. |
|
5528 | 5850 |
^ text |
5851 |
! |
|
5852 |
||
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5853 |
getHashForContents:contents |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5854 |
| hashStream| |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5855 |
|
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5856 |
self hasMD5 ifFalse:[^ nil]. |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5857 |
|
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5858 |
hashStream := MD5Stream new. |
11284
ebb519afb53d
handle non-string collections as contents (virtualArray)
Claus Gittinger <cg@exept.de>
parents:
11104
diff
changeset
|
5859 |
(contents isCollection and:[ contents isString not ]) ifTrue:[ |
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5860 |
contents do:[:eachLine | |
4616 | 5861 |
eachLine notNil ifTrue:[ |
5862 |
hashStream nextPutAll:(eachLine string withTabs). |
|
5863 |
]. |
|
5864 |
hashStream nextPut:Character cr. |
|
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5865 |
]. |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5866 |
] ifFalse:[ |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5867 |
hashStream nextPutAll:(contents string). |
4071 | 5868 |
]. |
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5869 |
^ hashStream hashValue. |
11284
ebb519afb53d
handle non-string collections as contents (virtualArray)
Claus Gittinger <cg@exept.de>
parents:
11104
diff
changeset
|
5870 |
|
ebb519afb53d
handle non-string collections as contents (virtualArray)
Claus Gittinger <cg@exept.de>
parents:
11104
diff
changeset
|
5871 |
"Modified: / 27-02-2012 / 22:10:18 / cg" |
4071 | 5872 |
! |
5873 |
||
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5874 |
hideEditorOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5875 |
self editorOperationsToolBarVisibleHolder value:false |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5876 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5877 |
"Created: / 02-08-2013 / 16:12:00 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5878 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5879 |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
5880 |
openDiffView |
8684 | 5881 |
|fn diffView text1 l1 text2 l2| |
5882 |
||
5883 |
(fn := self fileName) notNil ifTrue:[ |
|
14124
8dfb9e38a4d6
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14065
diff
changeset
|
5884 |
text1 := editView contentsAsString "asText". |
8684 | 5885 |
l1 := 'Editor'. |
5886 |
text2 := self getContents. |
|
5887 |
l2 := 'File: ' , fn baseName. |
|
5888 |
diffView := DiffTextView openOn:text1 label:l1 and:text2 label:l2. |
|
5889 |
diffView topView label:'File ' , fn baseName , ' vs. Editor Contents'. |
|
5890 |
]. |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
5891 |
! |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
5892 |
|
17747 | 5893 |
radixInDump:radix |
5894 |
radixInDump ~~ radix ifTrue:[ |
|
5895 |
radixInDump := radix. |
|
5896 |
||
5897 |
self presentation == #hexDump ifTrue:[ |
|
5898 |
self changeInformation. |
|
5899 |
self setContents. |
|
5900 |
]. |
|
5901 |
]. |
|
5902 |
||
5903 |
"Created: / 12-11-2017 / 12:22:52 / cg" |
|
5904 |
! |
|
5905 |
||
5528 | 5906 |
readStream:aStream lineDelimiter:aCharacter encoding:fileEncodingArg |
5907 |
"read from aStream, answer its contents as StringCollection. |
|
14498
16ebee6b698d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14496
diff
changeset
|
5908 |
The file's lines are delimited by aCharacter. |
5528 | 5909 |
If encoding is nonNil, the file is assumed to be coded according to |
5540 | 5910 |
that symbol, and #decodeString: should be able to convert it into unicode. |
5911 |
Always returns a unicode string." |
|
5912 |
||
6295 | 5913 |
^ self readStream:aStream lineDelimiter:aCharacter sizeLimit:nil encoding:fileEncodingArg |
5914 |
! |
|
5915 |
||
6796
23a7b7f0bd39
bug in long line handling fixed
Claus Gittinger <cg@exept.de>
parents:
6793
diff
changeset
|
5916 |
readStream:aStream lineDelimiter:lineDelimiter sizeLimit:sizeLimitOrNil encoding:fileEncodingArg |
6295 | 5917 |
"read from aStream, answer its contents as StringCollection. |
14498
16ebee6b698d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14496
diff
changeset
|
5918 |
The file's lines are delimited by aCharacter. |
6295 | 5919 |
If encoding is nonNil, the file is assumed to be coded according to |
5920 |
that symbol, and #decodeString: should be able to convert it into unicode. |
|
5921 |
Always returns a unicode string." |
|
5922 |
||
8390 | 5923 |
|text fileEncoding decoder firstDecoderError line lineNr| |
5540 | 5924 |
|
5528 | 5925 |
fileEncoding := fileEncodingArg ? #'iso8859-1'. |
5718 | 5926 |
decoder := CharacterEncoder encoderFor:fileEncoding. |
5528 | 5927 |
|
5928 |
text := StringCollection new. |
|
5929 |
||
5534 | 5930 |
firstDecoderError := true. |
8390 | 5931 |
lineNr := 1. |
5534 | 5932 |
|
5646 | 5933 |
DecodingError handle:[:ex | |
11590 | 5934 |
|msg answer labels values| |
5646 | 5935 |
|
5534 | 5936 |
firstDecoderError ifTrue:[ |
8390 | 5937 |
msg := resources stringWithCRs:'Error in decoder: %1\In Line: %2\\%3' with:ex errorString with:lineNr with:line. |
11590 | 5938 |
ex mayProceed ifTrue:[ |
5939 |
labels := #('Cancel' 'Ignore' 'Ignore All' 'Inspect Line'). |
|
5940 |
values := #(nil ignore ignoreAll inspectLine). |
|
5941 |
] ifFalse:[ |
|
5942 |
labels := #('Cancel' 'Inspect Line'). |
|
5943 |
values := #(nil inspectLine). |
|
5944 |
]. |
|
5945 |
||
5646 | 5946 |
answer := Dialog |
5947 |
confirmWithCancel:msg |
|
11590 | 5948 |
labels:(resources array:labels) |
5949 |
values:values |
|
5950 |
default:1 |
|
7693 | 5951 |
title:'Error during decode'. |
5646 | 5952 |
answer isNil ifTrue:[ AbortOperationRequest raise ]. |
5953 |
answer == #ignoreAll ifTrue:[ firstDecoderError := false ]. |
|
8390 | 5954 |
answer == #inspectLine ifTrue:[ line inspect. AbortOperationRequest raise ]. |
5534 | 5955 |
]. |
8389 | 5956 |
ex proceedWith:(ex defaultValue). |
5534 | 5957 |
] do:[ |
6295 | 5958 |
FileStream lineTooLongErrorSignal handle:[:ex | |
5959 |
|s partialLine| |
|
5960 |
||
5961 |
s := ex parameter at:1. |
|
5962 |
partialLine := ex parameter at:2. |
|
6796
23a7b7f0bd39
bug in long line handling fixed
Claus Gittinger <cg@exept.de>
parents:
6793
diff
changeset
|
5963 |
ex proceedWith:(partialLine , (s upTo:lineDelimiter)) |
6295 | 5964 |
] do:[ |
9172
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5965 |
(decoder characterSize:0) == 2 ifTrue:[ |
12066 | 5966 |
"a TwoByte decoder. Decode first and then process line breaks." |
11590 | 5967 |
|
9172
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5968 |
|buffer| |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5969 |
|
11590 | 5970 |
buffer := line := aStream upToEnd. |
9172
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5971 |
buffer := decoder decodeString:buffer. |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5972 |
buffer asCollectionOfLines do:[:line | |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5973 |
text add:line withTabsExpanded. |
5534 | 5974 |
]. |
9172
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5975 |
] ifFalse:[ |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5976 |
[aStream atEnd] whileFalse:[ |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5977 |
lineDelimiter == Character cr ifTrue:[ |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5978 |
line := aStream nextLine. |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5979 |
] ifFalse:[ |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5980 |
line := aStream upTo:lineDelimiter. |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5981 |
]. |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5982 |
|
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5983 |
line := line withTabsExpanded. |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5984 |
text add:(decoder decodeString:line). |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5985 |
sizeLimitOrNil notNil ifTrue:[ |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5986 |
aStream position > sizeLimitOrNil ifTrue:[ |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5987 |
^ text |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5988 |
] |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5989 |
]. |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5990 |
lineNr := lineNr + 1. |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
5991 |
] |
5528 | 5992 |
]. |
5993 |
]. |
|
5994 |
]. |
|
5995 |
^ text |
|
7693 | 5996 |
|
5997 |
"Modified: / 02-03-2007 / 15:09:30 / cg" |
|
12066 | 5998 |
"Modified (comment): / 22-11-2012 / 13:06:03 / cg" |
5528 | 5999 |
! |
6000 |
||
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6001 |
reload |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6002 |
|
4969 | 6003 |
textEditorModificationTime := self fileName modificationTime. |
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
6004 |
"/ self withWaitCursorDo:[ |
5287
693e3ca577aa
avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents:
5279
diff
changeset
|
6005 |
self setContents. |
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
6006 |
"/ ]. |
12089
4690e72f5af3
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12079
diff
changeset
|
6007 |
self setUpTextView |
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
6008 |
|
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
6009 |
"Modified: / 25-07-2006 / 09:09:55 / cg" |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6010 |
! |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6011 |
|
8684 | 6012 |
saveFileAs |
6013 |
self saveWithAskForFilename:true |
|
6014 |
! |
|
6015 |
||
5417 | 6016 |
saveWithAskForFilename:ask |
6017 |
||
8684 | 6018 |
|answer fn master defaultDir dir base fnDir| |
6019 |
||
6020 |
master := self masterApplication. |
|
12480
2d1bd93f29d1
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12348
diff
changeset
|
6021 |
(fn := self fileName) notNil ifTrue:[ |
2d1bd93f29d1
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12348
diff
changeset
|
6022 |
dir := fn directory. |
2d1bd93f29d1
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12348
diff
changeset
|
6023 |
base := fn baseName. |
8684 | 6024 |
]. |
5417 | 6025 |
|
6026 |
ask ifTrue:[ |
|
8684 | 6027 |
defaultDir := master notNil ifTrue:[ master currentDirectory ] ifFalse:[ nil ]. |
5417 | 6028 |
defaultDir isNil ifTrue:[ |
12480
2d1bd93f29d1
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12348
diff
changeset
|
6029 |
fn notNil ifTrue:[ |
8684 | 6030 |
defaultDir := dir. |
6031 |
] |
|
5417 | 6032 |
]. |
6033 |
answer := Dialog |
|
9611 | 6034 |
requestFileNameForSave:(resources string:'Save contents in:') |
8684 | 6035 |
default:base |
5417 | 6036 |
fromDirectory:defaultDir. |
9611 | 6037 |
answer isEmptyOrNil ifTrue:[^ self]. |
5417 | 6038 |
fn := answer asFilename. |
6039 |
]. |
|
8684 | 6040 |
|
5417 | 6041 |
(master notNil and:[master class openAnotherApplicationOnSameItem]) ifTrue:[ |
6042 |
(self updateSameFilesFor:fn) ifFalse:[ ^ self ]. |
|
6043 |
]. |
|
6044 |
||
6045 |
fnDir := fn directory. |
|
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6214
diff
changeset
|
6046 |
fnDir exists ifFalse:[ |
12079
50a553319d07
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
12066
diff
changeset
|
6047 |
[ |
50a553319d07
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
12066
diff
changeset
|
6048 |
fnDir recursiveMakeDirectory. |
17118 | 6049 |
] on:OsError do:[:ex| |
12079
50a553319d07
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
12066
diff
changeset
|
6050 |
Dialog warn:(ex description). |
50a553319d07
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
12066
diff
changeset
|
6051 |
^ self. |
50a553319d07
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
12066
diff
changeset
|
6052 |
] |
5417 | 6053 |
]. |
12480
2d1bd93f29d1
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12348
diff
changeset
|
6054 |
|
14660
39afddf6eea3
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14576
diff
changeset
|
6055 |
(editView saveAs:fn doAppend:false compressTabs:master compressTabsOnSave eolMode:master lineEndConvention) ifFalse:[^ self]. |
5417 | 6056 |
|
6057 |
textEditorModificationTime := self fileName modificationTime. |
|
6058 |
||
6059 |
self hasMD5 ifTrue:[ |
|
6060 |
md5CheckSum := self getHashForContents:self fileContentsModel value. |
|
6061 |
]. |
|
5471
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
6062 |
|
5417 | 6063 |
self enableReload value:false. |
6064 |
self itemChanged value:false. |
|
6065 |
self itemRemoved value:false. |
|
6066 |
self modifiedChannel value:false. |
|
6067 |
self notify:self fileName asString, ' saved'. |
|
13760
60a6ffe379a7
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13729
diff
changeset
|
6068 |
tagsBrowser notNil ifTrue:[ |
60a6ffe379a7
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13729
diff
changeset
|
6069 |
tagsBrowser updateTagList |
60a6ffe379a7
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13729
diff
changeset
|
6070 |
]. |
9611 | 6071 |
|
6072 |
"Modified: / 27-10-2010 / 10:41:29 / cg" |
|
5417 | 6073 |
! |
6074 |
||
4146
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6075 |
searchForPattern:aContentsPattern ignoreCase:ign |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6076 |
|
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6077 |
| pattern | |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6078 |
|
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6079 |
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
|
6080 |
pattern notEmpty ifTrue:[ |
15218
2401b6bf1879
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15209
diff
changeset
|
6081 |
editView perform:#cursorHome ifNotUnderstood:[]. |
4146
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6082 |
editView rememberSearchPattern:pattern. |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6083 |
editView searchFwd:pattern ignoreCase:ign. |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6084 |
] |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6085 |
! |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6086 |
|
8087 | 6087 |
selectInBrowser |
6088 |
|application| |
|
6089 |
||
6090 |
application := self masterApplication. |
|
6091 |
application notNil ifTrue:[ |
|
6092 |
application gotoFile:(self fileName). |
|
6093 |
]. |
|
6094 |
! |
|
6095 |
||
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6096 |
setContents |
5528 | 6097 |
|text| |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6098 |
|
7970
337b8efd934e
readcursor while reading a file
Claus Gittinger <cg@exept.de>
parents:
7947
diff
changeset
|
6099 |
self withReadCursorDo:[ |
337b8efd934e
readcursor while reading a file
Claus Gittinger <cg@exept.de>
parents:
7947
diff
changeset
|
6100 |
text := self getContents. |
337b8efd934e
readcursor while reading a file
Claus Gittinger <cg@exept.de>
parents:
7947
diff
changeset
|
6101 |
]. |
4201 | 6102 |
text isNil ifTrue:[ ^ false]. |
9885 | 6103 |
self withWaitCursorDo:[ |
6104 |
self setContentsFor:text. |
|
6105 |
]. |
|
4953 | 6106 |
^ true |
6107 |
! |
|
6108 |
||
5540 | 6109 |
setContentsFor:aUnicodeText |
4969 | 6110 |
self itemChanged value:false. |
5534 | 6111 |
|
5540 | 6112 |
self validateEditViewsFontEncoding. |
6113 |
||
6114 |
self fileContentsModel value:aUnicodeText. |
|
5534 | 6115 |
|
4071 | 6116 |
self hasMD5 ifTrue:[ |
5540 | 6117 |
md5CheckSum := self getHashForContents:aUnicodeText. |
4071 | 6118 |
]. |
3892 | 6119 |
self enableReload value:false. |
6120 |
self itemChanged value:false. |
|
4045 | 6121 |
self modifiedChannel value:false. |
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6122 |
self notify:nil. |
3892 | 6123 |
^ true |
5534 | 6124 |
|
6125 |
||
6126 |
"/ |
|
6127 |
"/ oldEncoding := editView characterEncoding. |
|
6128 |
"/ oldEncoding ~= newEncoding ifTrue:[ |
|
6129 |
"/self halt. |
|
6130 |
"/ (lines := editView contents) size > 0 ifTrue:[ |
|
6131 |
"/ (Dialog |
|
6132 |
"/ confirm:('Re-Encode contents (from %1 to %2) ?' |
|
6133 |
"/ bindWith:oldEncoding |
|
6134 |
"/ with:newEncoding) |
|
6135 |
"/ ) ifTrue:[ |
|
6136 |
"/ recoder := CharacterEncoder |
|
6137 |
"/ encoderToEncodeFrom:oldEncoding |
|
6138 |
"/ into:newEncoding. |
|
6139 |
"/ lines keysAndValuesDo:[:lineNr :line | |
|
6140 |
"/ line notNil ifTrue:[ |
|
6141 |
"/ editView at:lineNr put:(recoder encodeString:line). |
|
6142 |
"/ ]. |
|
6143 |
"/ ]. |
|
6144 |
"/ ] |
|
6145 |
"/ ]. |
|
6146 |
"/ ]. |
|
3892 | 6147 |
! |
6148 |
||
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6149 |
showEditorOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6150 |
self editorOperationsToolBarVisibleHolder value:true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6151 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6152 |
"Created: / 02-08-2013 / 16:11:52 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6153 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6154 |
|
9946 | 6155 |
tagSelected:aTag |
11032
67fc45edcaac
tag-selection fix (when textselection is present)
Claus Gittinger <cg@exept.de>
parents:
10955
diff
changeset
|
6156 |
editView deselect. "/ otherwise, it might jump back to show the selection |
9946 | 6157 |
editView cursorLine:(aTag lineNumber) col:1. |
6158 |
||
6159 |
"Created: / 23-06-2011 / 16:38:07 / cg" |
|
6160 |
! |
|
6161 |
||
5417 | 6162 |
updateSameFilesFor:aFilename |
3892 | 6163 |
| master modifiedApplications stream filename action| |
6164 |
||
6165 |
master := self masterApplication. |
|
6166 |
master notNil ifTrue:[ |
|
6167 |
modifiedApplications := master getSameFilesModifiedFor:self. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6481
diff
changeset
|
6168 |
(modifiedApplications isEmptyOrNil) ifTrue:[^ true ]. |
5417 | 6169 |
filename := aFilename asString. |
15594
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
6170 |
stream := CharacterWriteStream with:filename. |
3892 | 6171 |
stream nextPutAll:' is modified in tab'. |
6172 |
modifiedApplications size > 1 ifTrue:[ |
|
6173 |
stream nextPutAll:'s'. |
|
6174 |
]. |
|
6175 |
stream cr. |
|
6176 |
modifiedApplications do:[ : el | |
|
6177 |
stream space. |
|
6178 |
stream nextPutAll:filename. |
|
6179 |
stream space. |
|
6180 |
el sameFileIndex notNil ifTrue:[ |
|
6181 |
stream nextPutAll:el sameFileIndex asString. |
|
6182 |
]. |
|
6183 |
stream cr. |
|
6184 |
]. |
|
6185 |
stream nextPutAll:'forget changes on other tab'. |
|
6186 |
modifiedApplications size > 1 ifTrue:[ |
|
6187 |
stream nextPutAll:'s'. |
|
6188 |
]. |
|
6189 |
stream nextPutAll:' ?'. |
|
6190 |
action := Dialog |
|
6191 |
choose:stream contents |
|
13406
b3cb3f94b100
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13377
diff
changeset
|
6192 |
labels:#('Cancel' 'No' 'Yes') |
3892 | 6193 |
values:#(#cancel #no #yes) |
6194 |
default:#cancel. |
|
6195 |
||
6196 |
stream close. |
|
6197 |
action == #cancel ifTrue:[ ^ false ]. |
|
6198 |
action == #yes ifTrue:[ |
|
6199 |
"/ here force reload for other applications |
|
6200 |
modifiedApplications do:[ : el | |
|
6201 |
el reload. |
|
6202 |
] |
|
6203 |
]. |
|
6204 |
]. |
|
6205 |
^ true. |
|
13406
b3cb3f94b100
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13377
diff
changeset
|
6206 |
|
b3cb3f94b100
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13377
diff
changeset
|
6207 |
"Modified: / 29-08-2013 / 01:37:18 / cg" |
5540 | 6208 |
! |
6209 |
||
6210 |
validateEditViewsFontEncoding |
|
5717 | 6211 |
|fileEncoding preferredFontEncoding fontsEncoding action| |
5540 | 6212 |
|
6213 |
editView isNil ifTrue:[^ self]. |
|
6214 |
||
6215 |
fileEncoding := self fileEncoding. |
|
6216 |
||
11589 | 6217 |
fontsEncoding := editView font encoding ? #'iso8859-1'. |
5540 | 6218 |
|
6219 |
preferredFontEncoding := FontDescription preferredFontEncodingFor:fileEncoding. |
|
6220 |
(CharacterEncoder isEncoding:preferredFontEncoding subSetOf:fontsEncoding) ifFalse:[ |
|
6221 |
doNotShowFontDialog == true ifTrue:[ |
|
6222 |
action := #show |
|
6223 |
] ifFalse:[ |
|
5609 | 6224 |
action := Dialog choose:(resources string:'''%1'' seems to require a %2 (or unicode) font (file encoding is %3).' |
5540 | 6225 |
with:self fileName baseName |
6226 |
with:preferredFontEncoding allBold |
|
6227 |
with:fileEncoding) |
|
6228 |
labels:(resources array:#('Cancel' 'Show' 'Don''t Ask Again' 'Change Font')) |
|
6229 |
values:#(nil #show #showAlways #encoding) |
|
6230 |
default:#encoding. |
|
6231 |
]. |
|
6232 |
action == #showAlways ifTrue:[ |
|
6233 |
doNotShowFontDialog := true. |
|
6234 |
action := #show. |
|
6235 |
]. |
|
6236 |
action isNil ifTrue:[ |
|
13776
fd15b128241f
AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents:
13760
diff
changeset
|
6237 |
AbortOperationRequest raise |
5540 | 6238 |
]. |
6239 |
action == #encoding ifTrue:[ |
|
6240 |
editView validateFontEncodingFor:fileEncoding ask:false. |
|
6241 |
]. |
|
6242 |
]. |
|
3892 | 6243 |
! ! |
6244 |
||
6245 |
!FileApplicationNoteBook::TextEditor methodsFor:'aspects'! |
|
6246 |
||
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6247 |
canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6248 |
^ editView notNil and:[editView isReadOnly not] |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6249 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6250 |
"Created: / 02-08-2013 / 16:45:34 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6251 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6252 |
|
5120 | 6253 |
cursorColLabelHolder |
6254 |
^ BlockValue |
|
6255 |
with:[:v | v printString] |
|
6256 |
argument:editView cursorColHolder. |
|
6257 |
! |
|
6258 |
||
15821
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
6259 |
cursorLineAndColumnLabelHolder |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
6260 |
^ editView cursorLineAndColumnLabelHolder. |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
6261 |
! |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
6262 |
|
5120 | 6263 |
cursorLineLabelHolder |
6264 |
^ BlockValue |
|
6265 |
with:[:v | v printString] |
|
6266 |
argument:editView cursorLineHolder. |
|
6267 |
! |
|
6268 |
||
7103 | 6269 |
editModeInsert |
6270 |
editView editModeInsert |
|
6271 |
||
6272 |
"Created: / 11-09-2006 / 12:46:50 / cg" |
|
6273 |
! |
|
6274 |
||
6275 |
editModeInsertAndSelect |
|
6276 |
editView editModeInsertAndSelect |
|
6277 |
||
6278 |
"Created: / 11-09-2006 / 12:47:01 / cg" |
|
6279 |
! |
|
6280 |
||
6281 |
editModeOverwrite |
|
6282 |
editView editModeOverwrite |
|
6283 |
||
6284 |
"Created: / 11-09-2006 / 12:46:47 / cg" |
|
6285 |
! |
|
6286 |
||
7596
6ea35d883f1f
gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents:
7594
diff
changeset
|
6287 |
editView |
6ea35d883f1f
gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents:
7594
diff
changeset
|
6288 |
^ editView |
6ea35d883f1f
gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents:
7594
diff
changeset
|
6289 |
! |
6ea35d883f1f
gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents:
7594
diff
changeset
|
6290 |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6291 |
editorOperationsMenuSpecHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6292 |
editorOperationsMenuSpecHolder isNil ifTrue:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6293 |
editorOperationsMenuSpecHolder := self class menuEditorOperationsForNormalText asValue. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6294 |
]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6295 |
^ editorOperationsMenuSpecHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6296 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6297 |
"Created: / 02-08-2013 / 16:35:49 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6298 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6299 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6300 |
editorOperationsToolBarNotVisibleHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6301 |
^ BlockValue forLogicalNot:self editorOperationsToolBarVisibleHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6302 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6303 |
"Created: / 02-08-2013 / 16:11:02 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6304 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6305 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6306 |
editorOperationsToolBarVisibleHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6307 |
editorOperationsToolBarVisibleHolder isNil ifTrue:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6308 |
editorOperationsToolBarVisibleHolder := (DefaultEditorOperationsToolBarVisible ? true) asValue. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6309 |
editorOperationsToolBarVisibleHolder onChangeSend:#editorOperationsToolBarVisibilityChanged to:self. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6310 |
]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6311 |
^ editorOperationsToolBarVisibleHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6312 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6313 |
"Created: / 02-08-2013 / 15:59:43 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6314 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6315 |
|
3892 | 6316 |
enableHexToggle |
6317 |
enableHexToggle isNil ifTrue:[ |
|
6318 |
enableHexToggle := true asValue. |
|
6319 |
]. |
|
6320 |
^ enableHexToggle |
|
6321 |
! |
|
6322 |
||
6323 |
enableReload |
|
6324 |
enableReload isNil ifTrue:[ |
|
6325 |
enableReload := false asValue. |
|
6326 |
]. |
|
6327 |
^ enableReload. |
|
6328 |
! |
|
6329 |
||
6330 |
enableSave |
|
6331 |
enableSave isNil ifTrue:[ |
|
6332 |
enableSave := false asValue. |
|
6333 |
]. |
|
6334 |
^ enableSave. |
|
6335 |
! |
|
6336 |
||
8783 | 6337 |
enableSaveAs |
6338 |
^ true. |
|
6339 |
! |
|
6340 |
||
8087 | 6341 |
enableSelectInBrowser |
6342 |
enableSelectInBrowser isNil ifTrue:[ |
|
6343 |
enableSelectInBrowser := false asValue. |
|
6344 |
]. |
|
6345 |
^ enableSelectInBrowser. |
|
6346 |
! |
|
6347 |
||
3892 | 6348 |
fileContentsModel |
6349 |
fileContentsModel isNil ifTrue:[ |
|
6350 |
fileContentsModel := ValueHolder new. |
|
6351 |
]. |
|
6352 |
^ fileContentsModel. |
|
6353 |
! |
|
6354 |
||
5528 | 6355 |
fileEncodingHolder |
6356 |
fileEncodingHolder isNil ifTrue:[ |
|
5534 | 6357 |
fileEncodingHolder := #'iso8859-1' asValue |
5528 | 6358 |
]. |
6359 |
^ fileEncodingHolder |
|
6360 |
! |
|
6361 |
||
3892 | 6362 |
itemChanged |
6363 |
itemChanged isNil ifTrue:[ |
|
6364 |
itemChanged := false asValue. |
|
6365 |
itemChanged addDependent:self. |
|
6366 |
]. |
|
6367 |
^ itemChanged |
|
6368 |
! |
|
6369 |
||
6370 |
itemRemoved |
|
6371 |
itemRemoved isNil ifTrue:[ |
|
6372 |
itemRemoved := false asValue. |
|
6373 |
itemRemoved addDependent:self. |
|
6374 |
]. |
|
6375 |
^ itemRemoved |
|
6376 |
! |
|
6377 |
||
5737 | 6378 |
lockFileEncodingHolder |
6379 |
lockFileEncodingHolder isNil ifTrue:[ |
|
6380 |
lockFileEncodingHolder := false asValue. |
|
6381 |
]. |
|
6382 |
^ lockFileEncodingHolder |
|
6383 |
! |
|
6384 |
||
5120 | 6385 |
modeLabelHolder |
6386 |
^ editView modeLabelHolder. |
|
6387 |
! |
|
6388 |
||
7103 | 6389 |
modeLabelMenu |
6390 |
^ FileBrowserV2 editModeInfoLabelMenu |
|
6391 |
||
6392 |
"Created: / 11-09-2006 / 12:36:26 / cg" |
|
6393 |
! |
|
6394 |
||
3892 | 6395 |
modifiedChannel |
6396 |
modifiedChannel isNil ifTrue:[ |
|
6397 |
modifiedChannel := false asValue. |
|
6398 |
modifiedChannel addDependent:self. |
|
6399 |
]. |
|
6400 |
^ modifiedChannel. |
|
6401 |
! |
|
6402 |
||
17747 | 6403 |
presentationHolder |
6404 |
presentationHolder isNil ifTrue:[ |
|
6405 |
presentationHolder := ValueHolder with:#asText. |
|
6406 |
]. |
|
6407 |
^ presentationHolder |
|
6408 |
||
6409 |
"Created: / 12-11-2017 / 12:32:23 / cg" |
|
6410 |
! |
|
6411 |
||
3892 | 6412 |
printAsHexDump |
6413 |
printAsHexDump isNil ifTrue:[ |
|
6414 |
printAsHexDump := false asValue. |
|
6415 |
printAsHexDump addDependent:self. |
|
6416 |
]. |
|
6417 |
^ printAsHexDump. |
|
4071 | 6418 |
! |
6419 |
||
6420 |
viewModifiedChannel |
|
6421 |
viewModifiedChannel isNil ifTrue:[ |
|
6422 |
viewModifiedChannel := false asValue. |
|
6423 |
viewModifiedChannel addDependent:self. |
|
6424 |
]. |
|
6425 |
^ viewModifiedChannel. |
|
3892 | 6426 |
! ! |
6427 |
||
8684 | 6428 |
!FileApplicationNoteBook::TextEditor methodsFor:'aspects-visibility'! |
6429 |
||
11099 | 6430 |
closeButtonShown |
6431 |
^ false. |
|
6432 |
"/ ^ self isEmbeddedApplication. |
|
6433 |
||
6434 |
"Created: / 12-01-2012 / 00:32:15 / cg" |
|
6435 |
! |
|
6436 |
||
8684 | 6437 |
diffTextButtonVisible |
6438 |
^ self fileName notNil "/ true |
|
6439 |
! |
|
6440 |
||
13729
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6441 |
doItMenuButtonVisible |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6442 |
^true |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6443 |
|
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6444 |
"Created: / 17-12-2013 / 16:31:40 / cg" |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6445 |
! |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6446 |
|
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6447 |
inspectItMenuButtonVisible |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6448 |
^true |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6449 |
|
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6450 |
"Created: / 17-12-2013 / 16:31:49 / cg" |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6451 |
! |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6452 |
|
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6453 |
printItMenuButtonVisible |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6454 |
^true |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6455 |
|
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6456 |
"Created: / 17-12-2013 / 16:31:45 / cg" |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6457 |
! |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6458 |
|
8684 | 6459 |
reloadButtonVisible |
6460 |
^ self fileName notNil "/ true |
|
6461 |
! |
|
6462 |
||
6463 |
saveAsButtonVisible |
|
6464 |
^ true |
|
6465 |
! |
|
6466 |
||
6467 |
saveButtonVisible |
|
6468 |
^ self fileName notNil "/ true |
|
6469 |
! |
|
6470 |
||
6471 |
selectInBrowserButtonVisible |
|
6472 |
^ self masterApplication notNil |
|
9946 | 6473 |
! |
6474 |
||
6475 |
tagsBrowserVisibleHolder |
|
6476 |
tagsBrowserVisibleHolder isNil ifTrue:[ |
|
6477 |
masterApplication notNil ifTrue:[ |
|
6478 |
tagsBrowserVisibleHolder := masterApplication tagsBrowserVisibleHolder. |
|
6479 |
] ifFalse:[ |
|
10761 | 6480 |
tagsBrowserVisibleHolder := self class defaultTagsBrowserVisible asValue. |
9946 | 6481 |
]. |
6482 |
tagsBrowserVisibleHolder addDependent:self. |
|
6483 |
]. |
|
6484 |
^ tagsBrowserVisibleHolder |
|
6485 |
||
6486 |
"Created: / 23-06-2011 / 09:19:18 / cg" |
|
10761 | 6487 |
"Modified: / 06-10-2011 / 12:46:41 / cg" |
8684 | 6488 |
! ! |
6489 |
||
3892 | 6490 |
!FileApplicationNoteBook::TextEditor methodsFor:'change & update'! |
6491 |
||
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6492 |
changeTextColorForChanged |
4969 | 6493 |
|text prevCursorBehavior| |
6494 |
||
6495 |
prevCursorBehavior := editView cursorMovementWhenUpdating. |
|
6496 |
editView cursorMovementWhenUpdating:nil. |
|
6497 |
||
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6498 |
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
|
6499 |
text := editView contents. |
4499 | 6500 |
self fileContentsModel |
4969 | 6501 |
value:(text asText emphasizeAllWith:UserPreferences current emphasisForChangedCode). |
17256 | 6502 |
editView pushEvent:#flash. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6503 |
] ifFalse:[ |
17256 | 6504 |
"/ self fileContentsModel value:text string. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6505 |
]. |
4969 | 6506 |
editView cursorMovementWhenUpdating:prevCursorBehavior. |
6507 |
"/ self fileContentsModel changed:#value. |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6508 |
! |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6509 |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6510 |
editorOperationsToolBarVisibilityChanged |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6511 |
|editorToolBar editorOperationsToolBar editor topOffset editorOperationsToolBarVisible| |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6512 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6513 |
editorToolBar := self componentAt:#MenuTextEditor. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6514 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6515 |
editorOperationsToolBar := self componentAt:#EditorOperationsToolBar. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6516 |
editor := self componentAt:#TextEditor. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6517 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6518 |
topOffset := editorToolBar height. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6519 |
editorOperationsToolBarVisible := self editorOperationsToolBarVisibleHolder value. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6520 |
DefaultEditorToolBarVisible := editorOperationsToolBarVisible. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6521 |
editorOperationsToolBarVisible ifTrue:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6522 |
topOffset := topOffset + editorOperationsToolBar height. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6523 |
]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6524 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6525 |
topOffset := topOffset - 1. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6526 |
editor layout topOffset:topOffset. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6527 |
editor container notNil ifTrue:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6528 |
editor containerChangedSize. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6529 |
]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6530 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6531 |
"Created: / 02-08-2013 / 16:01:01 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6532 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6533 |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6534 |
itemModified |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6535 |
|
4161 | 6536 |
| modified outDated removed| |
3892 | 6537 |
|
6538 |
modified := self modifiedChannel value. |
|
4161 | 6539 |
outDated := self itemChanged value. |
3892 | 6540 |
removed := self itemRemoved value. |
6541 |
||
17002 | 6542 |
(modified or:[outDated or:[removed]]) ifTrue:[ |
4161 | 6543 |
modified ifTrue:[ |
6544 |
self changeInformationForModified:#modified. |
|
6545 |
]. |
|
6546 |
outDated ifTrue:[ |
|
6547 |
self changeInformationForModified:#outDated. |
|
6548 |
]. |
|
6549 |
removed ifTrue:[ |
|
6550 |
self changeInformationForModified:#removed. |
|
6551 |
]. |
|
6552 |
] ifFalse:[ |
|
6553 |
self changeInformationForModified:#unchanged. |
|
6554 |
]. |
|
5471
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
6555 |
|
4161 | 6556 |
self enableReload value:((modified or:[outDated]) and:[removed not]). |
3892 | 6557 |
! |
6558 |
||
9946 | 6559 |
postBuildTagsBrowser:aTagsBrowserCanvas |
6560 |
tagsBrowser := aTagsBrowserCanvas application. |
|
6561 |
tagsBrowser action:[:selectedTag | self tagSelected:selectedTag ]. |
|
6562 |
self updateTagsBrowser. |
|
6563 |
||
6564 |
"Created: / 23-06-2011 / 16:30:00 / cg" |
|
6565 |
! |
|
6566 |
||
6567 |
tagsBrowserVisibilityChanged |
|
10761 | 6568 |
|visible tagsBrowserCanvas| |
9949
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6569 |
|
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6570 |
tagsBrowser notNil ifTrue:[ |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6571 |
tagsBrowserCanvas := tagsBrowser window. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6572 |
]. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6573 |
|
10761 | 6574 |
(visible := self tagsBrowserVisibleHolder value) ifTrue:[ |
9949
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6575 |
tagsBrowser isNil ifTrue:[ |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6576 |
tagsBrowserCanvas := ApplicationSubView new. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6577 |
|
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6578 |
tagsBrowser := Tools::TagsBrowser new. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6579 |
tagsBrowser window:tagsBrowserCanvas. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6580 |
tagsBrowser allButOpen. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6581 |
|
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6582 |
(self builder componentAt:#Panel) |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6583 |
addComponent:tagsBrowserCanvas; |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6584 |
relativeCorners:#(0.75 1.0). |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6585 |
tagsBrowserCanvas realize. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6586 |
self postBuildTagsBrowser:tagsBrowserCanvas. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6587 |
] ifFalse:[ |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6588 |
tagsBrowserCanvas map. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6589 |
(self builder componentAt:#Panel) |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6590 |
relativeCorners:#(0.75 1.0). |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6591 |
]. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6592 |
|
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6593 |
self updateTagsBrowser. |
9946 | 6594 |
] ifFalse:[ |
9949
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6595 |
tagsBrowser notNil ifTrue:[ |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6596 |
tagsBrowserCanvas unmap. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6597 |
(self builder componentAt:#Panel) relativeCorners:#(1.0 1.0). |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6598 |
]. |
9946 | 6599 |
]. |
10761 | 6600 |
DefaultTagsBrowserVisible := visible |
9946 | 6601 |
|
6602 |
"Created: / 27-06-2011 / 16:06:00 / cg" |
|
10761 | 6603 |
"Modified: / 06-10-2011 / 12:45:20 / cg" |
9946 | 6604 |
! |
6605 |
||
3892 | 6606 |
update:something with:aParameter from:changedObject |
4969 | 6607 |
|itemRem contMd5CheckSum viewModified p| |
4071 | 6608 |
|
6609 |
changedObject == self viewModifiedChannel ifTrue:[ |
|
6610 |
viewModified := changedObject value. |
|
6611 |
self hasMD5 ifTrue:[ |
|
6612 |
self viewModifiedChannel value:false withoutNotifying:self. |
|
6613 |
viewModified ifTrue:[ |
|
4969 | 6614 |
(p := md5HashValueComputationProcess) notNil ifTrue:[ |
6615 |
p terminate. |
|
6616 |
]. |
|
6617 |
md5HashValueComputationProcess := |
|
6618 |
[ |
|
6619 |
contMd5CheckSum := self getHashForContents:(editView list). |
|
6620 |
self modifiedChannel value:(contMd5CheckSum ~= md5CheckSum). |
|
6621 |
md5HashValueComputationProcess := nil. |
|
6622 |
] newProcess. |
|
6623 |
md5HashValueComputationProcess priority:(Processor userBackgroundPriority). |
|
6624 |
md5HashValueComputationProcess resume. |
|
4071 | 6625 |
]. |
4969 | 6626 |
] ifFalse:[ |
6627 |
self modifiedChannel value:viewModified. |
|
6628 |
] |
|
4071 | 6629 |
]. |
3892 | 6630 |
changedObject == self modifiedChannel ifTrue:[ |
4969 | 6631 |
self enableSave value:changedObject value. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6632 |
self itemModified. |
3892 | 6633 |
^ self |
6634 |
]. |
|
6635 |
changedObject == self itemRemoved ifTrue:[ |
|
6636 |
itemRem := changedObject value. |
|
4969 | 6637 |
self enableSave value:(itemRem ? false). |
3892 | 6638 |
self enableHexToggle value:itemRem not. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6639 |
self itemModified. |
3892 | 6640 |
^ self |
6641 |
]. |
|
6642 |
changedObject == self itemChanged ifTrue:[ |
|
8228 | 6643 |
self enqueueMessage:#changeTextColorForChanged for:self arguments:#(). |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6644 |
self itemModified. |
3892 | 6645 |
^ self |
6646 |
]. |
|
5197 | 6647 |
|
3892 | 6648 |
changedObject == self printAsHexDump ifTrue:[ |
5197 | 6649 |
AbortOperationRequest handle:[:ex | |
6650 |
self printAsHexDump value:false withoutNotifying:self. |
|
6651 |
^ self. |
|
6652 |
] do:[ |
|
5198
ea3f838e1353
do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents:
5197
diff
changeset
|
6653 |
self askForChangeWithReload:true. |
3892 | 6654 |
]. |
5197 | 6655 |
self presentation:(changedObject value ifTrue:[#hexDump] ifFalse:[#asText]). |
3892 | 6656 |
self changeInformation. |
6657 |
self setContents. |
|
4621 | 6658 |
editView notNil ifTrue:[ |
5197 | 6659 |
editView readOnly:(self presentation == #hexDump). |
3892 | 6660 |
]. |
4621 | 6661 |
^ self |
3892 | 6662 |
]. |
9946 | 6663 |
changedObject == editView cursorLineHolder ifTrue:[ |
9951 | 6664 |
tagsBrowser notNil ifTrue:[ |
6665 |
tagsBrowser updateForLine:(changedObject value). |
|
6666 |
]. |
|
9946 | 6667 |
^ self |
6668 |
]. |
|
6669 |
changedObject == tagsBrowserVisibleHolder ifTrue:[ |
|
6670 |
self tagsBrowserVisibilityChanged. |
|
6671 |
^ self |
|
6672 |
]. |
|
3892 | 6673 |
|
6674 |
super update:something with:aParameter from:changedObject |
|
9946 | 6675 |
|
9951 | 6676 |
"Modified: / 29-06-2011 / 19:36:03 / cg" |
9946 | 6677 |
! |
6678 |
||
6679 |
updateTagsBrowser |
|
6680 |
tagsBrowser notNil ifTrue:[ |
|
9949
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6681 |
self tagsBrowserVisibleHolder value ifTrue:[ |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6682 |
tagsBrowser editedFile:(self item isNil ifTrue:[nil] ifFalse:[self item fileName]). |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6683 |
] |
9946 | 6684 |
] |
6685 |
||
6686 |
"Created: / 23-06-2011 / 16:32:44 / cg" |
|
3892 | 6687 |
! ! |
6688 |
||
9399
dae73aa739a8
no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents:
9359
diff
changeset
|
6689 |
!FileApplicationNoteBook::TextEditor methodsFor:'initialization'! |
dae73aa739a8
no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents:
9359
diff
changeset
|
6690 |
|
dae73aa739a8
no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents:
9359
diff
changeset
|
6691 |
initialize |
dae73aa739a8
no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents:
9359
diff
changeset
|
6692 |
super initialize. |
dae73aa739a8
no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents:
9359
diff
changeset
|
6693 |
semaChangeItem := Semaphore forMutualExclusion. |
17747 | 6694 |
|
6695 |
characterEncodingInDump := nil. "/ nil defaults to 'iso8859-1' " |
|
6696 |
radixInDump := 16. |
|
6697 |
||
6698 |
"Modified (comment): / 12-11-2017 / 12:27:20 / cg" |
|
9399
dae73aa739a8
no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents:
9359
diff
changeset
|
6699 |
! ! |
dae73aa739a8
no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents:
9359
diff
changeset
|
6700 |
|
3892 | 6701 |
!FileApplicationNoteBook::TextEditor methodsFor:'printing'! |
6702 |
||
8002
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
6703 |
printOn:aStream |
8684 | 6704 |
|fn| |
6705 |
||
8002
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
6706 |
aStream nextPutAll:'TextEditor for:'. |
8684 | 6707 |
(fn := self fileName) notNil ifTrue:[ |
6708 |
fn baseName printOn:aStream. |
|
6709 |
] |
|
3892 | 6710 |
! ! |
6711 |
||
6481 | 6712 |
!FileApplicationNoteBook::TextEditor methodsFor:'private-process'! |
3892 | 6713 |
|
4969 | 6714 |
checkItemForChanges |
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6715 |
|exists fileModificationTime message| |
5584 | 6716 |
|
5612
7b0fa57f046e
Allow opening of a file in an empty text editor
Stefan Vogel <sv@exept.de>
parents:
5610
diff
changeset
|
6717 |
item isNil ifTrue:[ |
7b0fa57f046e
Allow opening of a file in an empty text editor
Stefan Vogel <sv@exept.de>
parents:
5610
diff
changeset
|
6718 |
^ self |
7b0fa57f046e
Allow opening of a file in an empty text editor
Stefan Vogel <sv@exept.de>
parents:
5610
diff
changeset
|
6719 |
]. |
7b0fa57f046e
Allow opening of a file in an empty text editor
Stefan Vogel <sv@exept.de>
parents:
5610
diff
changeset
|
6720 |
|
5584 | 6721 |
exists := self item exists. |
6722 |
self itemRemoved value:(exists not). |
|
6723 |
exists ifTrue:[ |
|
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6724 |
fileModificationTime := self fileName modificationTime. |
4969 | 6725 |
textEditorModificationTime isNil ifTrue:[ |
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6726 |
textEditorModificationTime := fileModificationTime. |
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
6727 |
]. |
5584 | 6728 |
message := '%1 was changed by someone else.'. |
6729 |
] ifFalse:[ |
|
6730 |
message := '%1 was removed by someone else.'. |
|
6731 |
]. |
|
6732 |
||
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6733 |
(textEditorModificationTime ~= fileModificationTime) ifTrue:[ |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6734 |
"file contents has been changed by someone else" |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6735 |
message := (resources string:message with:item fileName baseName) allBold |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6736 |
emphasisAllAdd:(UserPreferences current emphasisForModifiedBuffer). |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6737 |
message = self notifyChannel value ifFalse:[ |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6738 |
self notify:message. |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6739 |
self itemChanged value:true. |
4969 | 6740 |
]. |
3892 | 6741 |
]. |
5457 | 6742 |
! |
6743 |
||
6744 |
checkItemForChangesWithNewSetup |
|
6745 |
self checkItemForChanges. |
|
4969 | 6746 |
self setupCheckModify. |
6747 |
! |
|
6748 |
||
4977
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
6749 |
releaseCheckModify |
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6750 |
checkModifiedBlock notNil ifTrue:[ |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6751 |
Processor removeTimedBlock:checkModifiedBlock. |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6752 |
]. |
4977
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
6753 |
! |
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
6754 |
|
4969 | 6755 |
setupCheckModify |
6756 |
||
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6757 |
checkModifiedBlock isNil ifTrue:[ |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6758 |
checkModifiedBlock := [ |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6759 |
self |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6760 |
enqueueMessage:#checkItemForChangesWithNewSetup |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6761 |
for:self |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6762 |
arguments:#(). |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6763 |
]. |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6764 |
]. |
5461 | 6765 |
Processor addTimedBlock:checkModifiedBlock afterSeconds:(self class checkModifiedDelayTime). |
3892 | 6766 |
! ! |
6767 |
||
6768 |
!FileApplicationNoteBook::TextEditor methodsFor:'queries'! |
|
6769 |
||
7467 | 6770 |
additionalInfo |
6771 |
^ '[',editView numberOfLines printString , ' lines]'. |
|
6772 |
||
6773 |
"Created: / 24-10-2006 / 12:27:07 / cg" |
|
6774 |
! |
|
6775 |
||
4071 | 6776 |
hasMD5 |
6777 |
^ ( MD5Stream notNil and:[MD5Stream isLoaded]) |
|
6778 |
! |
|
6779 |
||
3892 | 6780 |
isModified |
5456 | 6781 |
self checkItemForChanges. |
5317 | 6782 |
^ self modifiedChannel value |
6783 |
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
|
6784 |
! |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6785 |
|
17747 | 6786 |
isShowingHexDumpHolder |
6787 |
^ BlockValue |
|
6788 |
with:[:v | v == #hexDump] |
|
6789 |
argument:(self presentationHolder) |
|
6790 |
||
6791 |
"Created: / 12-11-2017 / 12:36:27 / cg" |
|
6792 |
! |
|
6793 |
||
4146
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6794 |
isTextEditor |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6795 |
|
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6796 |
^ true |
3892 | 6797 |
! ! |
6798 |
||
6799 |
!FileApplicationNoteBook::TextEditor methodsFor:'startup & release'! |
|
6800 |
||
6801 |
closeRequest |
|
6626 | 6802 |
"asks for permission before closing" |
3892 | 6803 |
|
6804 |
(self doClose) ifTrue:[ |
|
6805 |
^ super closeRequest. |
|
6806 |
]. |
|
6807 |
! |
|
6808 |
||
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6809 |
editorOperationsMenuSpecForMimeType:mimeType |
13715
dab7e512b771
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13406
diff
changeset
|
6810 |
mimeType isHtmlType ifTrue:[ |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6811 |
^ self class menuEditorOperationsForHTML. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6812 |
]. |
13715
dab7e512b771
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13406
diff
changeset
|
6813 |
mimeType isSmalltalkSourceType ifTrue:[ |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6814 |
^ self class menuEditorOperationsForSourceCode. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6815 |
]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6816 |
mimeType isTextType ifTrue:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6817 |
^ self class menuEditorOperationsForNormalText. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6818 |
]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6819 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6820 |
^ self class menuEditorOperationsForOther. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6821 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6822 |
"Created: / 02-08-2013 / 18:00:39 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6823 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6824 |
|
10754 | 6825 |
getEditorClass |
6826 |
UserPreferences current useCodeView2InTools ifTrue:[ |
|
6827 |
^ Tools::CodeView2 ? CodeView |
|
6828 |
]. |
|
6829 |
^ CodeView |
|
6830 |
||
6831 |
"Created: / 06-10-2011 / 11:21:43 / cg" |
|
6832 |
! |
|
6833 |
||
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6834 |
hideEditorOperationsToolBarButtonCreated:aButton |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6835 |
aButton passiveLevel:(MenuPanel defaultLevel). |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6836 |
aButton activeLevel:-1. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6837 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6838 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6839 |
"Created: / 02-08-2013 / 16:01:49 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6840 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6841 |
|
3892 | 6842 |
postBuildTextEditor:aWidget |
10754 | 6843 |
editView := aWidget scrolledView. |
14916
794fcf3b42ec
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14907
diff
changeset
|
6844 |
|
794fcf3b42ec
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14907
diff
changeset
|
6845 |
"/ I don't want any non-smalltalk code to be syntaxhighlighted!! |
794fcf3b42ec
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14907
diff
changeset
|
6846 |
(editView askFor: #isCodeView2) ifTrue:[ |
10754 | 6847 |
editView languageHolder value:nil. |
6848 |
editView services:#(). |
|
6849 |
]. |
|
5430 | 6850 |
editView saveAction:[ self doSaveAs ]. |
9946 | 6851 |
editView cursorLineHolder addDependent:self. |
5430 | 6852 |
|
5417 | 6853 |
aWidget modifiedChannel:self viewModifiedChannel. |
5528 | 6854 |
|
6855 |
editView externalEncoding:self fileEncoding. |
|
16861 | 6856 |
"/ editView characterEncoding:'unicode'. - that's the default anyway |
9946 | 6857 |
|
10754 | 6858 |
"Modified: / 06-10-2011 / 11:43:40 / cg" |
10955 | 6859 |
"Modified (comment): / 03-12-2011 / 10:27:47 / cg" |
3892 | 6860 |
! |
6861 |
||
6862 |
postOpenWith:aBuilder |
|
6863 |
||
5120 | 6864 |
"/ self item isNil ifTrue:[ |
6865 |
"/ self item:(DirectoryContentsBrowser itemClass fileName:(Filename homeDirectory construct:'.bashrc')). |
|
6866 |
"/ ]. |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6867 |
(self componentAt:#EditorOperationsToolBar) menuHolder:self editorOperationsMenuSpecHolder. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6868 |
|
3892 | 6869 |
self setUpTextView. |
6870 |
self changeInformation. |
|
9949
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6871 |
self tagsBrowserVisibilityChanged. |
6626 | 6872 |
super postOpenWith:aBuilder |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6873 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6874 |
"Modified: / 02-08-2013 / 17:57:50 / cg" |
3892 | 6875 |
! |
6876 |
||
6877 |
release |
|
6878 |
"release my resources |
|
6879 |
" |
|
4977
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
6880 |
self releaseCheckModify. |
4969 | 6881 |
checkModifiedBlock := nil. |
3892 | 6882 |
super release. |
6883 |
! |
|
6884 |
||
6885 |
setUpTextView |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6886 |
"care for any contents specific settings for the editor |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6887 |
For example: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6888 |
- change the parenthesis-spec of the editor to include $< .. $> if the |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6889 |
shown document is an html- or xml document, |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6890 |
- change the editorOperationsMenu |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6891 |
" |
4945 | 6892 |
|
12089
4690e72f5af3
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12079
diff
changeset
|
6893 |
|item mimeType suffix parenthesis commentStrings parentesisSpec col| |
4945 | 6894 |
|
5550 | 6895 |
editView notNil ifTrue:[ |
6896 |
item := self item. |
|
6897 |
item notNil ifTrue:[ |
|
6898 |
item hasMimeType ifTrue:[ |
|
6899 |
mimeType := item mimeType. |
|
12089
4690e72f5af3
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12079
diff
changeset
|
6900 |
suffix := self fileName asFilename suffix. |
5550 | 6901 |
|
13715
dab7e512b771
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13406
diff
changeset
|
6902 |
(mimeType isHtmlType or:[mimeType isXmlType]) ifTrue:[ |
5550 | 6903 |
parenthesis := editView parenthesisSpecification copy. |
6904 |
((parenthesis at:#open) includes:$<) ifFalse:[ |
|
6905 |
col := ((parenthesis at:#open) asOrderedCollection). |
|
6906 |
col add:$<. |
|
6907 |
parenthesis at:#open put:col. |
|
6908 |
||
6909 |
col := ((parenthesis at:#close) asOrderedCollection). |
|
6910 |
col add:$>. |
|
6911 |
parenthesis at:#close put:col. |
|
6912 |
||
6913 |
editView parenthesisSpecification:parenthesis |
|
6914 |
]. |
|
5548 | 6915 |
]. |
5574
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
6916 |
|
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
6917 |
commentStrings := MIMETypes |
6477 | 6918 |
commentStringsForMimeType:mimeType |
12089
4690e72f5af3
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12079
diff
changeset
|
6919 |
suffix:suffix |
5574
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
6920 |
ifUnknown:[ |
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
6921 |
"/ st: |
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
6922 |
#('"/' ('"' '"')) |
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
6923 |
]. |
6477 | 6924 |
|
5574
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
6925 |
commentStrings notNil ifTrue:[ |
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
6926 |
editView perform:#commentStrings: with:commentStrings ifNotUnderstood:nil |
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
6927 |
]. |
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
6928 |
|
7787 | 6929 |
parentesisSpec := MIMETypes |
8176
64c5b7c41f3d
fix spelling of MIMETypes>>#parenthesis* methods
Stefan Vogel <sv@exept.de>
parents:
8087
diff
changeset
|
6930 |
parenthesisSpecForMimeType:mimeType |
12089
4690e72f5af3
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12079
diff
changeset
|
6931 |
suffix:suffix |
7787 | 6932 |
ifUnknown:[ |
6933 |
|spec| |
|
6934 |
spec := IdentityDictionary new. |
|
16637 | 6935 |
spec at:#open put:'([{' "#( $( $[ ${)" . |
6936 |
spec at:#close put:')]}' "#( $) $] $})". |
|
7787 | 6937 |
spec |
6938 |
]. |
|
6939 |
||
6940 |
parentesisSpec notNil ifTrue:[ |
|
6941 |
editView perform:#parenthesisSpecification: with:parentesisSpec ifNotUnderstood:nil |
|
6942 |
]. |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6943 |
self setupEditorOperationsMenuForMimeType:mimeType. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6944 |
] ifFalse:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6945 |
self setupEditorOperationsMenuForMimeType:(MIMETypes mimeTypeFromString:'text/plain'). |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6946 |
] |
3892 | 6947 |
]. |
5550 | 6948 |
editView externalEncoding:self fileEncoding. |
6949 |
] |
|
7787 | 6950 |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6951 |
"Modified: / 02-08-2013 / 16:34:34 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6952 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6953 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6954 |
setupEditorOperationsMenuForMimeType:mimeType |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6955 |
|spec| |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6956 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6957 |
spec := self editorOperationsMenuSpecForMimeType:mimeType. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6958 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6959 |
"/ does not work - why? |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6960 |
"/ self editorOperationsMenuSpecHolder value:spec. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6961 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6962 |
(self componentAt:#EditorOperationsToolBarMenu) menu:spec. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6963 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6964 |
"Created: / 02-08-2013 / 16:35:21 / cg" |
3892 | 6965 |
! ! |
6966 |
||
9785 | 6967 |
!FileApplicationNoteBook::XMLViewApplication class methodsFor:'defaults'! |
6968 |
||
6969 |
tabStringFor:aApplicationType |
|
6970 |
"the formatString shown in a tab (language translated)" |
|
6971 |
||
6972 |
^ 'XML View for %1' |
|
6973 |
||
6974 |
"Modified: / 17-02-2011 / 13:28:22 / cg" |
|
6975 |
! ! |
|
6976 |
||
6977 |
!FileApplicationNoteBook::XMLViewApplication class methodsFor:'help specs'! |
|
6978 |
||
6979 |
helpSpec |
|
6980 |
"This resource specification was automatically generated |
|
6981 |
by the UIHelpTool of ST/X." |
|
6982 |
||
6983 |
"Do not manually edit this!! If it is corrupted, |
|
6984 |
the UIHelpTool may not be able to read the specification." |
|
6985 |
||
6986 |
" |
|
6987 |
UIHelpTool openOnClass:FileApplicationNoteBook::HtmlViewApplication |
|
6988 |
" |
|
6989 |
||
6990 |
<resource: #help> |
|
6991 |
||
6992 |
^ super helpSpec addPairsFrom:#( |
|
6993 |
||
6994 |
||
6995 |
) |
|
6996 |
||
6997 |
"Modified: / 17-02-2011 / 13:28:28 / cg" |
|
6998 |
! ! |
|
6999 |
||
7000 |
!FileApplicationNoteBook::XMLViewApplication class methodsFor:'interface specs'! |
|
7001 |
||
7002 |
windowSpec |
|
7003 |
"This resource specification was automatically generated |
|
7004 |
by the UIPainter of ST/X." |
|
7005 |
||
7006 |
"Do not manually edit this!! If it is corrupted, |
|
7007 |
the UIPainter may not be able to read the specification." |
|
7008 |
||
7009 |
" |
|
7010 |
UIPainter new openOnClass:FileApplicationNoteBook::XMLViewApplication andSelector:#windowSpec |
|
7011 |
FileApplicationNoteBook::XMLViewApplication new openInterface:#windowSpec |
|
7012 |
FileApplicationNoteBook::XMLViewApplication open |
|
7013 |
" |
|
7014 |
||
7015 |
<resource: #canvas> |
|
7016 |
||
7017 |
^ |
|
7018 |
#(FullSpec |
|
7019 |
name: windowSpec |
|
7020 |
window: |
|
7021 |
(WindowSpec |
|
7022 |
label: 'NoteBookApplication::HtmlView' |
|
7023 |
name: 'NoteBookApplication::HtmlView' |
|
7024 |
min: (Point 10 10) |
|
7025 |
bounds: (Rectangle 0 0 676 492) |
|
7026 |
menu: mainMenu |
|
7027 |
) |
|
7028 |
component: |
|
7029 |
(SpecCollection |
|
7030 |
collection: ( |
|
7031 |
(MenuPanelSpec |
|
7032 |
name: 'MenuXml' |
|
7033 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
7034 |
level: 0 |
|
7035 |
visibilityChannel: isEmbeddedApplication |
|
7036 |
menu: menu |
|
7037 |
textDefault: true |
|
7038 |
) |
|
7039 |
(SubCanvasSpec |
|
7040 |
name: 'XMLCanvas' |
|
7041 |
layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 0 1) |
|
7042 |
level: 0 |
|
7043 |
hasHorizontalScrollBar: false |
|
7044 |
hasVerticalScrollBar: false |
|
7045 |
majorKey: #'XML::XMLInspector' |
|
7046 |
createNewApplication: true |
|
7047 |
createNewBuilder: false |
|
7048 |
postBuildCallback: postBuildXMLCanvas: |
|
7049 |
) |
|
7050 |
) |
|
7051 |
||
7052 |
) |
|
7053 |
) |
|
7054 |
! ! |
|
7055 |
||
7056 |
!FileApplicationNoteBook::XMLViewApplication class methodsFor:'menu specs'! |
|
7057 |
||
7058 |
menu |
|
7059 |
"This resource specification was automatically generated |
|
7060 |
by the MenuEditor of ST/X." |
|
7061 |
||
7062 |
"Do not manually edit this!! If it is corrupted, |
|
7063 |
the MenuEditor may not be able to read the specification." |
|
7064 |
||
7065 |
" |
|
7066 |
MenuEditor new openOnClass:FileApplicationNoteBook::XMLViewApplication andSelector:#menu |
|
7067 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::XMLViewApplication menu)) startUp |
|
7068 |
" |
|
7069 |
||
7070 |
<resource: #menu> |
|
7071 |
||
7072 |
^ |
|
7073 |
#(Menu |
|
7074 |
( |
|
7075 |
(MenuItem |
|
9786
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7076 |
activeHelpKey: reloadFile |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7077 |
isVisible: reloadButtonVisible |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7078 |
enabled: enableReload |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7079 |
label: 'Reload' |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7080 |
itemValue: reload |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7081 |
nameKey: Reload |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7082 |
translateLabel: true |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7083 |
isButton: true |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7084 |
labelImage: (ResourceRetriever ToolbarIconLibrary reloadTextFromFileIcon) |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7085 |
) |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7086 |
(MenuItem |
9785 | 7087 |
activeHelpKey: closeTabButton |
7088 |
label: 'Close' |
|
7089 |
itemValue: doClose |
|
7090 |
translateLabel: true |
|
7091 |
isButton: true |
|
7092 |
startGroup: right |
|
7093 |
hideMenuOnActivated: false |
|
7094 |
labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon) |
|
7095 |
) |
|
7096 |
) |
|
7097 |
nil |
|
7098 |
nil |
|
7099 |
) |
|
9786
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7100 |
|
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7101 |
"Modified: / 17-02-2011 / 17:30:26 / cg" |
9785 | 7102 |
! ! |
7103 |
||
7104 |
!FileApplicationNoteBook::XMLViewApplication class methodsFor:'queries'! |
|
7105 |
||
7106 |
canOpenItem:anItem |
|
15935 | 7107 |
|mime| |
7108 |
||
12121
57a6e8face3b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12115
diff
changeset
|
7109 |
(Smalltalk at:#'XML::XMLInspector') isNil ifTrue:[^ false]. |
15935 | 7110 |
((mime := anItem mimeType) isNil or:[ mime == #unknown]) ifTrue:[^ false]. |
7111 |
||
7112 |
^ mime isXmlType |
|
9785 | 7113 |
|
7114 |
"Modified: / 17-02-2011 / 13:34:08 / cg" |
|
7115 |
! |
|
7116 |
||
7117 |
wantNewApplicationAnyway |
|
7118 |
||
7119 |
^ false |
|
7120 |
! ! |
|
7121 |
||
7122 |
!FileApplicationNoteBook::XMLViewApplication methodsFor:'accessing'! |
|
7123 |
||
7124 |
item:anItem |
|
7125 |
|retVal| |
|
7126 |
||
7127 |
self labelHolder value:anItem fileName asString. |
|
7128 |
retVal := super item:anItem. |
|
7129 |
xmlTreeApp notNil ifTrue:[ |
|
7130 |
self updateXMLTree |
|
7131 |
]. |
|
7132 |
^ retVal |
|
7133 |
||
7134 |
"Modified: / 17-02-2011 / 13:38:53 / cg" |
|
7135 |
! |
|
7136 |
||
7137 |
updateXMLTree |
|
7138 |
|inStream dom| |
|
7139 |
||
7140 |
self withWaitCursorDo:[ |
|
9786
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7141 |
XML::XMLSignal handle:[:ex | |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7142 |
Dialog |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7143 |
information: |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7144 |
(resources |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7145 |
stringWithCRs:'Error reported by XML-Parser in line %1:\\%2\\Showing as regular text.' |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7146 |
with:inStream lineNumber |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7147 |
with:ex description). |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7148 |
Error raise. |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7149 |
] do:[ |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7150 |
inStream := LineNumberReadStream on:(self fileName readStream). |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7151 |
[ |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7152 |
dom := XML::XMLParser |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7153 |
processDocumentStream:inStream |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7154 |
beforeScanDo:[:parser | parser validate:false. ]. |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7155 |
xmlTreeApp model:dom. |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7156 |
] ensure:[ |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7157 |
inStream close |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7158 |
] |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7159 |
]. |
9785 | 7160 |
]. |
7161 |
||
7162 |
"Created: / 17-02-2011 / 13:39:07 / cg" |
|
9786
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7163 |
"Modified: / 17-02-2011 / 17:39:15 / cg" |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7164 |
! ! |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7165 |
|
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7166 |
!FileApplicationNoteBook::XMLViewApplication methodsFor:'actions'! |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7167 |
|
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7168 |
reload |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7169 |
self updateXMLTree. |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7170 |
|
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7171 |
"Created: / 17-02-2011 / 17:46:36 / cg" |
9785 | 7172 |
! ! |
7173 |
||
7174 |
!FileApplicationNoteBook::XMLViewApplication methodsFor:'aspects'! |
|
7175 |
||
7176 |
labelHolder |
|
7177 |
||
7178 |
labelHolder isNil ifTrue:[ |
|
7179 |
labelHolder := '' asValue. |
|
7180 |
]. |
|
7181 |
^ labelHolder. |
|
7182 |
! ! |
|
7183 |
||
7184 |
!FileApplicationNoteBook::XMLViewApplication methodsFor:'initialization & release'! |
|
7185 |
||
7186 |
postBuildXMLCanvas:aWidget |
|
7187 |
xmlTreeApp := aWidget client. |
|
7188 |
item notNil ifTrue:[self updateXMLTree]. |
|
7189 |
||
7190 |
"Modified: / 17-02-2011 / 13:39:18 / cg" |
|
7191 |
! ! |
|
7192 |
||
3892 | 7193 |
!FileApplicationNoteBook::XViewApplication class methodsFor:'defaults'! |
7194 |
||
7195 |
maxNumberOfVNCRestarts |
|
7196 |
||
7197 |
^ 10 |
|
7198 |
! |
|
7199 |
||
7200 |
mimeTypeUnixApplicationMapping |
|
7201 |
||
7202 |
" here insert the application and mime type pairs to open by XviewApplication |
|
7203 |
" |
|
7204 |
||
7205 |
^ |
|
7206 |
#( |
|
14496
4c671a13ba46
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14462
diff
changeset
|
7207 |
#(#'application/postscript' 'gv %1' ) |
4c671a13ba46
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14462
diff
changeset
|
7208 |
#(#'application/pdf' 'acroread %1' ) |
3892 | 7209 |
) |
7210 |
! |
|
7211 |
||
7212 |
tabStringFor:aApplicationType |
|
7687 | 7213 |
"the formatString shown in a tab (language translated)" |
7214 |
||
7215 |
^ 'VNC for %1' |
|
7216 |
||
7217 |
"Modified: / 01-03-2007 / 21:43:43 / cg" |
|
3892 | 7218 |
! |
7219 |
||
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
7220 |
unixVNCCommand |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
7221 |
|
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
7222 |
^ 'Xvnc' |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
7223 |
! |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
7224 |
|
3892 | 7225 |
wantNewApplicationAnyway |
7226 |
||
4500
9f0b8d6ae2be
make a new XView for a new item if an XView already open
penk
parents:
4499
diff
changeset
|
7227 |
^ true |
3892 | 7228 |
! ! |
7229 |
||
7230 |
!FileApplicationNoteBook::XViewApplication class methodsFor:'interface specs'! |
|
7231 |
||
7232 |
windowSpec |
|
7233 |
"This resource specification was automatically generated |
|
7234 |
by the UIPainter of ST/X." |
|
7235 |
||
7236 |
"Do not manually edit this!! If it is corrupted, |
|
7237 |
the UIPainter may not be able to read the specification." |
|
7238 |
||
7239 |
" |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
7240 |
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
|
7241 |
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
|
7242 |
FileApplicationNoteBook::XViewApplication open |
3892 | 7243 |
" |
7244 |
||
7245 |
<resource: #canvas> |
|
7246 |
||
7247 |
^ |
|
7248 |
#(#FullSpec |
|
7249 |
#name: #windowSpec |
|
7250 |
#window: |
|
7251 |
#(#WindowSpec |
|
7252 |
#label: 'XView' |
|
7253 |
#name: 'XView' |
|
7254 |
#min: #(#Point 10 10) |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
7255 |
#bounds: #(#Rectangle 16 42 692 534) |
3892 | 7256 |
#menu: #mainMenu |
7257 |
) |
|
7258 |
#component: |
|
7259 |
#(#SpecCollection |
|
7260 |
#collection: #( |
|
7261 |
#(#MenuPanelSpec |
|
4261 | 7262 |
#name: 'MenuVNC' |
3892 | 7263 |
#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
|
7264 |
#level: 0 |
3892 | 7265 |
#visibilityChannel: #isEmbeddedApplication |
7266 |
#menu: #menu |
|
7267 |
#textDefault: true |
|
7268 |
) |
|
7269 |
#(#ArbitraryComponentSpec |
|
4261 | 7270 |
#name: 'VNCView' |
3892 | 7271 |
#layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0) |
7272 |
#hasHorizontalScrollBar: true |
|
7273 |
#hasVerticalScrollBar: true |
|
7274 |
#miniScrollerHorizontal: false |
|
7275 |
#miniScrollerVertical: false |
|
7276 |
#hasBorder: false |
|
7277 |
#component: #VNCFrameBufferView |
|
7278 |
#postBuildCallback: #postBuildXView: |
|
7279 |
) |
|
7280 |
) |
|
7281 |
||
7282 |
) |
|
7283 |
) |
|
7284 |
! ! |
|
7285 |
||
7286 |
!FileApplicationNoteBook::XViewApplication class methodsFor:'menu specs'! |
|
7287 |
||
7288 |
menu |
|
7289 |
"This resource specification was automatically generated |
|
7290 |
by the MenuEditor of ST/X." |
|
7291 |
||
7292 |
"Do not manually edit this!! If it is corrupted, |
|
7293 |
the MenuEditor may not be able to read the specification." |
|
7294 |
||
7295 |
" |
|
7296 |
MenuEditor new openOnClass:NoteBookApplication::ImageViewApplication andSelector:#menu |
|
7297 |
(Menu new fromLiteralArrayEncoding:(NoteBookApplication::ImageViewApplication menu)) startUp |
|
7298 |
" |
|
7299 |
||
7300 |
<resource: #menu> |
|
7301 |
||
7302 |
^ |
|
7303 |
#(#Menu |
|
7304 |
#( |
|
7305 |
#(#MenuItem |
|
6100 | 7306 |
#activeHelpKey: #closeTabButton |
3892 | 7307 |
#label: 'Close' |
7308 |
#translateLabel: true |
|
7309 |
#isButton: true |
|
7310 |
#hideMenuOnActivated: false |
|
7311 |
#startGroup: #right |
|
7312 |
#value: #doClose |
|
6093 | 7313 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #removeTabIcon) |
3892 | 7314 |
) |
7315 |
) |
|
7316 |
nil |
|
7317 |
nil |
|
7318 |
) |
|
7319 |
! ! |
|
7320 |
||
7321 |
!FileApplicationNoteBook::XViewApplication class methodsFor:'queries'! |
|
7322 |
||
5008 | 7323 |
canOpenItem:anItem |
5265 | 7324 |
| keySym| |
3892 | 7325 |
|
5008 | 7326 |
keySym := anItem mimeType asSymbol. |
7327 |
OperatingSystem isUNIXlike ifFalse:[^ false]. |
|
7328 |
||
5265 | 7329 |
(self mimeTypeUnixApplicationMapping contains:[ : el | (el at:1) == keySym ]) ifFalse:[^ false]. |
5008 | 7330 |
|
7331 |
(OperatingSystem executeCommand:('which ', self unixVNCCommand)) ifFalse:[ |
|
14496
4c671a13ba46
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14462
diff
changeset
|
7332 |
"/ Dialog warn:'Cannot start a viewer for ' , anItem fileName baseName. |
5008 | 7333 |
^ false. |
3892 | 7334 |
]. |
5008 | 7335 |
|
7336 |
VNCFrameBufferView notNil ifFalse:[ |
|
7337 |
Dialog warn:'VNC support classes are missing (package not loaded?)'. |
|
7338 |
^ false. |
|
7339 |
]. |
|
7340 |
^ true |
|
3892 | 7341 |
! ! |
7342 |
||
7343 |
!FileApplicationNoteBook::XViewApplication methodsFor:'accessing'! |
|
7344 |
||
7345 |
xView |
|
7346 |
"return the value of the instance variable 'imageView' (automatically generated)" |
|
7347 |
||
7348 |
^ xView |
|
7349 |
! |
|
7350 |
||
7351 |
xView:something |
|
7352 |
"set the value of the instance variable 'imageView' (automatically generated)" |
|
7353 |
||
7354 |
xView := something. |
|
7355 |
! ! |
|
7356 |
||
7357 |
!FileApplicationNoteBook::XViewApplication methodsFor:'actions'! |
|
7358 |
||
7359 |
changeInformation |
|
15594
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
7360 |
|stream| |
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
7361 |
|
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
7362 |
stream := CharacterWriteStream with:'XView on: '. |
3892 | 7363 |
stream nextPutAll:self fileName baseName. |
7364 |
masterApplication isNil ifTrue:[ |
|
7365 |
self window label:stream contents. |
|
7366 |
] ifFalse:[ |
|
7367 |
masterApplication tabStringChangeTo:stream contents for:self. |
|
7368 |
]. |
|
7369 |
! |
|
7370 |
||
7371 |
setupXView |
|
7372 |
||
3906 | 7373 |
|xExt yExt mainView| |
3892 | 7374 |
|
7375 |
self startVNCserver. |
|
7376 |
xExt := self xView width asString. |
|
3906 | 7377 |
self masterApplication notNil ifTrue:[ |
7378 |
mainView := self builder windowGroup mainView. |
|
17633 | 7379 |
"/ if the mainView is a FileBrowser, take the y extent because size of notebook can be changed |
7380 |
(mainView application class == (Smalltalk at:#FileBrowserV2 ifAbsent:nil)) ifTrue:[ |
|
3906 | 7381 |
yExt := mainView height asString. |
7382 |
]. |
|
7383 |
]. |
|
7384 |
yExt isNil ifTrue:[ |
|
3892 | 7385 |
yExt := self xView height asString. |
7386 |
]. |
|
7387 |
ext := xExt, 'x', yExt. |
|
7388 |
self startViewer. |
|
17633 | 7389 |
|
7390 |
"Modified: / 25-08-2017 / 09:58:41 / cg" |
|
3892 | 7391 |
! ! |
7392 |
||
7393 |
!FileApplicationNoteBook::XViewApplication methodsFor:'actions VNC'! |
|
7394 |
||
7395 |
setupView |
|
7396 |
| renderer view| |
|
7397 |
||
7398 |
view := xView. |
|
7399 |
renderer := VNCRenderer for:vncConnection targetWindow:view device:xView device. |
|
7400 |
||
7401 |
view renderer:renderer. |
|
7402 |
view connection:vncConnection. |
|
7403 |
||
7404 |
VNCException handle:[:ex| |
|
7405 |
self stopViewer. |
|
7406 |
] do:[ |
|
7407 |
vncConnection |
|
7408 |
startMessageHandlerProcessForRenderer:renderer |
|
7409 |
errorHandler:[:ex | self stopViewer]. |
|
7410 |
]. |
|
7411 |
! |
|
7412 |
||
7413 |
startVNCserver |
|
7414 |
|cmd blocked connected numberOfVncStarts| |
|
7415 |
||
5008 | 7416 |
|
7417 |
VNCAuthenticationFailure isNil ifTrue:[ |
|
7418 |
Dialog warn:'VNC Classes missing (package not laoded ?)'. |
|
7419 |
^ self. |
|
7420 |
]. |
|
7421 |
||
3892 | 7422 |
connected := false. |
7423 |
numberOfVncStarts isNil ifTrue:[ |
|
7424 |
numberOfVncStarts := 1. |
|
7425 |
] ifFalse:[ |
|
7426 |
numberOfVncStarts := numberOfVncStarts + 1. |
|
7427 |
]. |
|
7428 |
||
7429 |
vncLock isNil ifTrue:[vncLock := Semaphore forMutualExclusion]. |
|
7430 |
||
7431 |
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
|
7432 |
cmd := ('/usr/X11R6/bin/', self class unixVNCCommand). |
3892 | 7433 |
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
|
7434 |
cmd := self class unixVNCCommand. |
3892 | 7435 |
]. |
7436 |
vncPortNr isNil ifTrue:[ |
|
7437 |
vncPortNr := 29 |
|
7438 |
]. |
|
7439 |
cmd := cmd , ' :' , vncPortNr printString , ' nologo -nevershared -localhost -depth 16 -geometry 1024x1024'. |
|
7440 |
||
7441 |
blocked := OperatingSystem blockInterrupts. |
|
7442 |
||
7443 |
vncServerPID := Processor |
|
7444 |
monitor:[ |
|
7445 |
vncServerIsTerminated := false. |
|
7446 |
OperatingSystem |
|
7447 |
exec:'/bin/sh' |
|
7448 |
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
|
7449 |
environment:nil |
3892 | 7450 |
fileDescriptors:#() |
7451 |
fork:true |
|
7452 |
newPgrp:true |
|
16823 | 7453 |
inDirectory:nil |
7454 |
showWindow:false. |
|
3892 | 7455 |
] |
7456 |
action:[:status | |
|
7457 |
status stillAlive ifFalse:[ |
|
7458 |
OperatingSystem closePid:vncServerPID. |
|
7459 |
vncLock critical:[ |
|
7460 |
vncServerPID := nil. |
|
7461 |
self vncServerTerminated. |
|
7462 |
]. |
|
7463 |
]. |
|
7464 |
]. |
|
7465 |
||
7466 |
blocked ifFalse:[ |
|
7467 |
OperatingSystem unblockInterrupts |
|
7468 |
]. |
|
7469 |
]. |
|
7470 |
||
7471 |
self waitForTerminationOfServer ifTrue:[ |
|
7472 |
"/ Transcript showCR:'server has terminated really - try with next port'. |
|
7473 |
(numberOfVncStarts < self class maxNumberOfVNCRestarts) ifTrue:[ |
|
7474 |
vncPortNr := vncPortNr + 1. |
|
7475 |
"/ Transcript showCR:'try next port ', vncPortNr asString. |
|
7476 |
self startVNCserver. |
|
7477 |
] ifFalse:[ |
|
7478 |
Dialog warn:'have started servers from port ' |
|
7479 |
, (vncPortNr - self class maxNumberOfVNCRestarts) asString |
|
7480 |
, ' to ' |
|
7481 |
, vncPortNr |
|
7482 |
, ' - cant connect anyway'. |
|
7483 |
"/ Transcript showCR:'have started servers from port ', vncPortNr - self class maxNumberOfVNCRestarts, ' to ', vncPortNr. |
|
7484 |
]. |
|
7485 |
] ifFalse:[ |
|
7486 |
vncLock critical:[ |
|
7487 |
vncServerPID isNil ifTrue:[ |
|
7488 |
Dialog warn:'Cannot start Xvnc'. |
|
7489 |
] ifFalse:[ |
|
7490 |
VNCAuthenticationFailure handle:[:ex | |
|
7491 |
Dialog warn:'Wrong password'. |
|
7492 |
] do:[ |
|
7493 |
connected := self vncConnect. |
|
7494 |
]. |
|
7495 |
connected ifTrue:[self setupView]. |
|
7496 |
]. |
|
7497 |
]. |
|
7498 |
]. |
|
7499 |
! |
|
7500 |
||
7501 |
stopVNCServer |
|
5259 | 7502 |
|pid| |
7503 |
||
7504 |
(pid := vncServerPID) notNil ifTrue:[ |
|
7505 |
OperatingSystem terminateProcess:pid. |
|
3892 | 7506 |
Delay waitForSeconds:0.2. |
7507 |
vncServerPID notNil ifTrue:[ |
|
5259 | 7508 |
OperatingSystem killProcess:pid. |
3892 | 7509 |
vncServerPID := nil. |
7510 |
]. |
|
5259 | 7511 |
OperatingSystem closePid:pid |
3892 | 7512 |
]. |
7513 |
self vncServerTerminated. |
|
7514 |
! |
|
7515 |
||
7516 |
vncConnect |
|
7517 |
| tryConnects| |
|
7518 |
||
7519 |
vncConnection notNil ifTrue:[ |
|
7520 |
vncConnection close |
|
7521 |
]. |
|
7522 |
||
7523 |
vncConnection := VNCServerConnection new. |
|
7524 |
tryConnects := 1. |
|
7525 |
[tryConnects < 3] whileTrue:[ |
|
7526 |
VNCConnectionFailure handle:[:ex | |
|
7527 |
Delay waitForSeconds:0.5. |
|
7528 |
tryConnects := tryConnects + 1. |
|
7529 |
] do:[ |
|
7530 |
vncConnection connectTo:'localhost' port:vncPortNr. |
|
7531 |
^ true. |
|
7532 |
]. |
|
7533 |
]. |
|
7534 |
^ false |
|
7535 |
! |
|
7536 |
||
7537 |
vncServerTerminated |
|
7538 |
"/ Transcript showCR:'vnc server has terminated'. |
|
7539 |
"/ 'vnc server has terminated' errorPrintCR. |
|
7540 |
"/ Dialog information:'vnc server has terminated'. |
|
7541 |
||
7542 |
self stopViewer. |
|
7543 |
vncConnection notNil ifTrue:[ |
|
7544 |
vncConnection close. |
|
7545 |
vncConnection := nil |
|
7546 |
]. |
|
7547 |
vncServerIsTerminated := true. |
|
7548 |
! |
|
7549 |
||
7550 |
waitForTerminationOfServer |
|
7551 |
| cycles | |
|
7552 |
||
7553 |
cycles := 1. |
|
7554 |
[vncServerIsTerminated] whileFalse:[ |
|
7555 |
(cycles > 3) ifTrue:[^ false]. |
|
7556 |
cycles := cycles + 1. |
|
7557 |
Delay waitForSeconds:0.5. |
|
7558 |
]. |
|
7559 |
^ true |
|
7560 |
! ! |
|
7561 |
||
7562 |
!FileApplicationNoteBook::XViewApplication methodsFor:'actions viewer'! |
|
7563 |
||
7564 |
startViewer |
|
7565 |
|cmd keySym applItem | |
|
7566 |
||
7567 |
keySym := self item mimeType asSymbol. |
|
7568 |
applItem := self class mimeTypeUnixApplicationMapping detect:[ : el | (el at:1) == keySym ] ifNone:[nil]. |
|
7569 |
applItem isNil ifTrue:[ ^ self]. |
|
7570 |
||
7571 |
cmd := (applItem at:2) asString, ' -geometry ', ext, ' -display :' , vncPortNr printString , ' ' , self fileName asString. |
|
7572 |
self startViewer:cmd |
|
7573 |
! |
|
7574 |
||
7575 |
startViewer:viewerCommand |
|
7576 |
|blocked| |
|
7577 |
||
7578 |
viewerPID notNil ifTrue:[ |
|
7579 |
^ self |
|
7580 |
]. |
|
7581 |
||
7582 |
blocked := OperatingSystem blockInterrupts. |
|
7583 |
||
7584 |
viewerPID := Processor |
|
7585 |
monitor:[ |
|
7586 |
OperatingSystem |
|
7587 |
exec:'/bin/sh' |
|
7588 |
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
|
7589 |
environment:nil |
3892 | 7590 |
fileDescriptors:#() |
7591 |
fork:true |
|
7592 |
newPgrp:true |
|
16823 | 7593 |
inDirectory:nil |
7594 |
showWindow:false. |
|
3892 | 7595 |
] |
7596 |
action:[:status | |
|
7597 |
status stillAlive ifFalse:[ |
|
7598 |
OperatingSystem closePid:viewerPID. |
|
7599 |
viewerPID := nil. |
|
7600 |
self viewerTerminated. |
|
7601 |
]. |
|
7602 |
]. |
|
7603 |
||
7604 |
blocked ifFalse:[ |
|
7605 |
OperatingSystem unblockInterrupts |
|
7606 |
]. |
|
7607 |
||
7608 |
viewerPID isNil ifTrue:[ |
|
7609 |
Dialog warn:'Cannot start ', viewerCommand. |
|
7610 |
]. |
|
7611 |
! |
|
7612 |
||
7613 |
startXterm |
|
7614 |
|cmd| |
|
7615 |
||
7616 |
cmd := 'xterm -geometry 600x800 -display :' , vncPortNr printString. |
|
7617 |
self startViewer:cmd |
|
7618 |
! |
|
7619 |
||
7620 |
stopViewer |
|
5259 | 7621 |
|pid| |
7622 |
||
7623 |
(pid := viewerPID) notNil ifTrue:[ |
|
7624 |
OperatingSystem terminateProcess:pid. |
|
3892 | 7625 |
Delay waitForSeconds:0.2. |
7626 |
viewerPID notNil ifTrue:[ |
|
5259 | 7627 |
OperatingSystem killProcess:pid. |
3892 | 7628 |
viewerPID := nil. |
5259 | 7629 |
]. |
7630 |
OperatingSystem closePid:pid |
|
3892 | 7631 |
]. |
7632 |
! |
|
7633 |
||
7634 |
viewerTerminated |
|
7635 |
"/ Transcript showCR:'viewer has terminated'. |
|
7636 |
"/ 'viewer has terminated' errorPrintCR. |
|
7637 |
"/ Dialog information:'viewer has terminated'. |
|
7638 |
! ! |
|
7639 |
||
7640 |
!FileApplicationNoteBook::XViewApplication methodsFor:'initialization & release'! |
|
7641 |
||
7642 |
postBuildXView:aWidget |
|
7643 |
||
7644 |
self xView:aWidget scrolledView. |
|
7645 |
self xView wantsFocusWithPointerEnter. |
|
7646 |
aWidget autoHideScrollBars:true. |
|
7647 |
! |
|
7648 |
||
7649 |
postOpenWith:aBuilder |
|
6626 | 7650 |
"only invoked if the application not started from a master" |
3892 | 7651 |
|
7652 |
|currentDir contents suffix fileName| |
|
7653 |
||
7654 |
self masterApplication isNil ifTrue:[ |
|
7655 |
self masterApplication:nil. |
|
7656 |
currentDir := Filename homeDirectory. |
|
7657 |
contents := currentDir directoryContents. |
|
7658 |
fileName := contents |
|
7659 |
detect:[:file | |
|
7660 |
suffix := file asFilename suffix asLowercase. |
|
7661 |
suffix = 'pdf' |
|
7662 |
] |
|
7663 |
ifNone:[nil]. |
|
7664 |
fileName isNil ifTrue:[ |
|
7665 |
Dialog warn:'cant find a PDF File in ' , currentDir asString. |
|
7666 |
^ self |
|
7667 |
]. |
|
3982 | 7668 |
self item:(DirectoryContentsBrowser itemClass fileName:(currentDir construct:fileName)). |
3892 | 7669 |
]. |
7670 |
self changeInformation. |
|
7671 |
self setupXView. |
|
6626 | 7672 |
super postOpenWith:aBuilder |
3892 | 7673 |
! |
7674 |
||
7675 |
release |
|
7676 |
"/Transcript showCR:'release'. |
|
7677 |
self stopViewer. |
|
7678 |
self stopVNCServer. |
|
14065
a6da1191dfc5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13905
diff
changeset
|
7679 |
super release |
3892 | 7680 |
! ! |
7681 |
||
7682 |
!FileApplicationNoteBook class methodsFor:'documentation'! |
|
7683 |
||
10761 | 7684 |
version |
15815
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
7685 |
^ '$Header$' |
10761 | 7686 |
! |
7687 |
||
8912 | 7688 |
version_CVS |
15815
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
7689 |
^ '$Header$' |
3892 | 7690 |
! ! |
12115 | 7691 |