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