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