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