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