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