author | Claus Gittinger <cg@exept.de> |
Fri, 20 Sep 2019 15:38:51 +0200 | |
changeset 19204 | 20d563ca2e45 |
parent 19153 | 0453ca2c3424 |
child 19205 | 8f2aa142fc66 |
permissions | -rw-r--r-- |
18717 | 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 |
|
18236 | 31 |
terminateByMe columnDescriptors inDropMode selectionIndexHolder' |
32 |
classVariableNames:'LastSearchedInName' |
|
9951 | 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 |
|
18670 | 90 |
radixInDump presentationHolder doMD5ModificationCheck' |
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 |
19028 | 476 |
(Dialog confirm:(resources string:'Really close all Tabs ?')) ifTrue:[ |
477 |
"/ must enumerate a copy here |
|
478 |
self listOfApplications copy do:[:eachApp | eachApp doClose.]. |
|
479 |
]. |
|
5307 | 480 |
! |
481 |
||
6214 | 482 |
doCloseAllOtherApplications |
19028 | 483 |
| currentApp | |
484 |
||
485 |
"/ (Dialog confirm:(resources string:'Really close all other Tabs ?')) ifFalse:[^ self]. |
|
6214 | 486 |
|
487 |
currentApp := self currentTabMenusApplication. |
|
19028 | 488 |
"/ must enumerate a copy here |
489 |
self listOfApplications copy do:[:eachApp | |
|
490 |
eachApp ~~ currentApp ifTrue:[ |
|
491 |
eachApp doClose. |
|
492 |
]. |
|
493 |
] |
|
6214 | 494 |
! |
495 |
||
3892 | 496 |
doCloseApplication |
5324 | 497 |
self currentTabMenusApplication doClose. |
3892 | 498 |
! |
499 |
||
4572 | 500 |
doRenameTab |
501 |
| newLabel | |
|
502 |
||
5335 | 503 |
newLabel := Dialog |
504 |
request:'New Tab Label:' |
|
505 |
initialAnswer:(self privateTabList at:tabMenuIndex). |
|
4572 | 506 |
newLabel size == 0 ifTrue:[^ self ]. |
507 |
self privateTabList at:tabMenuIndex put:newLabel |
|
508 |
! |
|
509 |
||
4045 | 510 |
doSelectInList |
5323 | 511 |
| fileName| |
512 |
||
5324 | 513 |
fileName := self currentTabMenusApplication fileName. |
4045 | 514 |
fileName notNil ifTrue:[ |
515 |
self gotoFile:fileName. |
|
516 |
]. |
|
517 |
! |
|
518 |
||
5010 | 519 |
openApplByFileItem:anItem |
14517
65a293fbfe93
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14516
diff
changeset
|
520 |
"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
|
521 |
return the new app or nil, if none was embedded. |
65a293fbfe93
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14516
diff
changeset
|
522 |
Uses the default class list for open of applications by item " |
3892 | 523 |
|
5290 | 524 |
| applList applItem itemClass itemType appl| |
3892 | 525 |
|
14516
805d42ab3c16
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14498
diff
changeset
|
526 |
anItem isNil ifTrue:[ ^ nil ]. |
5279 | 527 |
anItem isDirectory ifTrue:[ |
528 |
self warn:'No Application to open for directory:', anItem fileName asString, ' found'. |
|
529 |
^ nil. |
|
530 |
]. |
|
10706
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
531 |
|
18275 | 532 |
self openAlwaysInTextEditor value == false ifTrue:[ |
10706
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
533 |
applList := self applicationList. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
534 |
applItem := applList |
14496
4c671a13ba46
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14462
diff
changeset
|
535 |
detect:[:eachApplItem| |
4c671a13ba46
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14462
diff
changeset
|
536 |
itemClass := self class classFor:eachApplItem. |
10706
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
537 |
(itemClass canOpenItem:anItem). |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
538 |
] ifNone:[nil]. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
539 |
|
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
540 |
applItem notNil ifTrue:[ |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
541 |
itemType := self class typeFor:applItem. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
542 |
itemClass := self class classFor:applItem. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
543 |
Error handle:[:ex | |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
544 |
"/ catching the error, so we can still show text |
17556 | 545 |
('[FileApplication] ignored error: ',ex description,' - showing text') errorPrintCR. |
10706
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
546 |
] do:[ |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
547 |
appl := self openApplicationClass:itemClass withItem:anItem withType:itemType. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
548 |
appl notNil ifTrue:[ ^ appl]. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
549 |
]. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
550 |
]. |
18275 | 551 |
self alwaysUseSmalltalkTools value == true ifFalse:[ |
15112
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
552 |
((anItem fileName mimeTypeOfContents ? '') startsWith:'text') ifFalse:[ |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
553 |
"/ fallback: open a system utility |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
554 |
OperatingSystem |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
555 |
openApplicationForDocument:anItem fileName |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
556 |
operation:#open |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
557 |
mimeType:nil |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
558 |
ifNone:[self openDefaultApplicationByItem:anItem]. |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
559 |
^ nil. |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
560 |
]. |
f692f1792581
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14916
diff
changeset
|
561 |
]. |
10706
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
562 |
]. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
563 |
|
9786
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
564 |
^ self openDefaultApplicationByItem:anItem. |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
565 |
|
17556 | 566 |
"Modified: / 22-06-2017 / 18:43:15 / cg" |
18275 | 567 |
"Modified: / 19-07-2018 / 15:34:22 / Stefan Vogel" |
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 |
18271 | 959 |
<resource: #uiAspect> |
960 |
||
5120 | 961 |
^ self |
962 |
aspectFor:#cursorColLabelHolder |
|
963 |
ifAbsent:[ |
|
18271 | 964 |
IndirectValue for:(ValueHolder with:' ') |
5120 | 965 |
] |
18271 | 966 |
|
967 |
"Modified: / 18-07-2018 / 10:34:01 / Claus Gittinger" |
|
5120 | 968 |
! |
969 |
||
15821
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
970 |
cursorLineAndColumnLabelHolder |
18271 | 971 |
<resource: #uiAspect> |
972 |
||
15821
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
973 |
^ self |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
974 |
aspectFor:#cursorLineAndColumnLabelHolder |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
975 |
ifAbsent:[ |
18271 | 976 |
IndirectValue for:(ValueHolder with:' ') |
15821
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
977 |
] |
18271 | 978 |
|
979 |
"Modified: / 18-07-2018 / 10:34:04 / Claus Gittinger" |
|
15821
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
980 |
! |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
981 |
|
5120 | 982 |
cursorLineLabelHolder |
18271 | 983 |
<resource: #uiAspect> |
984 |
||
5120 | 985 |
^ self |
986 |
aspectFor:#cursorLineLabelHolder |
|
987 |
ifAbsent:[ |
|
18271 | 988 |
IndirectValue for:(ValueHolder with:' ') |
5120 | 989 |
] |
18271 | 990 |
|
991 |
"Modified: / 18-07-2018 / 10:34:06 / Claus Gittinger" |
|
5120 | 992 |
! |
993 |
||
5528 | 994 |
fileEncodingHolder |
995 |
^ self |
|
996 |
aspectFor:#fileEncodingHolder |
|
997 |
ifAbsent:[ |
|
18271 | 998 |
IndirectValue for:(ValueHolder with:'iso8859-1') |
5528 | 999 |
] |
18271 | 1000 |
|
1001 |
"Modified: / 18-07-2018 / 10:32:33 / Claus Gittinger" |
|
5528 | 1002 |
! |
1003 |
||
11056 | 1004 |
inputTabColumnConversionHolder |
1005 |
^ self |
|
1006 |
aspectFor:#inputTabColumnConversionHolder |
|
1007 |
ifAbsent:[ |
|
18271 | 1008 |
IndirectValue for:(ValueHolder with:8) |
11056 | 1009 |
] |
1010 |
||
1011 |
"Created: / 06-01-2012 / 15:26:32 / cg" |
|
18271 | 1012 |
"Modified: / 18-07-2018 / 10:32:28 / Claus Gittinger" |
11056 | 1013 |
! |
1014 |
||
1015 |
lineEndConventionHolder |
|
1016 |
^ self |
|
1017 |
aspectFor:#lineEndConventionHolder |
|
1018 |
ifAbsent:[ |
|
18950 | 1019 |
IndirectValue for:(ValueHolder with:#nl) |
11056 | 1020 |
] |
1021 |
||
1022 |
"Created: / 06-01-2012 / 13:03:24 / cg" |
|
18271 | 1023 |
"Modified: / 18-07-2018 / 10:32:21 / Claus Gittinger" |
18950 | 1024 |
"Modified (format): / 29-07-2019 / 10:28:52 / Stefan Vogel" |
11056 | 1025 |
! |
1026 |
||
5737 | 1027 |
lockFileEncodingHolder |
1028 |
^ self |
|
1029 |
aspectFor:#lockFileEncodingHolder |
|
1030 |
ifAbsent:[ |
|
18271 | 1031 |
IndirectValue for:(ValueHolder with:false) |
5737 | 1032 |
] |
18271 | 1033 |
|
1034 |
"Modified: / 18-07-2018 / 10:32:13 / Claus Gittinger" |
|
5737 | 1035 |
! |
1036 |
||
5120 | 1037 |
modeLabelHolder |
1038 |
^ self |
|
1039 |
aspectFor:#modeLabelHolder |
|
1040 |
ifAbsent:[ |
|
18271 | 1041 |
IndirectValue for:(ValueHolder with:' ') |
5120 | 1042 |
] |
18271 | 1043 |
|
1044 |
"Modified: / 18-07-2018 / 10:32:00 / Claus Gittinger" |
|
5120 | 1045 |
! |
1046 |
||
7103 | 1047 |
modeLabelMenu |
1048 |
|app| |
|
1049 |
||
1050 |
(app := self selectedApplication) notNil ifTrue:[ |
|
1051 |
^ app modeLabelMenu |
|
1052 |
]. |
|
1053 |
^ nil |
|
1054 |
||
1055 |
"Created: / 11-09-2006 / 12:33:27 / cg" |
|
1056 |
! |
|
1057 |
||
1058 |
modeLabelMenuHolder |
|
1059 |
^ self |
|
1060 |
aspectFor:#modeLabelMenuHolder |
|
18271 | 1061 |
ifAbsent:[ IndirectValue for:(ValueHolder new) ] |
7103 | 1062 |
|
1063 |
"Created: / 11-09-2006 / 12:28:08 / cg" |
|
18271 | 1064 |
"Modified: / 18-07-2018 / 10:31:47 / Claus Gittinger" |
7103 | 1065 |
! |
1066 |
||
3892 | 1067 |
privateTabList |
1068 |
||
1069 |
privateTabList isNil ifTrue:[ |
|
1070 |
privateTabList := List new. |
|
1071 |
privateTabList addDependent:self. |
|
1072 |
]. |
|
1073 |
^ privateTabList. |
|
1074 |
! |
|
1075 |
||
1076 |
selectedEditorPage |
|
1077 |
||
1078 |
selectedEditorPage isNil ifTrue:[ |
|
1079 |
selectedEditorPage := ValueHolder new. |
|
1080 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
1081 |
selectedEditorPage addDependent:self. |
|
1082 |
"/ selectedEditorPage onChangeSend:#selectedEditorPageChanged to:self. |
|
1083 |
]. |
|
1084 |
^ selectedEditorPage. |
|
1085 |
! |
|
1086 |
||
1087 |
tabList |
|
1088 |
||
1089 |
tabList isNil ifTrue:[ |
|
1090 |
tabList := (List new) asValue. |
|
1091 |
]. |
|
1092 |
^ tabList. |
|
1093 |
! |
|
1094 |
||
1095 |
tabList:aValue |
|
1096 |
||
1097 |
tabList := aValue. |
|
1098 |
! ! |
|
1099 |
||
1100 |
!FileApplicationNoteBook methodsFor:'change & update'! |
|
1101 |
||
5120 | 1102 |
canvasChanged |
1103 |
"invoked when the contentsView has been changed" |
|
1104 |
||
1105 |
|app| |
|
1106 |
||
7103 | 1107 |
app := self selectedApplication. |
5120 | 1108 |
|
1109 |
self cursorLineLabelHolder valueHolder: (app cursorLineLabelHolder). |
|
1110 |
self cursorColLabelHolder valueHolder: (app cursorColLabelHolder). |
|
15821
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
1111 |
self cursorLineAndColumnLabelHolder valueHolder: (app cursorLineAndColumnLabelHolder). |
5120 | 1112 |
self modeLabelHolder valueHolder: (app modeLabelHolder). |
5528 | 1113 |
self fileEncodingHolder valueHolder: (app fileEncodingHolder). |
7288 | 1114 |
|
1115 |
app lockFileEncodingHolder isBoolean ifTrue:[ |
|
8366 | 1116 |
self breakPoint:#cg |
7288 | 1117 |
] ifFalse:[ |
1118 |
self lockFileEncodingHolder valueHolder: (app lockFileEncodingHolder). |
|
1119 |
]. |
|
7103 | 1120 |
|
1121 |
"Modified: / 11-09-2006 / 12:44:07 / cg" |
|
5120 | 1122 |
! |
1123 |
||
3892 | 1124 |
update:something with:aParameter from:changedObject |
4071 | 1125 |
| appl sel| |
3892 | 1126 |
|
5120 | 1127 |
changedObject == canvasHolder ifTrue:[ |
1128 |
self canvasChanged. |
|
1129 |
^ self. |
|
1130 |
]. |
|
3892 | 1131 |
changedObject == self currentDirectories ifTrue:[ |
1132 |
self viewDirectoryDescription value ifTrue:[ |
|
1133 |
self changeDirectoryDescription. |
|
1134 |
]. |
|
1135 |
^ self. |
|
1136 |
]. |
|
1137 |
changedObject == self viewDirectoryDescription ifTrue:[ |
|
4071 | 1138 |
self viewDirectoryDescriptionChanged. |
3892 | 1139 |
^ self. |
1140 |
]. |
|
1141 |
changedObject == self privateTabList ifTrue:[ |
|
1142 |
| privateListOfTabs | |
|
1143 |
privateListOfTabs := changedObject. |
|
1144 |
privateListOfTabs size > 1 ifTrue:[ |
|
1145 |
self tabList value:privateListOfTabs. |
|
1146 |
self tabList changed. |
|
1147 |
] ifFalse:[ |
|
1148 |
self tabList value:nil. |
|
1149 |
]. |
|
1150 |
^ self |
|
1151 |
]. |
|
1152 |
changedObject == self selectedEditorPage ifTrue:[ |
|
1153 |
| listOfEdits indexOfLastSel list | |
|
1154 |
||
1155 |
sel := changedObject value. |
|
17031 | 1156 |
"/ don't want the tabs with one application - that's why i have to change my tablist |
3892 | 1157 |
"/ sel goes to if - i want select the last selection |
1158 |
sel = 0 ifTrue:[ |
|
1159 |
^ self. |
|
1160 |
]. |
|
1161 |
list := self selectionHistoryList. |
|
1162 |
(list includes:sel) ifTrue:[ |
|
1163 |
list remove:sel |
|
1164 |
]. |
|
1165 |
list add:sel. |
|
1166 |
self selectionHistoryList:list. |
|
1167 |
appl := self listOfApplications at:sel. |
|
1168 |
self doSelect:appl. |
|
1169 |
]. |
|
1170 |
||
1171 |
^ super update:something with:aParameter from:changedObject |
|
4071 | 1172 |
! |
1173 |
||
1174 |
viewDirectoryDescriptionChanged |
|
1175 |
||
1176 |
||
1177 |
|viewDirDescr| |
|
1178 |
||
1179 |
viewDirDescr := self viewDirectoryDescription value. |
|
1180 |
viewDirDescr ifTrue:[ |
|
1181 |
self openDirectoryDescription. |
|
1182 |
] ifFalse:[ |
|
1183 |
self closeDirectoryDescription. |
|
1184 |
]. |
|
1185 |
^ self. |
|
3892 | 1186 |
! ! |
1187 |
||
1188 |
!FileApplicationNoteBook methodsFor:'menu & actions'! |
|
1189 |
||
11099 | 1190 |
destroyTabAt:idx |
1191 |
|app| |
|
1192 |
||
1193 |
app := listOfApplications at:idx. |
|
1194 |
self closeSubCanvas:app. |
|
1195 |
app release. |
|
1196 |
||
1197 |
"Created: / 11-01-2012 / 23:46:09 / cg" |
|
1198 |
! |
|
1199 |
||
3892 | 1200 |
tabMenuAt:aTab |
1201 |
|menu| |
|
1202 |
||
7765 | 1203 |
menu := Menu decodeFromLiteralArray:self class tabMenu. |
3892 | 1204 |
tabMenuIndex := aTab. |
7765 | 1205 |
menu findGuiResourcesIn:self. |
3892 | 1206 |
^ menu |
7765 | 1207 |
|
1208 |
"Modified: / 27-03-2007 / 10:57:25 / cg" |
|
3892 | 1209 |
! ! |
1210 |
||
1211 |
!FileApplicationNoteBook methodsFor:'queries'! |
|
1212 |
||
1213 |
getSameFilesModifiedFor:aAppl |
|
1214 |
||
1215 |
| sameFileAppl colOfChanged | |
|
1216 |
||
1217 |
sameFileAppl := self getSameApplicationsFor:aAppl. |
|
1218 |
sameFileAppl notEmpty ifTrue:[ |
|
1219 |
colOfChanged := OrderedCollection new. |
|
1220 |
sameFileAppl do:[ : el | |
|
1221 |
el modifiedChannel value ifTrue:[ |
|
1222 |
colOfChanged add:el. |
|
1223 |
] |
|
1224 |
] |
|
1225 |
]. |
|
1226 |
^ colOfChanged |
|
1227 |
! ! |
|
1228 |
||
1229 |
!FileApplicationNoteBook methodsFor:'selection'! |
|
1230 |
||
5324 | 1231 |
currentTabMenusApplication |
1232 |
"only valid within menu processing" |
|
1233 |
||
1234 |
^ self listOfApplications at:tabMenuIndex |
|
1235 |
! |
|
1236 |
||
3892 | 1237 |
doSelect:anAppl |
1238 |
||
7467 | 1239 |
| index fileName additionalInfo| |
3892 | 1240 |
|
1241 |
fileName := anAppl fileName. |
|
4161 | 1242 |
index := self getIndexFor:anAppl. |
4180 | 1243 |
self changeFileBrowserTitleTo:(self privateTabList at:index ifAbsent:nil). |
4523 | 1244 |
|
7467 | 1245 |
additionalInfo := anAppl additionalInfo. |
1246 |
self notify:(fileName isNil |
|
1247 |
ifTrue:[additionalInfo] |
|
1248 |
ifFalse:[(fileName asString contractAtBeginningTo:80),' ',additionalInfo]). |
|
3982 | 1249 |
"/ self gotoFile:fileName. |
3892 | 1250 |
index notNil ifTrue:[ |
1251 |
canvasHolder value:(anAppl window). |
|
1252 |
self selectedEditorPage value:index. |
|
1253 |
] |
|
7467 | 1254 |
|
1255 |
"Modified: / 24-10-2006 / 12:32:53 / cg" |
|
4392 | 1256 |
! |
1257 |
||
1258 |
selectedApplication |
|
5324 | 1259 |
| canvas | |
1260 |
||
1261 |
canvas := self canvasHolder value. |
|
1262 |
canvas isNil ifTrue:[ ^ nil]. |
|
1263 |
^ canvas application. |
|
3892 | 1264 |
! ! |
1265 |
||
1266 |
!FileApplicationNoteBook methodsFor:'startup & release'! |
|
1267 |
||
3954 | 1268 |
closeRequest |
6626 | 1269 |
"asks for permission before closing" |
3954 | 1270 |
|
4082 | 1271 |
self tryCloseApplications ifTrue:[ |
1272 |
super closeRequest. |
|
1273 |
^ true |
|
3954 | 1274 |
]. |
4082 | 1275 |
^ false. |
3954 | 1276 |
! |
1277 |
||
3892 | 1278 |
makeDependent |
1279 |
||
1280 |
self viewDirectoryDescription addDependent:self. |
|
1281 |
self currentDirectories addDependent:self. |
|
1282 |
! |
|
1283 |
||
1284 |
postOpenAsSubcanvasWith:aBuilder |
|
1285 |
||
4071 | 1286 |
self viewDirectoryDescriptionChanged. |
14444
cea130516cc0
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14412
diff
changeset
|
1287 |
super postOpenAsSubcanvasWith:aBuilder. |
3892 | 1288 |
! |
1289 |
||
1290 |
postOpenWith:aBuilder |
|
6626 | 1291 |
"only invoked if the application not started from a master" |
1292 |
||
3982 | 1293 |
self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:(Filename homeDirectory construct:'.bashrc')). |
6626 | 1294 |
super postOpenWith:aBuilder |
3892 | 1295 |
! |
1296 |
||
1297 |
preBuildWith:aBuilder |
|
1298 |
||
1299 |
self masterApplication isNil ifTrue:[ |
|
1300 |
self masterApplication:nil. |
|
1301 |
]. |
|
14444
cea130516cc0
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14412
diff
changeset
|
1302 |
super preBuildWith:aBuilder. |
4082 | 1303 |
! |
1304 |
||
1305 |
tryCloseApplications |
|
1306 |
||
1307 |
self listOfApplications do:[:appl| |
|
5197 | 1308 |
appl doClose ifFalse:[ |
4082 | 1309 |
^ false. |
1310 |
]. |
|
1311 |
]. |
|
1312 |
^ true |
|
3892 | 1313 |
! ! |
1314 |
||
1315 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'defaults'! |
|
1316 |
||
1317 |
tabStringFor:aApplicationType |
|
7687 | 1318 |
"the formatString shown in a tab (language translated)" |
1319 |
||
1320 |
^ 'Archive %1' |
|
1321 |
||
1322 |
"Modified: / 01-03-2007 / 21:43:13 / cg" |
|
3892 | 1323 |
! ! |
1324 |
||
4392 | 1325 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'help specs'! |
1326 |
||
1327 |
helpSpec |
|
1328 |
"This resource specification was automatically generated |
|
1329 |
by the UIHelpTool of ST/X." |
|
1330 |
||
1331 |
"Do not manually edit this!! If it is corrupted, |
|
1332 |
the UIHelpTool may not be able to read the specification." |
|
1333 |
||
1334 |
" |
|
1335 |
UIHelpTool openOnClass:FileApplicationNoteBook::ArchiveViewApplication |
|
1336 |
" |
|
1337 |
||
1338 |
<resource: #help> |
|
1339 |
||
1340 |
^super helpSpec addPairsFrom:#( |
|
1341 |
||
17900 | 1342 |
#closeTabButton |
1343 |
'Close Archiver Tab' |
|
1344 |
||
4392 | 1345 |
#closeButton |
1346 |
'Close Archiver' |
|
1347 |
||
1348 |
#extractItem |
|
1349 |
'Extract...' |
|
1350 |
||
1351 |
#removeOutputButton |
|
1352 |
'Remove Error Output' |
|
1353 |
||
1354 |
#stopButton |
|
1355 |
'Stop' |
|
1356 |
||
1357 |
) |
|
1358 |
! ! |
|
1359 |
||
3892 | 1360 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'image specs'! |
1361 |
||
4392 | 1362 |
extract28x28Icon |
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1363 |
<resource: #image> |
4392 | 1364 |
"This resource specification was automatically generated |
1365 |
by the ImageEditor of ST/X." |
|
1366 |
"Do not manually edit this!! If it is corrupted, |
|
1367 |
the ImageEditor may not be able to read the specification." |
|
1368 |
" |
|
1369 |
self extract28x28Icon inspect |
|
1370 |
ImageEditor openOnClass:self andSelector:#extract28x28Icon |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1371 |
Icon flushCachedIcons" |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1372 |
|
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1373 |
^ Icon |
4392 | 1374 |
constantNamed:#'FileApplicationNoteBook::ArchiveViewApplication class extract28x28Icon' |
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1375 |
ifAbsentPut:[ |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1376 |
(Depth4Image new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1377 |
width:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1378 |
height:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1379 |
photometric:(#palette); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1380 |
bitsPerSample:(#( 4 )); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1381 |
samplesPerPixel:(1); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1382 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1383 |
fromPackedString:' |
4392 | 1384 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
1385 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@3L3L3L@@@@@@@@@@@@CQDMDP0@@@@@EUUAP@@L3L3L3@@@ @PUUTA@@@4QCQDL@@BHAAUUPD@@CL3L3L"H"H"DEUU |
|
1386 |
@P@@MDP4QBH"H"H @@@A@@@3L3L3H"H"H!!DQDQD@@CQDMDP0@@H DP@@@P@@L3L3L3@@@ @Q@ETA@@@4QCQDL@@@@AD@UPD@@CL3L3L0@@@@@@@@@@@@MDP4 |
|
1387 |
QC@@@@@@@@@@@@@3L3L3L@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1388 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1389 |
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
|
1390 |
mask:((ImageMask new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1391 |
width:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1392 |
height:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1393 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1394 |
fromPackedString:' |
4392 | 1395 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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
|
1396 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1397 |
yourself); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1398 |
yourself |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1399 |
] |
4392 | 1400 |
! |
1401 |
||
1402 |
removeBug28x28Icon |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1403 |
<resource: #image> |
4392 | 1404 |
"This resource specification was automatically generated |
1405 |
by the ImageEditor of ST/X." |
|
1406 |
"Do not manually edit this!! If it is corrupted, |
|
1407 |
the ImageEditor may not be able to read the specification." |
|
1408 |
" |
|
1409 |
self removeBug28x28Icon inspect |
|
1410 |
ImageEditor openOnClass:self andSelector:#removeBug28x28Icon |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1411 |
Icon flushCachedIcons" |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1412 |
|
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1413 |
^ Icon |
4392 | 1414 |
constantNamed:#'FileApplicationNoteBook::ArchiveViewApplication class removeBug28x28Icon' |
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1415 |
ifAbsentPut:[ |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1416 |
(Depth2Image new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1417 |
width:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1418 |
height:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1419 |
photometric:(#palette); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1420 |
bitsPerSample:(#( 2 )); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1421 |
samplesPerPixel:(1); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1422 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1423 |
fromPackedString:' |
4392 | 1424 |
UUUUUUUUT@@@@@@@@@@@@@@@@@@@B*@@@@@J(@J(@@@@J(@@* @@@J(@@B*@@@J(@@@J(@@J(@@@@* @J(@@@@B(@J+0@@@@J :*+@@@@B*:**,@@@O***** |
1425 |
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
|
1426 |
@@@@@@@@@@@@@@@@@@@@@@@a'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1427 |
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
|
1428 |
mask:((ImageMask new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1429 |
width:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1430 |
height:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1431 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1432 |
fromPackedString:' |
4392 | 1433 |
@@@@@@@@@@@@@@@@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
|
1434 |
C0@^@@^@O@@C0@@@@@@@@@@@@@@@@@@a'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1435 |
yourself); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1436 |
yourself |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1437 |
] |
4392 | 1438 |
! |
1439 |
||
3892 | 1440 |
removeError |
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1441 |
<resource: #image> |
3892 | 1442 |
"This resource specification was automatically generated |
1443 |
by the ImageEditor of ST/X." |
|
1444 |
"Do not manually edit this!! If it is corrupted, |
|
1445 |
the ImageEditor may not be able to read the specification." |
|
1446 |
" |
|
1447 |
self removeError inspect |
|
1448 |
ImageEditor openOnClass:self andSelector:#removeError |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1449 |
Icon flushCachedIcons" |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1450 |
|
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1451 |
^ Icon |
3892 | 1452 |
constantNamed:#'FileApplicationNoteBook::ArchiveViewApplication class removeError' |
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1453 |
ifAbsentPut:[ |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1454 |
(Depth8Image new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1455 |
width:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1456 |
height:22; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1457 |
photometric:(#palette); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1458 |
bitsPerSample:(#( 8 )); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1459 |
samplesPerPixel:(1); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1460 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1461 |
fromPackedString:' |
3892 | 1462 |
@@@@@@@@@@@FA @@@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@@@A X@@@XF@@@@@@@@@@@@@@@@@@@@@@@@ |
1463 |
@@@@@@@FA XF@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@XFA X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@XF |
|
1464 |
@@@FA @@@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@@@A X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
1465 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
1466 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
1467 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1468 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1469 |
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
|
1470 |
mask:((ImageMask new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1471 |
width:28; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1472 |
height:22; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1473 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1474 |
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
|
1475 |
yourself); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1476 |
yourself |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
1477 |
] |
3892 | 1478 |
! ! |
1479 |
||
1480 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'interface specs'! |
|
1481 |
||
1482 |
windowSpec |
|
1483 |
"This resource specification was automatically generated |
|
1484 |
by the UIPainter of ST/X." |
|
1485 |
||
1486 |
"Do not manually edit this!! If it is corrupted, |
|
1487 |
the UIPainter may not be able to read the specification." |
|
1488 |
||
1489 |
" |
|
3951 | 1490 |
UIPainter new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#windowSpec |
1491 |
FileApplicationNoteBook::ArchiveViewApplication new openInterface:#windowSpec |
|
1492 |
FileApplicationNoteBook::ArchiveViewApplication open |
|
3892 | 1493 |
" |
1494 |
||
1495 |
<resource: #canvas> |
|
1496 |
||
1497 |
^ |
|
18236 | 1498 |
#(FullSpec |
1499 |
name: windowSpec |
|
1500 |
uuid: '7d0661ea-7553-11e8-9d37-b8f6b1108e05' |
|
1501 |
window: |
|
1502 |
(WindowSpec |
|
1503 |
label: 'Archive Application' |
|
1504 |
name: 'Archive Application' |
|
1505 |
uuid: '7d066460-7553-11e8-9d37-b8f6b1108e05' |
|
1506 |
min: (Point 10 10) |
|
1507 |
bounds: (Rectangle 0 0 676 492) |
|
1508 |
menu: mainMenu |
|
1509 |
) |
|
1510 |
component: |
|
1511 |
(SpecCollection |
|
1512 |
collection: ( |
|
1513 |
(MenuPanelSpec |
|
1514 |
name: 'MenuArchive' |
|
1515 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
1516 |
uuid: '7d066668-7553-11e8-9d37-b8f6b1108e05' |
|
1517 |
level: 0 |
|
1518 |
menu: menu |
|
1519 |
textDefault: true |
|
1520 |
) |
|
1521 |
(#'FileBrowserV2UISpecifications::PanelSpec' |
|
1522 |
name: 'VerticalPanel' |
|
1523 |
layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0) |
|
1524 |
uuid: '7d06688e-7553-11e8-9d37-b8f6b1108e05' |
|
1525 |
level: 0 |
|
1526 |
whichView: last |
|
1527 |
orientation: vertical |
|
1528 |
visibility: errorListVisibilityHolder |
|
1529 |
component: |
|
1530 |
(SpecCollection |
|
1531 |
collection: ( |
|
1532 |
(DataSetSpec |
|
1533 |
name: 'Table1' |
|
1534 |
uuid: '7d066a8c-7553-11e8-9d37-b8f6b1108e05' |
|
1535 |
model: selectionIndexHolder |
|
1536 |
menu: fileListMenu |
|
1537 |
hasHorizontalScrollBar: true |
|
1538 |
hasVerticalScrollBar: true |
|
1539 |
dataList: archiveFileList |
|
1540 |
doubleClickSelector: dblClick |
|
1541 |
columnHolder: tableColumns |
|
1542 |
multipleSelectOk: true |
|
1543 |
verticalSpacing: 0 |
|
1544 |
postBuildCallback: postBuildFileTable: |
|
1545 |
properties: |
|
1546 |
(PropertyListDictionary |
|
1547 |
leaveSelector: dropLeave: |
|
1548 |
startDragSelector: doStartDrag:in: |
|
1549 |
overSelector: nil |
|
1550 |
dragArgument: archivApplication |
|
1551 |
dropSelector: doDrop: |
|
1552 |
canDropSelector: canDrop: |
|
1553 |
dropObjectSelector: getDropObjects: |
|
1554 |
enterSelector: dropEnter: |
|
1555 |
dropArgument: archivApplication |
|
1556 |
displayObjectSelector: getDisplayObjects: |
|
1557 |
) |
|
3892 | 1558 |
) |
18236 | 1559 |
(SequenceViewSpec |
1560 |
name: 'ErrorList' |
|
1561 |
uuid: '7d066e1a-7553-11e8-9d37-b8f6b1108e05' |
|
1562 |
initiallyDisabled: true |
|
1563 |
hasHorizontalScrollBar: true |
|
1564 |
hasVerticalScrollBar: true |
|
1565 |
backgroundColor: (Color 100.0 100.0 100.0) |
|
1566 |
isMultiSelect: true |
|
1567 |
useIndex: false |
|
1568 |
sequenceList: errorListHolder |
|
1569 |
) |
|
1570 |
) |
|
1571 |
||
1572 |
) |
|
1573 |
handles: (Any 0.5 1.0) |
|
3892 | 1574 |
) |
18236 | 1575 |
) |
1576 |
||
1577 |
) |
|
1578 |
) |
|
3892 | 1579 |
! ! |
1580 |
||
1581 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'menu specs'! |
|
1582 |
||
1583 |
fileListMenu |
|
1584 |
"This resource specification was automatically generated |
|
1585 |
by the MenuEditor of ST/X." |
|
1586 |
||
1587 |
"Do not manually edit this!! If it is corrupted, |
|
1588 |
the MenuEditor may not be able to read the specification." |
|
1589 |
||
1590 |
" |
|
4475 | 1591 |
MenuEditor new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#fileListMenu |
1592 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ArchiveViewApplication fileListMenu)) startUp |
|
3892 | 1593 |
" |
1594 |
||
1595 |
<resource: #menu> |
|
1596 |
||
1597 |
^ |
|
1598 |
#(#Menu |
|
1599 |
#( |
|
1600 |
#(#MenuItem |
|
4475 | 1601 |
#enabled: #hasListEntriesHolder |
1602 |
#label: 'Select All' |
|
1603 |
#itemValue: #selectAll |
|
3892 | 1604 |
#translateLabel: true |
1605 |
) |
|
1606 |
#(#MenuItem |
|
18236 | 1607 |
#enabled: #hasListEntriesHolder |
1608 |
#label: 'Find in Name...' |
|
1609 |
#itemValue: #findInName |
|
1610 |
#translateLabel: true |
|
1611 |
) |
|
1612 |
#(#MenuItem |
|
4475 | 1613 |
#label: '-' |
1614 |
) |
|
1615 |
#(#MenuItem |
|
1616 |
#enabled: #hasSelectionInList |
|
1617 |
#label: 'Copy Filenames' |
|
1618 |
#itemValue: #copyFilesToClipboard |
|
3892 | 1619 |
#translateLabel: true |
4475 | 1620 |
) |
1621 |
#(#MenuItem |
|
1622 |
#label: '-' |
|
3892 | 1623 |
) |
1624 |
#(#MenuItem |
|
4475 | 1625 |
#enabled: #hasSelectionInList |
1626 |
#label: 'Extract to Directory...' |
|
5415
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1627 |
#itemValue: #extractSelection |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1628 |
#translateLabel: true |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1629 |
) |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1630 |
#(#MenuItem |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1631 |
#label: 'Extract All to Directory...' |
4475 | 1632 |
#itemValue: #extractAll |
3892 | 1633 |
#translateLabel: true |
1634 |
) |
|
1635 |
#(#MenuItem |
|
4475 | 1636 |
#enabled: #canDelete |
4476 | 1637 |
#label: 'Delete from Archive' |
4961
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
1638 |
#itemValue: #removeFilesFromArchive |
3892 | 1639 |
#translateLabel: true |
4475 | 1640 |
#shortcutKey: #Delete |
3892 | 1641 |
) |
1642 |
#(#MenuItem |
|
5415
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1643 |
#label: '-' |
18236 | 1644 |
"/ #isVisible: #closeButtonShown |
5415
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1645 |
) |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1646 |
#(#MenuItem |
4475 | 1647 |
#enabled: #canViewFile |
5415
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
1648 |
#label: 'Show Contents' |
4475 | 1649 |
#itemValue: #viewFile |
3892 | 1650 |
#translateLabel: true |
18236 | 1651 |
"/ #isVisible: #closeButtonShown |
3892 | 1652 |
) |
1653 |
) |
|
1654 |
nil |
|
1655 |
nil |
|
1656 |
) |
|
11099 | 1657 |
|
1658 |
"Modified: / 12-01-2012 / 00:34:13 / cg" |
|
18236 | 1659 |
"Modified: / 21-06-2018 / 14:58:39 / Claus Gittinger" |
3892 | 1660 |
! |
1661 |
||
1662 |
menu |
|
1663 |
"This resource specification was automatically generated |
|
1664 |
by the MenuEditor of ST/X." |
|
1665 |
||
1666 |
"Do not manually edit this!! If it is corrupted, |
|
1667 |
the MenuEditor may not be able to read the specification." |
|
1668 |
||
1669 |
" |
|
1670 |
MenuEditor new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#menu |
|
1671 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ArchiveViewApplication menu)) startUp |
|
1672 |
" |
|
1673 |
||
1674 |
<resource: #menu> |
|
1675 |
||
1676 |
^ |
|
1677 |
#(#Menu |
|
1678 |
#( |
|
1679 |
#(#MenuItem |
|
4392 | 1680 |
#activeHelpKey: #stopButton |
1681 |
#enabled: #enableStopButton |
|
3892 | 1682 |
#label: 'Stop' |
4392 | 1683 |
#itemValue: #doStopProcess |
1684 |
#nameKey: #Stop |
|
3892 | 1685 |
#translateLabel: true |
1686 |
#isButton: true |
|
1687 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #stop22x22Icon) |
|
1688 |
) |
|
1689 |
#(#MenuItem |
|
4392 | 1690 |
#activeHelpKey: #extractItem |
3892 | 1691 |
#enabled: #hasListEntriesHolder |
4392 | 1692 |
#label: 'Extract' |
1693 |
#itemValue: #extractAll |
|
3892 | 1694 |
#translateLabel: true |
1695 |
#isButton: true |
|
4392 | 1696 |
#labelImage: #(#ResourceRetriever #'FileApplicationNoteBook::ArchiveViewApplication' #extract28x28Icon) |
3892 | 1697 |
) |
1698 |
#(#MenuItem |
|
4392 | 1699 |
#activeHelpKey: #removeOutputButton |
1700 |
#enabled: #enableRemoveErrorOutput |
|
1701 |
#label: 'Remove Output' |
|
1702 |
#itemValue: #removeErrorOutput |
|
3892 | 1703 |
#translateLabel: true |
1704 |
#isButton: true |
|
4392 | 1705 |
#labelImage: #(#ResourceRetriever #'FileApplicationNoteBook::ArchiveViewApplication' #removeBug28x28Icon) |
1706 |
) |
|
1707 |
#(#MenuItem |
|
6100 | 1708 |
#activeHelpKey: #closeTabButton |
4392 | 1709 |
#label: 'Close' |
1710 |
#itemValue: #doClose |
|
1711 |
#translateLabel: true |
|
1712 |
#isButton: true |
|
1713 |
#startGroup: #right |
|
11099 | 1714 |
#isVisible: #closeButtonShown |
4392 | 1715 |
#hideMenuOnActivated: false |
6093 | 1716 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #removeTabIcon) |
3892 | 1717 |
) |
1718 |
) |
|
1719 |
nil |
|
1720 |
nil |
|
1721 |
) |
|
11099 | 1722 |
|
1723 |
"Modified: / 12-01-2012 / 00:34:06 / cg" |
|
3892 | 1724 |
! ! |
1725 |
||
1726 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'queries'! |
|
1727 |
||
5010 | 1728 |
canOpenItem:anItem |
5287
693e3ca577aa
avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents:
5279
diff
changeset
|
1729 |
|suffix mimeType| |
693e3ca577aa
avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents:
5279
diff
changeset
|
1730 |
|
17402 | 1731 |
"/ "avoid autoloading the archiver if it's definitely not an archive" |
10706
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
1732 |
"/ OperatingSystem isUNIXlike ifFalse:[ |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
1733 |
"/ "until Archiver supports windows archives..." |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
1734 |
"/ ^ false. |
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
1735 |
"/ ]. |
6518 | 1736 |
|
5287
693e3ca577aa
avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents:
5279
diff
changeset
|
1737 |
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
|
1738 |
( #('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
|
1739 |
|
10922 | 1740 |
( #('xlsx' 'ets') includes:suffix) ifTrue:[^ true]. |
1741 |
||
5287
693e3ca577aa
avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents:
5279
diff
changeset
|
1742 |
mimeType := anItem mimeType. |
693e3ca577aa
avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents:
5279
diff
changeset
|
1743 |
( #('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
|
1744 |
|
5315 | 1745 |
Archiver isNil ifTrue:[^ false]. |
6518 | 1746 |
^ (Archiver classForMimeType:mimeType fileName:anItem fileName) notNil |
10706
2c487f44a355
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10566
diff
changeset
|
1747 |
|
10922 | 1748 |
"Modified: / 29-11-2011 / 18:59:35 / cg" |
17402 | 1749 |
"Modified (format): / 13-02-2017 / 20:12:23 / cg" |
3892 | 1750 |
! |
1751 |
||
1752 |
wantNewApplicationAnyway |
|
1753 |
||
1754 |
^ false |
|
1755 |
! ! |
|
1756 |
||
1757 |
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'tableColumns specs'! |
|
1758 |
||
1759 |
tableColumns |
|
1760 |
"This resource specification was automatically generated |
|
1761 |
by the DataSetBuilder of ST/X." |
|
1762 |
||
1763 |
"Do not manually edit this!! If it is corrupted, |
|
1764 |
the DataSetBuilder may not be able to read the specification." |
|
1765 |
||
1766 |
" |
|
5008 | 1767 |
DataSetBuilder new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#tableColumns |
3892 | 1768 |
" |
1769 |
||
1770 |
<resource: #tableColumns> |
|
1771 |
||
1772 |
^#( |
|
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1773 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1774 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1775 |
labelActionSelector: sortFileListsBy: |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1776 |
labelActionArgument: 'directory' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1777 |
width: 25 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1778 |
minWidth: 20 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1779 |
height: 16 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1780 |
model: icon |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1781 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1782 |
isResizeable: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1783 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1784 |
showColSeparator: false |
3892 | 1785 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1786 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1787 |
label: 'File Name' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1788 |
id: 'fileName' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1789 |
labelAlignment: left |
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 |
model: fileName |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1792 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1793 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1794 |
showColSeparator: false |
3892 | 1795 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1796 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1797 |
label: 'Perm' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1798 |
id: 'permissions' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1799 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1800 |
usePreferredWidth: true |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1801 |
width: 75 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1802 |
model: permissions |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1803 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1804 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1805 |
showColSeparator: false |
3892 | 1806 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1807 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1808 |
label: 'Version' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1809 |
id: 'version' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1810 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1811 |
columnAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1812 |
width: 100 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1813 |
minWidth: 50 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1814 |
model: version |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1815 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1816 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1817 |
showColSeparator: false |
3892 | 1818 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1819 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1820 |
label: 'Type' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1821 |
id: 'type' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1822 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1823 |
columnAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1824 |
width: 100 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1825 |
minWidth: 50 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1826 |
model: type |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1827 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1828 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1829 |
showColSeparator: false |
3892 | 1830 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1831 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1832 |
label: 'Owner/Group' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1833 |
id: 'ownerGroup' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1834 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1835 |
columnAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1836 |
width: 100 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1837 |
minWidth: 50 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1838 |
model: ownerGroup |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1839 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1840 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1841 |
showColSeparator: false |
3892 | 1842 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1843 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1844 |
label: 'Size' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1845 |
id: 'size' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1846 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1847 |
columnAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1848 |
width: 80 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1849 |
model: size |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1850 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1851 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1852 |
showColSeparator: false |
3892 | 1853 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1854 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1855 |
label: 'Date & Time' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1856 |
id: 'dateAndTime' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1857 |
labelAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1858 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1859 |
columnAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1860 |
usePreferredWidth: true |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1861 |
width: 140 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1862 |
model: dateAndTime |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1863 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1864 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1865 |
showColSeparator: false |
3892 | 1866 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1867 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1868 |
label: 'Method' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1869 |
id: 'method' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1870 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1871 |
columnAlignment: center |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1872 |
usePreferredWidth: true |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1873 |
width: 140 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1874 |
model: method |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1875 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1876 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1877 |
showColSeparator: false |
3892 | 1878 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1879 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1880 |
label: 'CRC' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1881 |
id: 'crc' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1882 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1883 |
usePreferredWidth: true |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1884 |
width: 140 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1885 |
model: crc |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1886 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1887 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1888 |
showColSeparator: false |
3892 | 1889 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1890 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1891 |
label: 'Compress Size' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1892 |
id: 'compressSize' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1893 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1894 |
columnAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1895 |
usePreferredWidth: true |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1896 |
width: 140 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1897 |
model: compressSize |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1898 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1899 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1900 |
showColSeparator: false |
3892 | 1901 |
) |
5222
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1902 |
(DataSetColumnSpec |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1903 |
label: 'Ratio' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1904 |
id: 'ratio' |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1905 |
labelButtonType: Button |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1906 |
columnAlignment: right |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1907 |
usePreferredWidth: true |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1908 |
width: 140 |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1909 |
model: ratio |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1910 |
canSelect: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1911 |
showRowSeparator: false |
a9bad3ac536e
sort archive table columns disabled no selector was available
penk
parents:
5221
diff
changeset
|
1912 |
showColSeparator: false |
3892 | 1913 |
) |
1914 |
) |
|
5008 | 1915 |
|
3892 | 1916 |
! ! |
1917 |
||
1918 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'accessing'! |
|
1919 |
||
1920 |
archiver |
|
1921 |
"return the value of the instance variable 'archiver' (automatically generated)" |
|
1922 |
||
1923 |
^ archiver |
|
1924 |
! |
|
1925 |
||
1926 |
archiver:something |
|
1927 |
"set the value of the instance variable 'archiver' (automatically generated)" |
|
1928 |
||
1929 |
archiver := something. |
|
1930 |
! |
|
1931 |
||
1932 |
columnDescriptors |
|
1933 |
"return the value of the instance variable 'columnDescriptors' (automatically generated)" |
|
1934 |
||
1935 |
^ columnDescriptors |
|
1936 |
! |
|
1937 |
||
1938 |
columnDescriptors:aListOfColumns |
|
1939 |
"set the value of the instance variable 'columnDescriptors' (automatically generated)" |
|
1940 |
||
1941 |
columnDescriptors = aListOfColumns ifTrue:[ |
|
1942 |
^ self |
|
1943 |
]. |
|
1944 |
||
1945 |
columnDescriptors := OrderedCollection new. |
|
1946 |
||
1947 |
aListOfColumns keysAndValuesDo:[:anIndex :aDesc| |col| |
|
7765 | 1948 |
col := aDesc isSequenceable ifTrue:[DataSetColumnSpec decodeFromLiteralArray:aDesc] |
3892 | 1949 |
ifFalse:[aDesc]. |
1950 |
columnDescriptors add:col. |
|
1951 |
]. |
|
7765 | 1952 |
|
1953 |
"Modified: / 27-03-2007 / 08:46:06 / cg" |
|
3892 | 1954 |
! |
1955 |
||
5010 | 1956 |
item:anItem |
1957 |
super item:anItem. |
|
4905 | 1958 |
|
4375 | 1959 |
self removeErrorOutput. |
4905 | 1960 |
archiver := Archiver newFor:self fileName. |
1961 |
||
1962 |
archiver notNil ifTrue:[ |
|
4803 | 1963 |
self |
1964 |
makeProcessFor:[ |
|
4905 | 1965 |
self archiver:archiver. |
4803 | 1966 |
self setColumnsForArchiver. |
1967 |
] |
|
1968 |
with:'Setup archive'. |
|
3892 | 1969 |
^ true |
1970 |
]. |
|
1971 |
^ false |
|
1972 |
! |
|
1973 |
||
18236 | 1974 |
selection |
1975 |
^ self selectionHolder value. |
|
1976 |
||
1977 |
"Created: / 21-06-2018 / 15:04:24 / Claus Gittinger" |
|
1978 |
! |
|
1979 |
||
3892 | 1980 |
temporaryDirectory |
1981 |
"return the value of the instance variable 'temporaryDirectory' (automatically generated)" |
|
1982 |
||
1983 |
temporaryDirectory isNil ifTrue:[ |
|
13112
ade9575b2a32
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
12830
diff
changeset
|
1984 |
temporaryDirectory := Filename newTemporaryDirectory. |
3892 | 1985 |
]. |
1986 |
^ temporaryDirectory |
|
1987 |
! ! |
|
1988 |
||
1989 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'actions'! |
|
1990 |
||
5010 | 1991 |
changeItem:anItem |
1992 |
self item:anItem. |
|
4803 | 1993 |
self clearFileList. |
4905 | 1994 |
self listAllFiles. |
3892 | 1995 |
^ true |
1996 |
! |
|
1997 |
||
4803 | 1998 |
clearFileList |
1999 |
||
2000 |
self archiveFileList value removeAll. |
|
2001 |
! |
|
2002 |
||
3892 | 2003 |
copyFilesToClipboard |
18236 | 2004 |
"copy the names of the selected files to the clipboard" |
2005 |
||
3892 | 2006 |
|sel list stream| |
2007 |
||
18236 | 2008 |
sel := self selection. |
3892 | 2009 |
list := self archiveFileList. |
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6481
diff
changeset
|
2010 |
(sel notEmptyOrNil) ifTrue:[ |
15594
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
2011 |
stream := CharacterWriteStream new. |
3892 | 2012 |
sel do:[: key | |
2013 |
stream nextPutAll:(key fileName asString). |
|
2014 |
stream cr. |
|
2015 |
]. |
|
6033 | 2016 |
self window setClipboardText:stream contents. |
3892 | 2017 |
]. |
10922 | 2018 |
|
2019 |
"Modified (format): / 29-11-2011 / 18:57:40 / cg" |
|
18236 | 2020 |
"Modified (comment): / 21-06-2018 / 15:05:13 / Claus Gittinger" |
3892 | 2021 |
! |
2022 |
||
2023 |
dblClick |
|
2024 |
||
2025 |
self viewFile. |
|
2026 |
! |
|
2027 |
||
2028 |
doStopProcess |
|
2029 |
| archiver | |
|
10922 | 2030 |
|
3892 | 2031 |
self stopProcess. |
2032 |
archiver := self archiver. |
|
2033 |
archiver notNil ifTrue:[ |
|
2034 |
self archiver stopProcess. |
|
2035 |
]. |
|
2036 |
self enableStopButton value:false. |
|
10922 | 2037 |
|
2038 |
"Modified (format): / 29-11-2011 / 18:57:50 / cg" |
|
3892 | 2039 |
! |
2040 |
||
18236 | 2041 |
findInName |
2042 |
||
2043 |
|selIndices pattern startIndex listOfFiles| |
|
2044 |
||
2045 |
pattern := Dialog request:'Find in Name:' |
|
2046 |
initialAnswer:LastSearchedInName. |
|
2047 |
pattern isEmptyOrNil ifTrue:[ |
|
2048 |
^ self |
|
2049 |
]. |
|
2050 |
LastSearchedInName := pattern. |
|
2051 |
||
2052 |
selIndices := self selectionIndexHolder value. |
|
2053 |
selIndices isEmpty ifTrue:[ selIndices := #(1) ]. |
|
2054 |
startIndex := (selIndices min max:1) + 1. |
|
2055 |
||
2056 |
listOfFiles := self archiveFileList value. |
|
2057 |
||
2058 |
startIndex to:(listOfFiles size) do:[:idx | |
|
2059 |
|item| |
|
2060 |
||
2061 |
item := listOfFiles at:idx. |
|
2062 |
(item fileName includesString:pattern caseSensitive:false) ifTrue:[ |
|
2063 |
self selectionIndexHolder value:(Array with:idx). |
|
2064 |
^ self |
|
2065 |
]. |
|
2066 |
]. |
|
2067 |
self device beep. |
|
2068 |
||
2069 |
"Created: / 21-06-2018 / 15:00:31 / Claus Gittinger" |
|
2070 |
! |
|
2071 |
||
3892 | 2072 |
removeErrorOutput |
2073 |
||
2074 |
self viewErrorList value:false. |
|
2075 |
self errorListHolder removeAll. |
|
2076 |
! |
|
2077 |
||
2078 |
removeTemporaryDirectory |
|
2079 |
||
2080 |
temporaryDirectory notNil ifTrue:[ |
|
4923
1aced17a14a7
Do not use obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
4913
diff
changeset
|
2081 |
temporaryDirectory removeDirectory. |
3892 | 2082 |
temporaryDirectory := nil. |
2083 |
]. |
|
2084 |
! |
|
2085 |
||
2086 |
selectAll |
|
18236 | 2087 |
|sel listOfFiles| |
2088 |
||
3892 | 2089 |
listOfFiles := self archiveFileList value. |
18236 | 2090 |
"/ sel := OrderedCollection new. |
2091 |
"/ 1 to:(listOfFiles size) do:[:el | |
|
2092 |
"/ sel add:el |
|
2093 |
"/ ]. |
|
2094 |
"/ self selectionHolder value:sel. |
|
2095 |
self selectionIndexHolder value:(1 to:(listOfFiles size)). |
|
2096 |
||
2097 |
"Modified: / 21-06-2018 / 15:07:08 / Claus Gittinger" |
|
3892 | 2098 |
! |
2099 |
||
2100 |
updateFileBrowserIfPresentWith:aDirectory |
|
2101 |
||
2102 |
| master| |
|
2103 |
||
2104 |
master := self masterApplication. |
|
2105 |
master notNil ifTrue:[ |
|
2106 |
master updateAndSelect:(OrderedCollection with:aDirectory). |
|
2107 |
]. |
|
2108 |
! |
|
2109 |
||
2110 |
viewFile |
|
2111 |
||
2112 |
| master item file tempDir| |
|
2113 |
||
4001 | 2114 |
self canViewFile ifFalse:[^ self]. |
3892 | 2115 |
master := self masterApplication. |
19139 | 2116 |
self selection size == 1 ifFalse:[ |
18236 | 2117 |
Dialog warn:'only one file has to be selected'. |
3892 | 2118 |
^ self. |
2119 |
]. |
|
2120 |
tempDir := self temporaryDirectory. |
|
2121 |
self extractSelectedFilesTo:tempDir askForExtractOptions:false. |
|
2122 |
process notNil ifTrue:[ |
|
2123 |
process waitUntilTerminated. |
|
2124 |
]. |
|
2125 |
file := tempDir construct:self selectionHolder value first fileName. |
|
2126 |
file exists ifTrue:[ |
|
3982 | 2127 |
item := DirectoryContentsBrowser itemClass fileName:file. |
3892 | 2128 |
]. |
2129 |
master notNil ifTrue:[ |
|
2130 |
master openApplByFileItem:item. |
|
2131 |
]. |
|
18236 | 2132 |
|
2133 |
"Modified: / 21-06-2018 / 15:07:23 / Claus Gittinger" |
|
3892 | 2134 |
! ! |
2135 |
||
2136 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'aspects'! |
|
2137 |
||
2138 |
archiveFileList |
|
2139 |
||
2140 |
archiveFileList isNil ifTrue:[ |
|
2141 |
archiveFileList := List new. |
|
2142 |
archiveFileList addDependent:self. |
|
2143 |
]. |
|
2144 |
^ archiveFileList. |
|
2145 |
! |
|
2146 |
||
2147 |
enableRemoveErrorOutput |
|
2148 |
"return/create the 'enableRemoveErrorOutput' value holder (automatically generated)" |
|
2149 |
||
2150 |
enableRemoveErrorOutput isNil ifTrue:[ |
|
2151 |
enableRemoveErrorOutput := false asValue. |
|
2152 |
]. |
|
2153 |
^ enableRemoveErrorOutput |
|
2154 |
! |
|
2155 |
||
2156 |
enableStopButton |
|
2157 |
||
2158 |
enableStopButton isNil ifTrue:[ |
|
2159 |
enableStopButton := false asValue. |
|
2160 |
]. |
|
2161 |
^ enableStopButton |
|
2162 |
! |
|
2163 |
||
2164 |
errorListHolder |
|
2165 |
||
2166 |
errorListHolder isNil ifTrue:[ |
|
2167 |
errorListHolder := List new. |
|
2168 |
]. |
|
2169 |
^ errorListHolder. |
|
2170 |
! |
|
2171 |
||
2172 |
errorListVisibilityHolder |
|
2173 |
||
2174 |
errorListVisibilityHolder isNil ifTrue:[ |
|
2175 |
errorListVisibilityHolder := false asValue. |
|
2176 |
]. |
|
2177 |
^ errorListVisibilityHolder |
|
2178 |
! |
|
2179 |
||
2180 |
hasSelectionInList |
|
2181 |
| sel | |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6481
diff
changeset
|
2182 |
|
18236 | 2183 |
sel := self selection. |
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6481
diff
changeset
|
2184 |
^ sel notEmptyOrNil |
18236 | 2185 |
|
2186 |
"Modified: / 21-06-2018 / 15:05:54 / Claus Gittinger" |
|
3892 | 2187 |
! |
2188 |
||
2189 |
selectionHolder |
|
2190 |
selectionHolder isNil ifTrue:[ |
|
2191 |
selectionHolder := ValueHolder new. |
|
2192 |
selectionHolder addDependent:self. |
|
2193 |
]. |
|
2194 |
^ selectionHolder. |
|
2195 |
! |
|
2196 |
||
18236 | 2197 |
selectionIndexHolder |
2198 |
selectionIndexHolder isNil ifTrue:[ |
|
2199 |
selectionIndexHolder := ValueHolder new. |
|
2200 |
selectionIndexHolder addDependent:self. |
|
2201 |
]. |
|
2202 |
^ selectionIndexHolder. |
|
2203 |
||
2204 |
"Created: / 21-06-2018 / 15:03:42 / Claus Gittinger" |
|
2205 |
! |
|
2206 |
||
3892 | 2207 |
tableColumns |
2208 |
||
2209 |
tableColumns isNil ifTrue:[ |
|
2210 |
tableColumns := self class tableColumns asValue. |
|
2211 |
]. |
|
2212 |
^ tableColumns. |
|
2213 |
! |
|
2214 |
||
2215 |
viewErrorList |
|
2216 |
"return/create the 'viewErrorList' value holder (automatically generated)" |
|
2217 |
||
2218 |
viewErrorList isNil ifTrue:[ |
|
2219 |
viewErrorList := false asValue. |
|
2220 |
viewErrorList onChangeSend:#viewErrorListChanged to:self. |
|
2221 |
]. |
|
2222 |
^ viewErrorList |
|
2223 |
! ! |
|
2224 |
||
2225 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'change & update'! |
|
2226 |
||
2227 |
update:something with:aParameter from:changedObject |
|
18236 | 2228 |
changedObject == selectionIndexHolder ifTrue:[ |
2229 |
self selectionHolder value:(self selectionIndexHolder value |
|
2230 |
collect:[:idx | self archiveFileList at:idx ifAbsent:nil]). |
|
2231 |
^ self |
|
2232 |
]. |
|
2233 |
||
3892 | 2234 |
changedObject == self archiveFileList ifTrue:[ |
2235 |
self hasListEntriesHolder value:(changedObject notEmpty). |
|
2236 |
^ self |
|
2237 |
]. |
|
2238 |
super update:something with:aParameter from:changedObject |
|
18236 | 2239 |
|
2240 |
"Modified: / 21-06-2018 / 15:15:17 / Claus Gittinger" |
|
3892 | 2241 |
! |
2242 |
||
2243 |
viewErrorListChanged |
|
2244 |
||
2245 |
| viewListValue| |
|
2246 |
||
2247 |
viewListValue := self viewErrorList value. |
|
2248 |
self enableRemoveErrorOutput value:viewListValue. |
|
2249 |
self errorListVisibilityHolder value:viewListValue. |
|
2250 |
! ! |
|
2251 |
||
2252 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'command execution'! |
|
2253 |
||
2254 |
getErrorBlock |
|
2255 |
||
2256 |
^ |
|
2257 |
[: x | |
|
2258 |
self viewErrorList value:true. |
|
2259 |
self errorListHolder value add:x. |
|
2260 |
] |
|
2261 |
! |
|
2262 |
||
2263 |
getErrorStream |
|
2264 |
||
2265 |
|errStream| |
|
2266 |
||
2267 |
errStream := ActorStream new. |
|
2268 |
errStream nextPutLineBlock:(self getErrorBlock). |
|
2269 |
^ errStream |
|
2270 |
! |
|
2271 |
||
2272 |
getOutBlock |
|
4961
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2273 |
|archiveOutputParser| |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2274 |
|
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2275 |
archiveOutputParser := archiver listFilesReader. |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2276 |
|
5413 | 2277 |
^ [: line | |item| |
4961
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2278 |
item := archiveOutputParser parseLine:line forItemClass:ArchivItem. |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2279 |
item notNil ifTrue:[ |
3892 | 2280 |
self archiveFileList value add:item |
2281 |
]. |
|
2282 |
] |
|
2283 |
! |
|
2284 |
||
2285 |
getOutStream |
|
2286 |
||
2287 |
|outStream| |
|
2288 |
||
2289 |
outStream := ActorStream new. |
|
2290 |
outStream nextPutLineBlock:(self getOutBlock). |
|
2291 |
^ outStream |
|
2292 |
! |
|
2293 |
||
2294 |
makeProcessFor:aBlock |
|
2295 |
self makeProcessFor:aBlock with:'' |
|
2296 |
! |
|
2297 |
||
2298 |
makeProcessFor:aBlock with:string |
|
2299 |
process notNil ifTrue:[ |
|
6054 | 2300 |
(process waitUntilTerminatedWithTimeout:10) ifTrue:[ |
2301 |
(Dialog confirm:'Terminate the current active archive operation ?') ifFalse:[^ self]. |
|
2302 |
process terminate. |
|
2303 |
]. |
|
3892 | 2304 |
terminateByMe ifTrue:[ |
2305 |
terminateByMe := false. |
|
2306 |
^ self |
|
2307 |
]. |
|
2308 |
]. |
|
4803 | 2309 |
|
2310 |
process := [ [ |
|
2311 |
self notify:string. |
|
2312 |
aBlock value. |
|
6190 | 2313 |
self notify:nil. |
4890
b3f7edcf4981
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
4880
diff
changeset
|
2314 |
] ensure:[ |
3892 | 2315 |
process := nil. |
2316 |
self enableStopButton value:false. |
|
2317 |
] |
|
4803 | 2318 |
] newProcess. |
15465
74d2b7497f7c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15232
diff
changeset
|
2319 |
process priority:(Processor userBackgroundPriority). |
3892 | 2320 |
process name:'ArchiveApplicationProcess'. |
4803 | 2321 |
process resume. |
3892 | 2322 |
self enableStopButton value:true. |
2323 |
! |
|
2324 |
||
2325 |
setColumnsForArchiver |
|
2326 |
||
2327 |
| newColumns archiverColumns allColumns iconColumn| |
|
2328 |
||
4965
a251b39fb4a2
dont use a column-descriptors id-field
Claus Gittinger <cg@exept.de>
parents:
4964
diff
changeset
|
2329 |
archiverColumns := archiver columns collect:[:el| el first]. |
3892 | 2330 |
allColumns := OrderedCollection new. |
2331 |
newColumns := OrderedCollection new. |
|
2332 |
self class tableColumns do:[:el| |
|
7765 | 2333 |
allColumns add:(DataSetColumnSpec decodeFromLiteralArray:el). |
3892 | 2334 |
]. |
4965
a251b39fb4a2
dont use a column-descriptors id-field
Claus Gittinger <cg@exept.de>
parents:
4964
diff
changeset
|
2335 |
iconColumn := allColumns detect:[: col | (col readSelector asSymbol) = #icon] ifNone:[nil]. |
3892 | 2336 |
iconColumn notNil ifTrue:[ |
2337 |
newColumns add:iconColumn. |
|
2338 |
]. |
|
2339 |
allColumns do:[:col| |
|
4965
a251b39fb4a2
dont use a column-descriptors id-field
Claus Gittinger <cg@exept.de>
parents:
4964
diff
changeset
|
2340 |
(archiverColumns includes:(col readSelector asSymbol)) ifTrue:[ |
3892 | 2341 |
newColumns add:col. |
2342 |
]. |
|
2343 |
]. |
|
2344 |
self tableColumns value:newColumns. |
|
18579 | 2345 |
self columnDescriptors:newColumns. |
7765 | 2346 |
|
2347 |
"Modified: / 27-03-2007 / 08:46:03 / cg" |
|
18579 | 2348 |
"Modified: / 05-02-2019 / 10:28:04 / Claus Gittinger" |
3892 | 2349 |
! |
2350 |
||
2351 |
stopProcess |
|
2352 |
||
2353 |
|task| |
|
2354 |
||
2355 |
terminateByMe := true. |
|
2356 |
(task := process) notNil ifTrue:[ |
|
2357 |
process := nil. |
|
2358 |
||
4645
fcf36da5b305
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4626
diff
changeset
|
2359 |
Error handle:[:ex| |
3892 | 2360 |
Dialog warn:ex description. |
4645
fcf36da5b305
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4626
diff
changeset
|
2361 |
] do:[ |
3892 | 2362 |
task isDead ifFalse:[ |
3919 | 2363 |
task terminateWithAllSubprocessesInGroup. |
3892 | 2364 |
task waitUntilTerminated. |
2365 |
] |
|
2366 |
] |
|
2367 |
]. |
|
2368 |
! ! |
|
2369 |
||
2370 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'command helper'! |
|
2371 |
||
2372 |
selectDirectoryDialog |
|
2373 |
||
2374 |
| dir directory haveDirectory| |
|
2375 |
||
2376 |
directory := self fileName directory. |
|
2377 |
haveDirectory := false. |
|
2378 |
[haveDirectory] whileFalse:[ |
|
2379 |
dir := Dialog requestDirectoryName:'Which directory ?' default:dir. |
|
3988 | 2380 |
dir isEmpty ifTrue:[ ^ nil]. |
3892 | 2381 |
dir := dir asFilename. |
2382 |
(dir isExecutable not or:[dir isWritable not]) ifTrue:[ |
|
2383 |
Dialog warn:'cant write to: ', dir asString. |
|
2384 |
]. |
|
2385 |
haveDirectory := true. |
|
2386 |
]. |
|
2387 |
^ dir |
|
3988 | 2388 |
! |
2389 |
||
2390 |
selectDirectoryDialog:message |
|
5413 | 2391 |
|dir haveDirectory answer| |
2392 |
||
2393 |
dir := self masterApplication currentDirectory. |
|
2394 |
dir isNil ifTrue:[ |
|
2395 |
dir := archiver fileName withoutSuffix. |
|
5221 | 2396 |
"/ (fn exists and:[fn isDirectory]) ifTrue:[ |
2397 |
"/ dir := fn |
|
2398 |
"/ ] ifFalse:[ |
|
2399 |
"/ dir := fn directory |
|
2400 |
"/ ]. |
|
4981
0476a3d2d4ef
archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents:
4977
diff
changeset
|
2401 |
]. |
5221 | 2402 |
|
3988 | 2403 |
haveDirectory := false. |
2404 |
[haveDirectory] whileFalse:[ |
|
2405 |
dir := Dialog requestDirectoryName:message default:dir. |
|
2406 |
dir isEmpty ifTrue:[ ^ nil]. |
|
4396
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2407 |
|
3988 | 2408 |
dir := dir asFilename. |
4396
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2409 |
dir exists ifFalse:[ |
5610 | 2410 |
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
|
2411 |
answer isNil ifTrue:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2412 |
^ nil |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2413 |
]. |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2414 |
answer ifTrue:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2415 |
dir makeDirectory. |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2416 |
dir exists ifFalse:[ |
5610 | 2417 |
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
|
2418 |
] |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2419 |
]. |
3988 | 2420 |
]. |
4396
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2421 |
dir exists ifTrue:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2422 |
(dir isExecutable not or:[dir isWritable not]) ifTrue:[ |
5610 | 2423 |
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
|
2424 |
] ifFalse:[ |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2425 |
haveDirectory := true. |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2426 |
]. |
eb8622726488
dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents:
4393
diff
changeset
|
2427 |
]. |
3988 | 2428 |
]. |
2429 |
^ dir |
|
3892 | 2430 |
! ! |
2431 |
||
2432 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands add'! |
|
2433 |
||
4803 | 2434 |
addFilesToArchive:colOfFiles |
2435 |
self archiver |
|
2436 |
outStream:nil |
|
2437 |
errorStream:(self getErrorStream) |
|
2438 |
synchron:true. |
|
2439 |
||
4961
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2440 |
"/ self |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2441 |
"/ makeProcessFor:[ |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2442 |
"/ self archiver addFilesToArchive:colOfFiles. |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2443 |
"/ ] |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2444 |
"/ with:'Adding files to archive'. |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2445 |
"/ synchronous - otherwise list below fails |
7b1d05219028
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
4953
diff
changeset
|
2446 |
self archiver addFilesToArchive:colOfFiles. |
4803 | 2447 |
|
2448 |
"/ ugly code alarm. |
|
3892 | 2449 |
(self archiver class == Archiver zipArchive) ifTrue:[ |
4905 | 2450 |
self listAllFiles |
3892 | 2451 |
] ifFalse:[ |
4905 | 2452 |
self listFiles:colOfFiles |
3892 | 2453 |
]. |
4803 | 2454 |
^ true |
3892 | 2455 |
! ! |
2456 |
||
2457 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands extract'! |
|
2458 |
||
2459 |
extractAll |
|
2460 |
||
2461 |
self extractSelectedFilesTo:nil withSelection:#all |
|
2462 |
! |
|
2463 |
||
2464 |
extractSelectedFilesTo:aDirectory askForExtractOptions:askForExtractOptionsBoolean |
|
2465 |
||
2466 |
self extractSelectedFilesTo:aDirectory withSelection:#selection askForExtractOptions:askForExtractOptionsBoolean |
|
2467 |
! |
|
2468 |
||
2469 |
extractSelectedFilesTo:aDirectory withSelection:selectOrAll |
|
2470 |
||
2471 |
self extractSelectedFilesTo:aDirectory withSelection:selectOrAll askForExtractOptions:true. |
|
2472 |
! |
|
2473 |
||
2474 |
extractSelectedFilesTo:aDirectory withSelection:selectOrAll askForExtractOptions:askForExtractOptionsBoolean |
|
2475 |
||
2476 |
| dir| |
|
2477 |
||
2478 |
aDirectory isNil ifTrue:[ |
|
5413 | 2479 |
dir := self selectDirectoryDialog:'Extract into Directory?'. |
3892 | 2480 |
dir isNil ifTrue:[^ self]. |
2481 |
] ifFalse:[ |
|
2482 |
dir := aDirectory. |
|
2483 |
]. |
|
2484 |
selectOrAll == #all ifTrue:[ |
|
2485 |
self extractAllTo:dir. |
|
2486 |
]. |
|
2487 |
selectOrAll == #selection ifTrue:[ |
|
2488 |
self extractSelectionTo:dir askForExtractOptions:askForExtractOptionsBoolean |
|
2489 |
]. |
|
4001 | 2490 |
"/ self updateFileBrowserIfPresentWith:dir. |
3892 | 2491 |
! ! |
2492 |
||
2493 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands extract private'! |
|
2494 |
||
2495 |
extractAllTo:aDirectory |
|
2496 |
||
4803 | 2497 |
self archiver |
2498 |
outStream:nil |
|
2499 |
errorStream:(self getErrorStream) |
|
2500 |
synchron:true. |
|
2501 |
self |
|
4905 | 2502 |
makeProcessFor:[ self archiver extractFilesTo:aDirectory ] |
4803 | 2503 |
with:'Extracting all files'. |
3892 | 2504 |
^ true. |
2505 |
! |
|
2506 |
||
5415
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
2507 |
extractSelection |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
2508 |
self extractSelectedFilesTo:nil withSelection:#selection askForExtractOptions:true |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
2509 |
! |
20210169445f
allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents:
5414
diff
changeset
|
2510 |
|
3892 | 2511 |
extractSelectionTo:aDirectory askForExtractOptions:askForExtractOptionsBoolean |
2512 |
| sel index extractWithDirectoryPart extractAllFilesInSelectedDirectories extractFiles| |
|
2513 |
||
2514 |
extractWithDirectoryPart := true. |
|
2515 |
extractAllFilesInSelectedDirectories := false. |
|
18236 | 2516 |
sel := self selection. |
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6481
diff
changeset
|
2517 |
(sel isEmptyOrNil) ifTrue:[ |
3892 | 2518 |
sel := self archiveFileList value. |
2519 |
]. |
|
19028 | 2520 |
"/ cg: removed the confusing assignment; |
2521 |
"/ (looks as ig do: changes anything, or returns another collection; |
|
2522 |
"/ if that is the case, this should be made explicit) |
|
2523 |
"sel :=" sel do:[:item| |
|
3892 | 2524 |
item fileName: item fileName |
2525 |
]. |
|
2526 |
(askForExtractOptionsBoolean and:[self archiver class ~= Archiver zipArchive]) ifTrue:[ |
|
2527 |
extractFiles := self selRemoveFilesForDirs:sel. |
|
2528 |
] ifFalse:[ |
|
2529 |
extractFiles := sel. |
|
2530 |
]. |
|
2531 |
||
2532 |
askForExtractOptionsBoolean ifTrue:[ |
|
2533 |
index := extractFiles findFirst:[: el | el hasDirectoryPart]. |
|
2534 |
index ~= 0 ifTrue:[ |
|
4964 | 2535 |
extractWithDirectoryPart := (Dialog confirmWithCancel:'Extract with directory part ?\\(I.e. create empty directories as required to preserve relative path)' withCRs default:true). |
3892 | 2536 |
extractWithDirectoryPart isNil ifTrue:[^ false]. |
2537 |
]. |
|
2538 |
]. |
|
2539 |
extractWithDirectoryPart ifTrue:[ |
|
2540 |
self extractWithDirectoryPartTo:aDirectory with:extractFiles. |
|
2541 |
] ifFalse:[ |
|
2542 |
self extractWithOutDirectoryPartTo:aDirectory with:extractFiles. |
|
2543 |
]. |
|
2544 |
^ true |
|
10922 | 2545 |
|
2546 |
"Modified (format): / 29-11-2011 / 18:57:54 / cg" |
|
18236 | 2547 |
"Modified: / 21-06-2018 / 15:05:20 / Claus Gittinger" |
3892 | 2548 |
! |
2549 |
||
2550 |
extractWithDirectoryPartTo:aDirectory with:extractFiles |
|
4803 | 2551 |
self archiver |
2552 |
outStream:nil |
|
2553 |
errorStream:(self getErrorStream) |
|
2554 |
synchron:true. |
|
2555 |
self |
|
4905 | 2556 |
makeProcessFor:[ self archiver extractFiles:extractFiles to:aDirectory ] |
4803 | 2557 |
with:('Extracting files to %1' bindWith:aDirectory asString). |
3892 | 2558 |
^ true. |
10922 | 2559 |
|
2560 |
"Modified (format): / 29-11-2011 / 18:57:58 / cg" |
|
3892 | 2561 |
! |
2562 |
||
2563 |
extractWithOutDirectoryPartTo:aDirectory with:extractFiles |
|
4803 | 2564 |
self archiver |
2565 |
outStream:nil |
|
2566 |
errorStream:(self getErrorStream) |
|
2567 |
synchron:true. |
|
2568 |
self |
|
2569 |
makeProcessFor:[ |
|
2570 |
self archiver |
|
4905 | 2571 |
extractFiles:(extractFiles collect:[:item| item fileName]) |
2572 |
withoutDirectoryTo:aDirectory. |
|
4803 | 2573 |
] |
2574 |
with:('Extracting files to %1' bindWith:aDirectory asString). |
|
3892 | 2575 |
^ true. |
10922 | 2576 |
|
2577 |
"Modified (format): / 29-11-2011 / 18:58:01 / cg" |
|
3892 | 2578 |
! ! |
2579 |
||
2580 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands list'! |
|
2581 |
||
4905 | 2582 |
listAllFiles |
3892 | 2583 |
self archiveFileList value removeAll. |
4905 | 2584 |
self listFiles:nil |
2585 |
! |
|
2586 |
||
17556 | 2587 |
listFiles:aColOfFilesOrNil |
2588 |
|a| |
|
2589 |
||
3892 | 2590 |
process notNil ifTrue:[ |
4803 | 2591 |
process waitUntilTerminated |
3892 | 2592 |
]. |
4803 | 2593 |
|
17556 | 2594 |
(a := archiver) notNil ifTrue:[ |
2595 |
a |
|
4905 | 2596 |
outStream:(self getOutStream) |
2597 |
errorStream:(self getErrorStream) |
|
2598 |
synchron:true. |
|
2599 |
||
2600 |
self |
|
17556 | 2601 |
makeProcessFor:[a listFiles:aColOfFilesOrNil] |
4905 | 2602 |
with:'List files' |
2603 |
] |
|
17556 | 2604 |
|
2605 |
"Modified: / 22-06-2017 / 18:44:15 / cg" |
|
3892 | 2606 |
! ! |
2607 |
||
2608 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands remove'! |
|
2609 |
||
4803 | 2610 |
removeFilesFromArchive |
2611 |
|sel realSel list firtsPre stringCol stringRealSel| |
|
3892 | 2612 |
|
18236 | 2613 |
sel := self selection. |
4803 | 2614 |
stringCol := sel collect:[:item | item fileName]. |
3892 | 2615 |
firtsPre := stringCol at:1. |
4803 | 2616 |
stringCol from:2 do:[:el | firtsPre := firtsPre commonPrefixWith:el]. |
3892 | 2617 |
list := self archiveFileList value. |
4803 | 2618 |
"/ realSel := OrderedCollection new. |
2619 |
"/ list do:[:item | |
|
2620 |
"/ ((item fileName) startsWith:firtsPre) ifTrue:[ |
|
2621 |
"/ realSel add:item |
|
2622 |
"/ ] |
|
2623 |
"/ ]. |
|
2624 |
realSel := list select:[:item | (item fileName) startsWith:firtsPre]. |
|
2625 |
stringRealSel := realSel collect:[:item | item fileName]. |
|
2626 |
||
2627 |
self archiver |
|
2628 |
outStream:nil |
|
2629 |
errorStream:(self getErrorStream) |
|
2630 |
synchron:true. |
|
2631 |
self |
|
2632 |
makeProcessFor:[ self archiver removeFilesFromArchive:stringCol ] |
|
2633 |
with:'Remove files'. |
|
4462
b14fcc67ff8e
removeAll: changed to removeAllFoundIn:
Michael Beyl <mb@exept.de>
parents:
4417
diff
changeset
|
2634 |
self archiveFileList value removeAllFoundIn:realSel |
18236 | 2635 |
|
2636 |
"Modified: / 21-06-2018 / 15:05:58 / Claus Gittinger" |
|
3892 | 2637 |
! ! |
2638 |
||
2639 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'drag & drop'! |
|
2640 |
||
3951 | 2641 |
canDrop:aContext |
2642 |
||
2643 |
^ inDropMode |
|
3892 | 2644 |
! |
2645 |
||
4803 | 2646 |
doDrop:aContext |
3892 | 2647 |
|col source arg objects| |
2648 |
||
2649 |
source := aContext dropSource. |
|
2650 |
arg := source argument. |
|
2651 |
objects := aContext dropObjects. |
|
4803 | 2652 |
col := objects collect:[:dropObject | dropObject theObject]. |
2653 |
^ self addFilesToArchive:col |
|
3892 | 2654 |
! |
2655 |
||
2656 |
doStartDrag:aDropSource in:aView |
|
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2657 |
"set the cursors before starting the drag & drop operation" |
3892 | 2658 |
|
4018 | 2659 |
archiver class canDragnDrop ifFalse:[^ self]. |
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2660 |
super doStartDrag:aDropSource in:aView |
3892 | 2661 |
! |
2662 |
||
3951 | 2663 |
dropEnter:aContext |
6377 | 2664 |
| dropObjects| |
3951 | 2665 |
|
2666 |
inDropMode := false. |
|
2667 |
(aContext dropSource receiver == self) ifTrue:[^ self]. |
|
6377 | 2668 |
dropObjects := aContext dropObjects. |
2669 |
||
17755 | 2670 |
dropObjects do:[:eachDropObject| |
2671 |
|checkObject checkObjectString| |
|
2672 |
||
2673 |
eachDropObject isFileObject ifFalse:[^ self]. |
|
2674 |
checkObject := eachDropObject theObject. |
|
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6214
diff
changeset
|
2675 |
checkObject isFilename ifFalse:[^ self]. |
3951 | 2676 |
checkObject isSpecialFile ifTrue:[^ self]. |
2677 |
]. |
|
2678 |
inDropMode := true. |
|
17755 | 2679 |
|
2680 |
"Modified (format): / 15-11-2017 / 11:10:07 / cg" |
|
3951 | 2681 |
! |
2682 |
||
2683 |
dropLeave:aContext |
|
2684 |
||
2685 |
inDropMode := false. |
|
2686 |
! |
|
2687 |
||
3892 | 2688 |
getDisplayObjects:anArgument |
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2689 |
"retrieve the objects displayed during a drag" |
3892 | 2690 |
|
2691 |
| sel string size fnName stream| |
|
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2692 |
|
18236 | 2693 |
sel := self selection. |
3892 | 2694 |
size := sel size. |
2695 |
size == 0 ifTrue:[^ '']. |
|
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2696 |
|
15594
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
2697 |
stream := CharacterWriteStream new. |
3892 | 2698 |
stream nextPutAll:(sel first fileName asFilename baseName asString). |
2699 |
size == 1 ifTrue:[ |
|
2700 |
fnName := 'ui_menuitem.xpm'. |
|
2701 |
] ifFalse:[ |
|
2702 |
fnName := 'ui_submenu_open.xpm'. |
|
2703 |
stream nextPutAll:' ... '. |
|
2704 |
stream nextPutAll:(sel last fileName asFilename baseName asString). |
|
2705 |
]. |
|
2706 |
string := stream contents. |
|
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2707 |
|
17538 | 2708 |
^ Array with:(LabelAndIcon icon:(Image fromFile:fnName) string:(string allBold)) |
2709 |
||
2710 |
"Modified: / 20-06-2017 / 08:18:07 / cg" |
|
18236 | 2711 |
"Modified: / 21-06-2018 / 15:05:39 / Claus Gittinger" |
3892 | 2712 |
! |
2713 |
||
2714 |
getDropObjects:anArgument |
|
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2715 |
"common code, used in subclasses" |
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2716 |
|
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2717 |
|sel| |
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2718 |
|
18236 | 2719 |
sel := self selection. |
9359
44d36e85cb39
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
9172
diff
changeset
|
2720 |
^ sel collect:[:el| DropObject newFileInArchive:(el fileName asFilename) ]. |
18236 | 2721 |
|
2722 |
"Modified: / 21-06-2018 / 15:05:45 / Claus Gittinger" |
|
3892 | 2723 |
! ! |
2724 |
||
2725 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'event handling'! |
|
2726 |
||
4803 | 2727 |
processEvent:anEvent |
3892 | 2728 |
"filter keyboard events. |
2729 |
Return true, if I have eaten the event" |
|
2730 |
||
18754 | 2731 |
<resource: #keyboard (#Delete #Backspace #Cut #Find)> |
12115 | 2732 |
|
3892 | 2733 |
|focusView key rawKey| |
2734 |
||
2735 |
anEvent isKeyPressEvent ifTrue:[ |
|
2736 |
focusView := anEvent targetView. |
|
2737 |
key := anEvent key. |
|
2738 |
rawKey := anEvent rawKey. |
|
18236 | 2739 |
|
3892 | 2740 |
(focusView isSameOrComponentOf:self window) ifTrue:[ |
18754 | 2741 |
((key == #Delete) |
2742 |
or:[key == #Backspace |
|
2743 |
or:[key == #Cut]]) ifTrue:[ |
|
4803 | 2744 |
self removeFilesFromArchive. |
3892 | 2745 |
^ true |
18236 | 2746 |
]. |
2747 |
(key == #Find) ifTrue:[ |
|
2748 |
self findInName. |
|
2749 |
^ true |
|
4803 | 2750 |
] |
3892 | 2751 |
] |
2752 |
]. |
|
2753 |
^ false |
|
18236 | 2754 |
|
18754 | 2755 |
"Modified: / 04-05-2019 / 15:44:26 / Claus Gittinger" |
3892 | 2756 |
! ! |
2757 |
||
2758 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'initialization & release'! |
|
2759 |
||
2760 |
postBuildFileTable:aWidget |
|
2761 |
||
2762 |
fileTable := aWidget scrolledView. |
|
2763 |
fileTable wantsFocusWithPointerEnter. |
|
2764 |
"/ FileBrowser icons keysAndValuesDo:[:aKey :anIcon| |
|
2765 |
"/ fileTable registerImage:anIcon key:aKey. |
|
2766 |
"/ ]. |
|
2767 |
self columnDescriptors:(self class tableColumns). |
|
2768 |
! |
|
2769 |
||
4803 | 2770 |
postOpenWith:aBuilder |
2771 |
|currentDir contents suffix fileName file archivItem| |
|
3892 | 2772 |
|
2773 |
self windowGroup addPreEventHook:self. |
|
2774 |
self masterApplication isNil ifTrue:[ |
|
2775 |
self masterApplication:nil. |
|
2776 |
currentDir := Filename homeDirectory. |
|
2777 |
contents := currentDir directoryContents. |
|
4803 | 2778 |
fileName := contents |
2779 |
detect:[:file | |
|
2780 |
suffix := file asFilename suffix asLowercase. |
|
2781 |
suffix = 'tgz' |
|
2782 |
] |
|
2783 |
ifNone:[nil]. |
|
2784 |
fileName isNil ifTrue:[ |
|
18579 | 2785 |
Dialog warn:'can''t find a Zip file in ' , currentDir asString. |
3892 | 2786 |
^ self |
2787 |
]. |
|
2788 |
file := currentDir construct:fileName. |
|
3982 | 2789 |
archivItem := DirectoryContentsBrowser itemClass fileName:file. |
3892 | 2790 |
(self item:archivItem) ifFalse:[ |
4803 | 2791 |
Dialog warn:'file type of ' , item fileName asString , ' not supported'. |
2792 |
^ self |
|
2793 |
] |
|
3892 | 2794 |
]. |
4905 | 2795 |
self listAllFiles. |
6626 | 2796 |
super postOpenWith:aBuilder |
18579 | 2797 |
|
2798 |
"Modified: / 05-02-2019 / 10:17:23 / Claus Gittinger" |
|
3892 | 2799 |
! |
2800 |
||
2801 |
release |
|
2802 |
self archiver release. |
|
14065
a6da1191dfc5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13905
diff
changeset
|
2803 |
super release. |
3892 | 2804 |
! ! |
2805 |
||
18236 | 2806 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'menus'! |
2807 |
||
2808 |
fileListMenu |
|
2809 |
^ [ self class fileListMenu ]. |
|
2810 |
||
2811 |
"Created: / 21-06-2018 / 15:01:53 / Claus Gittinger" |
|
2812 |
! ! |
|
2813 |
||
3892 | 2814 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'queries'! |
2815 |
||
2816 |
canDelete |
|
2817 |
||
2818 |
^ (self hasOneSelectionInList and:[archiver class canRemoveFiles]) |
|
2819 |
! |
|
2820 |
||
4001 | 2821 |
canViewFile |
2822 |
||
2823 |
^ self archiver class canViewFile and:[self hasOneSelectionInList] |
|
2824 |
! |
|
2825 |
||
2826 |
hasListEntriesHolder |
|
2827 |
"return/create the 'hasListEntriesHolder' value holder (automatically generated)" |
|
2828 |
||
2829 |
hasListEntriesHolder isNil ifTrue:[ |
|
2830 |
hasListEntriesHolder := false asValue. |
|
2831 |
]. |
|
2832 |
^ hasListEntriesHolder |
|
2833 |
! |
|
2834 |
||
2835 |
hasOneSelectionInList |
|
19139 | 2836 |
^ self selection size == 1 |
18236 | 2837 |
|
2838 |
"Modified: / 21-06-2018 / 15:05:50 / Claus Gittinger" |
|
4001 | 2839 |
! |
2840 |
||
3892 | 2841 |
selRemoveFilesForDirs:aSel |
2842 |
||
2843 |
|stringCol newSel string| |
|
2844 |
||
2845 |
stringCol := (aSel collect:[: item| item fileName]). |
|
2846 |
newSel := aSel copy. |
|
2847 |
aSel do:[:item | |
|
2848 |
item isDirectory ifTrue:[ |
|
2849 |
string := item fileName. |
|
2850 |
stringCol doWithIndex:[:filename : index| |
|
2851 |
(filename ~= string and:[filename startsWith:string]) ifTrue:[ |
|
2852 |
newSel remove:(aSel at:index) ifAbsent:[nil]. |
|
2853 |
] |
|
2854 |
] |
|
2855 |
]. |
|
2856 |
]. |
|
2857 |
^ newSel. |
|
2858 |
! ! |
|
2859 |
||
2860 |
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'sorting'! |
|
2861 |
||
2862 |
generateSortBlock:instanceName |
|
2863 |
||
2864 |
| aSymbol cmpOp sortCaselessLocal| |
|
2865 |
||
2866 |
aSymbol := instanceName asSymbol. |
|
2867 |
sortCaselessLocal := self sortCaseless value. |
|
2868 |
currentSortOrder isNil ifTrue:[ |
|
2869 |
currentSortOrder := aSymbol. |
|
2870 |
currentSortOrder := Dictionary new. |
|
2871 |
currentSortOrder at:#column put:aSymbol. |
|
2872 |
currentSortOrder at:#reverse put:false. |
|
2873 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
2874 |
] ifFalse:[ |
|
2875 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
2876 |
"/ same column like before - change sort order |
|
2877 |
| isReverse | |
|
2878 |
isReverse := currentSortOrder at:#reverse. |
|
2879 |
currentSortOrder at:#reverse put:(isReverse not). |
|
2880 |
] ifFalse:[ |
|
2881 |
"/ another column - remark column |
|
2882 |
currentSortOrder at:#column put:aSymbol. |
|
2883 |
] |
|
2884 |
]. |
|
2885 |
(currentSortOrder at:#reverse) ifTrue:[ |
|
2886 |
cmpOp := #'>' |
|
2887 |
] ifFalse:[ |
|
2888 |
cmpOp := #'<' |
|
2889 |
]. |
|
2890 |
^ [:a :b | |
|
2891 |
|entry1 entry2| |
|
2892 |
||
2893 |
entry1 := (a perform:aSymbol). |
|
2894 |
entry2 := (b perform:aSymbol). |
|
2895 |
aSymbol = #fileName ifTrue:[ |
|
2896 |
sortCaselessLocal ifTrue:[ |
|
2897 |
entry1 := entry1 asString asLowercase. |
|
2898 |
entry2 := entry2 asString asLowercase. |
|
2899 |
] ifFalse:[ |
|
2900 |
entry1 := entry1 asString. |
|
2901 |
entry2 := entry2 asString. |
|
2902 |
]. |
|
2903 |
]. |
|
2904 |
entry1 perform:cmpOp with:entry2 |
|
2905 |
]. |
|
2906 |
! |
|
2907 |
||
2908 |
sortList:instanceName |
|
2909 |
||
2910 |
||
2911 |
|sortBlock fileList sortCol| |
|
2912 |
||
2913 |
sortBlock := self generateSortBlock:instanceName. |
|
2914 |
fileList := self archiveFileList value. |
|
2915 |
sortCol := SortedCollection sortBlock:sortBlock. |
|
2916 |
sortCol addAll:fileList. |
|
2917 |
fileList removeAll. |
|
2918 |
fileList addAll:sortCol. |
|
2919 |
! ! |
|
2920 |
||
2921 |
!FileApplicationNoteBook::ArchiveViewApplication::ArchivItem methodsFor:'accessing'! |
|
2922 |
||
2923 |
compressSize |
|
2924 |
"return the value of the instance variable 'compressSize' (automatically generated)" |
|
2925 |
||
2926 |
^ compressSize |
|
2927 |
! |
|
2928 |
||
2929 |
compressSize:something |
|
2930 |
"set the value of the instance variable 'compressSize' (automatically generated)" |
|
2931 |
||
2932 |
compressSize := something. |
|
2933 |
! |
|
2934 |
||
2935 |
crc |
|
2936 |
"return the value of the instance variable 'crc' (automatically generated)" |
|
2937 |
||
2938 |
^ crc |
|
2939 |
! |
|
2940 |
||
2941 |
crc:something |
|
2942 |
"set the value of the instance variable 'crc' (automatically generated)" |
|
2943 |
||
2944 |
crc := something. |
|
2945 |
! |
|
2946 |
||
2947 |
dateAndTime |
|
2948 |
"return the value of the instance variable 'dateAndTime' (automatically generated)" |
|
2949 |
||
2950 |
^ dateAndTime |
|
2951 |
! |
|
2952 |
||
2953 |
dateAndTime:something |
|
2954 |
"set the value of the instance variable 'dateAndTime' (automatically generated)" |
|
2955 |
||
2956 |
dateAndTime := something. |
|
2957 |
! |
|
2958 |
||
5414 | 2959 |
day:day |
9402 | 2960 |
|ts| |
5414 | 2961 |
|
2962 |
dateAndTime isNil ifTrue:[ |
|
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
2963 |
ts := Timestamp now. |
5414 | 2964 |
] ifFalse:[ |
2965 |
ts := dateAndTime |
|
2966 |
]. |
|
2967 |
||
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
2968 |
dateAndTime := Timestamp |
9402 | 2969 |
year:ts year |
2970 |
month:ts month |
|
5414 | 2971 |
day:day |
9402 | 2972 |
hour:ts hour |
2973 |
minute:ts minutes |
|
2974 |
second:ts minutes |
|
5414 | 2975 |
! |
2976 |
||
2977 |
dayString:dayString |
|
2978 |
self day:(Integer readFrom:dayString) |
|
2979 |
! |
|
2980 |
||
3892 | 2981 |
fileName |
2982 |
"return the value of the instance variable 'fileName' (automatically generated)" |
|
2983 |
||
2984 |
^ fileName |
|
2985 |
! |
|
2986 |
||
2987 |
fileName:something |
|
2988 |
"set the value of the instance variable 'fileName' (automatically generated)" |
|
2989 |
||
2990 |
fileName := something withoutSpaces. |
|
2991 |
! |
|
2992 |
||
2993 |
icon |
|
2994 |
"return the value of the instance variable 'icon' (automatically generated)" |
|
2995 |
||
2996 |
^ icon |
|
2997 |
! |
|
2998 |
||
2999 |
icon:something |
|
3000 |
"set the value of the instance variable 'icon' (automatically generated)" |
|
3001 |
||
3002 |
icon := something. |
|
3003 |
! |
|
3004 |
||
3005 |
isDirectory |
|
3006 |
"return the value of the instance variable 'directory' (automatically generated)" |
|
3007 |
||
3008 |
^ isDirectory |
|
3009 |
! |
|
3010 |
||
3011 |
isDirectory:something |
|
3012 |
"set the value of the instance variable 'isDirectory' (automatically generated)" |
|
3013 |
||
3014 |
isDirectory := something. |
|
3015 |
! |
|
3016 |
||
3017 |
method |
|
3018 |
"return the value of the instance variable 'method' (automatically generated)" |
|
3019 |
||
3020 |
^ method |
|
3021 |
! |
|
3022 |
||
3023 |
method:something |
|
3024 |
"set the value of the instance variable 'method' (automatically generated)" |
|
3025 |
||
3026 |
method := something. |
|
3027 |
! |
|
3028 |
||
5414 | 3029 |
month:month |
9402 | 3030 |
|ts| |
5414 | 3031 |
|
3032 |
dateAndTime isNil ifTrue:[ |
|
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
3033 |
ts := Timestamp now. |
5414 | 3034 |
] ifFalse:[ |
3035 |
ts := dateAndTime |
|
3036 |
]. |
|
3037 |
||
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
3038 |
dateAndTime := Timestamp |
9402 | 3039 |
year:ts year |
5414 | 3040 |
month:month |
9402 | 3041 |
day:ts day |
3042 |
hour:ts hour |
|
3043 |
minute:ts minutes |
|
3044 |
second:ts minutes |
|
5414 | 3045 |
! |
3046 |
||
3047 |
monthName:monthName |
|
3048 |
self month:(Date indexOfMonth:monthName) |
|
3049 |
! |
|
3050 |
||
3892 | 3051 |
ownerGroup |
3052 |
"return the value of the instance variable 'owner' (automatically generated)" |
|
3053 |
||
3054 |
^ ownerGroup |
|
3055 |
! |
|
3056 |
||
3057 |
ownerGroup:something |
|
3058 |
"set the value of the instance variable 'owner' (automatically generated)" |
|
3059 |
||
3060 |
ownerGroup := something. |
|
3061 |
! |
|
3062 |
||
3063 |
permissions |
|
3064 |
"return the value of the instance variable 'permissions' (automatically generated)" |
|
3065 |
||
3066 |
^ permissions |
|
3067 |
! |
|
3068 |
||
3069 |
permissions:something |
|
3070 |
"set the value of the instance variable 'permissions' (automatically generated)" |
|
3071 |
||
3072 |
permissions := something. |
|
3073 |
! |
|
3074 |
||
3075 |
ratio |
|
3076 |
"return the value of the instance variable 'ratio' (automatically generated)" |
|
3077 |
||
3078 |
^ ratio |
|
3079 |
! |
|
3080 |
||
3081 |
ratio:something |
|
3082 |
"set the value of the instance variable 'ratio' (automatically generated)" |
|
3083 |
||
3084 |
ratio := something. |
|
3085 |
! |
|
3086 |
||
3087 |
size |
|
3088 |
"return the value of the instance variable 'size' (automatically generated)" |
|
3089 |
||
3090 |
^ size |
|
3091 |
! |
|
3092 |
||
3093 |
size:something |
|
3094 |
"set the value of the instance variable 'size' (automatically generated)" |
|
3095 |
||
3096 |
size := something. |
|
3097 |
! |
|
3098 |
||
3099 |
sizeAsNumber |
|
3100 |
"return the value of the instance variable 'size' (automatically generated)" |
|
3101 |
||
3102 |
^ size asInteger |
|
3103 |
! |
|
3104 |
||
5414 | 3105 |
time:time |
9402 | 3106 |
|ts| |
5414 | 3107 |
|
3108 |
dateAndTime isNil ifTrue:[ |
|
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
3109 |
ts := Timestamp now. |
5414 | 3110 |
] ifFalse:[ |
3111 |
ts := dateAndTime |
|
3112 |
]. |
|
3113 |
||
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
3114 |
dateAndTime := Timestamp |
9402 | 3115 |
year:ts day |
3116 |
month:ts day |
|
3117 |
day:ts day |
|
5414 | 3118 |
hour:time hours |
9402 | 3119 |
minute:time minutes |
3120 |
second:time seconds |
|
5414 | 3121 |
! |
3122 |
||
3123 |
timeString:timeString |
|
3124 |
self time:(Time readFrom:timeString) |
|
3125 |
! |
|
3126 |
||
3892 | 3127 |
type |
3128 |
"return the value of the instance variable 'type' (automatically generated)" |
|
3129 |
||
3130 |
^ type |
|
3131 |
! |
|
3132 |
||
3133 |
type:something |
|
3134 |
"set the value of the instance variable 'type' (automatically generated)" |
|
3135 |
||
3136 |
type := something. |
|
3137 |
! |
|
3138 |
||
3139 |
version |
|
3140 |
"return the value of the instance variable 'version' (automatically generated)" |
|
3141 |
||
3142 |
^ version |
|
3143 |
! |
|
3144 |
||
3145 |
version:something |
|
3146 |
"set the value of the instance variable 'version' (automatically generated)" |
|
3147 |
||
3148 |
version := something. |
|
5414 | 3149 |
! |
3150 |
||
3151 |
year:year |
|
9402 | 3152 |
|ts| |
5414 | 3153 |
|
3154 |
dateAndTime isNil ifTrue:[ |
|
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
3155 |
ts := Timestamp now. |
5414 | 3156 |
] ifFalse:[ |
3157 |
ts := dateAndTime |
|
3158 |
]. |
|
3159 |
||
5784
11ee27b3b78f
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
5745
diff
changeset
|
3160 |
dateAndTime := Timestamp |
5414 | 3161 |
year:year |
9402 | 3162 |
month:ts month |
3163 |
day:ts day |
|
3164 |
hour:ts hour |
|
3165 |
minute:ts minutes |
|
3166 |
second:ts minutes |
|
5414 | 3167 |
! |
3168 |
||
3169 |
yearString:yearString |
|
3170 |
self year:(Integer readFrom:yearString) |
|
3892 | 3171 |
! ! |
3172 |
||
3173 |
!FileApplicationNoteBook::ArchiveViewApplication::ArchivItem methodsFor:'printing'! |
|
3174 |
||
8002
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
3175 |
printOn:aStream |
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
3176 |
aStream nextPutAll:self fileName asString |
3892 | 3177 |
! ! |
3178 |
||
3179 |
!FileApplicationNoteBook::ArchiveViewApplication::ArchivItem methodsFor:'queries'! |
|
3180 |
||
3181 |
hasDirectoryPart |
|
18579 | 3182 |
|components| |
3183 |
||
3184 |
components := self fileName asFilename components. |
|
3185 |
components first = '.' ifTrue:[ |
|
19153 | 3186 |
^ components size ~~ 2 |
18579 | 3187 |
]. |
19153 | 3188 |
^ components size ~~ 1 |
18579 | 3189 |
|
3190 |
"Modified: / 05-02-2019 / 10:44:41 / Claus Gittinger" |
|
3892 | 3191 |
! ! |
3192 |
||
3193 |
!FileApplicationNoteBook::CommandResult class methodsFor:'defaults'! |
|
3194 |
||
3195 |
tabStringFor:aApplicationType |
|
7687 | 3196 |
"the formatString shown in a tab (language translated)" |
3197 |
||
3198 |
^ 'Command Output' |
|
3199 |
||
3200 |
"Modified: / 01-03-2007 / 21:43:31 / cg" |
|
3892 | 3201 |
! |
3202 |
||
3203 |
wantNewApplicationAnyway |
|
3204 |
||
3205 |
^ false |
|
3206 |
! ! |
|
3207 |
||
3208 |
!FileApplicationNoteBook::CommandResult class methodsFor:'interface specs'! |
|
3209 |
||
3210 |
windowSpec |
|
3211 |
"This resource specification was automatically generated |
|
3212 |
by the UIPainter of ST/X." |
|
3213 |
||
3214 |
"Do not manually edit this!! If it is corrupted, |
|
3215 |
the UIPainter may not be able to read the specification." |
|
3216 |
||
3217 |
" |
|
4169 | 3218 |
UIPainter new openOnClass:FileApplicationNoteBook::CommandResult andSelector:#windowSpec |
3219 |
FileApplicationNoteBook::CommandResult new openInterface:#windowSpec |
|
3220 |
FileApplicationNoteBook::CommandResult open |
|
3892 | 3221 |
" |
3222 |
||
3223 |
<resource: #canvas> |
|
3224 |
||
3225 |
^ |
|
3226 |
#(#FullSpec |
|
3227 |
#name: #windowSpec |
|
3228 |
#window: |
|
3229 |
#(#WindowSpec |
|
3230 |
#label: 'NoteBookApplication::CommandResult' |
|
3231 |
#name: 'NoteBookApplication::CommandResult' |
|
3232 |
#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
|
3233 |
#bounds: #(#Rectangle 220 193 723 546) |
3892 | 3234 |
#menu: #mainMenu |
3235 |
) |
|
3236 |
#component: |
|
3237 |
#(#SpecCollection |
|
3238 |
#collection: #( |
|
3239 |
#(#MenuPanelSpec |
|
3240 |
#name: 'ToolBar1' |
|
3241 |
#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
|
3242 |
#level: 0 |
3892 | 3243 |
#menu: #menu |
3244 |
#textDefault: true |
|
3245 |
) |
|
3246 |
#(#ArbitraryComponentSpec |
|
3247 |
#name: 'ArbitraryComponent1' |
|
3248 |
#layout: #(#LayoutFrame 0 0.0 32 0 0 1.0 0 1) |
|
3249 |
#hasHorizontalScrollBar: true |
|
3250 |
#hasVerticalScrollBar: true |
|
3251 |
#hasBorder: false |
|
3252 |
#component: #TextCollector |
|
3253 |
#postBuildCallback: #postBuildTextCollector: |
|
3254 |
) |
|
4169 | 3255 |
#(#ProgressIndicatorSpec |
3256 |
#name: 'ProgressIndicator1' |
|
3257 |
#layout: #(#LayoutFrame 125 0 11 0 231 0 21 0) |
|
4180 | 3258 |
#visibilityChannel: #enableStopButton |
4169 | 3259 |
#backgroundColor: #(#Color 0.0 66.9993 66.9993) |
3260 |
#showPercentage: false |
|
3261 |
#isActivityIndicator: true |
|
3892 | 3262 |
) |
3263 |
) |
|
3264 |
||
3265 |
) |
|
3266 |
) |
|
3267 |
! ! |
|
3268 |
||
3269 |
!FileApplicationNoteBook::CommandResult class methodsFor:'menu specs'! |
|
3270 |
||
3271 |
menu |
|
3272 |
"This resource specification was automatically generated |
|
3273 |
by the MenuEditor of ST/X." |
|
3274 |
||
3275 |
"Do not manually edit this!! If it is corrupted, |
|
3276 |
the MenuEditor may not be able to read the specification." |
|
3277 |
||
3278 |
" |
|
3279 |
MenuEditor new openOnClass:FileApplicationNoteBook::CommandResult andSelector:#menu |
|
3280 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::CommandResult menu)) startUp |
|
3281 |
" |
|
3282 |
||
3283 |
<resource: #menu> |
|
3284 |
||
3285 |
^ |
|
3286 |
#(#Menu |
|
3287 |
#( |
|
3288 |
#(#MenuItem |
|
3289 |
#label: 'Stop' |
|
3290 |
#translateLabel: true |
|
3291 |
#isButton: true |
|
3292 |
#nameKey: #Stop |
|
3293 |
#value: #doStopProcess |
|
3294 |
#enabled: #enableStopButton |
|
3295 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #stop22x22Icon 'Stop') |
|
3296 |
) |
|
3297 |
#(#MenuItem |
|
6100 | 3298 |
#activeHelpKey: #closeTabButton |
3892 | 3299 |
#label: 'Close' |
3300 |
#translateLabel: true |
|
3301 |
#isButton: true |
|
3302 |
#nameKey: #Close |
|
11099 | 3303 |
#isVisible: #closeButtonShown |
3892 | 3304 |
#startGroup: #right |
3305 |
#value: #doClose |
|
6093 | 3306 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #removeTabIcon) |
3892 | 3307 |
) |
3308 |
) |
|
3309 |
nil |
|
3310 |
nil |
|
3311 |
) |
|
11099 | 3312 |
|
3313 |
"Modified: / 12-01-2012 / 00:33:56 / cg" |
|
3892 | 3314 |
! ! |
3315 |
||
3316 |
!FileApplicationNoteBook::CommandResult methodsFor:'accessing'! |
|
3317 |
||
3318 |
resultStream |
|
3319 |
"return the value of the instance variable 'resultStream' (automatically generated)" |
|
3320 |
||
3321 |
^ resultStream |
|
3322 |
! |
|
3323 |
||
3324 |
resultStream:something |
|
3325 |
"set the value of the instance variable 'resultStream' (automatically generated)" |
|
3326 |
||
3327 |
resultStream := something. |
|
3328 |
! ! |
|
3329 |
||
3330 |
!FileApplicationNoteBook::CommandResult methodsFor:'actions'! |
|
3331 |
||
3332 |
changeTabTo:aString |
|
3333 |
||
3334 |
| masterApplication | |
|
3335 |
||
3336 |
masterApplication := self masterApplication. |
|
3337 |
masterApplication isNil ifFalse:[ |
|
3338 |
masterApplication tabStringChangeTo:aString for:self. |
|
3339 |
]. |
|
3340 |
! |
|
3341 |
||
3342 |
doStopProcess |
|
3343 |
||
3344 |
| myProcess | |
|
3345 |
||
3346 |
myProcess := self process value. |
|
3347 |
myProcess notNil ifTrue:[ |
|
4523 | 3348 |
self notify:('kill ', myProcess name). |
3892 | 3349 |
myProcess terminate. |
3350 |
]. |
|
3351 |
! ! |
|
3352 |
||
3353 |
!FileApplicationNoteBook::CommandResult methodsFor:'aspects'! |
|
3354 |
||
3355 |
enableStopButton |
|
3356 |
||
3357 |
enableStopButton isNil ifTrue:[ |
|
3358 |
enableStopButton := false asValue. |
|
3359 |
]. |
|
3360 |
^ enableStopButton |
|
3361 |
! |
|
3362 |
||
3363 |
process |
|
3364 |
"return/create the 'process' value holder (automatically generated)" |
|
3365 |
||
3366 |
process isNil ifTrue:[ |
|
3367 |
process := ValueHolder new. |
|
3368 |
process addDependent:self. |
|
3369 |
]. |
|
3370 |
^ process |
|
3371 |
! ! |
|
3372 |
||
3373 |
!FileApplicationNoteBook::CommandResult methodsFor:'change & update'! |
|
3374 |
||
3375 |
update:something with:aParameter from:changedObject |
|
3376 |
changedObject == self process ifTrue:[ |
|
3377 |
self enableStopButton value:changedObject value notNil. |
|
3378 |
^ self |
|
3379 |
]. |
|
3380 |
super update:something with:aParameter from:changedObject |
|
3381 |
! ! |
|
3382 |
||
3383 |
!FileApplicationNoteBook::CommandResult methodsFor:'initialization & release'! |
|
3384 |
||
3385 |
postBuildTextCollector:aBuilder |
|
3386 |
||
3387 |
self resultStream:aBuilder scrolledView. |
|
3388 |
! |
|
3389 |
||
3390 |
postOpenWith:aBuilder |
|
3391 |
"This is a hook method generated by the Browser. |
|
3392 |
It will be invoked right after the applications window has been opened. |
|
3393 |
Add any app-specific actions here (starting background processes etc.). |
|
3394 |
See also #postBuildWith:, which is invoked before opening." |
|
3395 |
||
3396 |
"/ add any code here ... |
|
3397 |
||
3398 |
self masterApplication isNil ifTrue:[ |
|
3399 |
self masterApplication:nil. |
|
3400 |
]. |
|
6626 | 3401 |
super postOpenWith:aBuilder |
3892 | 3402 |
! |
3403 |
||
3404 |
release |
|
3405 |
||
3406 |
self doStopProcess. |
|
14065
a6da1191dfc5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13905
diff
changeset
|
3407 |
super release |
3892 | 3408 |
! ! |
3409 |
||
3410 |
!FileApplicationNoteBook::CommandResult methodsFor:'printing'! |
|
3411 |
||
8002
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
3412 |
printOn:aStream |
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
3413 |
aStream nextPutAll:'CommandResult Application'. |
3892 | 3414 |
! ! |
3415 |
||
7909 | 3416 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'defaults'! |
3417 |
||
3418 |
tabStringFor:anApplicationType |
|
3419 |
"the formatString shown in a tab (language translated)" |
|
3420 |
||
3421 |
^ 'Note in %1' |
|
3422 |
||
3423 |
"Modified: / 01-03-2007 / 21:43:23 / cg" |
|
3424 |
! ! |
|
3425 |
||
3426 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'documentation'! |
|
3427 |
||
3428 |
documentation |
|
3429 |
" |
|
3430 |
a previewer-plugin for digital-notepad recordings as |
|
3431 |
provided by the waltop (tevion) MD85276 digital ink notepad. |
|
3432 |
" |
|
3433 |
! ! |
|
3434 |
||
3435 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'help specs'! |
|
3436 |
||
17900 | 3437 |
helpSpec |
7909 | 3438 |
"This resource specification was automatically generated |
3439 |
by the UIHelpTool of ST/X." |
|
3440 |
||
3441 |
"Do not manually edit this!! If it is corrupted, |
|
3442 |
the UIHelpTool may not be able to read the specification." |
|
3443 |
||
3444 |
" |
|
3445 |
UIHelpTool openOnClass:FileApplicationNoteBook::HtmlViewApplication |
|
3446 |
" |
|
3447 |
||
3448 |
<resource: #help> |
|
3449 |
||
17900 | 3450 |
^ super helpSpec addPairsFrom:#( |
7909 | 3451 |
|
3452 |
#'fitImageSize' |
|
3453 |
'Shrink to Fit View' |
|
3454 |
||
3455 |
) |
|
3456 |
! ! |
|
3457 |
||
3458 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'interface specs'! |
|
3459 |
||
3460 |
windowSpec |
|
3461 |
"This resource specification was automatically generated |
|
3462 |
by the UIPainter of ST/X." |
|
3463 |
||
3464 |
"Do not manually edit this!! If it is corrupted, |
|
3465 |
the UIPainter may not be able to read the specification." |
|
3466 |
||
3467 |
" |
|
3468 |
UIPainter new openOnClass:FileApplicationNoteBook::DigitalNotepadFileViewApplication andSelector:#windowSpec |
|
3469 |
FileApplicationNoteBook::DigitalNotepadFileViewApplication new openInterface:#windowSpec |
|
3470 |
FileApplicationNoteBook::DigitalNotepadFileViewApplication open |
|
3471 |
" |
|
3472 |
||
3473 |
<resource: #canvas> |
|
3474 |
||
3475 |
^ |
|
3476 |
#(FullSpec |
|
3477 |
name: windowSpec |
|
3478 |
window: |
|
3479 |
(WindowSpec |
|
3480 |
label: 'NotepadViewer' |
|
3481 |
name: 'NotepadViewer' |
|
3482 |
min: (Point 10 10) |
|
3483 |
bounds: (Rectangle 0 0 676 492) |
|
3484 |
menu: mainMenu |
|
3485 |
) |
|
3486 |
component: |
|
3487 |
(SpecCollection |
|
3488 |
collection: ( |
|
3489 |
(MenuPanelSpec |
|
3490 |
name: 'Menu' |
|
3491 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
3492 |
level: 0 |
|
3493 |
visibilityChannel: isEmbeddedApplication |
|
3494 |
menu: menu |
|
3495 |
textDefault: true |
|
3496 |
) |
|
3497 |
(ArbitraryComponentSpec |
|
3498 |
name: 'TOPFileView' |
|
3499 |
layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0) |
|
3500 |
hasHorizontalScrollBar: true |
|
3501 |
hasVerticalScrollBar: true |
|
3502 |
miniScrollerHorizontal: false |
|
3503 |
miniScrollerVertical: false |
|
3504 |
hasBorder: false |
|
3505 |
component: TOPFileViewer |
|
3506 |
postBuildCallback: postBuildImageView: |
|
3507 |
) |
|
3508 |
) |
|
3509 |
||
3510 |
) |
|
3511 |
) |
|
3512 |
! ! |
|
3513 |
||
3514 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'menu specs'! |
|
3515 |
||
3516 |
menu |
|
3517 |
"This resource specification was automatically generated |
|
3518 |
by the MenuEditor of ST/X." |
|
3519 |
||
3520 |
"Do not manually edit this!! If it is corrupted, |
|
3521 |
the MenuEditor may not be able to read the specification." |
|
3522 |
||
3523 |
" |
|
3524 |
MenuEditor new openOnClass:FileApplicationNoteBook::ImageViewApplication andSelector:#menu |
|
3525 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ImageViewApplication menu)) startUp |
|
3526 |
" |
|
3527 |
||
3528 |
<resource: #menu> |
|
3529 |
||
3530 |
^ |
|
3531 |
#(#Menu |
|
3532 |
#( |
|
3533 |
"/ #(#MenuItem |
|
3534 |
"/ #label: 'Edit' |
|
3535 |
"/ #itemValue: #editImage |
|
3536 |
"/ #nameKey: #EditImage |
|
3537 |
"/ #translateLabel: true |
|
3538 |
"/ #isButton: true |
|
3539 |
"/ #labelImage: #(#ResourceRetriever #ToolbarIconLibrary #startImageEditorIcon) |
|
3540 |
"/ ) |
|
3541 |
"/ #(#MenuItem |
|
3542 |
"/ #label: '-' |
|
3543 |
"/ ) |
|
3544 |
#(#MenuItem |
|
3545 |
#activeHelpKey: #fitImageSize |
|
3546 |
#label: 'FitSize' |
|
3547 |
#translateLabel: true |
|
3548 |
#isButton: true |
|
3549 |
#triggerOnDown: true |
|
3550 |
#indication: #fitSize |
|
3551 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #fitImageSizeToViewIcon) |
|
3552 |
) |
|
3553 |
#(#MenuItem |
|
3554 |
#label: '-' |
|
3555 |
) |
|
3556 |
#(#MenuItem |
|
3557 |
#activeHelpKey: #closeTabButton |
|
3558 |
#label: 'Close' |
|
3559 |
#itemValue: #doClose |
|
3560 |
#translateLabel: true |
|
3561 |
#isButton: true |
|
3562 |
#startGroup: #right |
|
3563 |
#hideMenuOnActivated: false |
|
3564 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #removeTabIcon) |
|
3565 |
) |
|
3566 |
) |
|
3567 |
nil |
|
3568 |
nil |
|
3569 |
) |
|
3570 |
! ! |
|
3571 |
||
3572 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'queries'! |
|
3573 |
||
3574 |
canOpenItem:anItem |
|
3575 |
^ anItem mimeType = 'application/x-waltop-digital-notepad' |
|
3576 |
! |
|
3577 |
||
3578 |
wantNewApplicationAnyway |
|
3579 |
||
3580 |
^ false |
|
3581 |
! ! |
|
3582 |
||
3583 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'accessing'! |
|
3584 |
||
3585 |
imageView |
|
3586 |
^ imageView |
|
3587 |
! |
|
3588 |
||
3589 |
imageView:something |
|
3590 |
imageView := something. |
|
3591 |
! |
|
3592 |
||
3593 |
updateImageInfo |
|
3594 |
"/ |fn msg| |
|
3595 |
"/ |
|
3596 |
"/ image notNil ifTrue:[ |
|
3597 |
"/ fn := image fileName. |
|
3598 |
"/ fn isNil ifTrue:[ |
|
3599 |
"/ fn := 'unnamed' |
|
3600 |
"/ ] ifFalse:[ |
|
3601 |
"/ fn := fn asFilename baseName. |
|
3602 |
"/ ]. |
|
3603 |
"/ msg := '%1 %2x%3 depth:%4' |
|
3604 |
"/ bindWith:fn allBold |
|
3605 |
"/ with:image width |
|
3606 |
"/ with:image height |
|
3607 |
"/ with:image depth. |
|
3608 |
"/ ]. |
|
3609 |
"/ self notify:msg. |
|
3610 |
! ! |
|
3611 |
||
3612 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'actions'! |
|
3613 |
||
3614 |
changeItem:anItem |
|
3615 |
||
3616 |
self item:anItem. |
|
3617 |
self setupImageView. |
|
3618 |
^ true |
|
3619 |
! |
|
3620 |
||
3621 |
setupImageView |
|
3622 |
imageView readFile:self fileName |
|
3623 |
! ! |
|
3624 |
||
3625 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'aspects'! |
|
3626 |
||
3627 |
fitSize |
|
3628 |
"return/create the 'fitSize' value holder (automatically generated)" |
|
3629 |
||
3630 |
fitSize isNil ifTrue:[ |
|
3631 |
fitSize := ValueHolder new. |
|
3632 |
fitSize addDependent:self. |
|
3633 |
]. |
|
3634 |
^ fitSize |
|
3635 |
! ! |
|
3636 |
||
3637 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'change & update'! |
|
3638 |
||
3639 |
update:something with:aParameter from:changedObject |
|
3640 |
changedObject == self fitSize ifTrue:[ |
|
7910 | 3641 |
changedObject value ifTrue:[ |
3642 |
imageView adjust:#fit. |
|
3643 |
] ifFalse:[ |
|
3644 |
imageView adjust:nil. |
|
3645 |
]. |
|
7909 | 3646 |
^ self |
3647 |
]. |
|
3648 |
super update:something with:aParameter from:changedObject |
|
3649 |
! ! |
|
3650 |
||
3651 |
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'initialization & release'! |
|
3652 |
||
3653 |
postBuildImageView:aWidget |
|
3654 |
||
3655 |
self imageView: aWidget scrolledView. |
|
3656 |
"/ self imageView wantsFocusWithPointerEnter. |
|
3657 |
! |
|
3658 |
||
3659 |
postOpenWith:aBuilder |
|
3660 |
"only invoked if the application is not started from a master" |
|
3661 |
||
3662 |
|currentDir contents fileName| |
|
3663 |
||
3664 |
self masterApplication isNil ifTrue:[ |
|
3665 |
self masterApplication:nil. |
|
3666 |
currentDir := Filename currentDirectory. |
|
3667 |
contents := currentDir directoryContents. |
|
3668 |
fileName := contents |
|
3669 |
detect:[:file | |
|
3670 |
file asFilename mimeTypeOfContents = 'application/x-waltop-digital-notepad' |
|
3671 |
] |
|
3672 |
ifNone:[nil]. |
|
3673 |
fileName isNil ifTrue:[ |
|
3674 |
Dialog warn:'Cant find a TOP-file in ' , currentDir asString. |
|
3675 |
^ self |
|
3676 |
]. |
|
3677 |
self item:(DirectoryContentsBrowser itemClass fileName:(currentDir construct:fileName)) |
|
3678 |
]. |
|
3679 |
self setupImageView. |
|
3680 |
super postOpenWith:aBuilder |
|
3681 |
! ! |
|
3682 |
||
3892 | 3683 |
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'defaults'! |
3684 |
||
3685 |
tabStringFor:aApplicationType |
|
7687 | 3686 |
"the formatString shown in a tab (language translated)" |
3687 |
||
3688 |
^ 'HTML View for %1' |
|
3689 |
||
3690 |
"Modified: / 01-03-2007 / 21:43:18 / cg" |
|
3892 | 3691 |
! ! |
3692 |
||
5406 | 3693 |
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'help specs'! |
3694 |
||
3695 |
helpSpec |
|
3696 |
"This resource specification was automatically generated |
|
3697 |
by the UIHelpTool of ST/X." |
|
3698 |
||
3699 |
"Do not manually edit this!! If it is corrupted, |
|
3700 |
the UIHelpTool may not be able to read the specification." |
|
3701 |
||
3702 |
" |
|
3703 |
UIHelpTool openOnClass:FileApplicationNoteBook::HtmlViewApplication |
|
3704 |
" |
|
3705 |
||
3706 |
<resource: #help> |
|
3707 |
||
3708 |
^ super helpSpec addPairsFrom:#( |
|
3709 |
||
3710 |
#'Edit Source' |
|
3711 |
'' |
|
3712 |
||
3713 |
) |
|
3714 |
! ! |
|
3715 |
||
3892 | 3716 |
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'interface specs'! |
3717 |
||
3718 |
windowSpec |
|
10566 | 3719 |
|
3720 |
| webKitView | |
|
3721 |
||
3722 |
^((webKitView := (Smalltalk at:#WebKitView)) notNil |
|
3723 |
and:[webKitView isAvailable]) |
|
3724 |
ifTrue:[self windowSpec_WebBrowserPage] |
|
3725 |
ifFalse:[self windowSpec_HTMLView] |
|
3726 |
||
3727 |
"Modified: / 11-08-2011 / 00:33:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3728 |
! |
|
3729 |
||
3730 |
windowSpec_HTMLView |
|
3892 | 3731 |
"This resource specification was automatically generated |
3732 |
by the UIPainter of ST/X." |
|
3733 |
||
3734 |
"Do not manually edit this!! If it is corrupted, |
|
3735 |
the UIPainter may not be able to read the specification." |
|
3736 |
||
3737 |
" |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
3738 |
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
|
3739 |
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
|
3740 |
FileApplicationNoteBook::HtmlViewApplication open |
3892 | 3741 |
" |
3742 |
||
3743 |
<resource: #canvas> |
|
3744 |
||
3745 |
^ |
|
3746 |
#(#FullSpec |
|
3747 |
#name: #windowSpec |
|
3748 |
#window: |
|
3749 |
#(#WindowSpec |
|
3750 |
#label: 'NoteBookApplication::HtmlView' |
|
3751 |
#name: 'NoteBookApplication::HtmlView' |
|
3752 |
#min: #(#Point 10 10) |
|
3753 |
#bounds: #(#Rectangle 16 42 692 534) |
|
3754 |
#menu: #mainMenu |
|
3755 |
) |
|
3756 |
#component: |
|
3757 |
#(#SpecCollection |
|
3758 |
#collection: #( |
|
3759 |
#(#MenuPanelSpec |
|
3760 |
#name: 'MenuHtml' |
|
3761 |
#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
|
3762 |
#level: 0 |
3892 | 3763 |
#visibilityChannel: #isEmbeddedApplication |
3764 |
#menu: #menu |
|
3765 |
#textDefault: true |
|
3766 |
) |
|
3767 |
#(#ArbitraryComponentSpec |
|
3768 |
#name: 'HTMLView' |
|
3769 |
#layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1) |
|
3770 |
#hasHorizontalScrollBar: true |
|
3771 |
#hasVerticalScrollBar: true |
|
3772 |
#miniScrollerHorizontal: false |
|
3773 |
#miniScrollerVertical: false |
|
3774 |
#hasBorder: false |
|
3775 |
#component: #HTMLDocumentView |
|
3776 |
#postBuildCallback: #postBuildHtmlView: |
|
3777 |
) |
|
3778 |
#(#LabelSpec |
|
3779 |
#label: 'FileLabel' |
|
3780 |
#name: 'FileLabel' |
|
3781 |
#layout: #(#LayoutFrame 212 0 2 0 -73 1 30 0) |
|
3782 |
#level: -1 |
|
3783 |
#translateLabel: true |
|
3784 |
#labelChannel: #labelHolder |
|
3785 |
#adjust: #left |
|
3786 |
) |
|
3787 |
) |
|
3788 |
||
3789 |
) |
|
3790 |
) |
|
10566 | 3791 |
|
3792 |
"Created: / 11-08-2011 / 00:19:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3793 |
! |
|
3794 |
||
3795 |
windowSpec_WebBrowserPage |
|
3796 |
"This resource specification was automatically generated |
|
3797 |
by the UIPainter of ST/X." |
|
3798 |
||
3799 |
"Do not manually edit this!! If it is corrupted, |
|
3800 |
the UIPainter may not be able to read the specification." |
|
3801 |
||
3802 |
" |
|
3803 |
UIPainter new openOnClass:FileApplicationNoteBook::HtmlViewApplication andSelector:#windowSpec_WebBrowserPage |
|
3804 |
FileApplicationNoteBook::HtmlViewApplication new openInterface:#windowSpec_WebBrowserPage |
|
3805 |
" |
|
3806 |
||
3807 |
<resource: #canvas> |
|
3808 |
||
3809 |
^ |
|
3810 |
#(FullSpec |
|
3811 |
name: #'windowSpec_WebBrowserPage' |
|
3812 |
window: |
|
3813 |
(WindowSpec |
|
3814 |
label: 'NoteBookApplication::HtmlView' |
|
3815 |
name: 'NoteBookApplication::HtmlView' |
|
3816 |
min: (Point 10 10) |
|
3817 |
bounds: (Rectangle 0 0 676 492) |
|
3818 |
menu: menuJustClose |
|
3819 |
) |
|
3820 |
component: |
|
3821 |
(SpecCollection |
|
3822 |
collection: ( |
|
3823 |
(MenuPanelSpec |
|
3824 |
name: 'MenuClose' |
|
3825 |
layout: (LayoutFrame -25 1 0 0 0 1.0 30 0) |
|
3826 |
level: 0 |
|
3827 |
visibilityChannel: isEmbeddedApplication |
|
3828 |
menu: menuJustClose |
|
3829 |
textDefault: true |
|
3830 |
) |
|
3831 |
(SubCanvasSpec |
|
3832 |
name: 'ToolBar' |
|
3833 |
layout: (LayoutFrame 0 0 0 0 -25 1 30 0) |
|
3834 |
hasHorizontalScrollBar: false |
|
3835 |
hasVerticalScrollBar: false |
|
3836 |
minorKey: toolBarSpec |
|
3837 |
clientKey: webBrowserPage |
|
3838 |
createNewBuilder: false |
|
3839 |
) |
|
3840 |
(SubCanvasSpec |
|
3841 |
name: 'Content' |
|
3842 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
3843 |
hasHorizontalScrollBar: false |
|
3844 |
hasVerticalScrollBar: false |
|
3845 |
minorKey: contentSpec |
|
3846 |
clientKey: webBrowserPage |
|
3847 |
createNewBuilder: false |
|
3848 |
) |
|
3849 |
) |
|
3850 |
||
3851 |
) |
|
3852 |
) |
|
3853 |
||
3854 |
"Modified: / 11-08-2011 / 00:34:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3892 | 3855 |
! ! |
3856 |
||
3857 |
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'menu specs'! |
|
3858 |
||
3859 |
menu |
|
3860 |
"This resource specification was automatically generated |
|
3861 |
by the MenuEditor of ST/X." |
|
3862 |
||
3863 |
"Do not manually edit this!! If it is corrupted, |
|
3864 |
the MenuEditor may not be able to read the specification." |
|
3865 |
||
3866 |
" |
|
3867 |
MenuEditor new openOnClass:FileApplicationNoteBook::HtmlViewApplication andSelector:#menu |
|
3868 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::HtmlViewApplication menu)) startUp |
|
3869 |
" |
|
3870 |
||
3871 |
<resource: #menu> |
|
3872 |
||
3873 |
^ |
|
5406 | 3874 |
#(Menu |
3875 |
( |
|
3876 |
(MenuItem |
|
3877 |
label: 'Reload' |
|
3878 |
itemValue: doReload |
|
3879 |
translateLabel: true |
|
3880 |
isButton: true |
|
6286 | 3881 |
labelImage: (ResourceRetriever ToolbarIconLibrary reloadTextFromFileIcon) |
3892 | 3882 |
) |
5406 | 3883 |
(MenuItem |
3884 |
label: 'Back' |
|
3885 |
itemValue: doGoBack |
|
3886 |
translateLabel: true |
|
3887 |
isButton: true |
|
6286 | 3888 |
labelImage: (ResourceRetriever ToolbarIconLibrary historyBackIcon) |
3892 | 3889 |
) |
5406 | 3890 |
(MenuItem |
8087 | 3891 |
label: '-' |
3892 |
) |
|
3893 |
(MenuItem |
|
5406 | 3894 |
label: 'Print' |
3895 |
itemValue: doPrint |
|
3896 |
translateLabel: true |
|
3897 |
isButton: true |
|
6286 | 3898 |
labelImage: (ResourceRetriever ToolbarIconLibrary printerIcon) |
3892 | 3899 |
) |
5406 | 3900 |
(MenuItem |
8087 | 3901 |
label: '-' |
3902 |
) |
|
3903 |
(MenuItem |
|
5406 | 3904 |
activeHelpKey: #'Edit Source' |
3905 |
label: 'Edit' |
|
3906 |
itemValue: doEdit |
|
3907 |
translateLabel: true |
|
3908 |
isButton: true |
|
6093 | 3909 |
labelImage: (ResourceRetriever ToolbarIconLibrary editFileIcon) |
5406 | 3910 |
) |
3911 |
(MenuItem |
|
8087 | 3912 |
activeHelpKey: closeTabButton |
5406 | 3913 |
label: 'Close' |
3914 |
itemValue: doClose |
|
3915 |
translateLabel: true |
|
3916 |
isButton: true |
|
3917 |
startGroup: right |
|
3918 |
hideMenuOnActivated: false |
|
6093 | 3919 |
labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon) |
3892 | 3920 |
) |
3921 |
) |
|
3922 |
nil |
|
3923 |
nil |
|
3924 |
) |
|
10566 | 3925 |
! |
3926 |
||
3927 |
menuJustClose |
|
3928 |
"This resource specification was automatically generated |
|
3929 |
by the MenuEditor of ST/X." |
|
3930 |
||
3931 |
"Do not manually edit this!! If it is corrupted, |
|
3932 |
the MenuEditor may not be able to read the specification." |
|
3933 |
||
3934 |
" |
|
3935 |
MenuEditor new openOnClass:FileApplicationNoteBook::HtmlViewApplication andSelector:#menuJustClose |
|
3936 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::HtmlViewApplication menuJustClose)) startUp |
|
3937 |
" |
|
3938 |
||
3939 |
<resource: #menu> |
|
3940 |
||
3941 |
^ |
|
3942 |
#(Menu |
|
3943 |
( |
|
3944 |
(MenuItem |
|
3945 |
activeHelpKey: closeTabButton |
|
3946 |
label: 'Close' |
|
3947 |
itemValue: doClose |
|
3948 |
translateLabel: true |
|
3949 |
isButton: true |
|
3950 |
startGroup: right |
|
3951 |
hideMenuOnActivated: false |
|
3952 |
labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon) |
|
3953 |
) |
|
3954 |
) |
|
3955 |
nil |
|
3956 |
nil |
|
3957 |
) |
|
3892 | 3958 |
! ! |
3959 |
||
3960 |
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'queries'! |
|
3961 |
||
5010 | 3962 |
canOpenItem:anItem |
3963 |
||
13715
dab7e512b771
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13406
diff
changeset
|
3964 |
^ (anItem hasMimeType and:[anItem mimeType isHtmlType]) |
3892 | 3965 |
! |
3966 |
||
3967 |
wantNewApplicationAnyway |
|
3968 |
||
3969 |
^ false |
|
3970 |
! ! |
|
3971 |
||
3972 |
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'accessing'! |
|
3973 |
||
3974 |
htmlView |
|
3975 |
"return the value of the instance variable 'imageView' (automatically generated)" |
|
3976 |
||
3977 |
^ htmlView |
|
3978 |
! |
|
3979 |
||
3980 |
htmlView:something |
|
3981 |
"set the value of the instance variable 'imageView' (automatically generated)" |
|
3982 |
||
3983 |
htmlView := something. |
|
3984 |
! |
|
3985 |
||
5010 | 3986 |
item:anItem |
3892 | 3987 |
|
3988 |
|retVal| |
|
3989 |
||
5010 | 3990 |
self labelHolder value:anItem fileName asString. |
3991 |
retVal := super item:anItem. |
|
3892 | 3992 |
self setupHtmlView. |
3993 |
^ retVal |
|
3994 |
! ! |
|
3995 |
||
15232
0e892557798d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15230
diff
changeset
|
3996 |
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'accessing-subApps'! |
10566 | 3997 |
|
3998 |
webBrowserPage |
|
3999 |
||
4000 |
webBrowserPage isNil ifTrue:[ |
|
4001 |
webBrowserPage := Tools::WebBrowserPage new. |
|
4002 |
webBrowserPage urlHolder: self labelHolder |
|
4003 |
]. |
|
4004 |
^webBrowserPage |
|
4005 |
||
4006 |
"Created: / 11-08-2011 / 00:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4007 |
! ! |
|
4008 |
||
3892 | 4009 |
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'actions'! |
4010 |
||
5406 | 4011 |
doEdit |
7540
69a739c09f2c
edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents:
7487
diff
changeset
|
4012 |
self masterApplication |
69a739c09f2c
edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents:
7487
diff
changeset
|
4013 |
openTextEditorForFile:(htmlView currentDocument) |
69a739c09f2c
edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents:
7487
diff
changeset
|
4014 |
"/ openTextEditorOn:item. |
69a739c09f2c
edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents:
7487
diff
changeset
|
4015 |
|
69a739c09f2c
edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents:
7487
diff
changeset
|
4016 |
"Modified: / 24-11-2006 / 11:14:51 / cg" |
5406 | 4017 |
! |
4018 |
||
3892 | 4019 |
doGoBack |
4020 |
||
4021 |
self htmlView menu_back. |
|
4022 |
! |
|
4023 |
||
4024 |
doGoHome |
|
4025 |
||
4026 |
self htmlView menu_home. |
|
4027 |
! |
|
4028 |
||
4029 |
doHelp |
|
4030 |
||
4031 |
self htmlView menu_help. |
|
4032 |
! |
|
4033 |
||
4034 |
doPrint |
|
4035 |
||
4036 |
self htmlView menu_print. |
|
4037 |
! |
|
4038 |
||
4039 |
doReload |
|
4040 |
||
4041 |
self htmlView menu_reload. |
|
4042 |
! |
|
4043 |
||
4044 |
setupHtmlView |
|
4045 |
||
4046 |
| html file directory| |
|
4047 |
||
4048 |
html := self htmlView. |
|
4049 |
html isNil ifTrue:[^ self]. |
|
9785 | 4050 |
|
3892 | 4051 |
file := self fileName. |
4052 |
directory := file directoryName. |
|
4053 |
html homeDocument:(file asString). |
|
4054 |
html setTopDirectoryName:directory. |
|
4055 |
html uriHolder:self labelHolder. |
|
4056 |
html infoHolder:self notifyChannel. |
|
4057 |
html linkButtonPanel:nil. |
|
4058 |
^ html |
|
9785 | 4059 |
|
4060 |
"Modified: / 17-02-2011 / 14:01:35 / cg" |
|
3892 | 4061 |
! ! |
4062 |
||
4063 |
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'aspects'! |
|
4064 |
||
4065 |
labelHolder |
|
4066 |
||
4067 |
labelHolder isNil ifTrue:[ |
|
4068 |
labelHolder := '' asValue. |
|
4069 |
]. |
|
4070 |
^ labelHolder. |
|
4071 |
! ! |
|
4072 |
||
4073 |
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'initialization & release'! |
|
4074 |
||
4075 |
postBuildHtmlView:aWidget |
|
4076 |
||
4077 |
self htmlView: aWidget scrolledView. |
|
4078 |
self htmlView wantsFocusWithPointerEnter. |
|
4079 |
! |
|
4080 |
||
4081 |
postOpenWith:aBuilder |
|
6626 | 4082 |
"only invoked if the application not started from a master" |
3892 | 4083 |
|
4084 |
|currentDir contents suffix fileName| |
|
4085 |
||
4086 |
self masterApplication isNil ifTrue:[ |
|
4087 |
self masterApplication:nil. |
|
4088 |
currentDir := Filename homeDirectory. |
|
4089 |
||
4090 |
contents := currentDir directoryContents. |
|
4091 |
fileName := contents |
|
4092 |
detect:[:file | |
|
4093 |
suffix := file asFilename suffix asLowercase. |
|
4094 |
suffix = 'html' |
|
4095 |
] |
|
4096 |
ifNone:[nil]. |
|
4097 |
fileName isNil ifTrue:[ |
|
4098 |
Dialog warn:'cant find a HTML file in ' , currentDir asString. |
|
4099 |
^ self |
|
4100 |
]. |
|
9785 | 4101 |
self item:(DirectoryContentsBrowser itemClass |
4102 |
fileName:('../../doc/online/english/TOP.html') asFilename asAbsoluteFilename). |
|
3892 | 4103 |
]. |
4104 |
self setupHtmlView. |
|
6626 | 4105 |
super postOpenWith:aBuilder |
9785 | 4106 |
|
4107 |
"Modified: / 17-02-2011 / 13:27:12 / cg" |
|
3892 | 4108 |
! ! |
4109 |
||
4110 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'defaults'! |
|
4111 |
||
4112 |
tabStringFor:aApplicationType |
|
7687 | 4113 |
"the formatString shown in a tab (language translated)" |
4114 |
||
4115 |
^ 'Image in %1' |
|
4116 |
||
4117 |
"Modified: / 01-03-2007 / 21:43:23 / cg" |
|
3892 | 4118 |
! ! |
4119 |
||
7909 | 4120 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'documentation'! |
4121 |
||
4122 |
documentation |
|
4123 |
" |
|
4124 |
a previewer-plugin for bitmap images (jpg, xpm, tiff, gif, etc.) |
|
4125 |
Offers edit and adjust-size button functions. |
|
4126 |
" |
|
4127 |
! ! |
|
4128 |
||
6100 | 4129 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'help specs'! |
4130 |
||
17900 | 4131 |
helpSpec |
6100 | 4132 |
"This resource specification was automatically generated |
4133 |
by the UIHelpTool of ST/X." |
|
4134 |
||
4135 |
"Do not manually edit this!! If it is corrupted, |
|
4136 |
the UIHelpTool may not be able to read the specification." |
|
4137 |
||
4138 |
" |
|
4139 |
UIHelpTool openOnClass:FileApplicationNoteBook::HtmlViewApplication |
|
4140 |
" |
|
4141 |
||
4142 |
<resource: #help> |
|
4143 |
||
17900 | 4144 |
^ super helpSpec addPairsFrom:#( |
6100 | 4145 |
|
4146 |
#'fitImageSize' |
|
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4147 |
'Shrink image to fit view' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4148 |
|
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4149 |
#'showHex' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4150 |
'Show a hex dump of the file''s contents' |
6100 | 4151 |
|
4152 |
) |
|
4153 |
! ! |
|
4154 |
||
3892 | 4155 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'image specs'! |
4156 |
||
4157 |
fitSize20x20Icon |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4158 |
<resource: #image> |
3892 | 4159 |
"This resource specification was automatically generated |
4160 |
by the ImageEditor of ST/X." |
|
4161 |
"Do not manually edit this!! If it is corrupted, |
|
4162 |
the ImageEditor may not be able to read the specification." |
|
4163 |
" |
|
4164 |
self fitSize20x20Icon inspect |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4165 |
ImageEditor openOnClass:self andSelector:#fitSize20x20Icon" |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4166 |
|
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4167 |
^ Icon |
3892 | 4168 |
constantNamed:#'FileApplicationNoteBook::ImageViewApplication class fitSize20x20Icon' |
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4169 |
ifAbsentPut:[ |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4170 |
(Depth4Image new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4171 |
width:20; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4172 |
height:20; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4173 |
photometric:(#palette); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4174 |
bitsPerSample:(#( 4 )); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4175 |
samplesPerPixel:(1); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4176 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4177 |
fromPackedString:' |
3892 | 4178 |
@@DQDQDQDQDP@@@PDQDQDQDQ@P@A@ADQDQDQDP@PD@@PDQDQDPD@@QDQ@ADQDQ@@DQDQD@@@@@@@@@DQDQDPQDQDQ@DQDQDQDDQUUTPADQDQDQAEUUUT@QDQ |
4179 |
DQDPQEUUQ@DQDQDQDDQFQDPADQDQDQADQ$QD@QDQDQDPL3X3Q@DQDQDQDCL3L3LADQDQD@@@@@@@@@DQDQD@DQDQDP@QDQ@@DADQDQDA@@DA@ADQDQDQDP@P |
|
4180 |
@@@QDQDQDQDA@@@ADQDQDQDQD@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
4181 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4182 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4183 |
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
|
4184 |
mask:((ImageMask new) |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4185 |
width:20; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4186 |
height:20; |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4187 |
bits:(ByteArray |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4188 |
fromPackedString:' |
3892 | 4189 |
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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
4190 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
4191 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
4192 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
14412
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4193 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4194 |
yourself); |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4195 |
yourself |
7440739e2b8b
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14124
diff
changeset
|
4196 |
] |
3892 | 4197 |
! ! |
4198 |
||
4199 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'interface specs'! |
|
4200 |
||
4201 |
windowSpec |
|
4202 |
"This resource specification was automatically generated |
|
4203 |
by the UIPainter of ST/X." |
|
4204 |
||
4205 |
"Do not manually edit this!! If it is corrupted, |
|
4206 |
the UIPainter may not be able to read the specification." |
|
4207 |
||
4208 |
" |
|
4209 |
UIPainter new openOnClass:FileApplicationNoteBook::ImageViewApplication andSelector:#windowSpec |
|
4210 |
FileApplicationNoteBook::ImageViewApplication new openInterface:#windowSpec |
|
4211 |
FileApplicationNoteBook::ImageViewApplication open |
|
4212 |
" |
|
4213 |
||
4214 |
<resource: #canvas> |
|
4215 |
||
4216 |
^ |
|
4217 |
#(#FullSpec |
|
4218 |
#name: #windowSpec |
|
4219 |
#window: |
|
4220 |
#(#WindowSpec |
|
4221 |
#label: 'ImageViewer' |
|
4222 |
#name: 'ImageViewer' |
|
4223 |
#min: #(#Point 10 10) |
|
4224 |
#bounds: #(#Rectangle 16 42 692 534) |
|
4225 |
#menu: #mainMenu |
|
4226 |
) |
|
4227 |
#component: |
|
4228 |
#(#SpecCollection |
|
4229 |
#collection: #( |
|
4230 |
#(#MenuPanelSpec |
|
4261 | 4231 |
#name: 'MenuImage' |
3892 | 4232 |
#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
|
4233 |
#level: 0 |
3892 | 4234 |
#visibilityChannel: #isEmbeddedApplication |
4235 |
#menu: #menu |
|
4236 |
#textDefault: true |
|
4237 |
) |
|
4238 |
#(#ArbitraryComponentSpec |
|
4261 | 4239 |
#name: 'ImageView' |
3892 | 4240 |
#layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0) |
4241 |
#hasHorizontalScrollBar: true |
|
4242 |
#hasVerticalScrollBar: true |
|
4243 |
#miniScrollerHorizontal: false |
|
4244 |
#miniScrollerVertical: false |
|
4245 |
#hasBorder: false |
|
4246 |
#component: #ImageView |
|
4247 |
#postBuildCallback: #postBuildImageView: |
|
4248 |
) |
|
4249 |
) |
|
4250 |
||
4251 |
) |
|
4252 |
) |
|
4253 |
! ! |
|
4254 |
||
4255 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'menu specs'! |
|
4256 |
||
4257 |
menu |
|
4258 |
"This resource specification was automatically generated |
|
4259 |
by the MenuEditor of ST/X." |
|
4260 |
||
4261 |
"Do not manually edit this!! If it is corrupted, |
|
4262 |
the MenuEditor may not be able to read the specification." |
|
4263 |
||
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4264 |
|
3892 | 4265 |
" |
4266 |
MenuEditor new openOnClass:FileApplicationNoteBook::ImageViewApplication andSelector:#menu |
|
4267 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ImageViewApplication menu)) startUp |
|
4268 |
" |
|
4269 |
||
4270 |
<resource: #menu> |
|
4271 |
||
4272 |
^ |
|
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4273 |
#(Menu |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4274 |
( |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4275 |
(MenuItem |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4276 |
label: 'Edit' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4277 |
itemValue: editImage |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4278 |
nameKey: EditImage |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4279 |
isButton: true |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4280 |
labelImage: (ResourceRetriever ToolbarIconLibrary startImageEditorIcon) |
3892 | 4281 |
) |
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4282 |
(MenuItem |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4283 |
label: '-' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4284 |
) |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4285 |
(MenuItem |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4286 |
activeHelpKey: fitImageSize |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4287 |
label: 'FitSize' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4288 |
isButton: true |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4289 |
triggerOnDown: true |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4290 |
indication: fitSize |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4291 |
labelImage: (ResourceRetriever ToolbarIconLibrary fitImageSizeToViewIcon) |
3892 | 4292 |
) |
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4293 |
(MenuItem |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4294 |
label: '-' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4295 |
) |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4296 |
(MenuItem |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4297 |
activeHelpKey: showHex |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4298 |
label: 'ShowHex' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4299 |
itemValue: showHex |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4300 |
isButton: true |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4301 |
triggerOnDown: true |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4302 |
labelImage: (ResourceRetriever ToolbarIconLibrary hexToggleIcon) |
3892 | 4303 |
) |
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4304 |
(MenuItem |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4305 |
label: '' |
3892 | 4306 |
) |
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4307 |
(MenuItem |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4308 |
activeHelpKey: closeTabButton |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4309 |
label: 'Close' |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4310 |
itemValue: doClose |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4311 |
isButton: true |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4312 |
startGroup: right |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4313 |
hideMenuOnActivated: false |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4314 |
labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon) |
3892 | 4315 |
) |
4316 |
) |
|
4317 |
nil |
|
4318 |
nil |
|
4319 |
) |
|
4320 |
! ! |
|
4321 |
||
4322 |
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'queries'! |
|
4323 |
||
5010 | 4324 |
canOpenItem:anItem |
17951 | 4325 |
"check if I can open that document; |
4326 |
first check the mimetype (by suffix), |
|
4327 |
then also ask the corresponding imageReader if the file is actually valid" |
|
4328 |
||
17950 | 4329 |
|mimeType imageReader| |
4330 |
||
4331 |
^ (anItem hasMimeType |
|
4332 |
and:[(mimeType := anItem mimeType) isImageType |
|
4333 |
"/ do not trust the mimetype - the contents may not correspond to its mimetype... |
|
4334 |
and:[(imageReader := MIMETypes imageReaderForType:mimeType) notNil |
|
4335 |
and:[imageReader isValidImageFile:anItem fileName]]]) |
|
3892 | 4336 |
! |
4337 |
||
4338 |
wantNewApplicationAnyway |
|
4339 |
||
4340 |
^ false |
|
4341 |
! ! |
|
4342 |
||
4343 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'accessing'! |
|
4344 |
||
4345 |
image:something |
|
4346 |
image := something. |
|
4417 | 4347 |
self updateImageInfo. |
3892 | 4348 |
! |
4349 |
||
4350 |
imageView |
|
4351 |
^ imageView |
|
4352 |
! |
|
4353 |
||
4354 |
imageView:something |
|
4355 |
imageView := something. |
|
4417 | 4356 |
! |
4357 |
||
4358 |
updateImageInfo |
|
17639 | 4359 |
|fn msg depth imageType| |
4417 | 4360 |
|
4361 |
image notNil ifTrue:[ |
|
4362 |
fn := image fileName. |
|
4363 |
fn isNil ifTrue:[ |
|
4364 |
fn := 'unnamed' |
|
4365 |
] ifFalse:[ |
|
4366 |
fn := fn asFilename baseName. |
|
4367 |
]. |
|
17639 | 4368 |
|
4369 |
depth := image depth. |
|
4370 |
imageType := image photometric. |
|
4371 |
||
4372 |
(imageType == #blackIs0 or:[ imageType == #whiteIs0 ]) ifTrue:[ |
|
4373 |
imageType := #grayscale. |
|
4374 |
depth == 1 ifTrue:[ |
|
4375 |
imageType := 'monochrome' |
|
4376 |
]. |
|
4377 |
]. |
|
4378 |
||
4379 |
msg := '%1 %2x%3 depth:%4 (%5)' |
|
4417 | 4380 |
bindWith:fn allBold |
4381 |
with:image width |
|
4382 |
with:image height |
|
17639 | 4383 |
with:depth |
4384 |
with:imageType. |
|
4417 | 4385 |
]. |
4523 | 4386 |
self notify:msg. |
17637 | 4387 |
|
17639 | 4388 |
"Modified: / 29-08-2017 / 12:37:27 / cg" |
3892 | 4389 |
! ! |
4390 |
||
4391 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'actions'! |
|
4392 |
||
5010 | 4393 |
changeItem:anItem |
4394 |
||
4395 |
self item:anItem. |
|
3892 | 4396 |
self setupImageView. |
4397 |
^ true |
|
4398 |
! |
|
4399 |
||
4400 |
editImage |
|
4401 |
|img| |
|
4402 |
||
4403 |
img := self image. |
|
4404 |
img notNil ifTrue:[ |
|
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
4405 |
"/ self withWaitCursorDo:[ |
4855 | 4406 |
img edit. |
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
4407 |
"/ ] |
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
4408 |
]. |
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
4409 |
|
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
4410 |
"Modified: / 25-07-2006 / 09:09:20 / cg" |
3892 | 4411 |
! |
4412 |
||
4413 |
image |
|
17640 | 4414 |
|img fn e firstTry| |
3892 | 4415 |
|
4416 |
fn := self fileName. |
|
17640 | 4417 |
firstTry := true. |
14819
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4418 |
Image badImageFormatQuerySignal handle:[:ex | |
17640 | 4419 |
|reader| |
4420 |
||
4421 |
firstTry ifTrue:[ |
|
4422 |
firstTry := false. |
|
4423 |
||
4424 |
"/ autoload image readers and retry |
|
4425 |
(fn suffix = 'pcx') ifTrue:[ |
|
4426 |
reader := PCXReader. |
|
4427 |
]. |
|
4428 |
(#('ppm' 'pgm' 'pbm' ) includes:fn suffix) ifTrue:[ |
|
4429 |
reader := PBMReader. |
|
4430 |
]. |
|
4431 |
(fn suffix = 'tga') ifTrue:[ |
|
4432 |
reader := TargaReader. |
|
4433 |
]. |
|
4434 |
(fn suffix = 'bmp') ifTrue:[ |
|
4435 |
reader := WindowsIconReader. |
|
4436 |
]. |
|
4437 |
reader notNil ifTrue:[ |
|
4438 |
reader autoload. ex restart. |
|
4439 |
] |
|
4440 |
]. |
|
4441 |
||
14819
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4442 |
e := ex description. |
17635 | 4443 |
Dialog warn:('Error while reading image:\n\n%s' printfWith:e). |
16146 | 4444 |
"/ ex mayProceed ifTrue:[ ex proceed ]. |
14819
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4445 |
] do:[ |
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4446 |
img := Image fromFile:fn. |
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4447 |
]. |
17640 | 4448 |
|
3892 | 4449 |
img isNil ifTrue:[ |
14819
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4450 |
e isNil ifTrue:[ |
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4451 |
fn exists ifTrue:[ |
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4452 |
e := 'Unknown/unsupported image format' |
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4453 |
] ifFalse:[ |
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4454 |
e := 'No such image' |
0248509ac90d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14808
diff
changeset
|
4455 |
]. |
17411 | 4456 |
Dialog warn:('Error while reading image:\n%s' printfWith:e). |
3892 | 4457 |
]. |
4458 |
^ nil |
|
4459 |
]. |
|
14907
647b035e2f5f
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14906
diff
changeset
|
4460 |
e notNil ifTrue:[ |
647b035e2f5f
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14906
diff
changeset
|
4461 |
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
|
4462 |
]. |
3892 | 4463 |
^ img. |
17411 | 4464 |
|
17640 | 4465 |
"Modified: / 29-08-2017 / 22:42:35 / cg" |
14906
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4466 |
! |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4467 |
|
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4468 |
showHex |
b8003fbf8094
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14841
diff
changeset
|
4469 |
masterApplication openTextEditorWithHexPresentationOn:item |
3892 | 4470 |
! ! |
4471 |
||
4472 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'aspects'! |
|
4473 |
||
4474 |
fitSize |
|
4475 |
"return/create the 'fitSize' value holder (automatically generated)" |
|
4476 |
||
4477 |
fitSize isNil ifTrue:[ |
|
4478 |
fitSize := ValueHolder new. |
|
4479 |
fitSize addDependent:self. |
|
4480 |
]. |
|
4481 |
^ fitSize |
|
4482 |
! ! |
|
4483 |
||
4484 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'change & update'! |
|
4485 |
||
4486 |
update:something with:aParameter from:changedObject |
|
4487 |
changedObject == self fitSize ifTrue:[ |
|
4488 |
changedObject value ifTrue:[ |
|
17683 | 4489 |
"/ imageView adjust:#smoothFitBig. |
3892 | 4490 |
imageView adjust:#fitBig. |
4491 |
] ifFalse:[ |
|
4492 |
imageView adjust:nil. |
|
4493 |
]. |
|
4494 |
^ self |
|
4495 |
]. |
|
4496 |
super update:something with:aParameter from:changedObject |
|
17683 | 4497 |
|
4498 |
"Modified: / 11-09-2017 / 09:06:40 / cg" |
|
3892 | 4499 |
! ! |
4500 |
||
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4501 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'event handling'! |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4502 |
|
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4503 |
processEvent:anEvent |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4504 |
|view rawKey key| |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4505 |
|
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4506 |
view := anEvent view. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4507 |
anEvent isKeyPressEvent ifTrue:[ |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4508 |
(imageView notNil |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4509 |
and:[view notNil |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4510 |
and:[(view == imageView)]] |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4511 |
) ifTrue:[ |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4512 |
rawKey := anEvent rawKey. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4513 |
key := anEvent key. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4514 |
(rawKey == #CursorDown) ifTrue:[ |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4515 |
masterApplication selectNextFile; enterAction. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4516 |
^ true. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4517 |
]. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4518 |
(rawKey == #CursorUp) ifTrue:[ |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4519 |
masterApplication selectPreviousFile; enterAction. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4520 |
^ true. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4521 |
]. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4522 |
key == $q ifTrue:[ |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4523 |
self doClose. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4524 |
^ true. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4525 |
]. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4526 |
((key == #Escape) or:[key == $x]) ifTrue:[ |
17683 | 4527 |
self topView perform:#collapse ifNotUnderstood:[]. |
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4528 |
^ true. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4529 |
]. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4530 |
((key == #Cut) |
18754 | 4531 |
or:[key == #BackSpace |
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4532 |
or:[key == #Delete]]) ifTrue:[ |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4533 |
masterApplication deleteFiles. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4534 |
^ true |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4535 |
]. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4536 |
^ false |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4537 |
] |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4538 |
]. |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4539 |
^ false |
17683 | 4540 |
|
4541 |
"Modified: / 10-09-2017 / 16:52:40 / cg" |
|
18754 | 4542 |
"Modified (format): / 04-05-2019 / 15:42:39 / Claus Gittinger" |
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4543 |
! ! |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4544 |
|
3892 | 4545 |
!FileApplicationNoteBook::ImageViewApplication methodsFor:'initialization & release'! |
4546 |
||
4547 |
postBuildImageView:aWidget |
|
4548 |
||
4549 |
self imageView: aWidget scrolledView. |
|
4550 |
self imageView wantsFocusWithPointerEnter. |
|
4551 |
! |
|
4552 |
||
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4553 |
postOpenAsSubcanvasWith:aBuilder |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4554 |
"invoked if the application is embedded in some other view" |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4555 |
|
16049 | 4556 |
|wg| |
4557 |
||
4558 |
(wg := self imageView windowGroup) notNil ifTrue:[ |
|
4559 |
wg addPreEventHook:self. |
|
4560 |
]. |
|
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4561 |
super postOpenAsSubcanvasWith:aBuilder |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4562 |
! |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4563 |
|
3892 | 4564 |
postOpenWith:aBuilder |
7909 | 4565 |
"only invoked if the application is not started from a master" |
3892 | 4566 |
|
4567 |
|currentDir contents suffix fileName| |
|
4568 |
||
4569 |
self masterApplication isNil ifTrue:[ |
|
4570 |
self masterApplication:nil. |
|
4571 |
currentDir := Filename currentDirectory. |
|
4572 |
contents := currentDir directoryContents. |
|
4573 |
fileName := contents |
|
4574 |
detect:[:file | |
|
4575 |
suffix := file asFilename suffix asLowercase. |
|
4576 |
Image isImageFileSuffix:suffix |
|
4577 |
] |
|
4578 |
ifNone:[nil]. |
|
4579 |
fileName isNil ifTrue:[ |
|
4580 |
Dialog warn:'cant find a Image in ' , currentDir asString. |
|
4581 |
^ self |
|
4582 |
]. |
|
3982 | 4583 |
self item:(DirectoryContentsBrowser itemClass fileName:(currentDir construct:fileName)) |
3892 | 4584 |
]. |
4585 |
self setupImageView. |
|
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4586 |
self imageView windowGroup addPreEventHook:self. |
6626 | 4587 |
super postOpenWith:aBuilder |
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4588 |
! |
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4589 |
|
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4590 |
setupImageView |
17639 | 4591 |
|p| |
4592 |
||
4593 |
(p := imageReadProcess) notNil ifTrue:[ |
|
4594 |
imageReadProcess := nil. |
|
4595 |
p terminate. |
|
4596 |
]. |
|
4597 |
||
4598 |
imageReadProcess := |
|
4599 |
[ |
|
4600 |
|img| |
|
4601 |
||
4602 |
imageView withCursor:(Cursor wait) do:[ |
|
4603 |
img := self image. |
|
4604 |
img notNil ifTrue:[ |
|
4605 |
self image:img. |
|
4606 |
imageView image:img |
|
4607 |
]. |
|
4608 |
imageReadProcess := nil. |
|
14576
c9b94a8aacb5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14517
diff
changeset
|
4609 |
]. |
17639 | 4610 |
] fork. |
4611 |
||
4612 |
"Modified: / 29-08-2017 / 12:31:00 / cg" |
|
3892 | 4613 |
! ! |
4614 |
||
4615 |
!FileApplicationNoteBook::Terminal class methodsFor:'defaults'! |
|
4616 |
||
4758 | 4617 |
defaultLineLimit |
4618 |
"the number of buffered lines" |
|
4619 |
||
4759 | 4620 |
^ DefaultLineLimit ? TextCollector defaultLineLimit |
7787 | 4621 |
|
4622 |
" |
|
4623 |
DefaultLineLimit := 30000 |
|
4624 |
" |
|
4625 |
||
4626 |
"Modified: / 05-04-2007 / 17:03:11 / cg" |
|
4758 | 4627 |
! |
4628 |
||
3892 | 4629 |
tabStringFor:aApplicationType |
7687 | 4630 |
"the formatString shown in a tab (language translated)" |
3892 | 4631 |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4632 |
^ 'Terminal' |
7687 | 4633 |
|
4634 |
"Modified: / 01-03-2007 / 21:43:38 / cg" |
|
3892 | 4635 |
! ! |
4636 |
||
11099 | 4637 |
!FileApplicationNoteBook::Terminal class methodsFor:'help specs'! |
4638 |
||
4639 |
helpSpec |
|
4640 |
"This resource specification was automatically generated |
|
4641 |
by the UIHelpTool of ST/X." |
|
4642 |
||
4643 |
"Do not manually edit this!! If it is corrupted, |
|
4644 |
the UIHelpTool may not be able to read the specification." |
|
4645 |
||
4646 |
" |
|
4647 |
UIHelpTool openOnClass:FileApplicationNoteBook::Terminal |
|
4648 |
" |
|
4649 |
||
4650 |
<resource: #help> |
|
4651 |
||
4652 |
^ super helpSpec addPairsFrom:#( |
|
4653 |
||
4654 |
#closeTabButton |
|
17994 | 4655 |
'Close this tab' |
4656 |
||
4657 |
#saveAs |
|
4658 |
'Save the contents in a file' |
|
4659 |
||
4660 |
#clearConsole |
|
4661 |
'Clear the contents' |
|
4662 |
||
4663 |
#scrollLock |
|
4664 |
'Toggle scroll lock' |
|
11099 | 4665 |
|
4666 |
) |
|
4667 |
! ! |
|
4668 |
||
3892 | 4669 |
!FileApplicationNoteBook::Terminal class methodsFor:'interface specs'! |
4670 |
||
4671 |
windowSpec |
|
4672 |
"This resource specification was automatically generated |
|
4673 |
by the UIPainter of ST/X." |
|
4674 |
||
4675 |
"Do not manually edit this!! If it is corrupted, |
|
4676 |
the UIPainter may not be able to read the specification." |
|
4677 |
||
4678 |
" |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
4679 |
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
|
4680 |
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
|
4681 |
FileApplicationNoteBook::Terminal open |
3892 | 4682 |
" |
4683 |
||
4684 |
<resource: #canvas> |
|
4685 |
||
4686 |
^ |
|
5661
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4687 |
#(FullSpec |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4688 |
name: windowSpec |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4689 |
window: |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4690 |
(WindowSpec |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4691 |
label: 'Terminal' |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4692 |
name: 'Terminal' |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4693 |
min: (Point 10 10) |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4694 |
bounds: (Rectangle 0 0 692 537) |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4695 |
"/ menu: mainMenu |
3892 | 4696 |
) |
5661
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4697 |
component: |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4698 |
(SpecCollection |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4699 |
collection: ( |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4700 |
(MenuPanelSpec |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4701 |
name: 'MenuTerminal' |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4702 |
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
|
4703 |
level: 0 |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4704 |
menu: toolbarMenu |
5661
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4705 |
textDefault: true |
3892 | 4706 |
) |
5661
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4707 |
(ArbitraryComponentSpec |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4708 |
name: 'TerminalView' |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4709 |
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
|
4710 |
hasHorizontalScrollBar: true |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4711 |
hasVerticalScrollBar: true |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4712 |
miniScrollerHorizontal: true |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4713 |
miniScrollerVertical: false |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4714 |
autoHideScrollBars: false |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4715 |
hasBorder: false |
706b3e6cfd1f
terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents:
5646
diff
changeset
|
4716 |
component: terminalView |
3892 | 4717 |
) |
4718 |
) |
|
4719 |
||
4720 |
) |
|
4721 |
) |
|
4722 |
! ! |
|
4723 |
||
4724 |
!FileApplicationNoteBook::Terminal class methodsFor:'menu specs'! |
|
4725 |
||
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4726 |
toolbarMenu |
3892 | 4727 |
"This resource specification was automatically generated |
4728 |
by the MenuEditor of ST/X." |
|
4729 |
||
4730 |
"Do not manually edit this!! If it is corrupted, |
|
4731 |
the MenuEditor may not be able to read the specification." |
|
4732 |
||
11099 | 4733 |
|
3892 | 4734 |
" |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4735 |
MenuEditor new openOnClass:FileApplicationNoteBook::Terminal andSelector:#toolbarMenu |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4736 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::Terminal toolbarMenu)) startUp |
3892 | 4737 |
" |
4738 |
||
4739 |
<resource: #menu> |
|
4740 |
||
4741 |
^ |
|
11099 | 4742 |
#(Menu |
4743 |
( |
|
4744 |
(MenuItem |
|
4745 |
label: 'Save As...' |
|
17994 | 4746 |
activeHelpKey: saveAs |
11099 | 4747 |
itemValue: saveAs |
4748 |
nameKey: Save |
|
4749 |
isButton: true |
|
4750 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveToFileAsIcon) |
|
3892 | 4751 |
) |
11099 | 4752 |
(MenuItem |
4753 |
activeHelpKey: closeTabButton |
|
4754 |
label: 'Close' |
|
4755 |
itemValue: doClose |
|
4756 |
isButton: true |
|
4757 |
startGroup: right |
|
4758 |
isVisible: closeButtonShown |
|
4759 |
hideMenuOnActivated: false |
|
4760 |
labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon) |
|
3892 | 4761 |
) |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4762 |
(MenuItem |
14801
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4763 |
label: 'Scroll Lock' |
17994 | 4764 |
activeHelpKey: scrollLock |
14801
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4765 |
itemValue: scrollLockedChanged |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4766 |
isButton: true |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4767 |
startGroup: right |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4768 |
indication: scrollLockedHolder |
14802
99e863c55e0f
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
4769 |
labelImage: (ResourceRetriever ToolbarIconLibrary scrollLockIcon) |
14801
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4770 |
) |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4771 |
(MenuItem |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4772 |
label: 'Clear Console Output' |
17994 | 4773 |
activeHelpKey: clearConsole |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4774 |
itemValue: menuClearConsole |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4775 |
isButton: true |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4776 |
startGroup: right |
14802
99e863c55e0f
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
4777 |
labelImage: (ResourceRetriever ToolbarIconLibrary clearConsoleIcon) |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4778 |
) |
3892 | 4779 |
) |
4780 |
nil |
|
4781 |
nil |
|
4782 |
) |
|
4783 |
! ! |
|
4784 |
||
4785 |
!FileApplicationNoteBook::Terminal methodsFor:'accessing'! |
|
4786 |
||
4787 |
terminalView |
|
4788 |
||
4789 |
terminalView isNil ifTrue:[ |
|
13905
519c20b1a23c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13812
diff
changeset
|
4790 |
(OperatingSystem isUNIXlike |
14458
bba439082438
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14444
diff
changeset
|
4791 |
"/ 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
|
4792 |
and:[UserPreferences current useXTermViewIfAvailable |
13905
519c20b1a23c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13812
diff
changeset
|
4793 |
and:[XTermView notNil |
519c20b1a23c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13812
diff
changeset
|
4794 |
and:[XTermView isAvailable]]]) ifTrue:[ |
13812 | 4795 |
terminalView := XTermView new. |
13905
519c20b1a23c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13812
diff
changeset
|
4796 |
terminalView workingDirectory: item fileName pathName. |
519c20b1a23c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13812
diff
changeset
|
4797 |
terminalView lineLimit:(self class defaultLineLimit). |
13812 | 4798 |
] ifFalse:[ |
4799 |
VT100TerminalView isNil ifTrue:[ |
|
4800 |
Dialog warn:('Missing class: ' , 'VT100TerminalView' allBold). |
|
4801 |
AbortOperationRequest raise |
|
4802 |
]. |
|
4803 |
terminalView := VT100TerminalView new. |
|
6435 | 4804 |
]. |
3892 | 4805 |
]. |
4806 |
^ terminalView. |
|
13812 | 4807 |
|
4808 |
"Modified: / 05-04-2012 / 15:58:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3892 | 4809 |
! ! |
4810 |
||
4811 |
!FileApplicationNoteBook::Terminal methodsFor:'actions'! |
|
4812 |
||
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4813 |
menuClearConsole |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4814 |
terminalView clear. |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4815 |
! |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4816 |
|
3892 | 4817 |
saveAs |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4818 |
"open a save-as dialog" |
3892 | 4819 |
|
4820 |
self terminalView save. |
|
14801
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4821 |
! |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4822 |
|
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4823 |
scrollLockedChanged |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4824 |
terminalView scrollLock:scrollLockedHolder value. |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4825 |
! |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4826 |
|
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4827 |
scrollLockedHolder |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4828 |
scrollLockedHolder isNil ifTrue:[ |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4829 |
scrollLockedHolder := false asValue |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4830 |
]. |
3706d48d3c1b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14799
diff
changeset
|
4831 |
^ scrollLockedHolder. |
3892 | 4832 |
! ! |
4833 |
||
4834 |
!FileApplicationNoteBook::Terminal methodsFor:'initialization & release'! |
|
4835 |
||
14462
293b9728e748
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14458
diff
changeset
|
4836 |
doClose |
293b9728e748
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14458
diff
changeset
|
4837 |
terminalView closeDownShell. |
293b9728e748
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14458
diff
changeset
|
4838 |
^ super doClose. |
293b9728e748
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14458
diff
changeset
|
4839 |
! |
293b9728e748
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14458
diff
changeset
|
4840 |
|
3892 | 4841 |
shellFinished |
4842 |
| master text string| |
|
4843 |
||
4844 |
master := self masterApplication. |
|
4845 |
master notNil ifTrue:[ |
|
4846 |
string := ' - closed'. |
|
4847 |
master tabStringAdd:string for:self. |
|
4848 |
]. |
|
4523 | 4849 |
self notify:'shell in ' , self fileName asString, ' finished'. |
3892 | 4850 |
terminalView cr. |
4515 | 4851 |
|
16513 | 4852 |
text := '>> shell terminated.' allBold withColor:#red. |
3892 | 4853 |
terminalView nextPutAll:text. |
4854 |
! |
|
4855 |
||
4856 |
startShell |
|
4857 |
|vt100| |
|
4858 |
||
4859 |
vt100 := self terminalView. |
|
4860 |
vt100 shellTerminateAction:[ self shellFinished ]. |
|
4861 |
vt100 startShellIn:(self fileName). |
|
4862 |
! ! |
|
4863 |
||
4864 |
!FileApplicationNoteBook::Terminal methodsFor:'printing'! |
|
4865 |
||
8002
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
4866 |
printOn:aStream |
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
4867 |
aStream nextPutAll:'Terminal on:'. |
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
4868 |
self fileName baseName printOn:aStream. |
3892 | 4869 |
! ! |
4870 |
||
4871 |
!FileApplicationNoteBook::Terminal methodsFor:'queries'! |
|
4872 |
||
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4873 |
getTabIcon |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4874 |
"the item shown in a tab" |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4875 |
|
14802
99e863c55e0f
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14801
diff
changeset
|
4876 |
^ ToolbarIconLibrary console13x13Icon |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4877 |
! |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
4878 |
|
7687 | 4879 |
getTabValueString |
4880 |
"the item shown in a tab (not language translated)" |
|
4881 |
||
4882 |
^ nil |
|
4883 |
||
4884 |
"Created: / 01-03-2007 / 21:39:56 / cg" |
|
3892 | 4885 |
! ! |
4886 |
||
4887 |
!FileApplicationNoteBook::Terminal methodsFor:'startup & release'! |
|
4888 |
||
4889 |
postOpenWith:aBuilder |
|
6626 | 4890 |
"only invoked if the application not started from a master" |
4891 |
||
3892 | 4892 |
self masterApplication isNil ifTrue:[ |
4893 |
self masterApplication:nil. |
|
3982 | 4894 |
self item:(DirectoryContentsBrowser itemClass fileName:(Filename currentDirectory asAbsoluteFilename)). |
3892 | 4895 |
]. |
4896 |
self startShell. |
|
6626 | 4897 |
super postOpenWith:aBuilder. |
14444
cea130516cc0
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14412
diff
changeset
|
4898 |
terminalView requestFocus. |
3892 | 4899 |
! ! |
4900 |
||
4901 |
!FileApplicationNoteBook::TextEditor class methodsFor:'defaults'! |
|
4902 |
||
5461 | 4903 |
checkModifiedDelayTime |
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
4904 |
^ 30 "seconds" |
5461 | 4905 |
! |
4906 |
||
10761 | 4907 |
defaultTagsBrowserVisible |
4908 |
^ DefaultTagsBrowserVisible ? true |
|
4909 |
||
4910 |
"Created: / 06-10-2011 / 12:45:58 / cg" |
|
4911 |
! |
|
4912 |
||
3892 | 4913 |
tabStringFor:aApplicationType |
7687 | 4914 |
"the formatString shown in a tab (language translated)" |
3892 | 4915 |
|
4916 |
aApplicationType == #directoryDescription ifTrue:[ |
|
7687 | 4917 |
^ 'Directory Description of %1' |
4918 |
]. |
|
4919 |
^ '%1' |
|
4920 |
||
4921 |
"Modified: / 01-03-2007 / 21:46:24 / cg" |
|
3892 | 4922 |
! |
4923 |
||
4924 |
wantNewApplicationAnyway |
|
4925 |
||
4926 |
^ false |
|
4927 |
! ! |
|
4928 |
||
7909 | 4929 |
!FileApplicationNoteBook::TextEditor class methodsFor:'documentation'! |
4930 |
||
4931 |
documentation |
|
4932 |
" |
|
4933 |
a previewer-plugin for plain text |
|
4934 |
Offers edit, hex-display and diff functions. |
|
4935 |
" |
|
4936 |
! ! |
|
4937 |
||
11099 | 4938 |
!FileApplicationNoteBook::TextEditor class methodsFor:'help specs'! |
4939 |
||
4940 |
helpSpec |
|
4941 |
"This resource specification was automatically generated |
|
4942 |
by the UIHelpTool of ST/X." |
|
4943 |
||
4944 |
"Do not manually edit this!! If it is corrupted, |
|
4945 |
the UIHelpTool may not be able to read the specification." |
|
4946 |
||
4947 |
" |
|
4948 |
UIHelpTool openOnClass:FileApplicationNoteBook::TextEditor |
|
4949 |
" |
|
4950 |
||
4951 |
<resource: #help> |
|
4952 |
||
4953 |
^ super helpSpec addPairsFrom:#( |
|
4954 |
||
4955 |
#closeTabButton |
|
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4956 |
'Close this tab' |
11099 | 4957 |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4958 |
#hideEditorOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4959 |
'Hide the additional editor operations menu' |
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 |
#indentCode |
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4962 |
'Indent the selected lines (or the cursor line) by 4' |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4963 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4964 |
#showEditOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4965 |
'Show the additional editor operations menu' |
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 |
#undentCode |
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4968 |
'Undent the selected lines (or the cursor line) by 4' |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4969 |
|
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4970 |
#toggleBold |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4971 |
'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
|
4972 |
|
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4973 |
#toggleItalic |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4974 |
'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
|
4975 |
|
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4976 |
#toggleCode |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4977 |
'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
|
4978 |
|
14808
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
4979 |
#toggleEscape |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
4980 |
'Escape the selected characters with &; escape sequences.\(i.e. change "<" into "<")' |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
4981 |
|
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4982 |
#addAnchor |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4983 |
'Make the selection an an anchor element' |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4984 |
|
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4985 |
#addImage |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4986 |
'Insert a bitmap image element' |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
4987 |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4988 |
|
11099 | 4989 |
) |
4990 |
! ! |
|
4991 |
||
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4992 |
!FileApplicationNoteBook::TextEditor class methodsFor:'image specs'! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4993 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4994 |
hideToolBarIcon |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4995 |
<resource: #programImage> |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4996 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4997 |
^ ToolbarIconLibrary hideToolBarIcon |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4998 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
4999 |
"Created: / 02-08-2013 / 16:03:09 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5000 |
! ! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5001 |
|
8912 | 5002 |
!FileApplicationNoteBook::TextEditor class methodsFor:'interface specs'! |
3892 | 5003 |
|
5004 |
windowSpec |
|
5005 |
"This resource specification was automatically generated |
|
5006 |
by the UIPainter of ST/X." |
|
5007 |
||
5008 |
"Do not manually edit this!! If it is corrupted, |
|
5009 |
the UIPainter may not be able to read the specification." |
|
5010 |
||
5011 |
" |
|
3950 | 5012 |
UIPainter new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#windowSpec |
5013 |
FileApplicationNoteBook::TextEditor new openInterface:#windowSpec |
|
5014 |
FileApplicationNoteBook::TextEditor open |
|
3892 | 5015 |
" |
5016 |
||
5017 |
<resource: #canvas> |
|
5018 |
||
5019 |
^ |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5020 |
#(FullSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5021 |
name: windowSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5022 |
window: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5023 |
(WindowSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5024 |
label: 'TextEditor' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5025 |
name: 'TextEditor' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5026 |
min: (Point 10 10) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5027 |
bounds: (Rectangle 0 0 650 300) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5028 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5029 |
component: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5030 |
(SpecCollection |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5031 |
collection: ( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5032 |
(VariableHorizontalPanelSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5033 |
name: 'Panel' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5034 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5035 |
showHandle: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5036 |
snapMode: max |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5037 |
component: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5038 |
(SpecCollection |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5039 |
collection: ( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5040 |
(ViewSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5041 |
name: 'EditorBox' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5042 |
component: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5043 |
(SpecCollection |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5044 |
collection: ( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5045 |
(MenuPanelSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5046 |
name: 'MenuTextEditor' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5047 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 30 0) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5048 |
level: 1 |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5049 |
menu: menu |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5050 |
textDefault: true |
9949
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
5051 |
) |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5052 |
(ViewSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5053 |
name: 'EditorOperationsToolBar' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5054 |
layout: (LayoutFrame 0 0 30 0 0 1 60 0) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5055 |
level: 0 |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5056 |
visibilityChannel: editorOperationsToolBarVisibleHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5057 |
component: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5058 |
(SpecCollection |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5059 |
collection: ( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5060 |
(ActionButtonSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5061 |
label: 'hideToolBarIcon' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5062 |
name: 'HideEditorOperationsToolBarButton' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5063 |
layout: (LayoutFrame 0 0 0 0 13 0 0 1) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5064 |
activeHelpKey: hideEditorOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5065 |
level: 1 |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5066 |
hasCharacterOrientedLabel: false |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5067 |
translateLabel: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5068 |
model: hideEditorOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5069 |
postBuildCallback: hideEditorOperationsToolBarButtonCreated: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5070 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5071 |
(MenuPanelSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5072 |
name: 'EditorOperationsToolBarMenu' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5073 |
layout: (LayoutFrame 13 0 0 0 0 1 30 0) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5074 |
level: 1 |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5075 |
menu: editorOperationsMenuSpecHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5076 |
textDefault: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5077 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5078 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5079 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5080 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5081 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5082 |
(TextEditorSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5083 |
name: 'TextEditor' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5084 |
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
|
5085 |
model: fileContentsModel |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5086 |
hasHorizontalScrollBar: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5087 |
hasVerticalScrollBar: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5088 |
modifiedChannel: viewModifiedChannel |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5089 |
acceptCallBack: accept |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5090 |
allowDoIt: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5091 |
hasKeyboardFocusInitially: false |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5092 |
postBuildCallback: postBuildTextEditor: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5093 |
viewClassName: 'getEditorClass' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5094 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5095 |
(ActionButtonSpec |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5096 |
label: '...' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5097 |
name: 'Button1' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5098 |
layout: (LayoutFrame -56 1 5 0 -36 1 27 0) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5099 |
activeHelpKey: showEditOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5100 |
visibilityChannel: editorOperationsToolBarNotVisibleHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5101 |
translateLabel: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5102 |
model: showEditorOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5103 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5104 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5105 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5106 |
) |
9946 | 5107 |
) |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5108 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5109 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5110 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5111 |
handles: (Any 1.0) |
5417 | 5112 |
) |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5113 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5114 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5115 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5116 |
) |
5417 | 5117 |
! |
5118 |
||
5119 |
xwindowSpec |
|
5120 |
"This resource specification was automatically generated |
|
5121 |
by the UIPainter of ST/X." |
|
5122 |
||
5123 |
"Do not manually edit this!! If it is corrupted, |
|
5124 |
the UIPainter may not be able to read the specification." |
|
5125 |
||
5126 |
" |
|
5127 |
UIPainter new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#windowSpec |
|
5128 |
FileApplicationNoteBook::TextEditor new openInterface:#windowSpec |
|
5129 |
FileApplicationNoteBook::TextEditor open |
|
5130 |
" |
|
5131 |
||
5132 |
<resource: #canvas> |
|
5133 |
||
5134 |
^ |
|
3892 | 5135 |
#(#FullSpec |
5136 |
#name: #windowSpec |
|
5137 |
#window: |
|
5138 |
#(#WindowSpec |
|
5139 |
#label: 'TextEditor' |
|
5140 |
#name: 'TextEditor' |
|
5141 |
#min: #(#Point 10 10) |
|
5142 |
#max: #(#Point 1024 768) |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
5143 |
#bounds: #(#Rectangle 16 42 666 342) |
3892 | 5144 |
) |
5145 |
#component: |
|
5146 |
#(#SpecCollection |
|
5147 |
#collection: #( |
|
5148 |
#(#MenuPanelSpec |
|
5149 |
#name: 'MenuTextEditor' |
|
5150 |
#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
|
5151 |
#level: 0 |
3892 | 5152 |
#menu: #menu |
5153 |
#textDefault: true |
|
5154 |
) |
|
5155 |
#(#TextEditorSpec |
|
5156 |
#name: 'TextEditor' |
|
5157 |
#layout: #(#LayoutFrame 0 0.0 32 0 0 1.0 0 1.0) |
|
5158 |
#model: #fileContentsModel |
|
5159 |
#hasHorizontalScrollBar: true |
|
5160 |
#hasVerticalScrollBar: true |
|
4071 | 5161 |
#modifiedChannel: #viewModifiedChannel |
3892 | 5162 |
#acceptCallBack: #accept |
3950 | 5163 |
#allowDoIt: true |
3892 | 5164 |
#postBuildCallback: #postBuildTextEditor: |
5165 |
) |
|
5166 |
) |
|
5167 |
||
5168 |
) |
|
5169 |
) |
|
5170 |
! ! |
|
5171 |
||
5172 |
!FileApplicationNoteBook::TextEditor class methodsFor:'menu specs'! |
|
5173 |
||
5174 |
menu |
|
5175 |
"This resource specification was automatically generated |
|
5176 |
by the MenuEditor of ST/X." |
|
5177 |
||
5178 |
"Do not manually edit this!! If it is corrupted, |
|
5179 |
the MenuEditor may not be able to read the specification." |
|
5180 |
||
11099 | 5181 |
|
3892 | 5182 |
" |
5183 |
MenuEditor new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#menu |
|
5184 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::TextEditor menu)) startUp |
|
5185 |
" |
|
5186 |
||
5187 |
<resource: #menu> |
|
5188 |
||
5189 |
^ |
|
5197 | 5190 |
#(Menu |
5191 |
( |
|
5192 |
(MenuItem |
|
8087 | 5193 |
activeHelpKey: saveFile |
5197 | 5194 |
enabled: enableSave |
5429 | 5195 |
label: 'Save' |
5196 |
itemValue: accept |
|
5197 |
nameKey: Save |
|
5198 |
isButton: true |
|
11099 | 5199 |
isVisible: saveButtonVisible |
6117 | 5200 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveTextToFileIcon) |
5429 | 5201 |
) |
5202 |
(MenuItem |
|
8684 | 5203 |
activeHelpKey: saveFileAs |
5204 |
enabled: enableSaveAs |
|
5205 |
label: 'Save As...' |
|
5206 |
itemValue: saveFileAs |
|
5207 |
nameKey: SaveAs |
|
5208 |
isButton: true |
|
11099 | 5209 |
isVisible: saveAsButtonVisible |
8684 | 5210 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveToFileAsIcon) |
5211 |
) |
|
5212 |
(MenuItem |
|
8087 | 5213 |
activeHelpKey: reloadFile |
5197 | 5214 |
enabled: enableReload |
5215 |
label: 'Reload' |
|
5216 |
itemValue: reload |
|
5217 |
nameKey: Reload |
|
5218 |
isButton: true |
|
11099 | 5219 |
isVisible: reloadButtonVisible |
6117 | 5220 |
labelImage: (ResourceRetriever ToolbarIconLibrary reloadTextFromFileIcon) |
3892 | 5221 |
) |
5197 | 5222 |
(MenuItem |
8087 | 5223 |
activeHelpKey: findInBrowser |
5224 |
enabled: enableSelectInBrowser |
|
5225 |
label: 'Select in Browser' |
|
5226 |
itemValue: selectInBrowser |
|
5227 |
nameKey: SelectInBrowser |
|
5228 |
isButton: true |
|
11099 | 5229 |
isVisible: selectInBrowserButtonVisible |
8087 | 5230 |
labelImage: (ResourceRetriever ToolbarIconLibrary searchFileIcon) |
5231 |
) |
|
5232 |
(MenuItem |
|
6681 | 5233 |
label: '-' |
3892 | 5234 |
) |
5197 | 5235 |
(MenuItem |
8087 | 5236 |
activeHelpKey: print |
5197 | 5237 |
enabled: enableHexToggle |
5238 |
label: 'Print' |
|
5239 |
itemValue: doPrint |
|
5240 |
nameKey: Print |
|
5241 |
isButton: true |
|
6117 | 5242 |
labelImage: (ResourceRetriever ToolbarIconLibrary printerIcon) |
3892 | 5243 |
) |
5197 | 5244 |
(MenuItem |
6681 | 5245 |
label: '-' |
3892 | 5246 |
) |
5197 | 5247 |
(MenuItem |
15815
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5248 |
activeHelpKey: showDifferences |
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5249 |
label: 'Diff to Current' |
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5250 |
itemValue: openDiffView |
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5251 |
isButton: true |
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5252 |
isVisible: diffTextButtonVisible |
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5253 |
labelImage: (ResourceRetriever ToolbarIconLibrary diffIcon) |
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5254 |
) |
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
5255 |
(MenuItem |
8087 | 5256 |
activeHelpKey: toggleHexDisplay |
5197 | 5257 |
enabled: enableHexToggle |
5258 |
label: 'Hex' |
|
5259 |
isButton: true |
|
5260 |
indication: printAsHexDump |
|
17747 | 5261 |
submenu: |
5262 |
(Menu |
|
5263 |
( |
|
5264 |
(MenuItem |
|
17752 | 5265 |
label: 'Character Decoding in Dump' |
17747 | 5266 |
submenu: |
5267 |
(Menu |
|
5268 |
( |
|
5269 |
(MenuItem |
|
5270 |
label: 'Iso8859-1' |
|
5271 |
itemValue: characterEncodingInDump: |
|
5272 |
argument: #'iso8859-1' |
|
5273 |
) |
|
5274 |
(MenuItem |
|
5275 |
label: 'Ascii7' |
|
5276 |
itemValue: characterEncodingInDump: |
|
17748 | 5277 |
argument: ascii7 |
17747 | 5278 |
) |
5279 |
(MenuItem |
|
17749 | 5280 |
label: 'EBCDIC-037' |
17747 | 5281 |
itemValue: characterEncodingInDump: |
17749 | 5282 |
argument: #'ebcdic-037' |
17747 | 5283 |
) |
5284 |
) |
|
5285 |
nil |
|
5286 |
nil |
|
5287 |
) |
|
5288 |
) |
|
5289 |
(MenuItem |
|
5290 |
label: '-' |
|
5291 |
) |
|
5292 |
(MenuItem |
|
5293 |
label: 'Hex' |
|
5294 |
itemValue: radixInDump: |
|
5295 |
argument: 16 |
|
5296 |
) |
|
5297 |
(MenuItem |
|
5298 |
label: 'Octal' |
|
5299 |
itemValue: radixInDump: |
|
5300 |
argument: 8 |
|
5301 |
) |
|
5302 |
(MenuItem |
|
5303 |
label: 'Decimal' |
|
5304 |
itemValue: radixInDump: |
|
5305 |
argument: 10 |
|
5306 |
) |
|
5307 |
(MenuItem |
|
5308 |
label: 'Binary' |
|
5309 |
itemValue: radixInDump: |
|
5310 |
argument: 2 |
|
5311 |
) |
|
5312 |
) |
|
5313 |
nil |
|
5314 |
nil |
|
5315 |
) |
|
6096 | 5316 |
labelImage: (ResourceRetriever ToolbarIconLibrary hexToggleIcon) |
3892 | 5317 |
) |
5197 | 5318 |
(MenuItem |
5319 |
label: '' |
|
8684 | 5320 |
isVisible: diffTextButtonVisible |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
5321 |
) |
5197 | 5322 |
(MenuItem |
6681 | 5323 |
activeHelpKey: closeTabButton |
5197 | 5324 |
label: 'Close' |
5325 |
itemValue: doClose |
|
5326 |
isButton: true |
|
5327 |
startGroup: right |
|
11099 | 5328 |
isVisible: closeButtonShown |
5197 | 5329 |
hideMenuOnActivated: false |
6093 | 5330 |
labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon) |
3892 | 5331 |
) |
5332 |
) |
|
5333 |
nil |
|
5334 |
nil |
|
5335 |
) |
|
17747 | 5336 |
|
17752 | 5337 |
"Modified: / 14-11-2017 / 00:17:49 / cg" |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5338 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5339 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5340 |
menuEditorOperationsForHTML |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5341 |
"This resource specification was automatically generated |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5342 |
by the MenuEditor of ST/X." |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5343 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5344 |
"Do not manually edit this!! If it is corrupted, |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5345 |
the MenuEditor may not be able to read the specification." |
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 |
|
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 |
MenuEditor new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#menuEditorOperationsForHTML |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5350 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::TextEditor menuEditorOperationsForHTML)) startUp |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5351 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5352 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5353 |
<resource: #menu> |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5354 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5355 |
^ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5356 |
#(Menu |
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 |
(MenuItem |
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5359 |
activeHelpKey: toggleBold |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5360 |
label: 'bold' |
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5361 |
itemValue: editOperationToggleBoldHTML |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5362 |
labelImage: (ResourceRetriever ToolbarIconLibrary #'edit_bold_15x15') |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5363 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5364 |
(MenuItem |
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5365 |
activeHelpKey: toggleItalic |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5366 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5367 |
label: 'italic' |
14808
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5368 |
itemValue: editOperationToggleItalicHTML |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5369 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5370 |
labelImage: (ResourceRetriever ToolbarIconLibrary #'edit_italic_15x15') |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5371 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5372 |
(MenuItem |
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5373 |
activeHelpKey: toggleCode |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5374 |
enabled: canEdit |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5375 |
label: 'code' |
14808
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5376 |
itemValue: editOperationToggleCodeHTML |
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5377 |
isButton: true |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5378 |
labelImage: (ResourceRetriever ToolbarIconLibrary #'edit_code_15x15') |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5379 |
) |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5380 |
(MenuItem |
14808
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5381 |
activeHelpKey: toggleEscape |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5382 |
enabled: canEdit |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5383 |
label: 'escape' |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5384 |
itemValue: editOperationEscapeSpecialCharactersHTML |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5385 |
isButton: true |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5386 |
labelImage: (ResourceRetriever ToolbarIconLibrary #'edit_escapeHTMLCharacters') |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5387 |
) |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5388 |
(MenuItem |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5389 |
activeHelpKey: addAnchor |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5390 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5391 |
label: 'anchor' |
14808
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5392 |
itemValue: editOperationAddAnchorHTML |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5393 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5394 |
labelImage: (ResourceRetriever ToolbarIconLibrary #'edit_anchor15x15') |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5395 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5396 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5397 |
activeHelpKey: addImage |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5398 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5399 |
label: 'image' |
14808
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5400 |
itemValue: editOperationAddImageHTML |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5401 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5402 |
labelImage: (ResourceRetriever ToolbarIconLibrary #'edit_image_15x15') |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5403 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5404 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5405 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5406 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5407 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5408 |
! |
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 |
menuEditorOperationsForNormalText |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5411 |
"This resource specification was automatically generated |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5412 |
by the MenuEditor of ST/X." |
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 |
"Do not manually edit this!! If it is corrupted, |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5415 |
the MenuEditor may not be able to read the specification." |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5416 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5417 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5418 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5419 |
MenuEditor new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#menuEditorOperationsForNormalText |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5420 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::TextEditor menuEditorOperationsForNormalText)) startUp |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5421 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5422 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5423 |
<resource: #menu> |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5424 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5425 |
^ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5426 |
#(Menu |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5427 |
( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5428 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5429 |
activeHelpKey: undentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5430 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5431 |
label: 'Undent' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5432 |
itemValue: editOperationUndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5433 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5434 |
startGroup: right |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5435 |
labelImage: (ResourceRetriever ToolbarIconLibrary undent16x16Icon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5436 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5437 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5438 |
activeHelpKey: indentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5439 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5440 |
label: 'Indent' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5441 |
itemValue: editOperationIndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5442 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5443 |
startGroup: right |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5444 |
labelImage: (ResourceRetriever ToolbarIconLibrary indent16x16Icon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5445 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5446 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5447 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5448 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5449 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5450 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5451 |
"Modified: / 02-08-2013 / 18:21:42 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5452 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5453 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5454 |
menuEditorOperationsForOther |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5455 |
"This resource specification was automatically generated |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5456 |
by the MenuEditor of ST/X." |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5457 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5458 |
"Do not manually edit this!! If it is corrupted, |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5459 |
the MenuEditor may not be able to read the specification." |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5460 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5461 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5462 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5463 |
MenuEditor new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#menuEditorOperationsForNormalText |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5464 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::TextEditor menuEditorOperationsForNormalText)) startUp |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5465 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5466 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5467 |
<resource: #menu> |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5468 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5469 |
^ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5470 |
#(Menu |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5471 |
( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5472 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5473 |
activeHelpKey: undentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5474 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5475 |
label: 'Undent' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5476 |
itemValue: editOperationUndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5477 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5478 |
startGroup: right |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5479 |
labelImage: (ResourceRetriever ToolbarIconLibrary undent16x16Icon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5480 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5481 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5482 |
activeHelpKey: indentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5483 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5484 |
label: 'Indent' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5485 |
itemValue: editOperationIndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5486 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5487 |
startGroup: right |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5488 |
labelImage: (ResourceRetriever ToolbarIconLibrary indent16x16Icon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5489 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5490 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5491 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5492 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5493 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5494 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5495 |
"Created: / 02-08-2013 / 17:09:31 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5496 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5497 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5498 |
menuEditorOperationsForSourceCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5499 |
"This resource specification was automatically generated |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5500 |
by the MenuEditor of ST/X." |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5501 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5502 |
"Do not manually edit this!! If it is corrupted, |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5503 |
the MenuEditor may not be able to read the specification." |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5504 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5505 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5506 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5507 |
MenuEditor new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#menuEditorOperationsForSourceCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5508 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::TextEditor menuEditorOperationsForSourceCode)) startUp |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5509 |
" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5510 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5511 |
<resource: #menu> |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5512 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5513 |
^ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5514 |
#(Menu |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5515 |
( |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5516 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5517 |
activeHelpKey: #'help_doIt' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5518 |
label: 'DoIt' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5519 |
itemValue: doIt |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5520 |
isButton: true |
13729
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
5521 |
isVisible: doItMenuButtonVisible |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5522 |
labelImage: (ResourceRetriever ToolbarIconLibrary doItIcon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5523 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5524 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5525 |
activeHelpKey: #'help_printIt' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5526 |
label: 'PrintIt' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5527 |
itemValue: printIt |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5528 |
isButton: true |
13729
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
5529 |
isVisible: printItMenuButtonVisible |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5530 |
labelImage: (ResourceRetriever ToolbarIconLibrary printItIcon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5531 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5532 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5533 |
activeHelpKey: #'help_inspectIt' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5534 |
label: 'InspectIt' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5535 |
itemValue: inspectIt |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5536 |
isButton: true |
13729
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
5537 |
isVisible: inspectItMenuButtonVisible |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5538 |
labelImage: (ResourceRetriever ToolbarIconLibrary inspectItIcon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5539 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5540 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5541 |
activeHelpKey: undentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5542 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5543 |
label: 'Undent' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5544 |
itemValue: editOperationUndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5545 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5546 |
startGroup: right |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5547 |
labelImage: (ResourceRetriever ToolbarIconLibrary undent16x16Icon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5548 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5549 |
(MenuItem |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5550 |
activeHelpKey: indentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5551 |
enabled: canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5552 |
label: 'Indent' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5553 |
itemValue: editOperationIndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5554 |
isButton: true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5555 |
startGroup: right |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5556 |
labelImage: (ResourceRetriever ToolbarIconLibrary indent16x16Icon) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5557 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5558 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5559 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5560 |
nil |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5561 |
) |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5562 |
|
13729
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
5563 |
"Modified: / 17-12-2013 / 16:37:59 / cg" |
3892 | 5564 |
! ! |
5565 |
||
5566 |
!FileApplicationNoteBook::TextEditor methodsFor:'accessing'! |
|
5567 |
||
5528 | 5568 |
fileEncoding |
5569 |
^ self fileEncodingHolder value |
|
5570 |
! |
|
5571 |
||
5534 | 5572 |
fileEncoding:newEncoding |
5573 |
self fileEncodingHolder value:newEncoding. |
|
5528 | 5574 |
|
5575 |
editView notNil ifTrue:[ |
|
5705 | 5576 |
self enableReload value:true. |
5534 | 5577 |
editView externalEncoding:newEncoding. |
5528 | 5578 |
]. |
5579 |
! |
|
5580 |
||
3892 | 5581 |
item:aDirContentsItem |
5582 |
||
4977
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
5583 |
self releaseCheckModify. |
4620 | 5584 |
(self item = aDirContentsItem and:[(self presentation == #hexDump) == self printAsHexDump value]) ifTrue:[^ true]. |
7947 | 5585 |
|
5534 | 5586 |
self askForChangeWithReload:false "true". |
5197 | 5587 |
|
3892 | 5588 |
super item:aDirContentsItem. |
4698 | 5589 |
self printAsHexDump value:(self presentation == #hexDump) withoutNotifying:self. |
9946 | 5590 |
self updateTagsBrowser. |
4201 | 5591 |
self setContents ifFalse:[ ^ false]. |
5528 | 5592 |
|
5593 |
self setUpTextView. |
|
5594 |
||
4977
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
5595 |
textEditorModificationTime := self fileName modificationTime. |
5417 | 5596 |
self releaseCheckModify. |
4969 | 5597 |
self setupCheckModify. |
5417 | 5598 |
self changeInformation. |
3892 | 5599 |
^ true |
9946 | 5600 |
|
5601 |
"Modified: / 23-06-2011 / 16:45:13 / cg" |
|
18670 | 5602 |
"Modified: / 12-03-2019 / 15:33:51 / Claus Gittinger" |
3892 | 5603 |
! |
5604 |
||
5737 | 5605 |
lockFileEncoding:aBoolean |
5606 |
self lockFileEncodingHolder value:aBoolean. |
|
5607 |
! |
|
5608 |
||
3892 | 5609 |
presentation |
17747 | 5610 |
"return the current presentation (either #hexDump or #asText)" |
5611 |
||
5612 |
^ self presentationHolder value |
|
5613 |
||
5614 |
"Modified: / 12-11-2017 / 12:33:43 / cg" |
|
5615 |
! |
|
5616 |
||
5617 |
presentation:aSymbol |
|
5618 |
"change the presentation (either #hexDump or #asText)" |
|
5619 |
||
5620 |
"/ self assert:((aSymbol == #asText) or:[aSymbol == #hexDump]). |
|
5621 |
self presentationHolder value:aSymbol. |
|
5622 |
||
5623 |
"Modified (comment): / 12-11-2017 / 12:34:44 / cg" |
|
3892 | 5624 |
! |
5625 |
||
5626 |
semaChangeItem |
|
5627 |
^ semaChangeItem |
|
5459 | 5628 |
! |
5629 |
||
5630 |
type:aType |
|
5631 |
||
5632 |
super type:aType. |
|
5633 |
self changeInformation. |
|
3892 | 5634 |
! ! |
5635 |
||
5636 |
!FileApplicationNoteBook::TextEditor methodsFor:'actions'! |
|
5637 |
||
5638 |
accept |
|
5417 | 5639 |
self saveWithAskForFilename:false. |
3892 | 5640 |
! |
5641 |
||
5198
ea3f838e1353
do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents:
5197
diff
changeset
|
5642 |
askForChangeWithReload:doReload |
5197 | 5643 |
"ask for save changes; |
5644 |
if modified and answered true, the current contents is written back (accepted) |
|
3892 | 5645 |
" |
5646 |
||
5578 | 5647 |
self askForChangeWithReload:doReload forClose:false |
5648 |
! |
|
5649 |
||
5650 |
askForChangeWithReload:doReload forClose:forClose |
|
5651 |
"ask for save changes; |
|
5652 |
if modified and answered true, the current contents is written back (accepted) |
|
5653 |
" |
|
5654 |
||
5471
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5655 |
|fn answer string arg| |
3892 | 5656 |
|
5197 | 5657 |
self modifiedChannel value ifFalse:[ ^ false]. |
5658 |
||
5471
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5659 |
fn := self fileName. |
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5660 |
fn isNil ifTrue:[ |
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5661 |
fn := 'unknown' |
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5662 |
] ifFalse:[ |
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5663 |
fn := fn baseName. |
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5664 |
]. |
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
5665 |
arg := fn allBold. |
5197 | 5666 |
|
5578 | 5667 |
string := 'Save changed file "%1" ?'. |
5668 |
||
5669 |
forClose ifTrue:[ |
|
5670 |
self itemChanged value ifTrue:[ |
|
9568 | 5671 |
string := 'Modified %1 was changed by someone else.\\Save your changes (overwrite someone''s changes) ?' |
5578 | 5672 |
] ifFalse:[ |
5673 |
self itemRemoved value ifTrue:[ |
|
6376 | 5674 |
string := 'Modified %1 was removed by someone else.\\Save your changes (recreate the removed file) ?' |
5578 | 5675 |
] |
5676 |
]. |
|
5197 | 5677 |
] ifFalse:[ |
5578 | 5678 |
self itemChanged value ifTrue:[ |
9568 | 5679 |
string := '%1 was changed by someone else.\\Save your changes anyway (overwrite someon''es changes) ?' |
5197 | 5680 |
] ifFalse:[ |
5578 | 5681 |
self itemRemoved value ifTrue:[ |
6376 | 5682 |
string := '%1 was removed by someone else.\\Save your changes anyway (recreate the removed file) ?' |
5578 | 5683 |
] |
5684 |
]. |
|
3892 | 5685 |
]. |
5197 | 5686 |
|
5199
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5687 |
answer := OptionBox |
6376 | 5688 |
request:(resources stringWithCRs:string with:arg) |
5199
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5689 |
buttonLabels:(resources array:#('Cancel' 'Show Diffs' 'No' 'Yes')) |
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5690 |
values:#(nil showDiffs false true) |
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5691 |
default:nil. |
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5692 |
|
5197 | 5693 |
answer isNil ifTrue:[^ AbortOperationRequest raise ]. |
5694 |
||
5199
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5695 |
answer == #showDiffs ifTrue:[ |
5201 | 5696 |
self openDiffView. |
5199
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5697 |
AbortOperationRequest raise |
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5698 |
]. |
f8f257045045
added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents:
5198
diff
changeset
|
5699 |
|
5197 | 5700 |
answer ifTrue:[ |
5701 |
self accept |
|
5702 |
] ifFalse:[ |
|
5198
ea3f838e1353
do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents:
5197
diff
changeset
|
5703 |
doReload ifTrue:[ |
ea3f838e1353
do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents:
5197
diff
changeset
|
5704 |
self setContents. |
ea3f838e1353
do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents:
5197
diff
changeset
|
5705 |
] |
3892 | 5706 |
]. |
5707 |
^ answer |
|
9568 | 5708 |
|
5709 |
"Modified: / 11-09-2010 / 13:07:37 / cg" |
|
3892 | 5710 |
! |
5711 |
||
5712 |
changeInformation |
|
5713 |
||
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
5714 |
|string win| |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
5715 |
|
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
5716 |
string := self getTabString. |
3892 | 5717 |
masterApplication isNil ifTrue:[ |
4621 | 5718 |
win := self window. |
5719 |
win notNil ifTrue:[ |
|
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
5720 |
self window label:string asString string. |
4621 | 5721 |
]. |
3892 | 5722 |
] ifFalse:[ |
14799
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
5723 |
masterApplication tabStringChangeTo:string for:self. |
9931a2248312
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14660
diff
changeset
|
5724 |
]. |
3892 | 5725 |
! |
5726 |
||
4161 | 5727 |
changeInformationForModified:aSymbol |
4045 | 5728 |
masterApplication isNil ifTrue:[ ^ self]. |
4161 | 5729 |
masterApplication changeModified:aSymbol for:self. |
4045 | 5730 |
! |
5731 |
||
17747 | 5732 |
characterEncodingInDump:anEencodingSymbol |
5733 |
characterEncodingInDump ~~ anEencodingSymbol ifTrue:[ |
|
5734 |
characterEncodingInDump := anEencodingSymbol. |
|
5735 |
||
5736 |
self presentation == #hexDump ifTrue:[ |
|
5737 |
self changeInformation. |
|
5738 |
self setContents. |
|
5739 |
]. |
|
5740 |
]. |
|
5741 |
||
5742 |
"Created: / 12-11-2017 / 12:22:43 / cg" |
|
5743 |
! |
|
5744 |
||
3892 | 5745 |
doClose |
5746 |
||
5578 | 5747 |
self askForChangeWithReload:false forClose:true. |
3892 | 5748 |
self masterApplication notNil ifTrue:[ |
3954 | 5749 |
^ super doClose |
3892 | 5750 |
]. |
5751 |
^ true |
|
5752 |
! |
|
5753 |
||
5754 |
doPrint |
|
5755 |
"print the contents |
|
5756 |
" |
|
4473 | 5757 |
(Dialog confirm:'Print contents of editView ?') ifTrue:[ |
3892 | 5758 |
editView doPrint. |
5759 |
]. |
|
5760 |
! |
|
5761 |
||
5417 | 5762 |
doSaveAs |
5763 |
self saveWithAskForFilename:true. |
|
5764 |
! |
|
5765 |
||
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5766 |
editOperationAddAnchorHTML |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5767 |
|sel new| |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5768 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5769 |
sel := editView selectionAsString. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5770 |
sel isNil ifTrue:[^ self]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5771 |
|
16000 | 5772 |
new := '<A HREF="http://www.exept.de">',editView selectionAsString,'</A>'. |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5773 |
editView |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5774 |
undoableDo:[ |
13298
0e2817ce7e77
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13295
diff
changeset
|
5775 |
editView replaceSelectionBy:new keepCursor:false select:true |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5776 |
] |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5777 |
info:'Add Anchor' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5778 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5779 |
"Created: / 02-08-2013 / 18:16:44 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5780 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5781 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5782 |
editOperationAddImageHTML |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5783 |
|new| |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5784 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5785 |
new := '<IMG NOPRINT ALIGN="middle" SRC="xxx.png">'. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5786 |
editView |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5787 |
undoableDo:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5788 |
editView insertStringAtCursor:new |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5789 |
] |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5790 |
info:'Add Image' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5791 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5792 |
"Created: / 02-08-2013 / 18:17:26 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5793 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5794 |
|
14808
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5795 |
editOperationEscapeSpecialCharactersHTML |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5796 |
|sel escaped| |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5797 |
|
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5798 |
sel := editView selectionAsString. |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5799 |
sel isNil ifTrue:[^ self]. |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5800 |
|
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5801 |
escaped := HTMLUtilities withSpecialHTMLCharactersEscaped:sel. |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5802 |
editView |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5803 |
undoableDo:[ |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5804 |
editView replaceSelectionBy:escaped keepCursor:false select:true |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5805 |
] |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5806 |
info:'Escape HTML characters' |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5807 |
! |
e36c7a43aee4
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14802
diff
changeset
|
5808 |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5809 |
editOperationIndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5810 |
editView indentBy4 |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5811 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5812 |
"Created: / 02-08-2013 / 18:20:18 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5813 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5814 |
|
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5815 |
editOperationToggleBoldHTML |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5816 |
self editOperationToggleHTML:'Toggle Bold' start:'<b>' end:'</b>' |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5817 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5818 |
"Created: / 02-08-2013 / 18:04:27 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5819 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5820 |
|
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5821 |
editOperationToggleCodeHTML |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5822 |
self editOperationToggleHTML:'Toggle Code' start:'<code><pre>' end:'</pre></code>' |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5823 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5824 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5825 |
editOperationToggleHTML:info start:whatStart end:whatEnd |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5826 |
|sel new| |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5827 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5828 |
sel := editView selectionAsString. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5829 |
sel isNil ifTrue:[^ self]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5830 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5831 |
(sel asLowercase startsWith:whatStart) ifTrue:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5832 |
new := sel copyFrom: whatStart size+1. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5833 |
(new asLowercase endsWith:whatEnd) ifTrue:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5834 |
new := new copyButLast:whatEnd size. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5835 |
] |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5836 |
] ifFalse:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5837 |
new := whatStart,editView selectionAsString,whatEnd |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5838 |
]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5839 |
editView |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5840 |
undoableDo:[ |
13298
0e2817ce7e77
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13295
diff
changeset
|
5841 |
editView replaceSelectionBy:new keepCursor:false select:true |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5842 |
] |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5843 |
info:info |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5844 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5845 |
"Created: / 02-08-2013 / 18:14:25 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5846 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5847 |
|
13377
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5848 |
editOperationToggleItalicHTML |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5849 |
self editOperationToggleHTML:'Toggle Italic' start:'<i>' end:'</i>' |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5850 |
|
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5851 |
"Created: / 02-08-2013 / 18:14:55 / cg" |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5852 |
! |
2f8afe7d9426
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13298
diff
changeset
|
5853 |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5854 |
editOperationUndentCode |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5855 |
editView undentBy4 |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5856 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5857 |
"Created: / 02-08-2013 / 18:22:47 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5858 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
5859 |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
5860 |
getContents |
12346
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5861 |
|file fileSize contents presentation alreadyConfirmed answer sizeLimit showLastPart |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5862 |
dontAskAgainHolder| |
3892 | 5863 |
|
5864 |
file := self fileName. |
|
5831
6db521464804
care for no-selection when toggling hex-mode
Claus Gittinger <cg@exept.de>
parents:
5784
diff
changeset
|
5865 |
file isNil ifTrue:[ |
6db521464804
care for no-selection when toggling hex-mode
Claus Gittinger <cg@exept.de>
parents:
5784
diff
changeset
|
5866 |
^ nil |
6db521464804
care for no-selection when toggling hex-mode
Claus Gittinger <cg@exept.de>
parents:
5784
diff
changeset
|
5867 |
]. |
7487 | 5868 |
fileSize := file fileSize. |
5869 |
fileSize isNil ifTrue:[ |
|
5870 |
^ nil |
|
5871 |
]. |
|
5831
6db521464804
care for no-selection when toggling hex-mode
Claus Gittinger <cg@exept.de>
parents:
5784
diff
changeset
|
5872 |
|
8087 | 5873 |
self enableSelectInBrowser value:true. |
5874 |
||
6295 | 5875 |
presentation := self presentation. |
5876 |
presentation == #asText ifTrue:[ |
|
12346
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5877 |
fileSize > (MaxFileSizeLoadedWithoutAsking ? (8 * 1024 * 1024)) ifTrue:[ |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5878 |
dontAskAgainHolder := false asValue. |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5879 |
answer := Dialog |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5880 |
confirmWithCancel:(resources |
8471 | 5881 |
stringWithCRs:'%1 is very large (%2).\\Show all or only the first 8 Mb ?' |
5882 |
with:file baseName allBold |
|
5883 |
with:(UnitConverter fileSizeStringFor:fileSize)) |
|
12346
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5884 |
labels:(resources array:#('Cancel' 'Show All' 'Show Last Part' 'Show First Part' )) |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5885 |
values:#(#abort #all #last #first) |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5886 |
default:#abort |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5887 |
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
|
5888 |
title:(resources string:'Large File'). |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5889 |
|
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5890 |
answer == #all ifTrue:[ |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5891 |
dontAskAgainHolder value ifTrue:[ |
12348
bf878489e196
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12346
diff
changeset
|
5892 |
MaxFileSizeLoadedWithoutAsking := fileSize + 4096 |
12346
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5893 |
] |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5894 |
]. |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5895 |
|
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5896 |
"/ old |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5897 |
"/ answer := OptionBox |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5898 |
"/ request:(resources |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5899 |
"/ 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
|
5900 |
"/ with:file baseName allBold |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5901 |
"/ with:(UnitConverter fileSizeStringFor:fileSize)) |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5902 |
"/ label:(resources string:'Large File') |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5903 |
"/ buttonLabels:(resources array:#('Cancel' 'Show All' 'Show Last Part' 'Show First Part' )) |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5904 |
"/ values:#(#abort #all #last #first) |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5905 |
"/ default:#abort. |
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5906 |
|
7d832383f007
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12121
diff
changeset
|
5907 |
"/ very old |
8471 | 5908 |
"/ answer := Dialog |
5909 |
"/ confirmWithCancel:(resources |
|
5910 |
"/ stringWithCRs:'%1 is very large (%2).\\Show all or only the first 4 Mb ?' |
|
5911 |
"/ with:file baseName allBold |
|
5912 |
"/ with:(UnitConverter fileSizeStringFor:fileSize)) |
|
5913 |
"/ labels:#('Cancel' 'Show All' 'Show First Part' ). |
|
5914 |
"/ answer isNil ifTrue:[^ nil]. |
|
5915 |
"/ answer ifTrue:[ |
|
5916 |
"/ sizeLimit := 4 * 1024 * 1024 |
|
5917 |
"/ ]. |
|
5918 |
answer == #abort ifTrue:[^ nil ]. |
|
5919 |
answer ~~ #all ifTrue:[ |
|
5920 |
sizeLimit := 4 * 1024 * 1024. |
|
5921 |
showLastPart := (answer == #last). |
|
6295 | 5922 |
]. |
5923 |
]. |
|
5924 |
]. |
|
5925 |
||
5037 | 5926 |
ExternalStream readErrorSignal handle:[:ex | |
5927 |
(Dialog confirm:('Read Error.\\Retry ?' withCRs)) |
|
5019 | 5928 |
ifTrue:[ |
5037 | 5929 |
^ ex restart |
5019 | 5930 |
]. |
5037 | 5931 |
] do:[ |
5932 |
ExternalStream lineTooLongErrorSignal handle:[ :ex | |
|
5933 |
(alreadyConfirmed==true |
|
5934 |
or:[ Dialog confirm:(file asString, ' contains very long line(s).\\Load anyway ?' withCRs)]) |
|
5935 |
ifTrue:[ |
|
5936 |
alreadyConfirmed := true. |
|
5937 |
^ ex parameter second , ex parameter first nextLine |
|
5938 |
]. |
|
5939 |
^ nil. |
|
5940 |
] do:[ |
|
6295 | 5941 |
presentation == #asText ifTrue:[ |
8471 | 5942 |
contents := self getContentsAsTextWithSizeLimit:sizeLimit lastPart:showLastPart. |
5037 | 5943 |
] ifFalse:[ |
6295 | 5944 |
presentation == #hexDump ifTrue:[ |
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
5945 |
"/ self withWaitCursorDo:[ |
8471 | 5946 |
contents := AbstractFileBrowser |
17747 | 5947 |
contentsOfFileAsDump:file base:radixInDump |
8471 | 5948 |
withLimit:sizeLimit |
17745 | 5949 |
lastPart:showLastPart |
17747 | 5950 |
characterEncoding:characterEncodingInDump. |
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
5951 |
"/ ] |
4677 | 5952 |
] |
3892 | 5953 |
] |
5037 | 5954 |
]. |
3892 | 5955 |
]. |
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5956 |
^ contents. |
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
5957 |
|
17747 | 5958 |
"Modified: / 12-11-2017 / 12:26:40 / cg" |
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5959 |
! |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
5960 |
|
6295 | 5961 |
getContentsAsTextWithSizeLimit:sizeLimitOrNil |
5540 | 5962 |
"returns the contents as unicode" |
5963 |
||
8471 | 5964 |
^ self getContentsAsTextWithSizeLimit:sizeLimitOrNil lastPart:false |
5965 |
! |
|
5966 |
||
15908 | 5967 |
getContentsAsTextWithSizeLimit:sizeLimitOrNilArg lastPart:showLastPartOrNil |
8471 | 5968 |
"returns the contents as unicode" |
5969 |
||
15908 | 5970 |
|text guessedEncoding s sizeLimitOrNil| |
5971 |
||
5972 |
sizeLimitOrNil := sizeLimitOrNilArg. |
|
8390 | 5973 |
(self lockFileEncodingHolder value ? false) ifFalse:[ |
6173
4ba4589e4952
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
6120
diff
changeset
|
5974 |
guessedEncoding := CharacterEncoder guessEncodingOfFile:item fileName asFilename. |
11589 | 5975 |
guessedEncoding := guessedEncoding ? #'iso8859-1' "(self fileEncoding)". |
5976 |
self fileEncoding:guessedEncoding asSymbol. |
|
5737 | 5977 |
]. |
5528 | 5978 |
|
5979 |
editView notNil ifTrue:[ |
|
5540 | 5980 |
"/ self validateEditViewsFontEncoding. |
5528 | 5981 |
editView externalEncoding:self fileEncoding. |
5982 |
]. |
|
5983 |
||
5984 |
s := self fileName readStream. |
|
7594 | 5985 |
[ |
8471 | 5986 |
showLastPartOrNil == true ifTrue:[ |
11590 | 5987 |
s position:(s fileSize - sizeLimitOrNil). |
15908 | 5988 |
sizeLimitOrNil := nil. |
8471 | 5989 |
]. |
5990 |
||
7594 | 5991 |
text := self |
5992 |
readStream:s |
|
5993 |
lineDelimiter:(Character cr) |
|
5994 |
sizeLimit:sizeLimitOrNil |
|
5995 |
encoding:self fileEncoding. |
|
5996 |
] ensure:[ |
|
5997 |
s close. |
|
5998 |
]. |
|
5528 | 5999 |
^ text |
6000 |
! |
|
6001 |
||
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
6002 |
getHashForContents:contents |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
6003 |
| hashStream| |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
6004 |
|
18670 | 6005 |
doMD5ModificationCheck ifFalse:[^ nil]. |
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
6006 |
|
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
6007 |
hashStream := MD5Stream new. |
11284
ebb519afb53d
handle non-string collections as contents (virtualArray)
Claus Gittinger <cg@exept.de>
parents:
11104
diff
changeset
|
6008 |
(contents isCollection and:[ contents isString not ]) ifTrue:[ |
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
6009 |
contents do:[:eachLine | |
4616 | 6010 |
eachLine notNil ifTrue:[ |
6011 |
hashStream nextPutAll:(eachLine string withTabs). |
|
6012 |
]. |
|
6013 |
hashStream nextPut:Character cr. |
|
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
6014 |
]. |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
6015 |
] ifFalse:[ |
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
6016 |
hashStream nextPutAll:(contents string). |
4071 | 6017 |
]. |
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
6018 |
^ hashStream hashValue. |
11284
ebb519afb53d
handle non-string collections as contents (virtualArray)
Claus Gittinger <cg@exept.de>
parents:
11104
diff
changeset
|
6019 |
|
ebb519afb53d
handle non-string collections as contents (virtualArray)
Claus Gittinger <cg@exept.de>
parents:
11104
diff
changeset
|
6020 |
"Modified: / 27-02-2012 / 22:10:18 / cg" |
18670 | 6021 |
"Modified: / 12-03-2019 / 15:28:22 / Claus Gittinger" |
4071 | 6022 |
! |
6023 |
||
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6024 |
hideEditorOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6025 |
self editorOperationsToolBarVisibleHolder value:false |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6026 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6027 |
"Created: / 02-08-2013 / 16:12:00 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6028 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6029 |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6030 |
openDiffView |
8684 | 6031 |
|fn diffView text1 l1 text2 l2| |
6032 |
||
6033 |
(fn := self fileName) notNil ifTrue:[ |
|
14124
8dfb9e38a4d6
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14065
diff
changeset
|
6034 |
text1 := editView contentsAsString "asText". |
8684 | 6035 |
l1 := 'Editor'. |
6036 |
text2 := self getContents. |
|
6037 |
l2 := 'File: ' , fn baseName. |
|
6038 |
diffView := DiffTextView openOn:text1 label:l1 and:text2 label:l2. |
|
6039 |
diffView topView label:'File ' , fn baseName , ' vs. Editor Contents'. |
|
6040 |
]. |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6041 |
! |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6042 |
|
17747 | 6043 |
radixInDump:radix |
6044 |
radixInDump ~~ radix ifTrue:[ |
|
6045 |
radixInDump := radix. |
|
6046 |
||
6047 |
self presentation == #hexDump ifTrue:[ |
|
6048 |
self changeInformation. |
|
6049 |
self setContents. |
|
6050 |
]. |
|
6051 |
]. |
|
6052 |
||
6053 |
"Created: / 12-11-2017 / 12:22:52 / cg" |
|
6054 |
! |
|
6055 |
||
5528 | 6056 |
readStream:aStream lineDelimiter:aCharacter encoding:fileEncodingArg |
6057 |
"read from aStream, answer its contents as StringCollection. |
|
14498
16ebee6b698d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14496
diff
changeset
|
6058 |
The file's lines are delimited by aCharacter. |
5528 | 6059 |
If encoding is nonNil, the file is assumed to be coded according to |
5540 | 6060 |
that symbol, and #decodeString: should be able to convert it into unicode. |
6061 |
Always returns a unicode string." |
|
6062 |
||
6295 | 6063 |
^ self readStream:aStream lineDelimiter:aCharacter sizeLimit:nil encoding:fileEncodingArg |
6064 |
! |
|
6065 |
||
6796
23a7b7f0bd39
bug in long line handling fixed
Claus Gittinger <cg@exept.de>
parents:
6793
diff
changeset
|
6066 |
readStream:aStream lineDelimiter:lineDelimiter sizeLimit:sizeLimitOrNil encoding:fileEncodingArg |
6295 | 6067 |
"read from aStream, answer its contents as StringCollection. |
14498
16ebee6b698d
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14496
diff
changeset
|
6068 |
The file's lines are delimited by aCharacter. |
6295 | 6069 |
If encoding is nonNil, the file is assumed to be coded according to |
6070 |
that symbol, and #decodeString: should be able to convert it into unicode. |
|
6071 |
Always returns a unicode string." |
|
6072 |
||
8390 | 6073 |
|text fileEncoding decoder firstDecoderError line lineNr| |
5540 | 6074 |
|
5528 | 6075 |
fileEncoding := fileEncodingArg ? #'iso8859-1'. |
5718 | 6076 |
decoder := CharacterEncoder encoderFor:fileEncoding. |
5528 | 6077 |
|
6078 |
text := StringCollection new. |
|
6079 |
||
5534 | 6080 |
firstDecoderError := true. |
8390 | 6081 |
lineNr := 1. |
5534 | 6082 |
|
5646 | 6083 |
DecodingError handle:[:ex | |
11590 | 6084 |
|msg answer labels values| |
5646 | 6085 |
|
5534 | 6086 |
firstDecoderError ifTrue:[ |
8390 | 6087 |
msg := resources stringWithCRs:'Error in decoder: %1\In Line: %2\\%3' with:ex errorString with:lineNr with:line. |
11590 | 6088 |
ex mayProceed ifTrue:[ |
6089 |
labels := #('Cancel' 'Ignore' 'Ignore All' 'Inspect Line'). |
|
6090 |
values := #(nil ignore ignoreAll inspectLine). |
|
6091 |
] ifFalse:[ |
|
6092 |
labels := #('Cancel' 'Inspect Line'). |
|
6093 |
values := #(nil inspectLine). |
|
6094 |
]. |
|
6095 |
||
5646 | 6096 |
answer := Dialog |
6097 |
confirmWithCancel:msg |
|
11590 | 6098 |
labels:(resources array:labels) |
6099 |
values:values |
|
6100 |
default:1 |
|
7693 | 6101 |
title:'Error during decode'. |
5646 | 6102 |
answer isNil ifTrue:[ AbortOperationRequest raise ]. |
6103 |
answer == #ignoreAll ifTrue:[ firstDecoderError := false ]. |
|
8390 | 6104 |
answer == #inspectLine ifTrue:[ line inspect. AbortOperationRequest raise ]. |
5534 | 6105 |
]. |
8389 | 6106 |
ex proceedWith:(ex defaultValue). |
5534 | 6107 |
] do:[ |
6295 | 6108 |
FileStream lineTooLongErrorSignal handle:[:ex | |
6109 |
|s partialLine| |
|
6110 |
||
6111 |
s := ex parameter at:1. |
|
6112 |
partialLine := ex parameter at:2. |
|
6796
23a7b7f0bd39
bug in long line handling fixed
Claus Gittinger <cg@exept.de>
parents:
6793
diff
changeset
|
6113 |
ex proceedWith:(partialLine , (s upTo:lineDelimiter)) |
6295 | 6114 |
] do:[ |
9172
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6115 |
(decoder characterSize:0) == 2 ifTrue:[ |
12066 | 6116 |
"a TwoByte decoder. Decode first and then process line breaks." |
11590 | 6117 |
|
9172
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6118 |
|buffer| |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6119 |
|
11590 | 6120 |
buffer := line := aStream upToEnd. |
9172
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6121 |
buffer := decoder decodeString:buffer. |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6122 |
buffer asCollectionOfLines do:[:line | |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6123 |
text add:line withTabsExpanded. |
5534 | 6124 |
]. |
9172
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6125 |
] ifFalse:[ |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6126 |
[aStream atEnd] whileFalse:[ |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6127 |
lineDelimiter == Character cr ifTrue:[ |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6128 |
line := aStream nextLine. |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6129 |
] ifFalse:[ |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6130 |
line := aStream upTo:lineDelimiter. |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6131 |
]. |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6132 |
|
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6133 |
line := line withTabsExpanded. |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6134 |
text add:(decoder decodeString:line). |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6135 |
sizeLimitOrNil notNil ifTrue:[ |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6136 |
aStream position > sizeLimitOrNil ifTrue:[ |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6137 |
^ text |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6138 |
] |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6139 |
]. |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6140 |
lineNr := lineNr + 1. |
e7632f98f762
handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents:
8912
diff
changeset
|
6141 |
] |
5528 | 6142 |
]. |
6143 |
]. |
|
6144 |
]. |
|
6145 |
^ text |
|
7693 | 6146 |
|
6147 |
"Modified: / 02-03-2007 / 15:09:30 / cg" |
|
12066 | 6148 |
"Modified (comment): / 22-11-2012 / 13:06:03 / cg" |
5528 | 6149 |
! |
6150 |
||
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6151 |
reload |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6152 |
|
4969 | 6153 |
textEditorModificationTime := self fileName modificationTime. |
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
6154 |
"/ self withWaitCursorDo:[ |
5287
693e3ca577aa
avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents:
5279
diff
changeset
|
6155 |
self setContents. |
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
6156 |
"/ ]. |
12089
4690e72f5af3
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12079
diff
changeset
|
6157 |
self setUpTextView |
6833
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
6158 |
|
caeedd92f25c
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6796
diff
changeset
|
6159 |
"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
|
6160 |
! |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6161 |
|
8684 | 6162 |
saveFileAs |
6163 |
self saveWithAskForFilename:true |
|
6164 |
! |
|
6165 |
||
5417 | 6166 |
saveWithAskForFilename:ask |
6167 |
||
8684 | 6168 |
|answer fn master defaultDir dir base fnDir| |
6169 |
||
6170 |
master := self masterApplication. |
|
12480
2d1bd93f29d1
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12348
diff
changeset
|
6171 |
(fn := self fileName) notNil ifTrue:[ |
2d1bd93f29d1
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12348
diff
changeset
|
6172 |
dir := fn directory. |
2d1bd93f29d1
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12348
diff
changeset
|
6173 |
base := fn baseName. |
8684 | 6174 |
]. |
5417 | 6175 |
|
6176 |
ask ifTrue:[ |
|
8684 | 6177 |
defaultDir := master notNil ifTrue:[ master currentDirectory ] ifFalse:[ nil ]. |
5417 | 6178 |
defaultDir isNil ifTrue:[ |
12480
2d1bd93f29d1
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12348
diff
changeset
|
6179 |
fn notNil ifTrue:[ |
8684 | 6180 |
defaultDir := dir. |
6181 |
] |
|
5417 | 6182 |
]. |
6183 |
answer := Dialog |
|
9611 | 6184 |
requestFileNameForSave:(resources string:'Save contents in:') |
8684 | 6185 |
default:base |
5417 | 6186 |
fromDirectory:defaultDir. |
9611 | 6187 |
answer isEmptyOrNil ifTrue:[^ self]. |
5417 | 6188 |
fn := answer asFilename. |
6189 |
]. |
|
8684 | 6190 |
|
5417 | 6191 |
(master notNil and:[master class openAnotherApplicationOnSameItem]) ifTrue:[ |
6192 |
(self updateSameFilesFor:fn) ifFalse:[ ^ self ]. |
|
6193 |
]. |
|
6194 |
||
6195 |
fnDir := fn directory. |
|
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6214
diff
changeset
|
6196 |
fnDir exists ifFalse:[ |
12079
50a553319d07
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
12066
diff
changeset
|
6197 |
[ |
50a553319d07
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
12066
diff
changeset
|
6198 |
fnDir recursiveMakeDirectory. |
17118 | 6199 |
] on:OsError do:[:ex| |
12079
50a553319d07
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
12066
diff
changeset
|
6200 |
Dialog warn:(ex description). |
50a553319d07
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
12066
diff
changeset
|
6201 |
^ self. |
50a553319d07
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
12066
diff
changeset
|
6202 |
] |
5417 | 6203 |
]. |
12480
2d1bd93f29d1
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12348
diff
changeset
|
6204 |
|
14660
39afddf6eea3
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14576
diff
changeset
|
6205 |
(editView saveAs:fn doAppend:false compressTabs:master compressTabsOnSave eolMode:master lineEndConvention) ifFalse:[^ self]. |
5417 | 6206 |
|
6207 |
textEditorModificationTime := self fileName modificationTime. |
|
6208 |
||
18670 | 6209 |
doMD5ModificationCheck ifTrue:[ |
5417 | 6210 |
md5CheckSum := self getHashForContents:self fileContentsModel value. |
6211 |
]. |
|
5471
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
6212 |
|
5417 | 6213 |
self enableReload value:false. |
6214 |
self itemChanged value:false. |
|
6215 |
self itemRemoved value:false. |
|
6216 |
self modifiedChannel value:false. |
|
6217 |
self notify:self fileName asString, ' saved'. |
|
13760
60a6ffe379a7
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13729
diff
changeset
|
6218 |
tagsBrowser notNil ifTrue:[ |
60a6ffe379a7
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13729
diff
changeset
|
6219 |
tagsBrowser updateTagList |
60a6ffe379a7
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13729
diff
changeset
|
6220 |
]. |
9611 | 6221 |
|
6222 |
"Modified: / 27-10-2010 / 10:41:29 / cg" |
|
18670 | 6223 |
"Modified: / 12-03-2019 / 15:28:29 / Claus Gittinger" |
5417 | 6224 |
! |
6225 |
||
4146
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6226 |
searchForPattern:aContentsPattern ignoreCase:ign |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6227 |
|
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6228 |
| pattern | |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6229 |
|
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6230 |
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
|
6231 |
pattern notEmpty ifTrue:[ |
15218
2401b6bf1879
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15209
diff
changeset
|
6232 |
editView perform:#cursorHome ifNotUnderstood:[]. |
4146
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6233 |
editView rememberSearchPattern:pattern. |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6234 |
editView searchFwd:pattern ignoreCase:ign. |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6235 |
] |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6236 |
! |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6237 |
|
8087 | 6238 |
selectInBrowser |
6239 |
|application| |
|
6240 |
||
6241 |
application := self masterApplication. |
|
6242 |
application notNil ifTrue:[ |
|
6243 |
application gotoFile:(self fileName). |
|
6244 |
]. |
|
6245 |
! |
|
6246 |
||
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6247 |
setContents |
5528 | 6248 |
|text| |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6249 |
|
7970
337b8efd934e
readcursor while reading a file
Claus Gittinger <cg@exept.de>
parents:
7947
diff
changeset
|
6250 |
self withReadCursorDo:[ |
337b8efd934e
readcursor while reading a file
Claus Gittinger <cg@exept.de>
parents:
7947
diff
changeset
|
6251 |
text := self getContents. |
337b8efd934e
readcursor while reading a file
Claus Gittinger <cg@exept.de>
parents:
7947
diff
changeset
|
6252 |
]. |
4201 | 6253 |
text isNil ifTrue:[ ^ false]. |
9885 | 6254 |
self withWaitCursorDo:[ |
6255 |
self setContentsFor:text. |
|
6256 |
]. |
|
4953 | 6257 |
^ true |
6258 |
! |
|
6259 |
||
5540 | 6260 |
setContentsFor:aUnicodeText |
18670 | 6261 |
|prevMode prevReadOnly prevDoMD5| |
6262 |
||
6263 |
prevDoMD5 := doMD5ModificationCheck. |
|
6264 |
self presentation == #hexDump ifTrue:[ |
|
6265 |
editView notNil ifTrue:[ |
|
6266 |
prevMode := editView expandTabsWhenUpdating. |
|
6267 |
prevReadOnly := editView isReadOnly. |
|
6268 |
editView expandTabsWhenUpdating:false. |
|
6269 |
editView readOnly:true. |
|
6270 |
]. |
|
6271 |
doMD5ModificationCheck := false. |
|
6272 |
]. |
|
6273 |
||
4969 | 6274 |
self itemChanged value:false. |
5534 | 6275 |
|
5540 | 6276 |
self validateEditViewsFontEncoding. |
6277 |
||
6278 |
self fileContentsModel value:aUnicodeText. |
|
5534 | 6279 |
|
18670 | 6280 |
doMD5ModificationCheck ifTrue:[ |
5540 | 6281 |
md5CheckSum := self getHashForContents:aUnicodeText. |
4071 | 6282 |
]. |
3892 | 6283 |
self enableReload value:false. |
6284 |
self itemChanged value:false. |
|
4045 | 6285 |
self modifiedChannel value:false. |
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6286 |
self notify:nil. |
18670 | 6287 |
|
6288 |
prevMode notNil ifTrue:[ |
|
6289 |
editView expandTabsWhenUpdating:prevMode. |
|
6290 |
editView readOnly:prevReadOnly. |
|
6291 |
]. |
|
6292 |
doMD5ModificationCheck := prevDoMD5. |
|
3892 | 6293 |
^ true |
5534 | 6294 |
|
6295 |
||
6296 |
"/ |
|
6297 |
"/ oldEncoding := editView characterEncoding. |
|
6298 |
"/ oldEncoding ~= newEncoding ifTrue:[ |
|
6299 |
"/self halt. |
|
6300 |
"/ (lines := editView contents) size > 0 ifTrue:[ |
|
6301 |
"/ (Dialog |
|
6302 |
"/ confirm:('Re-Encode contents (from %1 to %2) ?' |
|
6303 |
"/ bindWith:oldEncoding |
|
6304 |
"/ with:newEncoding) |
|
6305 |
"/ ) ifTrue:[ |
|
6306 |
"/ recoder := CharacterEncoder |
|
6307 |
"/ encoderToEncodeFrom:oldEncoding |
|
6308 |
"/ into:newEncoding. |
|
6309 |
"/ lines keysAndValuesDo:[:lineNr :line | |
|
6310 |
"/ line notNil ifTrue:[ |
|
6311 |
"/ editView at:lineNr put:(recoder encodeString:line). |
|
6312 |
"/ ]. |
|
6313 |
"/ ]. |
|
6314 |
"/ ] |
|
6315 |
"/ ]. |
|
6316 |
"/ ]. |
|
18670 | 6317 |
|
6318 |
"Modified: / 12-03-2019 / 15:35:16 / Claus Gittinger" |
|
3892 | 6319 |
! |
6320 |
||
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6321 |
showEditorOperationsToolBar |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6322 |
self editorOperationsToolBarVisibleHolder value:true |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6323 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6324 |
"Created: / 02-08-2013 / 16:11:52 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6325 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6326 |
|
9946 | 6327 |
tagSelected:aTag |
11032
67fc45edcaac
tag-selection fix (when textselection is present)
Claus Gittinger <cg@exept.de>
parents:
10955
diff
changeset
|
6328 |
editView deselect. "/ otherwise, it might jump back to show the selection |
9946 | 6329 |
editView cursorLine:(aTag lineNumber) col:1. |
6330 |
||
6331 |
"Created: / 23-06-2011 / 16:38:07 / cg" |
|
6332 |
! |
|
6333 |
||
5417 | 6334 |
updateSameFilesFor:aFilename |
3892 | 6335 |
| master modifiedApplications stream filename action| |
6336 |
||
6337 |
master := self masterApplication. |
|
6338 |
master notNil ifTrue:[ |
|
6339 |
modifiedApplications := master getSameFilesModifiedFor:self. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6481
diff
changeset
|
6340 |
(modifiedApplications isEmptyOrNil) ifTrue:[^ true ]. |
5417 | 6341 |
filename := aFilename asString. |
15594
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
6342 |
stream := CharacterWriteStream with:filename. |
3892 | 6343 |
stream nextPutAll:' is modified in tab'. |
6344 |
modifiedApplications size > 1 ifTrue:[ |
|
6345 |
stream nextPutAll:'s'. |
|
6346 |
]. |
|
6347 |
stream cr. |
|
6348 |
modifiedApplications do:[ : el | |
|
6349 |
stream space. |
|
6350 |
stream nextPutAll:filename. |
|
6351 |
stream space. |
|
6352 |
el sameFileIndex notNil ifTrue:[ |
|
6353 |
stream nextPutAll:el sameFileIndex asString. |
|
6354 |
]. |
|
6355 |
stream cr. |
|
6356 |
]. |
|
6357 |
stream nextPutAll:'forget changes on other tab'. |
|
6358 |
modifiedApplications size > 1 ifTrue:[ |
|
6359 |
stream nextPutAll:'s'. |
|
6360 |
]. |
|
6361 |
stream nextPutAll:' ?'. |
|
6362 |
action := Dialog |
|
6363 |
choose:stream contents |
|
13406
b3cb3f94b100
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13377
diff
changeset
|
6364 |
labels:#('Cancel' 'No' 'Yes') |
3892 | 6365 |
values:#(#cancel #no #yes) |
6366 |
default:#cancel. |
|
6367 |
||
6368 |
stream close. |
|
6369 |
action == #cancel ifTrue:[ ^ false ]. |
|
6370 |
action == #yes ifTrue:[ |
|
6371 |
"/ here force reload for other applications |
|
6372 |
modifiedApplications do:[ : el | |
|
6373 |
el reload. |
|
6374 |
] |
|
6375 |
]. |
|
6376 |
]. |
|
6377 |
^ true. |
|
13406
b3cb3f94b100
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13377
diff
changeset
|
6378 |
|
b3cb3f94b100
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13377
diff
changeset
|
6379 |
"Modified: / 29-08-2013 / 01:37:18 / cg" |
5540 | 6380 |
! |
6381 |
||
6382 |
validateEditViewsFontEncoding |
|
5717 | 6383 |
|fileEncoding preferredFontEncoding fontsEncoding action| |
5540 | 6384 |
|
6385 |
editView isNil ifTrue:[^ self]. |
|
6386 |
||
6387 |
fileEncoding := self fileEncoding. |
|
6388 |
||
11589 | 6389 |
fontsEncoding := editView font encoding ? #'iso8859-1'. |
5540 | 6390 |
|
6391 |
preferredFontEncoding := FontDescription preferredFontEncodingFor:fileEncoding. |
|
6392 |
(CharacterEncoder isEncoding:preferredFontEncoding subSetOf:fontsEncoding) ifFalse:[ |
|
6393 |
doNotShowFontDialog == true ifTrue:[ |
|
6394 |
action := #show |
|
6395 |
] ifFalse:[ |
|
5609 | 6396 |
action := Dialog choose:(resources string:'''%1'' seems to require a %2 (or unicode) font (file encoding is %3).' |
5540 | 6397 |
with:self fileName baseName |
6398 |
with:preferredFontEncoding allBold |
|
6399 |
with:fileEncoding) |
|
6400 |
labels:(resources array:#('Cancel' 'Show' 'Don''t Ask Again' 'Change Font')) |
|
6401 |
values:#(nil #show #showAlways #encoding) |
|
6402 |
default:#encoding. |
|
6403 |
]. |
|
6404 |
action == #showAlways ifTrue:[ |
|
6405 |
doNotShowFontDialog := true. |
|
6406 |
action := #show. |
|
6407 |
]. |
|
6408 |
action isNil ifTrue:[ |
|
13776
fd15b128241f
AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents:
13760
diff
changeset
|
6409 |
AbortOperationRequest raise |
5540 | 6410 |
]. |
6411 |
action == #encoding ifTrue:[ |
|
6412 |
editView validateFontEncodingFor:fileEncoding ask:false. |
|
6413 |
]. |
|
6414 |
]. |
|
3892 | 6415 |
! ! |
6416 |
||
6417 |
!FileApplicationNoteBook::TextEditor methodsFor:'aspects'! |
|
6418 |
||
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6419 |
canEdit |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6420 |
^ editView notNil and:[editView isReadOnly not] |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6421 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6422 |
"Created: / 02-08-2013 / 16:45:34 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6423 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6424 |
|
5120 | 6425 |
cursorColLabelHolder |
6426 |
^ BlockValue |
|
6427 |
with:[:v | v printString] |
|
6428 |
argument:editView cursorColHolder. |
|
6429 |
! |
|
6430 |
||
15821
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
6431 |
cursorLineAndColumnLabelHolder |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
6432 |
^ editView cursorLineAndColumnLabelHolder. |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
6433 |
! |
4cc5466ba247
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15815
diff
changeset
|
6434 |
|
5120 | 6435 |
cursorLineLabelHolder |
6436 |
^ BlockValue |
|
6437 |
with:[:v | v printString] |
|
6438 |
argument:editView cursorLineHolder. |
|
6439 |
! |
|
6440 |
||
7103 | 6441 |
editModeInsert |
6442 |
editView editModeInsert |
|
6443 |
||
6444 |
"Created: / 11-09-2006 / 12:46:50 / cg" |
|
6445 |
! |
|
6446 |
||
6447 |
editModeInsertAndSelect |
|
6448 |
editView editModeInsertAndSelect |
|
6449 |
||
6450 |
"Created: / 11-09-2006 / 12:47:01 / cg" |
|
6451 |
! |
|
6452 |
||
6453 |
editModeOverwrite |
|
6454 |
editView editModeOverwrite |
|
6455 |
||
6456 |
"Created: / 11-09-2006 / 12:46:47 / cg" |
|
6457 |
! |
|
6458 |
||
7596
6ea35d883f1f
gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents:
7594
diff
changeset
|
6459 |
editView |
6ea35d883f1f
gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents:
7594
diff
changeset
|
6460 |
^ editView |
6ea35d883f1f
gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents:
7594
diff
changeset
|
6461 |
! |
6ea35d883f1f
gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents:
7594
diff
changeset
|
6462 |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6463 |
editorOperationsMenuSpecHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6464 |
editorOperationsMenuSpecHolder isNil ifTrue:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6465 |
editorOperationsMenuSpecHolder := self class menuEditorOperationsForNormalText asValue. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6466 |
]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6467 |
^ editorOperationsMenuSpecHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6468 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6469 |
"Created: / 02-08-2013 / 16:35:49 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6470 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6471 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6472 |
editorOperationsToolBarNotVisibleHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6473 |
^ BlockValue forLogicalNot:self editorOperationsToolBarVisibleHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6474 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6475 |
"Created: / 02-08-2013 / 16:11:02 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6476 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6477 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6478 |
editorOperationsToolBarVisibleHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6479 |
editorOperationsToolBarVisibleHolder isNil ifTrue:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6480 |
editorOperationsToolBarVisibleHolder := (DefaultEditorOperationsToolBarVisible ? true) asValue. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6481 |
editorOperationsToolBarVisibleHolder onChangeSend:#editorOperationsToolBarVisibilityChanged to:self. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6482 |
]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6483 |
^ editorOperationsToolBarVisibleHolder |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6484 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6485 |
"Created: / 02-08-2013 / 15:59:43 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6486 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6487 |
|
3892 | 6488 |
enableHexToggle |
6489 |
enableHexToggle isNil ifTrue:[ |
|
6490 |
enableHexToggle := true asValue. |
|
6491 |
]. |
|
6492 |
^ enableHexToggle |
|
6493 |
! |
|
6494 |
||
6495 |
enableReload |
|
6496 |
enableReload isNil ifTrue:[ |
|
6497 |
enableReload := false asValue. |
|
6498 |
]. |
|
6499 |
^ enableReload. |
|
6500 |
! |
|
6501 |
||
6502 |
enableSave |
|
6503 |
enableSave isNil ifTrue:[ |
|
6504 |
enableSave := false asValue. |
|
6505 |
]. |
|
6506 |
^ enableSave. |
|
6507 |
! |
|
6508 |
||
8783 | 6509 |
enableSaveAs |
6510 |
^ true. |
|
6511 |
! |
|
6512 |
||
8087 | 6513 |
enableSelectInBrowser |
6514 |
enableSelectInBrowser isNil ifTrue:[ |
|
6515 |
enableSelectInBrowser := false asValue. |
|
6516 |
]. |
|
6517 |
^ enableSelectInBrowser. |
|
6518 |
! |
|
6519 |
||
3892 | 6520 |
fileContentsModel |
6521 |
fileContentsModel isNil ifTrue:[ |
|
6522 |
fileContentsModel := ValueHolder new. |
|
6523 |
]. |
|
6524 |
^ fileContentsModel. |
|
6525 |
! |
|
6526 |
||
5528 | 6527 |
fileEncodingHolder |
6528 |
fileEncodingHolder isNil ifTrue:[ |
|
5534 | 6529 |
fileEncodingHolder := #'iso8859-1' asValue |
5528 | 6530 |
]. |
6531 |
^ fileEncodingHolder |
|
6532 |
! |
|
6533 |
||
3892 | 6534 |
itemChanged |
6535 |
itemChanged isNil ifTrue:[ |
|
6536 |
itemChanged := false asValue. |
|
6537 |
itemChanged addDependent:self. |
|
6538 |
]. |
|
6539 |
^ itemChanged |
|
6540 |
! |
|
6541 |
||
6542 |
itemRemoved |
|
6543 |
itemRemoved isNil ifTrue:[ |
|
6544 |
itemRemoved := false asValue. |
|
6545 |
itemRemoved addDependent:self. |
|
6546 |
]. |
|
6547 |
^ itemRemoved |
|
6548 |
! |
|
6549 |
||
5737 | 6550 |
lockFileEncodingHolder |
6551 |
lockFileEncodingHolder isNil ifTrue:[ |
|
6552 |
lockFileEncodingHolder := false asValue. |
|
6553 |
]. |
|
6554 |
^ lockFileEncodingHolder |
|
6555 |
! |
|
6556 |
||
5120 | 6557 |
modeLabelHolder |
6558 |
^ editView modeLabelHolder. |
|
6559 |
! |
|
6560 |
||
7103 | 6561 |
modeLabelMenu |
6562 |
^ FileBrowserV2 editModeInfoLabelMenu |
|
6563 |
||
6564 |
"Created: / 11-09-2006 / 12:36:26 / cg" |
|
6565 |
! |
|
6566 |
||
3892 | 6567 |
modifiedChannel |
6568 |
modifiedChannel isNil ifTrue:[ |
|
6569 |
modifiedChannel := false asValue. |
|
6570 |
modifiedChannel addDependent:self. |
|
6571 |
]. |
|
6572 |
^ modifiedChannel. |
|
6573 |
! |
|
6574 |
||
17747 | 6575 |
presentationHolder |
6576 |
presentationHolder isNil ifTrue:[ |
|
6577 |
presentationHolder := ValueHolder with:#asText. |
|
6578 |
]. |
|
6579 |
^ presentationHolder |
|
6580 |
||
6581 |
"Created: / 12-11-2017 / 12:32:23 / cg" |
|
6582 |
! |
|
6583 |
||
3892 | 6584 |
printAsHexDump |
6585 |
printAsHexDump isNil ifTrue:[ |
|
6586 |
printAsHexDump := false asValue. |
|
6587 |
printAsHexDump addDependent:self. |
|
6588 |
]. |
|
6589 |
^ printAsHexDump. |
|
4071 | 6590 |
! |
6591 |
||
6592 |
viewModifiedChannel |
|
6593 |
viewModifiedChannel isNil ifTrue:[ |
|
6594 |
viewModifiedChannel := false asValue. |
|
6595 |
viewModifiedChannel addDependent:self. |
|
6596 |
]. |
|
6597 |
^ viewModifiedChannel. |
|
3892 | 6598 |
! ! |
6599 |
||
8684 | 6600 |
!FileApplicationNoteBook::TextEditor methodsFor:'aspects-visibility'! |
6601 |
||
11099 | 6602 |
closeButtonShown |
6603 |
^ false. |
|
6604 |
"/ ^ self isEmbeddedApplication. |
|
6605 |
||
6606 |
"Created: / 12-01-2012 / 00:32:15 / cg" |
|
6607 |
! |
|
6608 |
||
8684 | 6609 |
diffTextButtonVisible |
6610 |
^ self fileName notNil "/ true |
|
6611 |
! |
|
6612 |
||
13729
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6613 |
doItMenuButtonVisible |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6614 |
^true |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6615 |
|
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6616 |
"Created: / 17-12-2013 / 16:31:40 / cg" |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6617 |
! |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6618 |
|
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6619 |
inspectItMenuButtonVisible |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6620 |
^true |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6621 |
|
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6622 |
"Created: / 17-12-2013 / 16:31:49 / cg" |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6623 |
! |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6624 |
|
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6625 |
printItMenuButtonVisible |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6626 |
^true |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6627 |
|
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6628 |
"Created: / 17-12-2013 / 16:31:45 / cg" |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6629 |
! |
6d0268de5de9
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13715
diff
changeset
|
6630 |
|
8684 | 6631 |
saveAsButtonVisible |
6632 |
^ true |
|
6633 |
! |
|
6634 |
||
6635 |
saveButtonVisible |
|
6636 |
^ self fileName notNil "/ true |
|
6637 |
! |
|
6638 |
||
6639 |
selectInBrowserButtonVisible |
|
6640 |
^ self masterApplication notNil |
|
9946 | 6641 |
! |
6642 |
||
6643 |
tagsBrowserVisibleHolder |
|
6644 |
tagsBrowserVisibleHolder isNil ifTrue:[ |
|
6645 |
masterApplication notNil ifTrue:[ |
|
6646 |
tagsBrowserVisibleHolder := masterApplication tagsBrowserVisibleHolder. |
|
6647 |
] ifFalse:[ |
|
10761 | 6648 |
tagsBrowserVisibleHolder := self class defaultTagsBrowserVisible asValue. |
9946 | 6649 |
]. |
6650 |
tagsBrowserVisibleHolder addDependent:self. |
|
6651 |
]. |
|
6652 |
^ tagsBrowserVisibleHolder |
|
6653 |
||
6654 |
"Created: / 23-06-2011 / 09:19:18 / cg" |
|
10761 | 6655 |
"Modified: / 06-10-2011 / 12:46:41 / cg" |
8684 | 6656 |
! ! |
6657 |
||
3892 | 6658 |
!FileApplicationNoteBook::TextEditor methodsFor:'change & update'! |
6659 |
||
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6660 |
changeTextColorForChanged |
4969 | 6661 |
|text prevCursorBehavior| |
6662 |
||
6663 |
prevCursorBehavior := editView cursorMovementWhenUpdating. |
|
6664 |
editView cursorMovementWhenUpdating:nil. |
|
6665 |
||
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6666 |
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
|
6667 |
text := editView contents. |
4499 | 6668 |
self fileContentsModel |
18691 | 6669 |
value:(text emphasizeAllWith:UserPreferences current emphasisForChangedCode). |
17256 | 6670 |
editView pushEvent:#flash. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6671 |
] ifFalse:[ |
17256 | 6672 |
"/ self fileContentsModel value:text string. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6673 |
]. |
4969 | 6674 |
editView cursorMovementWhenUpdating:prevCursorBehavior. |
6675 |
"/ self fileContentsModel changed:#value. |
|
18691 | 6676 |
|
6677 |
"Modified: / 13-03-2019 / 21:57:58 / Claus Gittinger" |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6678 |
! |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6679 |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6680 |
editorOperationsToolBarVisibilityChanged |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6681 |
|editorToolBar editorOperationsToolBar editor topOffset editorOperationsToolBarVisible| |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6682 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6683 |
editorToolBar := self componentAt:#MenuTextEditor. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6684 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6685 |
editorOperationsToolBar := self componentAt:#EditorOperationsToolBar. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6686 |
editor := self componentAt:#TextEditor. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6687 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6688 |
topOffset := editorToolBar height. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6689 |
editorOperationsToolBarVisible := self editorOperationsToolBarVisibleHolder value. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6690 |
DefaultEditorToolBarVisible := editorOperationsToolBarVisible. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6691 |
editorOperationsToolBarVisible ifTrue:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6692 |
topOffset := topOffset + editorOperationsToolBar height. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6693 |
]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6694 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6695 |
topOffset := topOffset - 1. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6696 |
editor layout topOffset:topOffset. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6697 |
editor container notNil ifTrue:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6698 |
editor containerChangedSize. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6699 |
]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6700 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6701 |
"Created: / 02-08-2013 / 16:01:01 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6702 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6703 |
|
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6704 |
itemModified |
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6705 |
|
4161 | 6706 |
| modified outDated removed| |
3892 | 6707 |
|
6708 |
modified := self modifiedChannel value. |
|
4161 | 6709 |
outDated := self itemChanged value. |
3892 | 6710 |
removed := self itemRemoved value. |
6711 |
||
17002 | 6712 |
(modified or:[outDated or:[removed]]) ifTrue:[ |
4161 | 6713 |
modified ifTrue:[ |
6714 |
self changeInformationForModified:#modified. |
|
6715 |
]. |
|
6716 |
outDated ifTrue:[ |
|
6717 |
self changeInformationForModified:#outDated. |
|
6718 |
]. |
|
6719 |
removed ifTrue:[ |
|
6720 |
self changeInformationForModified:#removed. |
|
6721 |
]. |
|
6722 |
] ifFalse:[ |
|
6723 |
self changeInformationForModified:#unchanged. |
|
6724 |
]. |
|
5471
ad6c1fc272de
care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents:
5461
diff
changeset
|
6725 |
|
4161 | 6726 |
self enableReload value:((modified or:[outDated]) and:[removed not]). |
3892 | 6727 |
! |
6728 |
||
9946 | 6729 |
postBuildTagsBrowser:aTagsBrowserCanvas |
6730 |
tagsBrowser := aTagsBrowserCanvas application. |
|
6731 |
tagsBrowser action:[:selectedTag | self tagSelected:selectedTag ]. |
|
6732 |
self updateTagsBrowser. |
|
6733 |
||
6734 |
"Created: / 23-06-2011 / 16:30:00 / cg" |
|
6735 |
! |
|
6736 |
||
6737 |
tagsBrowserVisibilityChanged |
|
10761 | 6738 |
|visible tagsBrowserCanvas| |
9949
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6739 |
|
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6740 |
tagsBrowser notNil ifTrue:[ |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6741 |
tagsBrowserCanvas := tagsBrowser window. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6742 |
]. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6743 |
|
10761 | 6744 |
(visible := self tagsBrowserVisibleHolder value) ifTrue:[ |
9949
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6745 |
tagsBrowser isNil ifTrue:[ |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6746 |
tagsBrowserCanvas := ApplicationSubView new. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6747 |
|
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6748 |
tagsBrowser := Tools::TagsBrowser new. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6749 |
tagsBrowser window:tagsBrowserCanvas. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6750 |
tagsBrowser allButOpen. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6751 |
|
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6752 |
(self builder componentAt:#Panel) |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6753 |
addComponent:tagsBrowserCanvas; |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6754 |
relativeCorners:#(0.75 1.0). |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6755 |
tagsBrowserCanvas realize. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6756 |
self postBuildTagsBrowser:tagsBrowserCanvas. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6757 |
] ifFalse:[ |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6758 |
tagsBrowserCanvas map. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6759 |
(self builder componentAt:#Panel) |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6760 |
relativeCorners:#(0.75 1.0). |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6761 |
]. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6762 |
|
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6763 |
self updateTagsBrowser. |
9946 | 6764 |
] ifFalse:[ |
9949
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6765 |
tagsBrowser notNil ifTrue:[ |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6766 |
tagsBrowserCanvas unmap. |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6767 |
(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
|
6768 |
]. |
9946 | 6769 |
]. |
10761 | 6770 |
DefaultTagsBrowserVisible := visible |
9946 | 6771 |
|
6772 |
"Created: / 27-06-2011 / 16:06:00 / cg" |
|
10761 | 6773 |
"Modified: / 06-10-2011 / 12:45:20 / cg" |
9946 | 6774 |
! |
6775 |
||
3892 | 6776 |
update:something with:aParameter from:changedObject |
4969 | 6777 |
|itemRem contMd5CheckSum viewModified p| |
4071 | 6778 |
|
6779 |
changedObject == self viewModifiedChannel ifTrue:[ |
|
6780 |
viewModified := changedObject value. |
|
18670 | 6781 |
doMD5ModificationCheck ifTrue:[ |
4071 | 6782 |
self viewModifiedChannel value:false withoutNotifying:self. |
6783 |
viewModified ifTrue:[ |
|
4969 | 6784 |
(p := md5HashValueComputationProcess) notNil ifTrue:[ |
6785 |
p terminate. |
|
6786 |
]. |
|
6787 |
md5HashValueComputationProcess := |
|
6788 |
[ |
|
6789 |
contMd5CheckSum := self getHashForContents:(editView list). |
|
6790 |
self modifiedChannel value:(contMd5CheckSum ~= md5CheckSum). |
|
6791 |
md5HashValueComputationProcess := nil. |
|
6792 |
] newProcess. |
|
6793 |
md5HashValueComputationProcess priority:(Processor userBackgroundPriority). |
|
6794 |
md5HashValueComputationProcess resume. |
|
4071 | 6795 |
]. |
4969 | 6796 |
] ifFalse:[ |
6797 |
self modifiedChannel value:viewModified. |
|
6798 |
] |
|
4071 | 6799 |
]. |
3892 | 6800 |
changedObject == self modifiedChannel ifTrue:[ |
4969 | 6801 |
self enableSave value:changedObject value. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6802 |
self itemModified. |
3892 | 6803 |
^ self |
6804 |
]. |
|
6805 |
changedObject == self itemRemoved ifTrue:[ |
|
6806 |
itemRem := changedObject value. |
|
4969 | 6807 |
self enableSave value:(itemRem ? false). |
3892 | 6808 |
self enableHexToggle value:itemRem not. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6809 |
self itemModified. |
3892 | 6810 |
^ self |
6811 |
]. |
|
6812 |
changedObject == self itemChanged ifTrue:[ |
|
18699 | 6813 |
self enqueueMessage:#changeTextColorForChanged. |
4047
e432ab54d1e7
contents color changed to red if modified by someone else
penk
parents:
4045
diff
changeset
|
6814 |
self itemModified. |
3892 | 6815 |
^ self |
6816 |
]. |
|
5197 | 6817 |
|
3892 | 6818 |
changedObject == self printAsHexDump ifTrue:[ |
5197 | 6819 |
AbortOperationRequest handle:[:ex | |
6820 |
self printAsHexDump value:false withoutNotifying:self. |
|
6821 |
^ self. |
|
6822 |
] do:[ |
|
5198
ea3f838e1353
do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents:
5197
diff
changeset
|
6823 |
self askForChangeWithReload:true. |
3892 | 6824 |
]. |
5197 | 6825 |
self presentation:(changedObject value ifTrue:[#hexDump] ifFalse:[#asText]). |
3892 | 6826 |
self changeInformation. |
6827 |
self setContents. |
|
4621 | 6828 |
editView notNil ifTrue:[ |
5197 | 6829 |
editView readOnly:(self presentation == #hexDump). |
3892 | 6830 |
]. |
4621 | 6831 |
^ self |
3892 | 6832 |
]. |
9946 | 6833 |
changedObject == editView cursorLineHolder ifTrue:[ |
9951 | 6834 |
tagsBrowser notNil ifTrue:[ |
6835 |
tagsBrowser updateForLine:(changedObject value). |
|
6836 |
]. |
|
9946 | 6837 |
^ self |
6838 |
]. |
|
6839 |
changedObject == tagsBrowserVisibleHolder ifTrue:[ |
|
6840 |
self tagsBrowserVisibilityChanged. |
|
6841 |
^ self |
|
6842 |
]. |
|
3892 | 6843 |
|
6844 |
super update:something with:aParameter from:changedObject |
|
9946 | 6845 |
|
9951 | 6846 |
"Modified: / 29-06-2011 / 19:36:03 / cg" |
18699 | 6847 |
"Modified: / 16-03-2019 / 14:09:57 / Claus Gittinger" |
9946 | 6848 |
! |
6849 |
||
6850 |
updateTagsBrowser |
|
6851 |
tagsBrowser notNil ifTrue:[ |
|
9949
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6852 |
self tagsBrowserVisibleHolder value ifTrue:[ |
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
6853 |
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
|
6854 |
] |
9946 | 6855 |
] |
6856 |
||
6857 |
"Created: / 23-06-2011 / 16:32:44 / cg" |
|
3892 | 6858 |
! ! |
6859 |
||
9399
dae73aa739a8
no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents:
9359
diff
changeset
|
6860 |
!FileApplicationNoteBook::TextEditor methodsFor:'initialization'! |
dae73aa739a8
no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents:
9359
diff
changeset
|
6861 |
|
dae73aa739a8
no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents:
9359
diff
changeset
|
6862 |
initialize |
dae73aa739a8
no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents:
9359
diff
changeset
|
6863 |
super initialize. |
dae73aa739a8
no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents:
9359
diff
changeset
|
6864 |
semaChangeItem := Semaphore forMutualExclusion. |
17747 | 6865 |
|
6866 |
characterEncodingInDump := nil. "/ nil defaults to 'iso8859-1' " |
|
6867 |
radixInDump := 16. |
|
18670 | 6868 |
doMD5ModificationCheck := self hasMD5. |
17747 | 6869 |
|
6870 |
"Modified (comment): / 12-11-2017 / 12:27:20 / cg" |
|
18670 | 6871 |
"Modified: / 12-03-2019 / 15:28:04 / Claus Gittinger" |
9399
dae73aa739a8
no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents:
9359
diff
changeset
|
6872 |
! ! |
dae73aa739a8
no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents:
9359
diff
changeset
|
6873 |
|
3892 | 6874 |
!FileApplicationNoteBook::TextEditor methodsFor:'printing'! |
6875 |
||
8002
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
6876 |
printOn:aStream |
8684 | 6877 |
|fn| |
6878 |
||
8002
031dca544927
Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents:
7970
diff
changeset
|
6879 |
aStream nextPutAll:'TextEditor for:'. |
8684 | 6880 |
(fn := self fileName) notNil ifTrue:[ |
6881 |
fn baseName printOn:aStream. |
|
6882 |
] |
|
3892 | 6883 |
! ! |
6884 |
||
6481 | 6885 |
!FileApplicationNoteBook::TextEditor methodsFor:'private-process'! |
3892 | 6886 |
|
4969 | 6887 |
checkItemForChanges |
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6888 |
|exists fileModificationTime message| |
5584 | 6889 |
|
5612
7b0fa57f046e
Allow opening of a file in an empty text editor
Stefan Vogel <sv@exept.de>
parents:
5610
diff
changeset
|
6890 |
item isNil ifTrue:[ |
7b0fa57f046e
Allow opening of a file in an empty text editor
Stefan Vogel <sv@exept.de>
parents:
5610
diff
changeset
|
6891 |
^ self |
7b0fa57f046e
Allow opening of a file in an empty text editor
Stefan Vogel <sv@exept.de>
parents:
5610
diff
changeset
|
6892 |
]. |
7b0fa57f046e
Allow opening of a file in an empty text editor
Stefan Vogel <sv@exept.de>
parents:
5610
diff
changeset
|
6893 |
|
5584 | 6894 |
exists := self item exists. |
6895 |
self itemRemoved value:(exists not). |
|
6896 |
exists ifTrue:[ |
|
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6897 |
fileModificationTime := self fileName modificationTime. |
4969 | 6898 |
textEditorModificationTime isNil ifTrue:[ |
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6899 |
textEditorModificationTime := fileModificationTime. |
4608
990e5559a904
md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents:
4572
diff
changeset
|
6900 |
]. |
5584 | 6901 |
message := '%1 was changed by someone else.'. |
6902 |
] ifFalse:[ |
|
6903 |
message := '%1 was removed by someone else.'. |
|
6904 |
]. |
|
6905 |
||
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6906 |
(textEditorModificationTime ~= fileModificationTime) ifTrue:[ |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6907 |
"file contents has been changed by someone else" |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6908 |
message := (resources string:message with:item fileName baseName) allBold |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6909 |
emphasisAllAdd:(UserPreferences current emphasisForModifiedBuffer). |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6910 |
message = self notifyChannel value ifFalse:[ |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6911 |
self notify:message. |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6912 |
self itemChanged value:true. |
4969 | 6913 |
]. |
3892 | 6914 |
]. |
5457 | 6915 |
! |
6916 |
||
6917 |
checkItemForChangesWithNewSetup |
|
6918 |
self checkItemForChanges. |
|
4969 | 6919 |
self setupCheckModify. |
6920 |
! |
|
6921 |
||
4977
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
6922 |
releaseCheckModify |
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6923 |
checkModifiedBlock notNil ifTrue:[ |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6924 |
Processor removeTimedBlock:checkModifiedBlock. |
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6925 |
]. |
4977
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
6926 |
! |
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
6927 |
|
4969 | 6928 |
setupCheckModify |
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6929 |
checkModifiedBlock isNil ifTrue:[ |
18699 | 6930 |
checkModifiedBlock := [ self enqueueMessage:#checkItemForChangesWithNewSetup ]. |
8614
6712b6367808
Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents:
8514
diff
changeset
|
6931 |
]. |
5461 | 6932 |
Processor addTimedBlock:checkModifiedBlock afterSeconds:(self class checkModifiedDelayTime). |
18699 | 6933 |
|
6934 |
"Modified: / 16-03-2019 / 14:09:51 / Claus Gittinger" |
|
3892 | 6935 |
! ! |
6936 |
||
6937 |
!FileApplicationNoteBook::TextEditor methodsFor:'queries'! |
|
6938 |
||
7467 | 6939 |
additionalInfo |
6940 |
^ '[',editView numberOfLines printString , ' lines]'. |
|
6941 |
||
6942 |
"Created: / 24-10-2006 / 12:27:07 / cg" |
|
6943 |
! |
|
6944 |
||
4071 | 6945 |
hasMD5 |
6946 |
^ ( MD5Stream notNil and:[MD5Stream isLoaded]) |
|
6947 |
! |
|
6948 |
||
3892 | 6949 |
isModified |
5456 | 6950 |
self checkItemForChanges. |
5317 | 6951 |
^ self modifiedChannel value |
6952 |
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
|
6953 |
! |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6954 |
|
17747 | 6955 |
isShowingHexDumpHolder |
6956 |
^ BlockValue |
|
6957 |
with:[:v | v == #hexDump] |
|
6958 |
argument:(self presentationHolder) |
|
6959 |
||
6960 |
"Created: / 12-11-2017 / 12:36:27 / cg" |
|
6961 |
! |
|
6962 |
||
4146
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6963 |
isTextEditor |
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6964 |
|
c7c4e3044e50
on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents:
4111
diff
changeset
|
6965 |
^ true |
3892 | 6966 |
! ! |
6967 |
||
6968 |
!FileApplicationNoteBook::TextEditor methodsFor:'startup & release'! |
|
6969 |
||
6970 |
closeRequest |
|
6626 | 6971 |
"asks for permission before closing" |
3892 | 6972 |
|
6973 |
(self doClose) ifTrue:[ |
|
6974 |
^ super closeRequest. |
|
6975 |
]. |
|
6976 |
! |
|
6977 |
||
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6978 |
editorOperationsMenuSpecForMimeType:mimeType |
13715
dab7e512b771
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13406
diff
changeset
|
6979 |
mimeType isHtmlType ifTrue:[ |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6980 |
^ self class menuEditorOperationsForHTML. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6981 |
]. |
13715
dab7e512b771
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13406
diff
changeset
|
6982 |
mimeType isSmalltalkSourceType ifTrue:[ |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6983 |
^ self class menuEditorOperationsForSourceCode. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6984 |
]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6985 |
mimeType isTextType ifTrue:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6986 |
^ self class menuEditorOperationsForNormalText. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6987 |
]. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6988 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6989 |
^ self class menuEditorOperationsForOther. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6990 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6991 |
"Created: / 02-08-2013 / 18:00:39 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6992 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
6993 |
|
10754 | 6994 |
getEditorClass |
6995 |
UserPreferences current useCodeView2InTools ifTrue:[ |
|
6996 |
^ Tools::CodeView2 ? CodeView |
|
6997 |
]. |
|
6998 |
^ CodeView |
|
6999 |
||
7000 |
"Created: / 06-10-2011 / 11:21:43 / cg" |
|
7001 |
! |
|
7002 |
||
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7003 |
hideEditorOperationsToolBarButtonCreated:aButton |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7004 |
aButton passiveLevel:(MenuPanel defaultLevel). |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7005 |
aButton activeLevel:-1. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7006 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7007 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7008 |
"Created: / 02-08-2013 / 16:01:49 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7009 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7010 |
|
3892 | 7011 |
postBuildTextEditor:aWidget |
10754 | 7012 |
editView := aWidget scrolledView. |
14916
794fcf3b42ec
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14907
diff
changeset
|
7013 |
|
794fcf3b42ec
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14907
diff
changeset
|
7014 |
"/ I don't want any non-smalltalk code to be syntaxhighlighted!! |
794fcf3b42ec
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14907
diff
changeset
|
7015 |
(editView askFor: #isCodeView2) ifTrue:[ |
10754 | 7016 |
editView languageHolder value:nil. |
7017 |
editView services:#(). |
|
7018 |
]. |
|
5430 | 7019 |
editView saveAction:[ self doSaveAs ]. |
9946 | 7020 |
editView cursorLineHolder addDependent:self. |
5430 | 7021 |
|
5417 | 7022 |
aWidget modifiedChannel:self viewModifiedChannel. |
5528 | 7023 |
|
7024 |
editView externalEncoding:self fileEncoding. |
|
16861 | 7025 |
"/ editView characterEncoding:'unicode'. - that's the default anyway |
9946 | 7026 |
|
10754 | 7027 |
"Modified: / 06-10-2011 / 11:43:40 / cg" |
10955 | 7028 |
"Modified (comment): / 03-12-2011 / 10:27:47 / cg" |
3892 | 7029 |
! |
7030 |
||
7031 |
postOpenWith:aBuilder |
|
7032 |
||
5120 | 7033 |
"/ self item isNil ifTrue:[ |
7034 |
"/ self item:(DirectoryContentsBrowser itemClass fileName:(Filename homeDirectory construct:'.bashrc')). |
|
7035 |
"/ ]. |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7036 |
(self componentAt:#EditorOperationsToolBar) menuHolder:self editorOperationsMenuSpecHolder. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7037 |
|
3892 | 7038 |
self setUpTextView. |
7039 |
self changeInformation. |
|
9949
d1161d3fbd19
tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents:
9947
diff
changeset
|
7040 |
self tagsBrowserVisibilityChanged. |
6626 | 7041 |
super postOpenWith:aBuilder |
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7042 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7043 |
"Modified: / 02-08-2013 / 17:57:50 / cg" |
3892 | 7044 |
! |
7045 |
||
7046 |
release |
|
7047 |
"release my resources |
|
7048 |
" |
|
4977
621cc3cb454d
checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents:
4971
diff
changeset
|
7049 |
self releaseCheckModify. |
4969 | 7050 |
checkModifiedBlock := nil. |
3892 | 7051 |
super release. |
7052 |
! |
|
7053 |
||
7054 |
setUpTextView |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7055 |
"care for any contents specific settings for the editor |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7056 |
For example: |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7057 |
- change the parenthesis-spec of the editor to include $< .. $> if the |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7058 |
shown document is an html- or xml document, |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7059 |
- change the editorOperationsMenu |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7060 |
" |
4945 | 7061 |
|
12089
4690e72f5af3
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12079
diff
changeset
|
7062 |
|item mimeType suffix parenthesis commentStrings parentesisSpec col| |
4945 | 7063 |
|
5550 | 7064 |
editView notNil ifTrue:[ |
7065 |
item := self item. |
|
7066 |
item notNil ifTrue:[ |
|
7067 |
item hasMimeType ifTrue:[ |
|
7068 |
mimeType := item mimeType. |
|
12089
4690e72f5af3
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12079
diff
changeset
|
7069 |
suffix := self fileName asFilename suffix. |
5550 | 7070 |
|
13715
dab7e512b771
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13406
diff
changeset
|
7071 |
(mimeType isHtmlType or:[mimeType isXmlType]) ifTrue:[ |
5550 | 7072 |
parenthesis := editView parenthesisSpecification copy. |
7073 |
((parenthesis at:#open) includes:$<) ifFalse:[ |
|
7074 |
col := ((parenthesis at:#open) asOrderedCollection). |
|
7075 |
col add:$<. |
|
7076 |
parenthesis at:#open put:col. |
|
7077 |
||
7078 |
col := ((parenthesis at:#close) asOrderedCollection). |
|
7079 |
col add:$>. |
|
7080 |
parenthesis at:#close put:col. |
|
7081 |
||
7082 |
editView parenthesisSpecification:parenthesis |
|
7083 |
]. |
|
5548 | 7084 |
]. |
5574
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
7085 |
|
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
7086 |
commentStrings := MIMETypes |
6477 | 7087 |
commentStringsForMimeType:mimeType |
12089
4690e72f5af3
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12079
diff
changeset
|
7088 |
suffix:suffix |
5574
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
7089 |
ifUnknown:[ |
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
7090 |
"/ st: |
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
7091 |
#('"/' ('"' '"')) |
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
7092 |
]. |
6477 | 7093 |
|
5574
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
7094 |
commentStrings notNil ifTrue:[ |
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
7095 |
editView perform:#commentStrings: with:commentStrings ifNotUnderstood:nil |
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
7096 |
]. |
d4a872f4b8b7
set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents:
5567
diff
changeset
|
7097 |
|
7787 | 7098 |
parentesisSpec := MIMETypes |
8176
64c5b7c41f3d
fix spelling of MIMETypes>>#parenthesis* methods
Stefan Vogel <sv@exept.de>
parents:
8087
diff
changeset
|
7099 |
parenthesisSpecForMimeType:mimeType |
12089
4690e72f5af3
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12079
diff
changeset
|
7100 |
suffix:suffix |
7787 | 7101 |
ifUnknown:[ |
7102 |
|spec| |
|
7103 |
spec := IdentityDictionary new. |
|
16637 | 7104 |
spec at:#open put:'([{' "#( $( $[ ${)" . |
7105 |
spec at:#close put:')]}' "#( $) $] $})". |
|
7787 | 7106 |
spec |
7107 |
]. |
|
7108 |
||
7109 |
parentesisSpec notNil ifTrue:[ |
|
7110 |
editView perform:#parenthesisSpecification: with:parentesisSpec ifNotUnderstood:nil |
|
7111 |
]. |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7112 |
self setupEditorOperationsMenuForMimeType:mimeType. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7113 |
] ifFalse:[ |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7114 |
self setupEditorOperationsMenuForMimeType:(MIMETypes mimeTypeFromString:'text/plain'). |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7115 |
] |
3892 | 7116 |
]. |
5550 | 7117 |
editView externalEncoding:self fileEncoding. |
7118 |
] |
|
7787 | 7119 |
|
13295
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7120 |
"Modified: / 02-08-2013 / 16:34:34 / cg" |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7121 |
! |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7122 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7123 |
setupEditorOperationsMenuForMimeType:mimeType |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7124 |
|spec| |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7125 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7126 |
spec := self editorOperationsMenuSpecForMimeType:mimeType. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7127 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7128 |
"/ does not work - why? |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7129 |
"/ self editorOperationsMenuSpecHolder value:spec. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7130 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7131 |
(self componentAt:#EditorOperationsToolBarMenu) menu:spec. |
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7132 |
|
30d3cb0c4f6c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13112
diff
changeset
|
7133 |
"Created: / 02-08-2013 / 16:35:21 / cg" |
3892 | 7134 |
! ! |
7135 |
||
9785 | 7136 |
!FileApplicationNoteBook::XMLViewApplication class methodsFor:'defaults'! |
7137 |
||
7138 |
tabStringFor:aApplicationType |
|
7139 |
"the formatString shown in a tab (language translated)" |
|
7140 |
||
7141 |
^ 'XML View for %1' |
|
7142 |
||
7143 |
"Modified: / 17-02-2011 / 13:28:22 / cg" |
|
7144 |
! ! |
|
7145 |
||
7146 |
!FileApplicationNoteBook::XMLViewApplication class methodsFor:'interface specs'! |
|
7147 |
||
7148 |
windowSpec |
|
7149 |
"This resource specification was automatically generated |
|
7150 |
by the UIPainter of ST/X." |
|
7151 |
||
7152 |
"Do not manually edit this!! If it is corrupted, |
|
7153 |
the UIPainter may not be able to read the specification." |
|
7154 |
||
7155 |
" |
|
7156 |
UIPainter new openOnClass:FileApplicationNoteBook::XMLViewApplication andSelector:#windowSpec |
|
7157 |
FileApplicationNoteBook::XMLViewApplication new openInterface:#windowSpec |
|
7158 |
FileApplicationNoteBook::XMLViewApplication open |
|
7159 |
" |
|
7160 |
||
7161 |
<resource: #canvas> |
|
7162 |
||
7163 |
^ |
|
7164 |
#(FullSpec |
|
7165 |
name: windowSpec |
|
7166 |
window: |
|
7167 |
(WindowSpec |
|
7168 |
label: 'NoteBookApplication::HtmlView' |
|
7169 |
name: 'NoteBookApplication::HtmlView' |
|
7170 |
min: (Point 10 10) |
|
7171 |
bounds: (Rectangle 0 0 676 492) |
|
7172 |
menu: mainMenu |
|
7173 |
) |
|
7174 |
component: |
|
7175 |
(SpecCollection |
|
7176 |
collection: ( |
|
7177 |
(MenuPanelSpec |
|
7178 |
name: 'MenuXml' |
|
7179 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
7180 |
level: 0 |
|
7181 |
visibilityChannel: isEmbeddedApplication |
|
7182 |
menu: menu |
|
7183 |
textDefault: true |
|
7184 |
) |
|
7185 |
(SubCanvasSpec |
|
7186 |
name: 'XMLCanvas' |
|
7187 |
layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 0 1) |
|
7188 |
level: 0 |
|
7189 |
hasHorizontalScrollBar: false |
|
7190 |
hasVerticalScrollBar: false |
|
7191 |
majorKey: #'XML::XMLInspector' |
|
7192 |
createNewApplication: true |
|
7193 |
createNewBuilder: false |
|
7194 |
postBuildCallback: postBuildXMLCanvas: |
|
7195 |
) |
|
7196 |
) |
|
7197 |
||
7198 |
) |
|
7199 |
) |
|
7200 |
! ! |
|
7201 |
||
7202 |
!FileApplicationNoteBook::XMLViewApplication class methodsFor:'menu specs'! |
|
7203 |
||
7204 |
menu |
|
7205 |
"This resource specification was automatically generated |
|
7206 |
by the MenuEditor of ST/X." |
|
7207 |
||
7208 |
"Do not manually edit this!! If it is corrupted, |
|
7209 |
the MenuEditor may not be able to read the specification." |
|
7210 |
||
7211 |
" |
|
7212 |
MenuEditor new openOnClass:FileApplicationNoteBook::XMLViewApplication andSelector:#menu |
|
7213 |
(Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::XMLViewApplication menu)) startUp |
|
7214 |
" |
|
7215 |
||
7216 |
<resource: #menu> |
|
7217 |
||
7218 |
^ |
|
7219 |
#(Menu |
|
7220 |
( |
|
7221 |
(MenuItem |
|
9786
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7222 |
activeHelpKey: reloadFile |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7223 |
isVisible: reloadButtonVisible |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7224 |
enabled: enableReload |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7225 |
label: 'Reload' |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7226 |
itemValue: reload |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7227 |
nameKey: Reload |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7228 |
translateLabel: true |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7229 |
isButton: true |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7230 |
labelImage: (ResourceRetriever ToolbarIconLibrary reloadTextFromFileIcon) |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7231 |
) |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7232 |
(MenuItem |
9785 | 7233 |
activeHelpKey: closeTabButton |
7234 |
label: 'Close' |
|
7235 |
itemValue: doClose |
|
7236 |
translateLabel: true |
|
7237 |
isButton: true |
|
7238 |
startGroup: right |
|
7239 |
hideMenuOnActivated: false |
|
7240 |
labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon) |
|
7241 |
) |
|
7242 |
) |
|
7243 |
nil |
|
7244 |
nil |
|
7245 |
) |
|
9786
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7246 |
|
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7247 |
"Modified: / 17-02-2011 / 17:30:26 / cg" |
9785 | 7248 |
! ! |
7249 |
||
7250 |
!FileApplicationNoteBook::XMLViewApplication class methodsFor:'queries'! |
|
7251 |
||
7252 |
canOpenItem:anItem |
|
15935 | 7253 |
|mime| |
7254 |
||
12121
57a6e8face3b
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
12115
diff
changeset
|
7255 |
(Smalltalk at:#'XML::XMLInspector') isNil ifTrue:[^ false]. |
18266 | 7256 |
((mime := anItem mimeType) isNil or:[ mime == #unknown]) ifTrue:[ |
7257 |
mime := anItem fileName mimeTypeOfContents |
|
7258 |
]. |
|
7259 |
(mime isNil or:[ mime == #unknown]) ifTrue:[^ false]. |
|
15935 | 7260 |
|
7261 |
^ mime isXmlType |
|
9785 | 7262 |
|
7263 |
"Modified: / 17-02-2011 / 13:34:08 / cg" |
|
18266 | 7264 |
"Modified: / 13-07-2018 / 16:59:03 / Claus Gittinger" |
9785 | 7265 |
! |
7266 |
||
7267 |
wantNewApplicationAnyway |
|
7268 |
||
7269 |
^ false |
|
7270 |
! ! |
|
7271 |
||
7272 |
!FileApplicationNoteBook::XMLViewApplication methodsFor:'accessing'! |
|
7273 |
||
7274 |
item:anItem |
|
7275 |
|retVal| |
|
7276 |
||
7277 |
self labelHolder value:anItem fileName asString. |
|
7278 |
retVal := super item:anItem. |
|
7279 |
xmlTreeApp notNil ifTrue:[ |
|
7280 |
self updateXMLTree |
|
7281 |
]. |
|
7282 |
^ retVal |
|
7283 |
||
7284 |
"Modified: / 17-02-2011 / 13:38:53 / cg" |
|
7285 |
! |
|
7286 |
||
7287 |
updateXMLTree |
|
18717 | 7288 |
|lineInStream dom| |
7289 |
[ |
|
9785 | 7290 |
self withWaitCursorDo:[ |
18717 | 7291 |
[ |
7292 |
|rawStream inStream encoding| |
|
7293 |
||
7294 |
rawStream := self fileName readStream. |
|
7295 |
rawStream binary. |
|
7296 |
encoding := CharacterEncoder detectAndSkipBOMInStream:rawStream. |
|
7297 |
rawStream text. |
|
7298 |
encoding notNil ifTrue:[ |
|
7299 |
inStream := EncodedStream stream:rawStream encoding:encoding. |
|
7300 |
] ifFalse:[ |
|
7301 |
inStream := rawStream |
|
7302 |
]. |
|
7303 |
lineInStream := LineNumberReadStream on:inStream. |
|
7304 |
[ |
|
7305 |
dom := XML::XMLParser |
|
7306 |
processDocumentStream:lineInStream |
|
7307 |
beforeScanDo:[:parser | parser validate:false. ]. |
|
7308 |
xmlTreeApp model:dom. |
|
7309 |
] ensure:[ |
|
7310 |
rawStream close |
|
7311 |
] |
|
7312 |
] on: XML::XMLSignal do:[:ex | |
|
9786
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7313 |
Dialog |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7314 |
information: |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7315 |
(resources |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7316 |
stringWithCRs:'Error reported by XML-Parser in line %1:\\%2\\Showing as regular text.' |
18717 | 7317 |
with:lineInStream lineNumber |
9786
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7318 |
with:ex description). |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7319 |
Error raise. |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7320 |
]. |
9785 | 7321 |
]. |
18717 | 7322 |
] on: Error do:[:ex | self halt]. |
9785 | 7323 |
|
7324 |
"Created: / 17-02-2011 / 13:39:07 / cg" |
|
9786
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7325 |
"Modified: / 17-02-2011 / 17:39:15 / cg" |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7326 |
! ! |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7327 |
|
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7328 |
!FileApplicationNoteBook::XMLViewApplication methodsFor:'actions'! |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7329 |
|
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7330 |
reload |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7331 |
self updateXMLTree. |
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7332 |
|
be0b10d85572
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
9785
diff
changeset
|
7333 |
"Created: / 17-02-2011 / 17:46:36 / cg" |
9785 | 7334 |
! ! |
7335 |
||
7336 |
!FileApplicationNoteBook::XMLViewApplication methodsFor:'aspects'! |
|
7337 |
||
18713 | 7338 |
enableReload |
7339 |
self fileName notNil |
|
7340 |
||
7341 |
"Created: / 26-03-2019 / 08:17:16 / Claus Gittinger" |
|
7342 |
! |
|
7343 |
||
9785 | 7344 |
labelHolder |
7345 |
||
7346 |
labelHolder isNil ifTrue:[ |
|
7347 |
labelHolder := '' asValue. |
|
7348 |
]. |
|
7349 |
^ labelHolder. |
|
7350 |
! ! |
|
7351 |
||
7352 |
!FileApplicationNoteBook::XMLViewApplication methodsFor:'initialization & release'! |
|
7353 |
||
7354 |
postBuildXMLCanvas:aWidget |
|
7355 |
xmlTreeApp := aWidget client. |
|
7356 |
item notNil ifTrue:[self updateXMLTree]. |
|
7357 |
||
7358 |
"Modified: / 17-02-2011 / 13:39:18 / cg" |
|
7359 |
! ! |
|
7360 |
||
3892 | 7361 |
!FileApplicationNoteBook::XViewApplication class methodsFor:'defaults'! |
7362 |
||
7363 |
maxNumberOfVNCRestarts |
|
7364 |
||
7365 |
^ 10 |
|
7366 |
! |
|
7367 |
||
7368 |
mimeTypeUnixApplicationMapping |
|
7369 |
||
7370 |
" here insert the application and mime type pairs to open by XviewApplication |
|
7371 |
" |
|
7372 |
||
7373 |
^ |
|
7374 |
#( |
|
14496
4c671a13ba46
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14462
diff
changeset
|
7375 |
#(#'application/postscript' 'gv %1' ) |
4c671a13ba46
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14462
diff
changeset
|
7376 |
#(#'application/pdf' 'acroread %1' ) |
3892 | 7377 |
) |
7378 |
! |
|
7379 |
||
7380 |
tabStringFor:aApplicationType |
|
7687 | 7381 |
"the formatString shown in a tab (language translated)" |
7382 |
||
7383 |
^ 'VNC for %1' |
|
7384 |
||
7385 |
"Modified: / 01-03-2007 / 21:43:43 / cg" |
|
3892 | 7386 |
! |
7387 |
||
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
7388 |
unixVNCCommand |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
7389 |
|
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
7390 |
^ 'Xvnc' |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
7391 |
! |
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
7392 |
|
3892 | 7393 |
wantNewApplicationAnyway |
7394 |
||
4500
9f0b8d6ae2be
make a new XView for a new item if an XView already open
penk
parents:
4499
diff
changeset
|
7395 |
^ true |
3892 | 7396 |
! ! |
7397 |
||
7398 |
!FileApplicationNoteBook::XViewApplication class methodsFor:'interface specs'! |
|
7399 |
||
7400 |
windowSpec |
|
7401 |
"This resource specification was automatically generated |
|
7402 |
by the UIPainter of ST/X." |
|
7403 |
||
7404 |
"Do not manually edit this!! If it is corrupted, |
|
7405 |
the UIPainter may not be able to read the specification." |
|
7406 |
||
7407 |
" |
|
4336
b4228ddf2183
change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents:
4293
diff
changeset
|
7408 |
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
|
7409 |
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
|
7410 |
FileApplicationNoteBook::XViewApplication open |
3892 | 7411 |
" |
7412 |
||
7413 |
<resource: #canvas> |
|
7414 |
||
7415 |
^ |
|
7416 |
#(#FullSpec |
|
7417 |
#name: #windowSpec |
|
7418 |
#window: |
|
7419 |
#(#WindowSpec |
|
7420 |
#label: 'XView' |
|
7421 |
#name: 'XView' |
|
7422 |
#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
|
7423 |
#bounds: #(#Rectangle 16 42 692 534) |
3892 | 7424 |
#menu: #mainMenu |
7425 |
) |
|
7426 |
#component: |
|
7427 |
#(#SpecCollection |
|
7428 |
#collection: #( |
|
7429 |
#(#MenuPanelSpec |
|
4261 | 7430 |
#name: 'MenuVNC' |
3892 | 7431 |
#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
|
7432 |
#level: 0 |
3892 | 7433 |
#visibilityChannel: #isEmbeddedApplication |
7434 |
#menu: #menu |
|
7435 |
#textDefault: true |
|
7436 |
) |
|
7437 |
#(#ArbitraryComponentSpec |
|
4261 | 7438 |
#name: 'VNCView' |
3892 | 7439 |
#layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0) |
7440 |
#hasHorizontalScrollBar: true |
|
7441 |
#hasVerticalScrollBar: true |
|
7442 |
#miniScrollerHorizontal: false |
|
7443 |
#miniScrollerVertical: false |
|
7444 |
#hasBorder: false |
|
7445 |
#component: #VNCFrameBufferView |
|
7446 |
#postBuildCallback: #postBuildXView: |
|
7447 |
) |
|
7448 |
) |
|
7449 |
||
7450 |
) |
|
7451 |
) |
|
7452 |
! ! |
|
7453 |
||
7454 |
!FileApplicationNoteBook::XViewApplication class methodsFor:'menu specs'! |
|
7455 |
||
7456 |
menu |
|
7457 |
"This resource specification was automatically generated |
|
7458 |
by the MenuEditor of ST/X." |
|
7459 |
||
7460 |
"Do not manually edit this!! If it is corrupted, |
|
7461 |
the MenuEditor may not be able to read the specification." |
|
7462 |
||
7463 |
" |
|
7464 |
MenuEditor new openOnClass:NoteBookApplication::ImageViewApplication andSelector:#menu |
|
7465 |
(Menu new fromLiteralArrayEncoding:(NoteBookApplication::ImageViewApplication menu)) startUp |
|
7466 |
" |
|
7467 |
||
7468 |
<resource: #menu> |
|
7469 |
||
7470 |
^ |
|
7471 |
#(#Menu |
|
7472 |
#( |
|
7473 |
#(#MenuItem |
|
6100 | 7474 |
#activeHelpKey: #closeTabButton |
3892 | 7475 |
#label: 'Close' |
7476 |
#translateLabel: true |
|
7477 |
#isButton: true |
|
7478 |
#hideMenuOnActivated: false |
|
7479 |
#startGroup: #right |
|
7480 |
#value: #doClose |
|
6093 | 7481 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #removeTabIcon) |
3892 | 7482 |
) |
7483 |
) |
|
7484 |
nil |
|
7485 |
nil |
|
7486 |
) |
|
7487 |
! ! |
|
7488 |
||
7489 |
!FileApplicationNoteBook::XViewApplication class methodsFor:'queries'! |
|
7490 |
||
5008 | 7491 |
canOpenItem:anItem |
5265 | 7492 |
| keySym| |
3892 | 7493 |
|
5008 | 7494 |
keySym := anItem mimeType asSymbol. |
7495 |
OperatingSystem isUNIXlike ifFalse:[^ false]. |
|
7496 |
||
5265 | 7497 |
(self mimeTypeUnixApplicationMapping contains:[ : el | (el at:1) == keySym ]) ifFalse:[^ false]. |
5008 | 7498 |
|
7499 |
(OperatingSystem executeCommand:('which ', self unixVNCCommand)) ifFalse:[ |
|
14496
4c671a13ba46
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
14462
diff
changeset
|
7500 |
"/ Dialog warn:'Cannot start a viewer for ' , anItem fileName baseName. |
5008 | 7501 |
^ false. |
3892 | 7502 |
]. |
5008 | 7503 |
|
7504 |
VNCFrameBufferView notNil ifFalse:[ |
|
7505 |
Dialog warn:'VNC support classes are missing (package not loaded?)'. |
|
7506 |
^ false. |
|
7507 |
]. |
|
7508 |
^ true |
|
3892 | 7509 |
! ! |
7510 |
||
7511 |
!FileApplicationNoteBook::XViewApplication methodsFor:'accessing'! |
|
7512 |
||
7513 |
xView |
|
7514 |
"return the value of the instance variable 'imageView' (automatically generated)" |
|
7515 |
||
7516 |
^ xView |
|
7517 |
! |
|
7518 |
||
7519 |
xView:something |
|
7520 |
"set the value of the instance variable 'imageView' (automatically generated)" |
|
7521 |
||
7522 |
xView := something. |
|
7523 |
! ! |
|
7524 |
||
7525 |
!FileApplicationNoteBook::XViewApplication methodsFor:'actions'! |
|
7526 |
||
7527 |
changeInformation |
|
15594
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
7528 |
|stream| |
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
7529 |
|
ebb982d3e6c3
class: FileApplicationNoteBook
Stefan Vogel <sv@exept.de>
parents:
15489
diff
changeset
|
7530 |
stream := CharacterWriteStream with:'XView on: '. |
3892 | 7531 |
stream nextPutAll:self fileName baseName. |
7532 |
masterApplication isNil ifTrue:[ |
|
7533 |
self window label:stream contents. |
|
7534 |
] ifFalse:[ |
|
7535 |
masterApplication tabStringChangeTo:stream contents for:self. |
|
7536 |
]. |
|
7537 |
! |
|
7538 |
||
7539 |
setupXView |
|
7540 |
||
3906 | 7541 |
|xExt yExt mainView| |
3892 | 7542 |
|
7543 |
self startVNCserver. |
|
7544 |
xExt := self xView width asString. |
|
3906 | 7545 |
self masterApplication notNil ifTrue:[ |
7546 |
mainView := self builder windowGroup mainView. |
|
17633 | 7547 |
"/ if the mainView is a FileBrowser, take the y extent because size of notebook can be changed |
7548 |
(mainView application class == (Smalltalk at:#FileBrowserV2 ifAbsent:nil)) ifTrue:[ |
|
3906 | 7549 |
yExt := mainView height asString. |
7550 |
]. |
|
7551 |
]. |
|
7552 |
yExt isNil ifTrue:[ |
|
3892 | 7553 |
yExt := self xView height asString. |
7554 |
]. |
|
7555 |
ext := xExt, 'x', yExt. |
|
7556 |
self startViewer. |
|
17633 | 7557 |
|
7558 |
"Modified: / 25-08-2017 / 09:58:41 / cg" |
|
3892 | 7559 |
! ! |
7560 |
||
7561 |
!FileApplicationNoteBook::XViewApplication methodsFor:'actions VNC'! |
|
7562 |
||
7563 |
setupView |
|
7564 |
| renderer view| |
|
7565 |
||
7566 |
view := xView. |
|
7567 |
renderer := VNCRenderer for:vncConnection targetWindow:view device:xView device. |
|
7568 |
||
7569 |
view renderer:renderer. |
|
7570 |
view connection:vncConnection. |
|
7571 |
||
7572 |
VNCException handle:[:ex| |
|
7573 |
self stopViewer. |
|
7574 |
] do:[ |
|
7575 |
vncConnection |
|
7576 |
startMessageHandlerProcessForRenderer:renderer |
|
7577 |
errorHandler:[:ex | self stopViewer]. |
|
7578 |
]. |
|
7579 |
! |
|
7580 |
||
7581 |
startVNCserver |
|
19204 | 7582 |
|cmd wasBlocked connected numberOfVncStarts| |
3892 | 7583 |
|
5008 | 7584 |
|
7585 |
VNCAuthenticationFailure isNil ifTrue:[ |
|
7586 |
Dialog warn:'VNC Classes missing (package not laoded ?)'. |
|
7587 |
^ self. |
|
7588 |
]. |
|
7589 |
||
3892 | 7590 |
connected := false. |
7591 |
numberOfVncStarts isNil ifTrue:[ |
|
7592 |
numberOfVncStarts := 1. |
|
7593 |
] ifFalse:[ |
|
7594 |
numberOfVncStarts := numberOfVncStarts + 1. |
|
7595 |
]. |
|
7596 |
||
7597 |
vncLock isNil ifTrue:[vncLock := Semaphore forMutualExclusion]. |
|
7598 |
||
7599 |
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
|
7600 |
cmd := ('/usr/X11R6/bin/', self class unixVNCCommand). |
3892 | 7601 |
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
|
7602 |
cmd := self class unixVNCCommand. |
3892 | 7603 |
]. |
7604 |
vncPortNr isNil ifTrue:[ |
|
7605 |
vncPortNr := 29 |
|
7606 |
]. |
|
7607 |
cmd := cmd , ' :' , vncPortNr printString , ' nologo -nevershared -localhost -depth 16 -geometry 1024x1024'. |
|
7608 |
||
19204 | 7609 |
[ |
7610 |
wasBlocked := OperatingSystem blockInterrupts. |
|
7611 |
||
7612 |
vncServerPID := Processor |
|
3892 | 7613 |
monitor:[ |
7614 |
vncServerIsTerminated := false. |
|
7615 |
OperatingSystem |
|
7616 |
exec:'/bin/sh' |
|
7617 |
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
|
7618 |
environment:nil |
3892 | 7619 |
fileDescriptors:#() |
7620 |
fork:true |
|
7621 |
newPgrp:true |
|
16823 | 7622 |
inDirectory:nil |
7623 |
showWindow:false. |
|
3892 | 7624 |
] |
7625 |
action:[:status | |
|
7626 |
status stillAlive ifFalse:[ |
|
7627 |
OperatingSystem closePid:vncServerPID. |
|
7628 |
vncLock critical:[ |
|
7629 |
vncServerPID := nil. |
|
7630 |
self vncServerTerminated. |
|
7631 |
]. |
|
7632 |
]. |
|
7633 |
]. |
|
19204 | 7634 |
] ensure:[ |
7635 |
wasBlocked ifFalse:[ OperatingSystem unblockInterrupts]. |
|
3892 | 7636 |
]. |
7637 |
]. |
|
7638 |
||
7639 |
self waitForTerminationOfServer ifTrue:[ |
|
7640 |
"/ Transcript showCR:'server has terminated really - try with next port'. |
|
7641 |
(numberOfVncStarts < self class maxNumberOfVNCRestarts) ifTrue:[ |
|
7642 |
vncPortNr := vncPortNr + 1. |
|
7643 |
"/ Transcript showCR:'try next port ', vncPortNr asString. |
|
7644 |
self startVNCserver. |
|
7645 |
] ifFalse:[ |
|
7646 |
Dialog warn:'have started servers from port ' |
|
7647 |
, (vncPortNr - self class maxNumberOfVNCRestarts) asString |
|
7648 |
, ' to ' |
|
7649 |
, vncPortNr |
|
7650 |
, ' - cant connect anyway'. |
|
7651 |
"/ Transcript showCR:'have started servers from port ', vncPortNr - self class maxNumberOfVNCRestarts, ' to ', vncPortNr. |
|
7652 |
]. |
|
7653 |
] ifFalse:[ |
|
7654 |
vncLock critical:[ |
|
7655 |
vncServerPID isNil ifTrue:[ |
|
7656 |
Dialog warn:'Cannot start Xvnc'. |
|
7657 |
] ifFalse:[ |
|
7658 |
VNCAuthenticationFailure handle:[:ex | |
|
7659 |
Dialog warn:'Wrong password'. |
|
7660 |
] do:[ |
|
7661 |
connected := self vncConnect. |
|
7662 |
]. |
|
7663 |
connected ifTrue:[self setupView]. |
|
7664 |
]. |
|
7665 |
]. |
|
7666 |
]. |
|
7667 |
! |
|
7668 |
||
7669 |
stopVNCServer |
|
5259 | 7670 |
|pid| |
7671 |
||
7672 |
(pid := vncServerPID) notNil ifTrue:[ |
|
7673 |
OperatingSystem terminateProcess:pid. |
|
3892 | 7674 |
Delay waitForSeconds:0.2. |
7675 |
vncServerPID notNil ifTrue:[ |
|
5259 | 7676 |
OperatingSystem killProcess:pid. |
3892 | 7677 |
vncServerPID := nil. |
7678 |
]. |
|
5259 | 7679 |
OperatingSystem closePid:pid |
3892 | 7680 |
]. |
7681 |
self vncServerTerminated. |
|
7682 |
! |
|
7683 |
||
7684 |
vncConnect |
|
7685 |
| tryConnects| |
|
7686 |
||
7687 |
vncConnection notNil ifTrue:[ |
|
7688 |
vncConnection close |
|
7689 |
]. |
|
7690 |
||
7691 |
vncConnection := VNCServerConnection new. |
|
7692 |
tryConnects := 1. |
|
7693 |
[tryConnects < 3] whileTrue:[ |
|
7694 |
VNCConnectionFailure handle:[:ex | |
|
7695 |
Delay waitForSeconds:0.5. |
|
7696 |
tryConnects := tryConnects + 1. |
|
7697 |
] do:[ |
|
7698 |
vncConnection connectTo:'localhost' port:vncPortNr. |
|
7699 |
^ true. |
|
7700 |
]. |
|
7701 |
]. |
|
7702 |
^ false |
|
7703 |
! |
|
7704 |
||
7705 |
vncServerTerminated |
|
7706 |
"/ Transcript showCR:'vnc server has terminated'. |
|
7707 |
"/ 'vnc server has terminated' errorPrintCR. |
|
7708 |
"/ Dialog information:'vnc server has terminated'. |
|
7709 |
||
7710 |
self stopViewer. |
|
7711 |
vncConnection notNil ifTrue:[ |
|
7712 |
vncConnection close. |
|
7713 |
vncConnection := nil |
|
7714 |
]. |
|
7715 |
vncServerIsTerminated := true. |
|
7716 |
! |
|
7717 |
||
7718 |
waitForTerminationOfServer |
|
7719 |
| cycles | |
|
7720 |
||
7721 |
cycles := 1. |
|
7722 |
[vncServerIsTerminated] whileFalse:[ |
|
7723 |
(cycles > 3) ifTrue:[^ false]. |
|
7724 |
cycles := cycles + 1. |
|
7725 |
Delay waitForSeconds:0.5. |
|
7726 |
]. |
|
7727 |
^ true |
|
7728 |
! ! |
|
7729 |
||
7730 |
!FileApplicationNoteBook::XViewApplication methodsFor:'actions viewer'! |
|
7731 |
||
7732 |
startViewer |
|
7733 |
|cmd keySym applItem | |
|
7734 |
||
7735 |
keySym := self item mimeType asSymbol. |
|
7736 |
applItem := self class mimeTypeUnixApplicationMapping detect:[ : el | (el at:1) == keySym ] ifNone:[nil]. |
|
7737 |
applItem isNil ifTrue:[ ^ self]. |
|
7738 |
||
7739 |
cmd := (applItem at:2) asString, ' -geometry ', ext, ' -display :' , vncPortNr printString , ' ' , self fileName asString. |
|
7740 |
self startViewer:cmd |
|
7741 |
! |
|
7742 |
||
7743 |
startViewer:viewerCommand |
|
19204 | 7744 |
|wasBlocked| |
3892 | 7745 |
|
7746 |
viewerPID notNil ifTrue:[ |
|
7747 |
^ self |
|
7748 |
]. |
|
7749 |
||
19204 | 7750 |
[ |
7751 |
wasBlocked := OperatingSystem blockInterrupts. |
|
7752 |
||
7753 |
viewerPID := Processor |
|
3892 | 7754 |
monitor:[ |
7755 |
OperatingSystem |
|
7756 |
exec:'/bin/sh' |
|
7757 |
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
|
7758 |
environment:nil |
3892 | 7759 |
fileDescriptors:#() |
7760 |
fork:true |
|
7761 |
newPgrp:true |
|
16823 | 7762 |
inDirectory:nil |
7763 |
showWindow:false. |
|
3892 | 7764 |
] |
7765 |
action:[:status | |
|
7766 |
status stillAlive ifFalse:[ |
|
7767 |
OperatingSystem closePid:viewerPID. |
|
7768 |
viewerPID := nil. |
|
7769 |
self viewerTerminated. |
|
7770 |
]. |
|
7771 |
]. |
|
19204 | 7772 |
] ensure:[ |
7773 |
wasBlocked ifFalse:[ OperatingSystem unblockInterrupts ] |
|
3892 | 7774 |
]. |
7775 |
||
7776 |
viewerPID isNil ifTrue:[ |
|
7777 |
Dialog warn:'Cannot start ', viewerCommand. |
|
7778 |
]. |
|
7779 |
! |
|
7780 |
||
7781 |
startXterm |
|
7782 |
|cmd| |
|
7783 |
||
7784 |
cmd := 'xterm -geometry 600x800 -display :' , vncPortNr printString. |
|
7785 |
self startViewer:cmd |
|
7786 |
! |
|
7787 |
||
7788 |
stopViewer |
|
5259 | 7789 |
|pid| |
7790 |
||
7791 |
(pid := viewerPID) notNil ifTrue:[ |
|
7792 |
OperatingSystem terminateProcess:pid. |
|
3892 | 7793 |
Delay waitForSeconds:0.2. |
7794 |
viewerPID notNil ifTrue:[ |
|
5259 | 7795 |
OperatingSystem killProcess:pid. |
3892 | 7796 |
viewerPID := nil. |
5259 | 7797 |
]. |
7798 |
OperatingSystem closePid:pid |
|
3892 | 7799 |
]. |
7800 |
! |
|
7801 |
||
7802 |
viewerTerminated |
|
7803 |
"/ Transcript showCR:'viewer has terminated'. |
|
7804 |
"/ 'viewer has terminated' errorPrintCR. |
|
7805 |
"/ Dialog information:'viewer has terminated'. |
|
7806 |
! ! |
|
7807 |
||
7808 |
!FileApplicationNoteBook::XViewApplication methodsFor:'initialization & release'! |
|
7809 |
||
7810 |
postBuildXView:aWidget |
|
7811 |
||
7812 |
self xView:aWidget scrolledView. |
|
7813 |
self xView wantsFocusWithPointerEnter. |
|
7814 |
aWidget autoHideScrollBars:true. |
|
7815 |
! |
|
7816 |
||
7817 |
postOpenWith:aBuilder |
|
6626 | 7818 |
"only invoked if the application not started from a master" |
3892 | 7819 |
|
7820 |
|currentDir contents suffix fileName| |
|
7821 |
||
7822 |
self masterApplication isNil ifTrue:[ |
|
7823 |
self masterApplication:nil. |
|
7824 |
currentDir := Filename homeDirectory. |
|
7825 |
contents := currentDir directoryContents. |
|
7826 |
fileName := contents |
|
7827 |
detect:[:file | |
|
7828 |
suffix := file asFilename suffix asLowercase. |
|
7829 |
suffix = 'pdf' |
|
7830 |
] |
|
7831 |
ifNone:[nil]. |
|
7832 |
fileName isNil ifTrue:[ |
|
7833 |
Dialog warn:'cant find a PDF File in ' , currentDir asString. |
|
7834 |
^ self |
|
7835 |
]. |
|
3982 | 7836 |
self item:(DirectoryContentsBrowser itemClass fileName:(currentDir construct:fileName)). |
3892 | 7837 |
]. |
7838 |
self changeInformation. |
|
7839 |
self setupXView. |
|
6626 | 7840 |
super postOpenWith:aBuilder |
3892 | 7841 |
! |
7842 |
||
7843 |
release |
|
7844 |
"/Transcript showCR:'release'. |
|
7845 |
self stopViewer. |
|
7846 |
self stopVNCServer. |
|
14065
a6da1191dfc5
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
13905
diff
changeset
|
7847 |
super release |
3892 | 7848 |
! ! |
7849 |
||
7850 |
!FileApplicationNoteBook class methodsFor:'documentation'! |
|
7851 |
||
10761 | 7852 |
version |
15815
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
7853 |
^ '$Header$' |
10761 | 7854 |
! |
7855 |
||
8912 | 7856 |
version_CVS |
15815
480bea0caf0c
class: FileApplicationNoteBook
Claus Gittinger <cg@exept.de>
parents:
15668
diff
changeset
|
7857 |
^ '$Header$' |
3892 | 7858 |
! ! |
12115 | 7859 |