FileApplicationNoteBook.st
author Stefan Vogel <sv@exept.de>
Wed, 11 Jul 2012 17:12:11 +0200
changeset 11590 dc5935e9387b
parent 11589 bb69ef59a32f
child 12066 dc7b890d8b7d
permissions -rw-r--r--
Fix decoding error handling
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
     1
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
     2
 COPYRIGHT (c) 2002 by eXept Software AG
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
     3
              All Rights Reserved
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
     4
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
     5
 This software is furnished under a license and may be used
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
     6
 only in accordance with the terms of that license and with the
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
     8
 be provided or otherwise made available to, or used by, any
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
     9
 other person.  No title to or ownership of the software is
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
    10
 hereby transferred.
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
    11
"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    12
"{ Package: 'stx:libtool' }"
321c1729db5b initial checkin
penk
parents:
diff changeset
    13
321c1729db5b initial checkin
penk
parents:
diff changeset
    14
AbstractFileBrowser subclass:#FileApplicationNoteBook
9951
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    15
	instanceVariableNames:'canvasHolder selectedEditorPage listOfApplications tabMenuIndex
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    16
		tabList selectionHistoryList privateTabList'
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    17
	classVariableNames:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    18
	poolDictionaries:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    19
	category:'Interface-Tools-File'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    20
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    21
321c1729db5b initial checkin
penk
parents:
diff changeset
    22
AbstractFileApplicationNoteBookComponent subclass:#ArchiveViewApplication
9951
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    23
	instanceVariableNames:'archiveFileList enableStopButton fileTable currentSortOrder
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    24
		selectionHolder tableColumns commandProcess errorListHolder
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    25
		viewErrorList temporaryDirectory enableRemoveErrorOutput
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    26
		errorListVisibilityHolder hasListEntriesHolder archiver process
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    27
		terminateByMe columnDescriptors inDropMode'
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    28
	classVariableNames:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    29
	poolDictionaries:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    30
	privateIn:FileApplicationNoteBook
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    31
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    32
321c1729db5b initial checkin
penk
parents:
diff changeset
    33
Object subclass:#ArchivItem
9951
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    34
	instanceVariableNames:'fileName size dateAndTime permissions icon ownerGroup method crc
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    35
		compressSize ratio version type isDirectory'
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    36
	classVariableNames:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    37
	poolDictionaries:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    38
	privateIn:FileApplicationNoteBook::ArchiveViewApplication
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    39
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    40
321c1729db5b initial checkin
penk
parents:
diff changeset
    41
AbstractFileApplicationNoteBookComponent subclass:#CommandResult
9951
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    42
	instanceVariableNames:'resultStream enableStopButton process labelHolder'
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    43
	classVariableNames:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    44
	poolDictionaries:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    45
	privateIn:FileApplicationNoteBook
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    46
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    47
7909
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
    48
AbstractFileApplicationNoteBookComponent subclass:#DigitalNotepadFileViewApplication
9951
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    49
	instanceVariableNames:'imageView image fitSize fitMode'
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    50
	classVariableNames:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    51
	poolDictionaries:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    52
	privateIn:FileApplicationNoteBook
7909
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
    53
!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
    54
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    55
AbstractFileApplicationNoteBookComponent subclass:#HtmlViewApplication
10566
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
    56
	instanceVariableNames:'htmlView labelHolder infoLabelHolder webBrowserPage'
9951
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    57
	classVariableNames:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    58
	poolDictionaries:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    59
	privateIn:FileApplicationNoteBook
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    60
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    61
321c1729db5b initial checkin
penk
parents:
diff changeset
    62
AbstractFileApplicationNoteBookComponent subclass:#ImageViewApplication
9951
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    63
	instanceVariableNames:'imageFile imageView image fitSize fitMode'
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    64
	classVariableNames:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    65
	poolDictionaries:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    66
	privateIn:FileApplicationNoteBook
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    67
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    68
321c1729db5b initial checkin
penk
parents:
diff changeset
    69
AbstractFileApplicationNoteBookComponent subclass:#Terminal
9951
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    70
	instanceVariableNames:'terminalView'
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    71
	classVariableNames:'DefaultLineLimit'
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    72
	poolDictionaries:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    73
	privateIn:FileApplicationNoteBook
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    74
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    75
321c1729db5b initial checkin
penk
parents:
diff changeset
    76
AbstractFileApplicationNoteBookComponent subclass:#TextEditor
9951
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    77
	instanceVariableNames:'fileContentsModel modifiedChannel editView enableSave
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    78
		enableReload presentation changeItemProcess closeApplication
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    79
		semaChangeItem wantToPrintAsHexDump printAsHexDump itemChanged
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    80
		itemRemoved enableHexToggle md5CheckSum
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    81
		md5HashValueComputationProcess viewModifiedChannel
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    82
		textEditorModificationTime checkModifiedBlock fileEncodingHolder
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    83
		doNotShowFontDialog lockFileEncodingHolder enableSelectInBrowser
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    84
		tagsBrowserVisibleHolder tagsBrowser'
10761
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
    85
	classVariableNames:'DefaultTagsBrowserVisible'
9951
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    86
	poolDictionaries:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    87
	privateIn:FileApplicationNoteBook
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
    88
!
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
    89
9785
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
    90
AbstractFileApplicationNoteBookComponent subclass:#XMLViewApplication
9951
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    91
	instanceVariableNames:'xmlTreeApp labelHolder infoLabelHolder'
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    92
	classVariableNames:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    93
	poolDictionaries:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    94
	privateIn:FileApplicationNoteBook
9785
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
    95
!
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
    96
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    97
AbstractFileApplicationNoteBookComponent subclass:#XViewApplication
9951
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    98
	instanceVariableNames:'xView xFile vncServerPID vncPortNr vncConnection viewerPID
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
    99
		vncLock vncServerIsTerminated xItem ext'
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
   100
	classVariableNames:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
   101
	poolDictionaries:''
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
   102
	privateIn:FileApplicationNoteBook
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   103
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   104
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   105
!FileApplicationNoteBook class methodsFor:'documentation'!
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   106
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   107
copyright
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   108
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   109
 COPYRIGHT (c) 2002 by eXept Software AG
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   110
              All Rights Reserved
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   111
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   112
 This software is furnished under a license and may be used
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   113
 only in accordance with the terms of that license and with the
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   114
 inclusion of the above copyright notice.   This software may not
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   115
 be provided or otherwise made available to, or used by, any
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   116
 other person.  No title to or ownership of the software is
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   117
 hereby transferred.
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   118
"
5968
a8715e97c1cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   119
!
a8715e97c1cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   120
a8715e97c1cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   121
documentation
a8715e97c1cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   122
"
a8715e97c1cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   123
    [Author:]
a8715e97c1cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   124
        Christian Penk
a8715e97c1cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   125
"
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5120
diff changeset
   126
! !
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   127
321c1729db5b initial checkin
penk
parents:
diff changeset
   128
!FileApplicationNoteBook class methodsFor:'application list'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   129
321c1729db5b initial checkin
penk
parents:
diff changeset
   130
applicationList
7840
3b752b047d94 comment
Claus Gittinger <cg@exept.de>
parents: 7787
diff changeset
   131
    " returns a list of all applications to start by the NoteBookApplication with 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   132
                #className                         #type                    
321c1729db5b initial checkin
penk
parents:
diff changeset
   133
321c1729db5b initial checkin
penk
parents:
diff changeset
   134
            example:
321c1729db5b initial checkin
penk
parents:
diff changeset
   135
            #(  #'FooEditor'                       nil                      )
7840
3b752b047d94 comment
Claus Gittinger <cg@exept.de>
parents: 7787
diff changeset
   136
    "
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   137
321c1729db5b initial checkin
penk
parents:
diff changeset
   138
    ^ #(
7909
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
   139
            #(  #'TextEditor'                        #file                    )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
   140
            #(  #'TextEditor'                        #directoryDescription    )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
   141
            #(  #'HtmlViewApplication'               nil                      )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
   142
            #(  #'FindFileApplication'               nil                      )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
   143
            #(  #'Terminal'                          nil                      )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
   144
            #(  #'ImageViewApplication'              nil                      )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
   145
            #(  #'ArchiveViewApplication'            nil                      )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
   146
            #(  #'CommandResult'                     nil                      )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
   147
            #(  #'XViewApplication'                  nil                      )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
   148
            #(  #'DigitalNotepadFileViewApplication' nil                      )
9788
675dca9b2692 changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9786
diff changeset
   149
"/            #(  #'XMLViewApplication'                nil                      )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   150
       )
7840
3b752b047d94 comment
Claus Gittinger <cg@exept.de>
parents: 7787
diff changeset
   151
9788
675dca9b2692 changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9786
diff changeset
   152
    "Modified: / 21-02-2011 / 17:21:54 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   153
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   154
321c1729db5b initial checkin
penk
parents:
diff changeset
   155
classFor:aApplicationListItem
321c1729db5b initial checkin
penk
parents:
diff changeset
   156
    |rawName cls|
321c1729db5b initial checkin
penk
parents:
diff changeset
   157
321c1729db5b initial checkin
penk
parents:
diff changeset
   158
    rawName := aApplicationListItem at:1.
321c1729db5b initial checkin
penk
parents:
diff changeset
   159
    (cls := self privateClassesAt:rawName) isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   160
        cls := Smalltalk at:rawName.
321c1729db5b initial checkin
penk
parents:
diff changeset
   161
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   162
    ^ cls
321c1729db5b initial checkin
penk
parents:
diff changeset
   163
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   164
321c1729db5b initial checkin
penk
parents:
diff changeset
   165
defaultApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
   166
" returns the application to be started if no itemQuery returns true or no supportedSuffix is supported
321c1729db5b initial checkin
penk
parents:
diff changeset
   167
"
321c1729db5b initial checkin
penk
parents:
diff changeset
   168
321c1729db5b initial checkin
penk
parents:
diff changeset
   169
    ^ self applicationList detect:[: applItem|
321c1729db5b initial checkin
penk
parents:
diff changeset
   170
        (((self classFor:applItem) == self textEditorClass)
321c1729db5b initial checkin
penk
parents:
diff changeset
   171
        and:[(self typeFor:applItem) == #file])
321c1729db5b initial checkin
penk
parents:
diff changeset
   172
    ] ifNone:[nil].
321c1729db5b initial checkin
penk
parents:
diff changeset
   173
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   174
321c1729db5b initial checkin
penk
parents:
diff changeset
   175
typeFor:aApplicationListItem
321c1729db5b initial checkin
penk
parents:
diff changeset
   176
321c1729db5b initial checkin
penk
parents:
diff changeset
   177
    ^ aApplicationListItem at:2
321c1729db5b initial checkin
penk
parents:
diff changeset
   178
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   179
321c1729db5b initial checkin
penk
parents:
diff changeset
   180
!FileApplicationNoteBook class methodsFor:'classAccess'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   181
321c1729db5b initial checkin
penk
parents:
diff changeset
   182
textEditorClass
321c1729db5b initial checkin
penk
parents:
diff changeset
   183
321c1729db5b initial checkin
penk
parents:
diff changeset
   184
    ^ TextEditor
321c1729db5b initial checkin
penk
parents:
diff changeset
   185
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   186
321c1729db5b initial checkin
penk
parents:
diff changeset
   187
!FileApplicationNoteBook class methodsFor:'defaults'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   188
321c1729db5b initial checkin
penk
parents:
diff changeset
   189
openAnotherApplicationOnSameItem
321c1729db5b initial checkin
penk
parents:
diff changeset
   190
321c1729db5b initial checkin
penk
parents:
diff changeset
   191
    ^ false
321c1729db5b initial checkin
penk
parents:
diff changeset
   192
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   193
321c1729db5b initial checkin
penk
parents:
diff changeset
   194
!FileApplicationNoteBook class methodsFor:'interface specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   195
321c1729db5b initial checkin
penk
parents:
diff changeset
   196
windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
   197
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
   198
     by the UIPainter of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
   199
321c1729db5b initial checkin
penk
parents:
diff changeset
   200
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
   201
     the UIPainter may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
   202
321c1729db5b initial checkin
penk
parents:
diff changeset
   203
    "
6484
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   204
     UIPainter new openOnClass:FileApplicationNoteBook andSelector:#windowSpec
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   205
     FileApplicationNoteBook new openInterface:#windowSpec
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   206
     FileApplicationNoteBook open
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   207
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   208
321c1729db5b initial checkin
penk
parents:
diff changeset
   209
    <resource: #canvas>
321c1729db5b initial checkin
penk
parents:
diff changeset
   210
321c1729db5b initial checkin
penk
parents:
diff changeset
   211
    ^ 
6484
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   212
     #(FullSpec
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   213
        name: windowSpec
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   214
        window: 
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   215
       (WindowSpec
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   216
          label: 'FileBrowserV2TextEditor'
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   217
          name: 'FileBrowserV2TextEditor'
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   218
          min: (Point 10 10)
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   219
          bounds: (Rectangle 0 0 300 300)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   220
        )
6484
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   221
        component: 
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   222
       (SpecCollection
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   223
          collection: (
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   224
           (NoteBookViewSpec
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   225
              name: 'CommandAndTextEditor'
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   226
              layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   227
              model: selectedEditorPage
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   228
              menu: tabList
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   229
              useIndex: true
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   230
              accessTabMenuAction: tabMenuAt:
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   231
              destroyTabAction: destroyTabAt:
6484
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   232
              canvas: canvasHolder
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   233
              keepCanvasAlive: true
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   234
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
   235
           )
321c1729db5b initial checkin
penk
parents:
diff changeset
   236
         
321c1729db5b initial checkin
penk
parents:
diff changeset
   237
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
   238
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
   239
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   240
321c1729db5b initial checkin
penk
parents:
diff changeset
   241
!FileApplicationNoteBook class methodsFor:'menu specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   242
321c1729db5b initial checkin
penk
parents:
diff changeset
   243
tabMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
   244
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
   245
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
   246
321c1729db5b initial checkin
penk
parents:
diff changeset
   247
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
   248
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
   249
321c1729db5b initial checkin
penk
parents:
diff changeset
   250
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   251
     MenuEditor new openOnClass:FileApplicationNoteBook andSelector:#tabMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
   252
     (Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook tabMenu)) startUp
321c1729db5b initial checkin
penk
parents:
diff changeset
   253
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
   254
321c1729db5b initial checkin
penk
parents:
diff changeset
   255
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
   256
321c1729db5b initial checkin
penk
parents:
diff changeset
   257
    ^ 
6214
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   258
     #(Menu
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   259
        (
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   260
         (MenuItem
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   261
            label: 'Add Text Editor'
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   262
            itemValue: newTextEditor
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   263
            translateLabel: true
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   264
          )
6214
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   265
         (MenuItem
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   266
            label: '-'
5307
45d1ce468a5f closeAll tabs
Claus Gittinger <cg@exept.de>
parents: 5305
diff changeset
   267
          )
6214
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   268
         (MenuItem
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   269
            label: 'Select in Filelist'
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   270
            itemValue: doSelectInList
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   271
            translateLabel: true
4045
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   272
          )
6214
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   273
         (MenuItem
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   274
            label: '-'
5186
040b261bb5d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5160
diff changeset
   275
          )
6214
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   276
         (MenuItem
7765
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
   277
            label: 'Rename Tab...'
6214
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   278
            itemValue: doRenameTab
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   279
            translateLabel: true
4572
ed5f7a7f1a8d + rename tab
Claus Gittinger <cg@exept.de>
parents: 4553
diff changeset
   280
          )
6214
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   281
         (MenuItem
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   282
            label: '-'
4572
ed5f7a7f1a8d + rename tab
Claus Gittinger <cg@exept.de>
parents: 4553
diff changeset
   283
          )
6214
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   284
         (MenuItem
7765
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
   285
            label: 'Close Tab'
6214
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   286
            itemValue: doCloseApplication
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   287
            translateLabel: true
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   288
          )
6214
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   289
         (MenuItem
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   290
            enabled: closeAllApplicationsEnabled
7765
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
   291
            label: 'Close all Tabs'
6214
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   292
            itemValue: doCloseAllApplications
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   293
            translateLabel: true
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   294
          )
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   295
         (MenuItem
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   296
            enabled: closeAllApplicationsEnabled
7765
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
   297
            label: 'Close all but this Tab'
6214
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   298
            itemValue: doCloseAllOtherApplications
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   299
            translateLabel: true
5307
45d1ce468a5f closeAll tabs
Claus Gittinger <cg@exept.de>
parents: 5305
diff changeset
   300
          )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   301
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
   302
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   303
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   304
      )
7765
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
   305
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
   306
    "Modified: / 27-03-2007 / 11:13:52 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   307
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   308
321c1729db5b initial checkin
penk
parents:
diff changeset
   309
!FileApplicationNoteBook methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   310
321c1729db5b initial checkin
penk
parents:
diff changeset
   311
listOfApplications
321c1729db5b initial checkin
penk
parents:
diff changeset
   312
    "return the value of the instance variable 'listOfApplications' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
   313
321c1729db5b initial checkin
penk
parents:
diff changeset
   314
    listOfApplications isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   315
        listOfApplications := OrderedCollection new.
321c1729db5b initial checkin
penk
parents:
diff changeset
   316
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   317
    ^ listOfApplications
321c1729db5b initial checkin
penk
parents:
diff changeset
   318
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   319
321c1729db5b initial checkin
penk
parents:
diff changeset
   320
selectionHistoryList
321c1729db5b initial checkin
penk
parents:
diff changeset
   321
321c1729db5b initial checkin
penk
parents:
diff changeset
   322
    selectionHistoryList isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   323
        selectionHistoryList := OrderedCollection new.
321c1729db5b initial checkin
penk
parents:
diff changeset
   324
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   325
    ^ selectionHistoryList
321c1729db5b initial checkin
penk
parents:
diff changeset
   326
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   327
321c1729db5b initial checkin
penk
parents:
diff changeset
   328
selectionHistoryList:aCol
321c1729db5b initial checkin
penk
parents:
diff changeset
   329
321c1729db5b initial checkin
penk
parents:
diff changeset
   330
    selectionHistoryList := aCol 
321c1729db5b initial checkin
penk
parents:
diff changeset
   331
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   332
4360
959719f86629 category change
Claus Gittinger <cg@exept.de>
parents: 4353
diff changeset
   333
!FileApplicationNoteBook methodsFor:'accessing-applications'!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   334
321c1729db5b initial checkin
penk
parents:
diff changeset
   335
getAllApplicationsByClass:aClass andType:aType
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   336
    ^ self listOfApplications 
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   337
        select:[ : appl  | 
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   338
            ((appl class = aClass)
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   339
            "and:[appl type = aType]")
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   340
        ].
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   341
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   342
    "Modified (format): / 29-11-2011 / 19:08:20 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   343
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   344
321c1729db5b initial checkin
penk
parents:
diff changeset
   345
getApplicationByType:aType
321c1729db5b initial checkin
penk
parents:
diff changeset
   346
321c1729db5b initial checkin
penk
parents:
diff changeset
   347
    ^ self listOfApplications detect:[ : appl  | 
321c1729db5b initial checkin
penk
parents:
diff changeset
   348
        (appl type == aType)
321c1729db5b initial checkin
penk
parents:
diff changeset
   349
    ] ifNone:[nil].
321c1729db5b initial checkin
penk
parents:
diff changeset
   350
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   351
321c1729db5b initial checkin
penk
parents:
diff changeset
   352
getIndexFor:aApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
   353
321c1729db5b initial checkin
penk
parents:
diff changeset
   354
    | index |
321c1729db5b initial checkin
penk
parents:
diff changeset
   355
321c1729db5b initial checkin
penk
parents:
diff changeset
   356
    index := self listOfApplications indexOf:aApplication.
321c1729db5b initial checkin
penk
parents:
diff changeset
   357
    index ~~ 0 ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   358
        ^ index.
321c1729db5b initial checkin
penk
parents:
diff changeset
   359
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   360
    ^ nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
   361
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   362
8513
f2e2e360cff4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8471
diff changeset
   363
getSameApplicationsFor:anApplication
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   364
8514
72d96e73deaa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8513
diff changeset
   365
    ^ self listOfApplications 
72d96e73deaa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8513
diff changeset
   366
        select:[:appl |
72d96e73deaa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8513
diff changeset
   367
            ( (appl ~= anApplication)    
72d96e73deaa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8513
diff changeset
   368
            and:[ (appl isKindOf:(anApplication class)) 
72d96e73deaa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8513
diff changeset
   369
            and:[ (appl item = (anApplication item)) 
72d96e73deaa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8513
diff changeset
   370
            and:[ (appl type == anApplication type) ]]])
72d96e73deaa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8513
diff changeset
   371
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   372
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   373
321c1729db5b initial checkin
penk
parents:
diff changeset
   374
!FileApplicationNoteBook methodsFor:'actions-app-common'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   375
9819
2edda6ff0600 changed:
Stefan Vogel <sv@exept.de>
parents: 9788
diff changeset
   376
changeItem:anItem for:anAppl
4988
34de57749932 correctly handle symlinks
Claus Gittinger <cg@exept.de>
parents: 4981
diff changeset
   377
    | applIndex string isDirectory |
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   378
9819
2edda6ff0600 changed:
Stefan Vogel <sv@exept.de>
parents: 9788
diff changeset
   379
    applIndex := self getIndexFor:anAppl.
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   380
    anItem notNil ifTrue:[
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   381
        isDirectory := anItem isDirectory or:[anItem linkTargetIsDirectory ].
4989
Claus Gittinger <cg@exept.de>
parents: 4988
diff changeset
   382
6250
5b0673ccff1c refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents: 6214
diff changeset
   383
        isDirectory ifFalse:[
9819
2edda6ff0600 changed:
Stefan Vogel <sv@exept.de>
parents: 9788
diff changeset
   384
            (anAppl changeItem:anItem) ifFalse:[ ^ self].
2edda6ff0600 changed:
Stefan Vogel <sv@exept.de>
parents: 9788
diff changeset
   385
            self fileHistory addFirst:anItem.
4989
Claus Gittinger <cg@exept.de>
parents: 4988
diff changeset
   386
            self enableFileHistory value:true.
Claus Gittinger <cg@exept.de>
parents: 4988
diff changeset
   387
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   388
    ].
9819
2edda6ff0600 changed:
Stefan Vogel <sv@exept.de>
parents: 9788
diff changeset
   389
    string := anAppl getTabString.
4045
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   390
    self privateTabList at:applIndex put:(Text fromString:string).
9882
5956cfea28a8 changed: #selectFiles:
Michael Beyl <mb@exept.de>
parents: 9819
diff changeset
   391
    "/ self doSelect:anAppl.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   392
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   393
4161
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   394
changeModified:aSymbol for:aAppl
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   395
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   396
    | index text stream|
4045
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   397
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   398
    index := self getIndexFor:aAppl.
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   399
    index isNil ifTrue:[ ^ self].
4161
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   400
    stream := WriteStream with:aAppl getTabString.
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   401
    aSymbol ~~ #unchanged ifTrue:[
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   402
        stream space.
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   403
        stream nextPut:$[.
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   404
        stream nextPutAll:aSymbol asString.
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   405
        stream nextPut:$].
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   406
        text := stream contents asText.
4499
395d7282b2f0 emphasis stuff
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
   407
        text emphasizeAllWith:UserPreferences current emphasisForModifiedBuffer.
4161
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   408
    ] ifFalse:[
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   409
        text := stream contents asText.
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   410
    ].
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   411
    self privateTabList at:index put:text.
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   412
    self selectedEditorPage value == index ifTrue:[
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
   413
        self changeFileBrowserTitleTo:text.
4045
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   414
    ].
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   415
!
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   416
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   417
closeSubCanvas:aApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
   418
3929
e373fe6a0b4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   419
    | applIndex historyList localHistoryList selectedPage|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   420
321c1729db5b initial checkin
penk
parents:
diff changeset
   421
    applIndex := self getIndexFor:aApplication.
321c1729db5b initial checkin
penk
parents:
diff changeset
   422
    applIndex notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   423
"/        "/ UPDATE THE LAST SELECTION BECAUSE SEL INDEX IS DECREMENTED FOR HIGHER INDEXES
321c1729db5b initial checkin
penk
parents:
diff changeset
   424
"/        self lastSelection:applIndex.
321c1729db5b initial checkin
penk
parents:
diff changeset
   425
321c1729db5b initial checkin
penk
parents:
diff changeset
   426
        historyList := self selectionHistoryList.
321c1729db5b initial checkin
penk
parents:
diff changeset
   427
        historyList remove:applIndex ifAbsent:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
   428
        localHistoryList := OrderedCollection new.
321c1729db5b initial checkin
penk
parents:
diff changeset
   429
        historyList notEmpty ifTrue:[
3929
e373fe6a0b4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   430
            selectedPage := historyList last.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   431
        ] ifFalse:[
3929
e373fe6a0b4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   432
            selectedPage := 1.
e373fe6a0b4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   433
        ].  
e373fe6a0b4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   434
        self selectedEditorPage value:selectedPage.
e373fe6a0b4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3919
diff changeset
   435
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   436
        historyList do:[ : index |
321c1729db5b initial checkin
penk
parents:
diff changeset
   437
            index <= applIndex ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   438
                localHistoryList add:index
321c1729db5b initial checkin
penk
parents:
diff changeset
   439
            ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   440
                localHistoryList add:(index - 1)
321c1729db5b initial checkin
penk
parents:
diff changeset
   441
            ]
321c1729db5b initial checkin
penk
parents:
diff changeset
   442
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   443
        self selectionHistoryList:localHistoryList.
321c1729db5b initial checkin
penk
parents:
diff changeset
   444
        self listOfApplications removeIndex:applIndex.
321c1729db5b initial checkin
penk
parents:
diff changeset
   445
        self privateTabList removeIndex:applIndex.
321c1729db5b initial checkin
penk
parents:
diff changeset
   446
        self privateTabList isEmpty ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   447
            self viewNoteBookApplicationHolder value:false.
321c1729db5b initial checkin
penk
parents:
diff changeset
   448
            self enableViewNoteBookApplication value:false.
4375
05dd38dadc66 archivapplication errors removed
penk
parents: 4360
diff changeset
   449
            self changeFileBrowserTitleTo:'FileBrowser V2'.
05dd38dadc66 archivapplication errors removed
penk
parents: 4360
diff changeset
   450
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   451
        ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   452
            historyList notEmpty ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   453
                self selectedEditorPage value:(self selectionHistoryList last).
321c1729db5b initial checkin
penk
parents:
diff changeset
   454
            ]
321c1729db5b initial checkin
penk
parents:
diff changeset
   455
        ]
321c1729db5b initial checkin
penk
parents:
diff changeset
   456
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   457
321c1729db5b initial checkin
penk
parents:
diff changeset
   458
    "/ because subCanvas was configured to keep its view,
321c1729db5b initial checkin
penk
parents:
diff changeset
   459
    "/ we must destroy it here.
3987
f012466a71cd *** empty log message ***
ca
parents: 3982
diff changeset
   460
    aApplication window destroy.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   461
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   462
6484
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   463
destroyTab:tabIndex
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   464
    (self listOfApplications at:tabIndex) doClose
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   465
!
9d12c4191a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
   466
5307
45d1ce468a5f closeAll tabs
Claus Gittinger <cg@exept.de>
parents: 5305
diff changeset
   467
doCloseAllApplications
45d1ce468a5f closeAll tabs
Claus Gittinger <cg@exept.de>
parents: 5305
diff changeset
   468
    | appl |
45d1ce468a5f closeAll tabs
Claus Gittinger <cg@exept.de>
parents: 5305
diff changeset
   469
45d1ce468a5f closeAll tabs
Claus Gittinger <cg@exept.de>
parents: 5305
diff changeset
   470
    (Dialog confirm:(resources string:'Really close all Tabs ?')) ifFalse:[^ self].
45d1ce468a5f closeAll tabs
Claus Gittinger <cg@exept.de>
parents: 5305
diff changeset
   471
45d1ce468a5f closeAll tabs
Claus Gittinger <cg@exept.de>
parents: 5305
diff changeset
   472
    appl := self listOfApplications copy do:[:eachApp | eachApp doClose.].
45d1ce468a5f closeAll tabs
Claus Gittinger <cg@exept.de>
parents: 5305
diff changeset
   473
!
45d1ce468a5f closeAll tabs
Claus Gittinger <cg@exept.de>
parents: 5305
diff changeset
   474
6214
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   475
doCloseAllOtherApplications
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   476
    | appl currentApp |
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   477
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   478
"/    (Dialog confirm:(resources string:'Really close all Tabs ?')) ifFalse:[^ self].
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   479
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   480
    currentApp := self currentTabMenusApplication.
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   481
    appl := self listOfApplications copy do:
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   482
        [:eachApp | 
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   483
            eachApp ~~ currentApp ifTrue:[
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   484
                eachApp doClose.
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   485
            ].
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   486
        ]
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   487
!
bba5ec45b937 +close all other tabs
Claus Gittinger <cg@exept.de>
parents: 6190
diff changeset
   488
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   489
doCloseApplication
5324
5df8cf9faeba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5323
diff changeset
   490
    self currentTabMenusApplication doClose.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   491
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   492
4572
ed5f7a7f1a8d + rename tab
Claus Gittinger <cg@exept.de>
parents: 4553
diff changeset
   493
doRenameTab
ed5f7a7f1a8d + rename tab
Claus Gittinger <cg@exept.de>
parents: 4553
diff changeset
   494
    | newLabel |
ed5f7a7f1a8d + rename tab
Claus Gittinger <cg@exept.de>
parents: 4553
diff changeset
   495
5335
c676d4fdd3f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5324
diff changeset
   496
    newLabel := Dialog 
c676d4fdd3f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5324
diff changeset
   497
                    request:'New Tab Label:' 
c676d4fdd3f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5324
diff changeset
   498
                    initialAnswer:(self privateTabList at:tabMenuIndex).
4572
ed5f7a7f1a8d + rename tab
Claus Gittinger <cg@exept.de>
parents: 4553
diff changeset
   499
    newLabel size == 0 ifTrue:[^ self ].
ed5f7a7f1a8d + rename tab
Claus Gittinger <cg@exept.de>
parents: 4553
diff changeset
   500
    self privateTabList at:tabMenuIndex put:newLabel
ed5f7a7f1a8d + rename tab
Claus Gittinger <cg@exept.de>
parents: 4553
diff changeset
   501
!
ed5f7a7f1a8d + rename tab
Claus Gittinger <cg@exept.de>
parents: 4553
diff changeset
   502
4045
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   503
doSelectInList
5323
407f0beaa69a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5317
diff changeset
   504
    | fileName|
407f0beaa69a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5317
diff changeset
   505
5324
5df8cf9faeba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5323
diff changeset
   506
    fileName := self currentTabMenusApplication fileName.
4045
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   507
    fileName notNil ifTrue:[
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   508
        self gotoFile:fileName.
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   509
    ].
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   510
!
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   511
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   512
openApplByFileItem:anItem
10706
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   513
    " use the default class list for open of applications by item "
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   514
5290
8aeb40fef0f7 wait cursor
Claus Gittinger <cg@exept.de>
parents: 5287
diff changeset
   515
    | applList applItem itemClass itemType appl|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   516
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   517
    anItem isNil ifTrue:[ ^ self ].
5279
165a7b841a86 open directories found
penk
parents: 5265
diff changeset
   518
    anItem isDirectory ifTrue:[
165a7b841a86 open directories found
penk
parents: 5265
diff changeset
   519
        self warn:'No Application to open for directory:', anItem fileName asString, ' found'.
165a7b841a86 open directories found
penk
parents: 5265
diff changeset
   520
        ^ nil.
165a7b841a86 open directories found
penk
parents: 5265
diff changeset
   521
    ].
10706
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   522
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   523
    self openAlwaysInTextEditor value ifFalse:[
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   524
        applList := self applicationList.
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   525
        applItem := applList 
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   526
                        detect:[: aApplItem|
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   527
                            itemClass := self class classFor:aApplItem.
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   528
                            (itemClass canOpenItem:anItem).
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   529
                        ] ifNone:[nil].
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
        applItem notNil ifTrue:[ 
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   532
            itemType := self class typeFor:applItem.
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   533
            itemClass := self class classFor:applItem.
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   534
            Error handle:[:ex |
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   535
                "/ catching the error, so we can still show text
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   536
            ] do:[
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   537
                appl := self openApplicationClass:itemClass withItem:anItem withType:itemType.
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   538
                appl notNil ifTrue:[ ^ appl].
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   539
            ].
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   540
        ].
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   541
    ].
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   542
9786
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
   543
    ^ self openDefaultApplicationByItem:anItem.
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
   544
10706
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
   545
    "Modified: / 16-09-2011 / 16:17:58 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   546
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   547
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   548
openApplicationClass:aClass withItem:anItem withType:aType
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   549
11104
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   550
    ^ self 
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   551
        openApplicationClass:aClass 
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   552
        withItem:anItem 
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   553
        withType:aType 
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   554
        checkExisting:true
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   555
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   556
    "Modified (format): / 12-01-2012 / 01:10:50 / cg"
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   557
!
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   558
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   559
openApplicationClass:aClass withItem:anItem withType:aType checkExisting:checkExisting 
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   560
    ^ self 
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   561
        openApplicationClass:aClass
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   562
        withItem:anItem
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   563
        withType:aType
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   564
        checkExisting:checkExisting
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   565
        preSetItem:nil
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   566
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   567
    "Modified (format): / 29-11-2011 / 19:06:27 / cg"
4620
59601a37cc0b hexDump from tools menu implemented
penk
parents: 4616
diff changeset
   568
!
59601a37cc0b hexDump from tools menu implemented
penk
parents: 4616
diff changeset
   569
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   570
openApplicationClass:aClass withItem:anItem withType:aType checkExisting:checkExisting preSetItem:aBlock
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   571
    |existingAppl newAppl|
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   572
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   573
    "do not open unreadable items"
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   574
    checkExisting ifTrue:[
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   575
        (anItem notNil and:[anItem isDirectory not and:[anItem fileName isReadable not]]) ifTrue:[
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   576
            Dialog warn:'Can not open unreadable file ', anItem fileName baseName.
9819
2edda6ff0600 changed:
Stefan Vogel <sv@exept.de>
parents: 9788
diff changeset
   577
            AbortOperationRequest raise.
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   578
        ].
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   579
        existingAppl := self tryToGetExistingApplFor:aClass withItem:anItem withType:aType preSetItem:aBlock.
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   580
        existingAppl notNil ifTrue:[
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   581
            self doSelect:existingAppl.
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   582
            ^ existingAppl
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   583
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   584
    ].
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   585
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   586
    newAppl := aClass new.
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   587
    newAppl masterApplication:self.
4620
59601a37cc0b hexDump from tools menu implemented
penk
parents: 4616
diff changeset
   588
    aBlock notNil ifTrue:[
59601a37cc0b hexDump from tools menu implemented
penk
parents: 4616
diff changeset
   589
        aBlock value:newAppl.    
59601a37cc0b hexDump from tools menu implemented
penk
parents: 4616
diff changeset
   590
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   591
    newAppl type:aType.
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   592
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   593
    newAppl isTextEditor ifTrue:[
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   594
        newAppl fileEncoding:(self fileEncodingHolder value).    
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   595
        newAppl lockFileEncoding:(self lockFileEncodingHolder value).    
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   596
    ].
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   597
    (newAppl item:anItem) ifFalse:[ ^ nil ].
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   598
    (anItem notNil and:[(anItem isDirectory not) and:[aType ~= #directoryDescription]]) ifTrue:[
9819
2edda6ff0600 changed:
Stefan Vogel <sv@exept.de>
parents: 9788
diff changeset
   599
        self fileHistory addFirst:anItem.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   600
        self enableFileHistory value:true.
321c1729db5b initial checkin
penk
parents:
diff changeset
   601
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   602
    self setSameFileIndexFor:newAppl.
321c1729db5b initial checkin
penk
parents:
diff changeset
   603
    self startApplication:newAppl.
321c1729db5b initial checkin
penk
parents:
diff changeset
   604
    ^ newAppl
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   605
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   606
    "Modified (format): / 29-11-2011 / 19:06:47 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   607
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   608
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   609
openDefaultApplicationByItem:anItem
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   610
" open the default application if no application for item is available or the start of the
321c1729db5b initial checkin
penk
parents:
diff changeset
   611
  available application failed
321c1729db5b initial checkin
penk
parents:
diff changeset
   612
"
321c1729db5b initial checkin
penk
parents:
diff changeset
   613
    | applItem |
321c1729db5b initial checkin
penk
parents:
diff changeset
   614
321c1729db5b initial checkin
penk
parents:
diff changeset
   615
    applItem := self class defaultApplication.
321c1729db5b initial checkin
penk
parents:
diff changeset
   616
    applItem notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   617
        |  itemType itemClass|
321c1729db5b initial checkin
penk
parents:
diff changeset
   618
        itemType := self class typeFor:applItem.
321c1729db5b initial checkin
penk
parents:
diff changeset
   619
        itemClass := self class classFor:applItem.
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   620
        ^ self openApplicationClass:itemClass withItem:anItem withType:itemType.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   621
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   622
    ^ nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   623
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   624
321c1729db5b initial checkin
penk
parents:
diff changeset
   625
setSameFileIndexFor:anAppl
321c1729db5b initial checkin
penk
parents:
diff changeset
   626
    |sameFiles index item|
321c1729db5b initial checkin
penk
parents:
diff changeset
   627
6250
5b0673ccff1c refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents: 6214
diff changeset
   628
    self class openAnotherApplicationOnSameItem ifFalse:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   629
        anAppl sameFileIndex:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
   630
        ^ self.
321c1729db5b initial checkin
penk
parents:
diff changeset
   631
    ].
10382
edf3a0e5ea8a changed: #setSameFileIndexFor:
Claus Gittinger <cg@exept.de>
parents: 9951
diff changeset
   632
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   633
    item := anAppl item.
321c1729db5b initial checkin
penk
parents:
diff changeset
   634
    item notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   635
        sameFiles := self getSameApplicationsFor:anAppl.
10382
edf3a0e5ea8a changed: #setSameFileIndexFor:
Claus Gittinger <cg@exept.de>
parents: 9951
diff changeset
   636
        (sameFiles notEmpty) ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   637
            (sameFiles size == 1 and:[sameFiles first sameFileIndex isNil]) ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   638
                anAppl sameFileIndex:1.
321c1729db5b initial checkin
penk
parents:
diff changeset
   639
            ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   640
                index :=  (sameFiles collect:[:el | (el sameFileIndex ? 1)]) max.
321c1729db5b initial checkin
penk
parents:
diff changeset
   641
                anAppl sameFileIndex:index + 1.
10382
edf3a0e5ea8a changed: #setSameFileIndexFor:
Claus Gittinger <cg@exept.de>
parents: 9951
diff changeset
   642
            ].
edf3a0e5ea8a changed: #setSameFileIndexFor:
Claus Gittinger <cg@exept.de>
parents: 9951
diff changeset
   643
            ^ self
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   644
        ]. 
321c1729db5b initial checkin
penk
parents:
diff changeset
   645
        anAppl sameFileIndex:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
   646
    ].
10382
edf3a0e5ea8a changed: #setSameFileIndexFor:
Claus Gittinger <cg@exept.de>
parents: 9951
diff changeset
   647
edf3a0e5ea8a changed: #setSameFileIndexFor:
Claus Gittinger <cg@exept.de>
parents: 9951
diff changeset
   648
    "Modified (format): / 24-07-2011 / 08:22:03 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   649
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   650
5007
82d60e287837 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5001
diff changeset
   651
startApplication:anApplication
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   652
    | window|
321c1729db5b initial checkin
penk
parents:
diff changeset
   653
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   654
"/    anApplication masterApplication:self.
7582
ee57ad4bee5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7540
diff changeset
   655
    anApplication window isNil ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   656
        window := ApplicationSubView new.
5007
82d60e287837 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5001
diff changeset
   657
        anApplication createBuilder.
82d60e287837 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5001
diff changeset
   658
        window client:anApplication.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   659
    ].
5007
82d60e287837 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5001
diff changeset
   660
    self listOfApplications add:anApplication.
82d60e287837 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5001
diff changeset
   661
    self privateTabList add:(Text fromString:(anApplication getTabString)).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   662
    self viewNoteBookApplicationHolder value:true.
321c1729db5b initial checkin
penk
parents:
diff changeset
   663
    self enableViewNoteBookApplication value:true.
9885
62bac7ad7d0c changed: #startApplication:
ab
parents: 9882
diff changeset
   664
    self withWaitCursorDo:[
62bac7ad7d0c changed: #startApplication:
ab
parents: 9882
diff changeset
   665
        self doSelect:anApplication.
62bac7ad7d0c changed: #startApplication:
ab
parents: 9882
diff changeset
   666
    ].
3987
f012466a71cd *** empty log message ***
ca
parents: 3982
diff changeset
   667
"/    [
5007
82d60e287837 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5001
diff changeset
   668
        anApplication postOpenWith:anApplication builder.
3987
f012466a71cd *** empty log message ***
ca
parents: 3982
diff changeset
   669
"/    ] forkAt:Processor activePriority.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   670
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   671
321c1729db5b initial checkin
penk
parents:
diff changeset
   672
tabStringAdd:aString for:aAppl
321c1729db5b initial checkin
penk
parents:
diff changeset
   673
321c1729db5b initial checkin
penk
parents:
diff changeset
   674
    | index text stream|
321c1729db5b initial checkin
penk
parents:
diff changeset
   675
321c1729db5b initial checkin
penk
parents:
diff changeset
   676
    index := self getIndexFor:aAppl.
321c1729db5b initial checkin
penk
parents:
diff changeset
   677
    index isNil ifTrue:[ ^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
   678
    text := self privateTabList at:index.
321c1729db5b initial checkin
penk
parents:
diff changeset
   679
    stream := WriteStream on:''.
321c1729db5b initial checkin
penk
parents:
diff changeset
   680
    stream nextPutAll:text.
321c1729db5b initial checkin
penk
parents:
diff changeset
   681
    stream space.
321c1729db5b initial checkin
penk
parents:
diff changeset
   682
    stream nextPutAll:aString.
4045
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   683
    self privateTabList at:index put:(Text fromString:(stream contents)).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   684
    stream close.
321c1729db5b initial checkin
penk
parents:
diff changeset
   685
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   686
321c1729db5b initial checkin
penk
parents:
diff changeset
   687
tabStringChangeTo:aString for:aAppl
321c1729db5b initial checkin
penk
parents:
diff changeset
   688
321c1729db5b initial checkin
penk
parents:
diff changeset
   689
    | index|
321c1729db5b initial checkin
penk
parents:
diff changeset
   690
321c1729db5b initial checkin
penk
parents:
diff changeset
   691
    index := self getIndexFor:aAppl.
321c1729db5b initial checkin
penk
parents:
diff changeset
   692
    index isNil ifTrue:[ ^ self].
4045
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
   693
    self privateTabList at:index put:(Text fromString:aString).
4180
e3e587a5fe65 change the window label
penk
parents: 4177
diff changeset
   694
    self selectedEditorPage value == index ifTrue:[
e3e587a5fe65 change the window label
penk
parents: 4177
diff changeset
   695
        self changeFileBrowserTitleTo:aString.
e3e587a5fe65 change the window label
penk
parents: 4177
diff changeset
   696
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   697
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   698
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   699
tryToGetExistingApplFor:aClass withItem:anItem withType:aType preSetItem:aBlock
4549
79d1c5a31e61 *** empty log message ***
penk
parents: 4529
diff changeset
   700
    | sameAppls changeAppl selAppl|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   701
321c1729db5b initial checkin
penk
parents:
diff changeset
   702
    aClass wantNewApplicationAnyway ifTrue:[^ nil].
4549
79d1c5a31e61 *** empty log message ***
penk
parents: 4529
diff changeset
   703
    sameAppls := self getAllApplicationsByClass:aClass andType:aType.
79d1c5a31e61 *** empty log message ***
penk
parents: 4529
diff changeset
   704
    sameAppls isEmpty ifTrue:[^ nil].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   705
    ((aType == #directoryDescription) or:[aType == #commandResult]) ifTrue:[
4549
79d1c5a31e61 *** empty log message ***
penk
parents: 4529
diff changeset
   706
"/        sameAppls := sameAppl first.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   707
    ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   708
        (self openMultipleApplicationsForType value) ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   709
        "/ open more than one application for a class and a type
321c1729db5b initial checkin
penk
parents:
diff changeset
   710
            (self class openAnotherApplicationOnSameItem) ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   711
                "/ open a new application anyway, no matters if item already open
321c1729db5b initial checkin
penk
parents:
diff changeset
   712
                ^ nil
321c1729db5b initial checkin
penk
parents:
diff changeset
   713
            ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   714
                "/ if item already changed select the application
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   715
                selAppl := sameAppls detect:[:appl | (appl item = anItem) ] ifNone:[nil].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   716
            ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   717
        ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   718
            "/ keep in same application change the first application of the same class and type - if item not changed otherwise open new
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   719
            sameAppls := sameAppls select:[:appl | appl isModified not ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   720
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   721
    ].
4393
194816f3a6ea Care for nil
Stefan Vogel <sv@exept.de>
parents: 4392
diff changeset
   722
    sameAppls size ~~ 0 ifTrue:[
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   723
        " take first all applications which have nil items 
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   724
          second the selected 
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   725
          third the first
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   726
        "
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   727
        | nilItemAppls |
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   728
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   729
        nilItemAppls := sameAppls select:[:appl| appl item == nil ].
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   730
        nilItemAppls notEmpty ifTrue:[sameAppls := nilItemAppls].
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   731
        (sameAppls includes:self selectedApplication) ifTrue:[
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   732
            changeAppl := self selectedApplication.
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   733
        ] ifFalse:[
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   734
            changeAppl := sameAppls first.
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   735
        ].
4620
59601a37cc0b hexDump from tools menu implemented
penk
parents: 4616
diff changeset
   736
        aBlock notNil ifTrue:[
59601a37cc0b hexDump from tools menu implemented
penk
parents: 4616
diff changeset
   737
            aBlock value:changeAppl.
59601a37cc0b hexDump from tools menu implemented
penk
parents: 4616
diff changeset
   738
        ].
5459
d90defc58d51 window label and tab string changed
penk
parents: 5458
diff changeset
   739
        changeAppl type:aType.
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   740
        self changeItem:anItem for:changeAppl.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   741
        selAppl := changeAppl.
321c1729db5b initial checkin
penk
parents:
diff changeset
   742
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   743
    ^ selAppl.
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   744
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   745
    "Modified (format): / 29-11-2011 / 19:07:57 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   746
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   747
321c1729db5b initial checkin
penk
parents:
diff changeset
   748
!FileApplicationNoteBook methodsFor:'actions-app-spec'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   749
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   750
addTerminalIn:aDirectory
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   751
    |item|
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   752
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   753
    item := DirectoryContentsBrowser itemClass fileName:aDirectory.
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   754
    self openTerminalApplication:item.
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   755
!
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   756
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   757
changeDirectoryDescription
321c1729db5b initial checkin
penk
parents:
diff changeset
   758
321c1729db5b initial checkin
penk
parents:
diff changeset
   759
    | aInfoItem|
321c1729db5b initial checkin
penk
parents:
diff changeset
   760
321c1729db5b initial checkin
penk
parents:
diff changeset
   761
    aInfoItem := self getInfoItem.
321c1729db5b initial checkin
penk
parents:
diff changeset
   762
    aInfoItem isNil ifTrue:[ ^ self closeDirectoryDescription ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   763
    self openDirectoryDescription.
321c1729db5b initial checkin
penk
parents:
diff changeset
   764
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   765
5307
45d1ce468a5f closeAll tabs
Claus Gittinger <cg@exept.de>
parents: 5305
diff changeset
   766
closeAllApplicationsEnabled
45d1ce468a5f closeAll tabs
Claus Gittinger <cg@exept.de>
parents: 5305
diff changeset
   767
    ^ tabList value size > 1
45d1ce468a5f closeAll tabs
Claus Gittinger <cg@exept.de>
parents: 5305
diff changeset
   768
!
45d1ce468a5f closeAll tabs
Claus Gittinger <cg@exept.de>
parents: 5305
diff changeset
   769
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   770
closeDirectoryDescription
321c1729db5b initial checkin
penk
parents:
diff changeset
   771
321c1729db5b initial checkin
penk
parents:
diff changeset
   772
    | dirContApll |
321c1729db5b initial checkin
penk
parents:
diff changeset
   773
321c1729db5b initial checkin
penk
parents:
diff changeset
   774
    dirContApll := self getApplicationByType:#directoryDescription.
321c1729db5b initial checkin
penk
parents:
diff changeset
   775
    dirContApll notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   776
        dirContApll doClose.
321c1729db5b initial checkin
penk
parents:
diff changeset
   777
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   778
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   779
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   780
doAddArchiverOn:aFilename
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   781
    |item|
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   782
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   783
    item := DirectoryContentsBrowser itemClass fileName:aFilename.
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   784
    self openArchiveViewApplication:item.
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   785
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   786
    "Created: / 29-11-2011 / 19:05:49 / cg"
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   787
!
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   788
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   789
newTextEditor
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   790
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   791
    ^ self openApplicationClass:TextEditor withItem:nil withType:#file checkExisting:false 
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   792
!
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   793
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   794
openArchiveViewApplication:anItem
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   795
    | result |
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   796
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   797
    result := self openApplicationClass:ArchiveViewApplication withItem:anItem withType:nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   798
    result isNil ifTrue:[
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   799
        Dialog warn:'file type of ', anItem fileName baseName, ' not yet supported'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   800
        ^ self.
321c1729db5b initial checkin
penk
parents:
diff changeset
   801
    ].
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   802
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
   803
    "Modified (format): / 29-11-2011 / 18:57:21 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   804
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   805
321c1729db5b initial checkin
penk
parents:
diff changeset
   806
openCommandResultApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
   807
321c1729db5b initial checkin
penk
parents:
diff changeset
   808
321c1729db5b initial checkin
penk
parents:
diff changeset
   809
    ^ self openApplicationClass:CommandResult withItem:nil withType:#commandResult
321c1729db5b initial checkin
penk
parents:
diff changeset
   810
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   811
11104
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   812
openCompareDirectory:directory1 with:directory2
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   813
    |newAppl|
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   814
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   815
    newAppl := DirectoryDifferenceViewApplication new.
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   816
    newAppl masterApplication:self.
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   817
    newAppl directory1:directory1 directory2:directory2.
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   818
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   819
    self setSameFileIndexFor:newAppl.
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   820
    self startApplication:newAppl.
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   821
    ^ newAppl
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   822
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   823
    "Created: / 12-01-2012 / 01:10:05 / cg"
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   824
!
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   825
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   826
openDirectoryDescription
321c1729db5b initial checkin
penk
parents:
diff changeset
   827
321c1729db5b initial checkin
penk
parents:
diff changeset
   828
    | appl aInfoItem|
321c1729db5b initial checkin
penk
parents:
diff changeset
   829
321c1729db5b initial checkin
penk
parents:
diff changeset
   830
    aInfoItem := self getInfoItem.
321c1729db5b initial checkin
penk
parents:
diff changeset
   831
    aInfoItem notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   832
        appl := self openTextEditorOn:aInfoItem type:#directoryDescription.
321c1729db5b initial checkin
penk
parents:
diff changeset
   833
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   834
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   835
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   836
openNewTextEditorOn:anItem 
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   837
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   838
    ^ self openApplicationClass:TextEditor withItem:anItem withType:#file checkExisting:false.
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   839
!
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   840
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   841
openSearchFileOn:anItem
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   842
11104
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   843
    ^ self 
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   844
        openApplicationClass:FindFileApplication 
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   845
        withItem:anItem 
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   846
        withType:nil 
6f9259e46cb0 added: #openCompareDirectory:with:
Claus Gittinger <cg@exept.de>
parents: 11099
diff changeset
   847
        checkExisting:false
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
    "Modified (format): / 12-01-2012 / 01:02:30 / cg"
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   850
!
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   851
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   852
openTerminalApplication:anItem
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   853
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   854
    ^ self openApplicationClass:Terminal withItem:anItem withType:nil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   855
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   856
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   857
openTextEditor
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   858
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   859
    ^ self openTextEditorOn:nil 
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   860
!
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
   861
4146
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
   862
openTextEditorForFile:aFilename 
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
   863
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
   864
    ^ 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
   865
!
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
   866
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   867
openTextEditorOn:anItem 
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   868
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   869
    ^ self openTextEditorOn:anItem type:#file 
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   870
!
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   871
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   872
openTextEditorOn:anItem type:aDirDescrOrFile
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   873
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   874
    ^ self openApplicationClass:TextEditor withItem:anItem withType:aDirDescrOrFile
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   875
!
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   876
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   877
openTextEditorWithHexPresentationOn:anItem 
4620
59601a37cc0b hexDump from tools menu implemented
penk
parents: 4616
diff changeset
   878
59601a37cc0b hexDump from tools menu implemented
penk
parents: 4616
diff changeset
   879
    ^ self  openApplicationClass:TextEditor 
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
   880
            withItem:anItem 
4620
59601a37cc0b hexDump from tools menu implemented
penk
parents: 4616
diff changeset
   881
            withType:#file 
59601a37cc0b hexDump from tools menu implemented
penk
parents: 4616
diff changeset
   882
            checkExisting:true 
59601a37cc0b hexDump from tools menu implemented
penk
parents: 4616
diff changeset
   883
            preSetItem:[:aTextEditor | aTextEditor presentation:#hexDump].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   884
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   885
321c1729db5b initial checkin
penk
parents:
diff changeset
   886
!FileApplicationNoteBook methodsFor:'applicationlist access'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   887
321c1729db5b initial checkin
penk
parents:
diff changeset
   888
applicationList
321c1729db5b initial checkin
penk
parents:
diff changeset
   889
    ^ self class applicationList
321c1729db5b initial checkin
penk
parents:
diff changeset
   890
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   891
321c1729db5b initial checkin
penk
parents:
diff changeset
   892
!FileApplicationNoteBook methodsFor:'aspects'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   893
321c1729db5b initial checkin
penk
parents:
diff changeset
   894
canvasHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
   895
321c1729db5b initial checkin
penk
parents:
diff changeset
   896
    canvasHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   897
        canvasHolder := ValueHolder new.
5120
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   898
        canvasHolder addDependent:self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   899
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   900
    ^ canvasHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
   901
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   902
5120
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   903
cursorColLabelHolder
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   904
    ^ self 
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   905
        aspectFor:#cursorColLabelHolder 
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   906
        ifAbsent:[
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   907
            IndirectValue for:(' ' asValue)
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   908
        ]
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   909
!
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   910
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   911
cursorLineLabelHolder
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   912
    ^ self 
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   913
        aspectFor:#cursorLineLabelHolder 
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   914
        ifAbsent:[
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   915
            IndirectValue for:(' ' asValue)
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   916
        ]
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   917
!
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   918
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
   919
fileEncodingHolder
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
   920
    ^ self 
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
   921
        aspectFor:#fileEncodingHolder 
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
   922
        ifAbsent:[
5567
3e00d2d4db6d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5550
diff changeset
   923
            IndirectValue for:('iso8859-1' asValue)
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
   924
        ]
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
   925
!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
   926
11056
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   927
inputTabColumnConversionHolder
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   928
    ^ self 
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   929
        aspectFor:#inputTabColumnConversionHolder 
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   930
        ifAbsent:[
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   931
            IndirectValue for:(8 asValue)
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   932
        ]
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   933
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   934
    "Created: / 06-01-2012 / 15:26:32 / cg"
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   935
!
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   936
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   937
lineEndConventionHolder
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   938
    ^ self 
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   939
        aspectFor:#lineEndConventionHolder 
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   940
        ifAbsent:[
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   941
            IndirectValue for:('nl' asValue)
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   942
        ]
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   943
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   944
    "Created: / 06-01-2012 / 13:03:24 / cg"
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   945
!
Claus Gittinger <cg@exept.de>
parents: 11032
diff changeset
   946
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   947
lockFileEncodingHolder
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   948
    ^ self 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   949
        aspectFor:#lockFileEncodingHolder 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   950
        ifAbsent:[
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   951
            IndirectValue for:(false asValue)
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   952
        ]
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   953
!
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
   954
5120
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   955
modeLabelHolder
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   956
    ^ self 
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   957
        aspectFor:#modeLabelHolder 
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   958
        ifAbsent:[
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   959
            IndirectValue for:(' ' asValue)
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   960
        ]
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   961
!
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
   962
7103
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   963
modeLabelMenu       
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   964
    |app|
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   965
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   966
    (app := self selectedApplication) notNil ifTrue:[
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   967
        ^ app modeLabelMenu
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   968
    ].
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   969
    ^ nil
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   970
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   971
    "Created: / 11-09-2006 / 12:33:27 / cg"
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   972
!
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   973
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   974
modeLabelMenuHolder
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   975
    ^ self 
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   976
        aspectFor:#modeLabelMenuHolder 
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   977
        ifAbsent:[
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   978
            IndirectValue for:(nil asValue)
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   979
        ]
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   980
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   981
    "Created: / 11-09-2006 / 12:28:08 / cg"
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   982
!
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
   983
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   984
privateTabList
321c1729db5b initial checkin
penk
parents:
diff changeset
   985
321c1729db5b initial checkin
penk
parents:
diff changeset
   986
    privateTabList isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   987
        privateTabList := List new.
321c1729db5b initial checkin
penk
parents:
diff changeset
   988
        privateTabList addDependent:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
   989
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   990
    ^ privateTabList.
321c1729db5b initial checkin
penk
parents:
diff changeset
   991
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   992
321c1729db5b initial checkin
penk
parents:
diff changeset
   993
selectedEditorPage
321c1729db5b initial checkin
penk
parents:
diff changeset
   994
321c1729db5b initial checkin
penk
parents:
diff changeset
   995
    selectedEditorPage isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
   996
        selectedEditorPage := ValueHolder new.
321c1729db5b initial checkin
penk
parents:
diff changeset
   997
"/ if your app needs to be notified of changes, uncomment one of the lines below:
321c1729db5b initial checkin
penk
parents:
diff changeset
   998
       selectedEditorPage addDependent:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
   999
"/       selectedEditorPage onChangeSend:#selectedEditorPageChanged to:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1000
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1001
    ^ selectedEditorPage.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1002
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1003
321c1729db5b initial checkin
penk
parents:
diff changeset
  1004
tabList
321c1729db5b initial checkin
penk
parents:
diff changeset
  1005
321c1729db5b initial checkin
penk
parents:
diff changeset
  1006
    tabList isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1007
        tabList := (List new) asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1008
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1009
    ^ tabList.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1010
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1011
321c1729db5b initial checkin
penk
parents:
diff changeset
  1012
tabList:aValue
321c1729db5b initial checkin
penk
parents:
diff changeset
  1013
321c1729db5b initial checkin
penk
parents:
diff changeset
  1014
    tabList := aValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1015
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1016
321c1729db5b initial checkin
penk
parents:
diff changeset
  1017
!FileApplicationNoteBook methodsFor:'change & update'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1018
5120
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1019
canvasChanged
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1020
    "invoked when the contentsView has been changed"
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1021
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1022
    |app|
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1023
7103
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  1024
    app := self selectedApplication.
5120
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1025
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1026
    self cursorLineLabelHolder valueHolder: (app cursorLineLabelHolder).
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1027
    self cursorColLabelHolder valueHolder: (app cursorColLabelHolder).
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1028
    self modeLabelHolder valueHolder: (app modeLabelHolder).
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  1029
    self fileEncodingHolder valueHolder: (app fileEncodingHolder).
7288
25108c48af42 lockEncoding fix
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
  1030
25108c48af42 lockEncoding fix
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
  1031
    app lockFileEncodingHolder isBoolean ifTrue:[
8366
6e6842bd8b1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8228
diff changeset
  1032
        self breakPoint:#cg
7288
25108c48af42 lockEncoding fix
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
  1033
    ] ifFalse:[
25108c48af42 lockEncoding fix
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
  1034
        self lockFileEncodingHolder valueHolder: (app lockFileEncodingHolder).
25108c48af42 lockEncoding fix
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
  1035
    ].
7103
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  1036
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  1037
    "Modified: / 11-09-2006 / 12:44:07 / cg"
5120
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1038
!
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1039
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1040
update:something with:aParameter from:changedObject
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1041
    | appl sel|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1042
5120
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1043
    changedObject == canvasHolder ifTrue:[
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1044
        self canvasChanged.
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1045
        ^ self.
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  1046
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1047
    changedObject == self currentDirectories ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1048
        self viewDirectoryDescription value ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1049
            self changeDirectoryDescription.  
321c1729db5b initial checkin
penk
parents:
diff changeset
  1050
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1051
        ^ self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1052
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1053
    changedObject == self viewDirectoryDescription ifTrue:[
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1054
        self viewDirectoryDescriptionChanged.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1055
        ^ self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1056
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1057
    changedObject == self privateTabList ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1058
        | privateListOfTabs |
321c1729db5b initial checkin
penk
parents:
diff changeset
  1059
        privateListOfTabs := changedObject.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1060
        privateListOfTabs size > 1 ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1061
            self tabList value:privateListOfTabs.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1062
            self tabList changed.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1063
        ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1064
            self tabList value:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1065
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1066
        ^ self
321c1729db5b initial checkin
penk
parents:
diff changeset
  1067
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1068
    changedObject == self selectedEditorPage ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1069
        | listOfEdits indexOfLastSel list |
321c1729db5b initial checkin
penk
parents:
diff changeset
  1070
321c1729db5b initial checkin
penk
parents:
diff changeset
  1071
        sel := changedObject value.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1072
        "/ dont want the tabs with one application - thats why i have to change my tablist
321c1729db5b initial checkin
penk
parents:
diff changeset
  1073
        "/ sel goes to if - i want select the last selection
321c1729db5b initial checkin
penk
parents:
diff changeset
  1074
        sel = 0 ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1075
            ^ self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1076
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1077
        list := self selectionHistoryList.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1078
        (list includes:sel) ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1079
            list remove:sel
321c1729db5b initial checkin
penk
parents:
diff changeset
  1080
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1081
        list add:sel.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1082
        self selectionHistoryList:list.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1083
        appl := self listOfApplications at:sel.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1084
        self doSelect:appl.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1085
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1086
321c1729db5b initial checkin
penk
parents:
diff changeset
  1087
    ^ super update:something with:aParameter from:changedObject
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1088
!
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1089
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1090
viewDirectoryDescriptionChanged
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1091
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1092
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1093
    |viewDirDescr|
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1094
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1095
    viewDirDescr := self viewDirectoryDescription value.
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1096
    viewDirDescr ifTrue:[
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1097
        self openDirectoryDescription.
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1098
    ] ifFalse:[
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1099
        self closeDirectoryDescription.
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1100
    ].
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1101
    ^ self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1102
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1103
321c1729db5b initial checkin
penk
parents:
diff changeset
  1104
!FileApplicationNoteBook methodsFor:'menu & actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1105
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1106
destroyTabAt:idx
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1107
    |app|
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1108
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1109
    app := listOfApplications at:idx.
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1110
    self closeSubCanvas:app.        
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1111
    app release.
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1112
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1113
    "Created: / 11-01-2012 / 23:46:09 / cg"
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1114
!
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1115
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1116
tabMenuAt:aTab
321c1729db5b initial checkin
penk
parents:
diff changeset
  1117
    |menu|
321c1729db5b initial checkin
penk
parents:
diff changeset
  1118
7765
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  1119
    menu :=  Menu decodeFromLiteralArray:self class tabMenu.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1120
    tabMenuIndex := aTab.
7765
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  1121
    menu findGuiResourcesIn:self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1122
    ^ menu
7765
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  1123
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  1124
    "Modified: / 27-03-2007 / 10:57:25 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1125
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1126
321c1729db5b initial checkin
penk
parents:
diff changeset
  1127
!FileApplicationNoteBook methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1128
321c1729db5b initial checkin
penk
parents:
diff changeset
  1129
getSameFilesModifiedFor:aAppl
321c1729db5b initial checkin
penk
parents:
diff changeset
  1130
321c1729db5b initial checkin
penk
parents:
diff changeset
  1131
    | sameFileAppl colOfChanged |
321c1729db5b initial checkin
penk
parents:
diff changeset
  1132
321c1729db5b initial checkin
penk
parents:
diff changeset
  1133
    sameFileAppl := self getSameApplicationsFor:aAppl.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1134
    sameFileAppl notEmpty ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1135
        colOfChanged := OrderedCollection new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1136
        sameFileAppl do:[ : el |
321c1729db5b initial checkin
penk
parents:
diff changeset
  1137
            el modifiedChannel value ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1138
                colOfChanged add:el.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1139
            ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  1140
        ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  1141
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1142
    ^ colOfChanged
321c1729db5b initial checkin
penk
parents:
diff changeset
  1143
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1144
321c1729db5b initial checkin
penk
parents:
diff changeset
  1145
!FileApplicationNoteBook methodsFor:'selection'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1146
5324
5df8cf9faeba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5323
diff changeset
  1147
currentTabMenusApplication
5df8cf9faeba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5323
diff changeset
  1148
    "only valid within menu processing"
5df8cf9faeba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5323
diff changeset
  1149
5df8cf9faeba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5323
diff changeset
  1150
    ^ self listOfApplications at:tabMenuIndex
5df8cf9faeba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5323
diff changeset
  1151
!
5df8cf9faeba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5323
diff changeset
  1152
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1153
doSelect:anAppl
321c1729db5b initial checkin
penk
parents:
diff changeset
  1154
7467
7dd3132cf29a show numlines
Claus Gittinger <cg@exept.de>
parents: 7288
diff changeset
  1155
    | index fileName additionalInfo|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1156
321c1729db5b initial checkin
penk
parents:
diff changeset
  1157
    fileName := anAppl fileName.
4161
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  1158
    index := self getIndexFor:anAppl.
4180
e3e587a5fe65 change the window label
penk
parents: 4177
diff changeset
  1159
    self changeFileBrowserTitleTo:(self privateTabList at:index ifAbsent:nil).
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4520
diff changeset
  1160
    
7467
7dd3132cf29a show numlines
Claus Gittinger <cg@exept.de>
parents: 7288
diff changeset
  1161
    additionalInfo := anAppl additionalInfo.
7dd3132cf29a show numlines
Claus Gittinger <cg@exept.de>
parents: 7288
diff changeset
  1162
    self notify:(fileName isNil 
7dd3132cf29a show numlines
Claus Gittinger <cg@exept.de>
parents: 7288
diff changeset
  1163
                    ifTrue:[additionalInfo] 
7dd3132cf29a show numlines
Claus Gittinger <cg@exept.de>
parents: 7288
diff changeset
  1164
                    ifFalse:[(fileName asString contractAtBeginningTo:80),' ',additionalInfo]).
3982
fc30449d705d *** empty log message ***
penk
parents: 3962
diff changeset
  1165
"/        self gotoFile:fileName.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1166
    index notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1167
        canvasHolder value:(anAppl window).
321c1729db5b initial checkin
penk
parents:
diff changeset
  1168
        self selectedEditorPage value:index.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1169
    ]
7467
7dd3132cf29a show numlines
Claus Gittinger <cg@exept.de>
parents: 7288
diff changeset
  1170
7dd3132cf29a show numlines
Claus Gittinger <cg@exept.de>
parents: 7288
diff changeset
  1171
    "Modified: / 24-10-2006 / 12:32:53 / cg"
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1172
!
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1173
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1174
selectedApplication
5324
5df8cf9faeba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5323
diff changeset
  1175
    | canvas |
5df8cf9faeba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5323
diff changeset
  1176
5df8cf9faeba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5323
diff changeset
  1177
    canvas := self canvasHolder value.
5df8cf9faeba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5323
diff changeset
  1178
    canvas isNil ifTrue:[ ^ nil].
5df8cf9faeba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5323
diff changeset
  1179
    ^ canvas application.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1180
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1181
321c1729db5b initial checkin
penk
parents:
diff changeset
  1182
!FileApplicationNoteBook methodsFor:'startup & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1183
3954
78e29a3ea4c1 next stage
penk
parents: 3951
diff changeset
  1184
closeRequest
6626
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  1185
    "asks for permission before closing"
3954
78e29a3ea4c1 next stage
penk
parents: 3951
diff changeset
  1186
4082
0ca141045a56 avoid warning
penk
parents: 4076
diff changeset
  1187
    self tryCloseApplications ifTrue:[
0ca141045a56 avoid warning
penk
parents: 4076
diff changeset
  1188
        super closeRequest.
0ca141045a56 avoid warning
penk
parents: 4076
diff changeset
  1189
        ^ true
3954
78e29a3ea4c1 next stage
penk
parents: 3951
diff changeset
  1190
    ].
4082
0ca141045a56 avoid warning
penk
parents: 4076
diff changeset
  1191
    ^ false.
3954
78e29a3ea4c1 next stage
penk
parents: 3951
diff changeset
  1192
!
78e29a3ea4c1 next stage
penk
parents: 3951
diff changeset
  1193
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1194
makeDependent
321c1729db5b initial checkin
penk
parents:
diff changeset
  1195
321c1729db5b initial checkin
penk
parents:
diff changeset
  1196
    self viewDirectoryDescription addDependent:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1197
    self currentDirectories addDependent:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1198
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1199
321c1729db5b initial checkin
penk
parents:
diff changeset
  1200
postOpenAsSubcanvasWith:aBuilder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1201
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  1202
    self viewDirectoryDescriptionChanged.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1203
    ^ super postOpenAsSubcanvasWith:aBuilder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1204
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1205
321c1729db5b initial checkin
penk
parents:
diff changeset
  1206
postOpenWith:aBuilder
6626
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  1207
    "only invoked if the application not started from a master"
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  1208
3982
fc30449d705d *** empty log message ***
penk
parents: 3962
diff changeset
  1209
    self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:(Filename homeDirectory construct:'.bashrc')).
6626
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  1210
    super postOpenWith:aBuilder
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1211
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1212
321c1729db5b initial checkin
penk
parents:
diff changeset
  1213
preBuildWith:aBuilder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1214
321c1729db5b initial checkin
penk
parents:
diff changeset
  1215
    self masterApplication isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1216
        self masterApplication:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1217
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1218
    ^ super preBuildWith:aBuilder.
4082
0ca141045a56 avoid warning
penk
parents: 4076
diff changeset
  1219
!
0ca141045a56 avoid warning
penk
parents: 4076
diff changeset
  1220
0ca141045a56 avoid warning
penk
parents: 4076
diff changeset
  1221
tryCloseApplications
0ca141045a56 avoid warning
penk
parents: 4076
diff changeset
  1222
0ca141045a56 avoid warning
penk
parents: 4076
diff changeset
  1223
    self listOfApplications do:[:appl|
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  1224
        appl doClose ifFalse:[
4082
0ca141045a56 avoid warning
penk
parents: 4076
diff changeset
  1225
            ^ false.
0ca141045a56 avoid warning
penk
parents: 4076
diff changeset
  1226
        ].
0ca141045a56 avoid warning
penk
parents: 4076
diff changeset
  1227
    ].
0ca141045a56 avoid warning
penk
parents: 4076
diff changeset
  1228
    ^ true
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1229
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1230
321c1729db5b initial checkin
penk
parents:
diff changeset
  1231
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'defaults'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1232
321c1729db5b initial checkin
penk
parents:
diff changeset
  1233
tabStringFor:aApplicationType
7687
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  1234
    "the formatString shown in a tab (language translated)"
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  1235
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  1236
    ^ 'Archive %1'
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  1237
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  1238
    "Modified: / 01-03-2007 / 21:43:13 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1239
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1240
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1241
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'help specs'!
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1242
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1243
flyByHelpSpec
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1244
    "This resource specification was automatically generated
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1245
     by the UIHelpTool of ST/X."
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1246
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1247
    "Do not manually edit this!! If it is corrupted,
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1248
     the UIHelpTool may not be able to read the specification."
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1249
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1250
    "
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1251
     UIHelpTool openOnClass:FileApplicationNoteBook::ArchiveViewApplication    
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1252
    "
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1253
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1254
    <resource: #help>
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1255
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1256
    ^super flyByHelpSpec addPairsFrom:#(
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1257
6100
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1258
#closeTabButton
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1259
'Close Archiver Tab'
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1260
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1261
#extractItem
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1262
'Extract...'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1263
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1264
#removeOutputButton
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1265
'Remove Error Output'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1266
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1267
#stopButton
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1268
'Stop'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1269
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1270
)
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1271
!
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1272
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1273
helpSpec
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1274
    "This resource specification was automatically generated
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1275
     by the UIHelpTool of ST/X."
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1276
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1277
    "Do not manually edit this!! If it is corrupted,
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1278
     the UIHelpTool may not be able to read the specification."
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1279
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1280
    "
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1281
     UIHelpTool openOnClass:FileApplicationNoteBook::ArchiveViewApplication    
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1282
    "
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1283
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1284
    <resource: #help>
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1285
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1286
    ^super helpSpec addPairsFrom:#(
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1287
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1288
#closeButton
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1289
'Close Archiver'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1290
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1291
#extractItem
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1292
'Extract...'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1293
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1294
#removeOutputButton
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1295
'Remove Error Output'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1296
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1297
#stopButton
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1298
'Stop'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1299
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1300
)
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1301
! !
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1302
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1303
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'image specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1304
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1305
extract28x28Icon
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1306
    "This resource specification was automatically generated
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1307
     by the ImageEditor of ST/X."
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1308
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1309
    "Do not manually edit this!! If it is corrupted,
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1310
     the ImageEditor may not be able to read the specification."
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1311
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1312
    "
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1313
     self extract28x28Icon inspect
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1314
     ImageEditor openOnClass:self andSelector:#extract28x28Icon
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1315
     Icon flushCachedIcons
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1316
    "
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1317
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1318
    <resource: #image>
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1319
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1320
    ^Icon
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1321
        constantNamed:#'FileApplicationNoteBook::ArchiveViewApplication class extract28x28Icon'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1322
        ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1323
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1324
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@3L3L3L@@@@@@@@@@@@CQDMDP0@@@@@EUUAP@@L3L3L3@@@ @PUUTA@@@4QCQDL@@BHAAUUPD@@CL3L3L"H"H"DEUU
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1325
@P@@MDP4QBH"H"H @@@A@@@3L3L3H"H"H!!DQDQD@@CQDMDP0@@H DP@@@P@@L3L3L3@@@ @Q@ETA@@@4QCQDL@@@@AD@UPD@@CL3L3L0@@@@@@@@@@@@MDP4
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1326
QC@@@@@@@@@@@@@3L3L3L@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1327
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 129 129 129 255 0 0 255 255 255 105 133 190 194 194 194]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1328
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@G?0@@A?<G? _?A?8G?1_>A?<_? _???8G???>A???? _?G?8G?1_>A?<G? _?@?0G?0@@A?<@@@_?@@@@@@
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1329
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself]
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1330
!
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1331
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1332
removeBug28x28Icon
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1333
    "This resource specification was automatically generated
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1334
     by the ImageEditor of ST/X."
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1335
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1336
    "Do not manually edit this!! If it is corrupted,
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1337
     the ImageEditor may not be able to read the specification."
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1338
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1339
    "
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1340
     self removeBug28x28Icon inspect
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1341
     ImageEditor openOnClass:self andSelector:#removeBug28x28Icon
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1342
     Icon flushCachedIcons
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1343
    "
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1344
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1345
    <resource: #image>
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1346
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1347
    ^Icon
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1348
        constantNamed:#'FileApplicationNoteBook::ArchiveViewApplication class removeBug28x28Icon'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1349
        ifAbsentPut:[(Depth2Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1350
UUUUUUUUT@@@@@@@@@@@@@@@@@@@B*@@@@@J(@J(@@@@J(@@* @@@J(@@B*@@@J(@@@J(@@J(@@@@* @J(@@@@B(@J+0@@@@J :*+@@@@B*:**,@@@O*****
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1351
0@@C:****,@@@N**@@@@@@O*****0@@@>+***<@@@B(N*?0@@@B*@J+0@@@B*@@* @@@B*@@B*@@@B*@@@J(@@B*@@@@* @B*@@@@B*@B*@@@@@J(@@@@@@@
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1352
@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 192 192 192 255 0 0 128 0 0]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1353
@@@@@@@@@@@@@@@@O@@C0A8@A8@O@@<@A80^@@O#O0@A>_1@@N/>@@A??0@@??>@G??? BG??8@A??>@G??? @???8@@_?<@@O/>@@G9?D@C83<@A80^@@<@
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1354
C0@^@@^@O@@C0@@@@@@@@@@@@@@@@@@a') ; yourself); yourself]
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1355
!
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1356
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1357
removeError
321c1729db5b initial checkin
penk
parents:
diff changeset
  1358
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  1359
     by the ImageEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1360
321c1729db5b initial checkin
penk
parents:
diff changeset
  1361
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  1362
     the ImageEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1363
321c1729db5b initial checkin
penk
parents:
diff changeset
  1364
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  1365
     self removeError inspect
321c1729db5b initial checkin
penk
parents:
diff changeset
  1366
     ImageEditor openOnClass:self andSelector:#removeError
321c1729db5b initial checkin
penk
parents:
diff changeset
  1367
     Icon flushCachedIcons
321c1729db5b initial checkin
penk
parents:
diff changeset
  1368
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  1369
321c1729db5b initial checkin
penk
parents:
diff changeset
  1370
    <resource: #image>
321c1729db5b initial checkin
penk
parents:
diff changeset
  1371
321c1729db5b initial checkin
penk
parents:
diff changeset
  1372
    ^Icon
321c1729db5b initial checkin
penk
parents:
diff changeset
  1373
        constantNamed:#'FileApplicationNoteBook::ArchiveViewApplication class removeError'
321c1729db5b initial checkin
penk
parents:
diff changeset
  1374
        ifAbsentPut:[(Depth8Image new) width: 28; height: 22; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
321c1729db5b initial checkin
penk
parents:
diff changeset
  1375
@@@@@@@@@@@FA @@@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@@@A X@@@XF@@@@@@@@@@@@@@@@@@@@@@@@
321c1729db5b initial checkin
penk
parents:
diff changeset
  1376
@@@@@@@FA XF@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@XFA X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@XF
321c1729db5b initial checkin
penk
parents:
diff changeset
  1377
@@@FA @@@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@XF@@@@@@@@@@@@@@@@@@@@@@@@@@XF@@@@@@@@A X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
321c1729db5b initial checkin
penk
parents:
diff changeset
  1378
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
321c1729db5b initial checkin
penk
parents:
diff changeset
  1379
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
321c1729db5b initial checkin
penk
parents:
diff changeset
  1380
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
321c1729db5b initial checkin
penk
parents:
diff changeset
  1381
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 8 4 8 105 133 190 121 133 157 129 129 129 194 194 194 255 0 0]; mask:((Depth1Image new) width: 28; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@LC@@@A!! @@@L0@@@A8@@@@L@@@@G @@@CL@@@A!! @@@0L@@@@@@@BY=5LAIUUT S5UU8D!!UUPAFU\#@@@@@@@LR9@@D)J @A:R(@@P$*@@CIN @@@@@@@@@a') ; yourself); yourself]
321c1729db5b initial checkin
penk
parents:
diff changeset
  1382
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1383
321c1729db5b initial checkin
penk
parents:
diff changeset
  1384
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'interface specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1385
321c1729db5b initial checkin
penk
parents:
diff changeset
  1386
windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  1387
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  1388
     by the UIPainter of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1389
321c1729db5b initial checkin
penk
parents:
diff changeset
  1390
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  1391
     the UIPainter may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1392
321c1729db5b initial checkin
penk
parents:
diff changeset
  1393
    "
3951
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  1394
     UIPainter new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#windowSpec
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  1395
     FileApplicationNoteBook::ArchiveViewApplication new openInterface:#windowSpec
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  1396
     FileApplicationNoteBook::ArchiveViewApplication open
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1397
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  1398
321c1729db5b initial checkin
penk
parents:
diff changeset
  1399
    <resource: #canvas>
321c1729db5b initial checkin
penk
parents:
diff changeset
  1400
321c1729db5b initial checkin
penk
parents:
diff changeset
  1401
    ^ 
321c1729db5b initial checkin
penk
parents:
diff changeset
  1402
     #(#FullSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  1403
        #name: #windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  1404
        #window: 
321c1729db5b initial checkin
penk
parents:
diff changeset
  1405
       #(#WindowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  1406
          #label: 'Archive Application'
321c1729db5b initial checkin
penk
parents:
diff changeset
  1407
          #name: 'Archive Application'
321c1729db5b initial checkin
penk
parents:
diff changeset
  1408
          #min: #(#Point 10 10)
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1409
          #bounds: #(#Rectangle 16 46 692 538)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1410
          #menu: #mainMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
  1411
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1412
        #component: 
321c1729db5b initial checkin
penk
parents:
diff changeset
  1413
       #(#SpecCollection
321c1729db5b initial checkin
penk
parents:
diff changeset
  1414
          #collection: #(
321c1729db5b initial checkin
penk
parents:
diff changeset
  1415
           #(#MenuPanelSpec
4261
8cfc011b2c0c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4201
diff changeset
  1416
              #name: 'MenuArchive'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1417
              #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
  1418
              #level: 0
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1419
              #menu: #menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  1420
              #textDefault: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1421
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1422
           #(#'FileBrowserV2UISpecifications::PanelSpec'
321c1729db5b initial checkin
penk
parents:
diff changeset
  1423
              #name: 'VerticalPanel'
321c1729db5b initial checkin
penk
parents:
diff changeset
  1424
              #layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0)
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1425
              #level: 0
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1426
              #whichView: #last
321c1729db5b initial checkin
penk
parents:
diff changeset
  1427
              #orientation: #vertical
321c1729db5b initial checkin
penk
parents:
diff changeset
  1428
              #visibility: #errorListVisibilityHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1429
              #component: 
321c1729db5b initial checkin
penk
parents:
diff changeset
  1430
             #(#SpecCollection
321c1729db5b initial checkin
penk
parents:
diff changeset
  1431
                #collection: #(
321c1729db5b initial checkin
penk
parents:
diff changeset
  1432
                 #(#DataSetSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  1433
                    #name: 'Table1'
321c1729db5b initial checkin
penk
parents:
diff changeset
  1434
                    #model: #selectionHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1435
                    #menu: #fileListMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
  1436
                    #hasHorizontalScrollBar: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1437
                    #hasVerticalScrollBar: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1438
                    #dataList: #archiveFileList
321c1729db5b initial checkin
penk
parents:
diff changeset
  1439
                    #useIndex: false
321c1729db5b initial checkin
penk
parents:
diff changeset
  1440
                    #has3Dsepartors: false
321c1729db5b initial checkin
penk
parents:
diff changeset
  1441
                    #doubleClickSelector: #dblClick
321c1729db5b initial checkin
penk
parents:
diff changeset
  1442
                    #columnHolder: #tableColumns
321c1729db5b initial checkin
penk
parents:
diff changeset
  1443
                    #multipleSelectOk: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1444
                    #verticalSpacing: 0
321c1729db5b initial checkin
penk
parents:
diff changeset
  1445
                    #postBuildCallback: #postBuildFileTable:
321c1729db5b initial checkin
penk
parents:
diff changeset
  1446
                    #properties: 
321c1729db5b initial checkin
penk
parents:
diff changeset
  1447
                   #(#PropertyListDictionary
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1448
                      #enterSelector: #dropEnter:
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1449
                      #dragArgument: #archivApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
  1450
                      #startDragSelector: #doStartDrag:in:
321c1729db5b initial checkin
penk
parents:
diff changeset
  1451
                      #displayObjectSelector: #getDisplayObjects:
321c1729db5b initial checkin
penk
parents:
diff changeset
  1452
                      #dropObjectSelector: #getDropObjects:
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1453
                      #overSelector: nil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1454
                      #dropArgument: #archivApplication
3951
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  1455
                      #canDropSelector: #canDrop:
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  1456
                      #leaveSelector: #dropLeave:
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1457
                      #dropSelector: #doDrop:
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1458
                    )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1459
                  )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1460
                 #(#SequenceViewSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  1461
                    #name: 'ErrorList'
321c1729db5b initial checkin
penk
parents:
diff changeset
  1462
                    #initiallyDisabled: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1463
                    #hasHorizontalScrollBar: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1464
                    #hasVerticalScrollBar: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1465
                    #backgroundColor: #(#Color 100.0 100.0 100.0)
321c1729db5b initial checkin
penk
parents:
diff changeset
  1466
                    #isMultiSelect: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1467
                    #useIndex: false
321c1729db5b initial checkin
penk
parents:
diff changeset
  1468
                    #sequenceList: #errorListHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  1469
                  )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1470
                 )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1471
               
321c1729db5b initial checkin
penk
parents:
diff changeset
  1472
              )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1473
              #handles: #(#Any 0.5 1.0)
321c1729db5b initial checkin
penk
parents:
diff changeset
  1474
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1475
           )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1476
         
321c1729db5b initial checkin
penk
parents:
diff changeset
  1477
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1478
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1479
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1480
321c1729db5b initial checkin
penk
parents:
diff changeset
  1481
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'menu specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1482
321c1729db5b initial checkin
penk
parents:
diff changeset
  1483
fileListMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
  1484
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  1485
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1486
321c1729db5b initial checkin
penk
parents:
diff changeset
  1487
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  1488
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1489
321c1729db5b initial checkin
penk
parents:
diff changeset
  1490
    "
4475
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1491
     MenuEditor new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#fileListMenu
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1492
     (Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ArchiveViewApplication fileListMenu)) startUp
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1493
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  1494
321c1729db5b initial checkin
penk
parents:
diff changeset
  1495
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
  1496
321c1729db5b initial checkin
penk
parents:
diff changeset
  1497
    ^ 
321c1729db5b initial checkin
penk
parents:
diff changeset
  1498
     #(#Menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  1499
        #(
321c1729db5b initial checkin
penk
parents:
diff changeset
  1500
         #(#MenuItem
4475
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1501
            #enabled: #hasListEntriesHolder
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1502
            #label: 'Select All'
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1503
            #itemValue: #selectAll
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1504
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1505
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1506
         #(#MenuItem
4475
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1507
            #label: '-'
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1508
          )
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1509
         #(#MenuItem
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1510
            #enabled: #hasSelectionInList
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1511
            #label: 'Copy Filenames'
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1512
            #itemValue: #copyFilesToClipboard
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1513
            #translateLabel: true
4475
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1514
          )
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1515
         #(#MenuItem
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1516
            #label: '-'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1517
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1518
         #(#MenuItem
4475
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1519
            #enabled: #hasSelectionInList
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1520
            #label: 'Extract to Directory...'
5415
20210169445f allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents: 5414
diff changeset
  1521
            #itemValue: #extractSelection
20210169445f allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents: 5414
diff changeset
  1522
            #translateLabel: true
20210169445f allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents: 5414
diff changeset
  1523
          )
20210169445f allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents: 5414
diff changeset
  1524
         #(#MenuItem
20210169445f allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents: 5414
diff changeset
  1525
            #label: 'Extract All to Directory...'
4475
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1526
            #itemValue: #extractAll
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1527
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1528
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1529
         #(#MenuItem
4475
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1530
            #enabled: #canDelete
4476
e4d58ec911c8 menu item
Claus Gittinger <cg@exept.de>
parents: 4475
diff changeset
  1531
            #label: 'Delete from Archive'
4961
7b1d05219028 no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 4953
diff changeset
  1532
            #itemValue: #removeFilesFromArchive
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1533
            #translateLabel: true
4475
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1534
            #shortcutKey: #Delete
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1535
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1536
         #(#MenuItem
5415
20210169445f allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents: 5414
diff changeset
  1537
            #label: '-'
20210169445f allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents: 5414
diff changeset
  1538
          )
20210169445f allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents: 5414
diff changeset
  1539
         #(#MenuItem
4475
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1540
            #enabled: #canViewFile
5415
20210169445f allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents: 5414
diff changeset
  1541
            #label: 'Show Contents'
4475
deb39868dfa9 menu items resorted
Claus Gittinger <cg@exept.de>
parents: 4473
diff changeset
  1542
            #itemValue: #viewFile
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1543
            #translateLabel: true
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1544
            #isVisible: #closeButtonShown
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1545
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1546
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1547
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  1548
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  1549
      )
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1550
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1551
    "Modified: / 12-01-2012 / 00:34:13 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1552
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1553
321c1729db5b initial checkin
penk
parents:
diff changeset
  1554
menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  1555
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  1556
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1557
321c1729db5b initial checkin
penk
parents:
diff changeset
  1558
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  1559
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1560
321c1729db5b initial checkin
penk
parents:
diff changeset
  1561
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  1562
     MenuEditor new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  1563
     (Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ArchiveViewApplication menu)) startUp
321c1729db5b initial checkin
penk
parents:
diff changeset
  1564
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  1565
321c1729db5b initial checkin
penk
parents:
diff changeset
  1566
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
  1567
321c1729db5b initial checkin
penk
parents:
diff changeset
  1568
    ^ 
321c1729db5b initial checkin
penk
parents:
diff changeset
  1569
     #(#Menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  1570
        #(
321c1729db5b initial checkin
penk
parents:
diff changeset
  1571
         #(#MenuItem
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1572
            #activeHelpKey: #stopButton
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1573
            #enabled: #enableStopButton
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1574
            #label: 'Stop'
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1575
            #itemValue: #doStopProcess
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1576
            #nameKey: #Stop
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1577
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1578
            #isButton: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1579
            #labelImage: #(#ResourceRetriever #ToolbarIconLibrary #stop22x22Icon)
321c1729db5b initial checkin
penk
parents:
diff changeset
  1580
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1581
         #(#MenuItem
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1582
            #activeHelpKey: #extractItem
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1583
            #enabled: #hasListEntriesHolder
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1584
            #label: 'Extract'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1585
            #itemValue: #extractAll
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1586
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1587
            #isButton: true
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1588
            #labelImage: #(#ResourceRetriever #'FileApplicationNoteBook::ArchiveViewApplication' #extract28x28Icon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1589
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1590
         #(#MenuItem
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1591
            #activeHelpKey: #removeOutputButton
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1592
            #enabled: #enableRemoveErrorOutput
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1593
            #label: 'Remove Output'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1594
            #itemValue: #removeErrorOutput
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1595
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1596
            #isButton: true
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1597
            #labelImage: #(#ResourceRetriever #'FileApplicationNoteBook::ArchiveViewApplication' #removeBug28x28Icon)
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1598
          )
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1599
         #(#MenuItem
6100
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  1600
            #activeHelpKey: #closeTabButton
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1601
            #label: 'Close'
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1602
            #itemValue: #doClose
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1603
            #translateLabel: true
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1604
            #isButton: true
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1605
            #startGroup: #right
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1606
            #isVisible: #closeButtonShown
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  1607
            #hideMenuOnActivated: false
6093
cab3a82eaa34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6091
diff changeset
  1608
            #labelImage: #(#ResourceRetriever #ToolbarIconLibrary #removeTabIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1609
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1610
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1611
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  1612
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  1613
      )
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1614
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  1615
    "Modified: / 12-01-2012 / 00:34:06 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1616
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1617
321c1729db5b initial checkin
penk
parents:
diff changeset
  1618
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1619
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  1620
canOpenItem:anItem
5287
693e3ca577aa avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents: 5279
diff changeset
  1621
    |suffix mimeType|
693e3ca577aa avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents: 5279
diff changeset
  1622
10706
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
  1623
"/    "avoid autoloading the archiver if its definitely not an archive"
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
  1624
"/    OperatingSystem isUNIXlike ifFalse:[
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
  1625
"/        "until Archiver supports windows archives..."
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
  1626
"/        ^ false.
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
  1627
"/    ].
6518
cc70159b7a85 stc-compile on Unix
Stefan Vogel <sv@exept.de>
parents: 6484
diff changeset
  1628
5287
693e3ca577aa avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents: 5279
diff changeset
  1629
    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
  1630
    ( #('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
  1631
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
  1632
    ( #('xlsx' 'ets') includes:suffix) ifTrue:[^ true].
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
  1633
5287
693e3ca577aa avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents: 5279
diff changeset
  1634
    mimeType := anItem mimeType.
693e3ca577aa avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents: 5279
diff changeset
  1635
    ( #('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
  1636
5315
7384fe48ec1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5307
diff changeset
  1637
    Archiver isNil ifTrue:[^ false].
6518
cc70159b7a85 stc-compile on Unix
Stefan Vogel <sv@exept.de>
parents: 6484
diff changeset
  1638
    ^ (Archiver classForMimeType:mimeType fileName:anItem fileName) notNil
10706
2c487f44a355 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10566
diff changeset
  1639
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
  1640
    "Modified: / 29-11-2011 / 18:59:35 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1641
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1642
321c1729db5b initial checkin
penk
parents:
diff changeset
  1643
wantNewApplicationAnyway
321c1729db5b initial checkin
penk
parents:
diff changeset
  1644
321c1729db5b initial checkin
penk
parents:
diff changeset
  1645
    ^ false
321c1729db5b initial checkin
penk
parents:
diff changeset
  1646
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1647
321c1729db5b initial checkin
penk
parents:
diff changeset
  1648
!FileApplicationNoteBook::ArchiveViewApplication class methodsFor:'tableColumns specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1649
321c1729db5b initial checkin
penk
parents:
diff changeset
  1650
tableColumns
321c1729db5b initial checkin
penk
parents:
diff changeset
  1651
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  1652
     by the DataSetBuilder of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1653
321c1729db5b initial checkin
penk
parents:
diff changeset
  1654
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  1655
     the DataSetBuilder may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  1656
321c1729db5b initial checkin
penk
parents:
diff changeset
  1657
    "
5008
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  1658
     DataSetBuilder new openOnClass:FileApplicationNoteBook::ArchiveViewApplication andSelector:#tableColumns
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1659
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  1660
321c1729db5b initial checkin
penk
parents:
diff changeset
  1661
    <resource: #tableColumns>
321c1729db5b initial checkin
penk
parents:
diff changeset
  1662
321c1729db5b initial checkin
penk
parents:
diff changeset
  1663
    ^#(
5222
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1664
      (DataSetColumnSpec
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1665
         labelButtonType: Button
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1666
         labelActionSelector: sortFileListsBy:
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1667
         labelActionArgument: 'directory'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1668
         width: 25
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1669
         minWidth: 20
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1670
         height: 16
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1671
         model: icon
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1672
         canSelect: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1673
         isResizeable: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1674
         showRowSeparator: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1675
         showColSeparator: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1676
       )
5222
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1677
      (DataSetColumnSpec
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1678
         label: 'File Name'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1679
         id: 'fileName'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1680
         labelAlignment: left
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1681
         labelButtonType: Button
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1682
         model: fileName
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1683
         canSelect: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1684
         showRowSeparator: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1685
         showColSeparator: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1686
       )
5222
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1687
      (DataSetColumnSpec
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1688
         label: 'Perm'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1689
         id: 'permissions'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1690
         labelButtonType: Button
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1691
         usePreferredWidth: true
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1692
         width: 75
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1693
         model: permissions
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1694
         canSelect: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1695
         showRowSeparator: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1696
         showColSeparator: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1697
       )
5222
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1698
      (DataSetColumnSpec
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1699
         label: 'Version'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1700
         id: 'version'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1701
         labelButtonType: Button
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1702
         columnAlignment: right
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1703
         width: 100
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1704
         minWidth: 50
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1705
         model: version
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1706
         canSelect: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1707
         showRowSeparator: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1708
         showColSeparator: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1709
       )
5222
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1710
      (DataSetColumnSpec
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1711
         label: 'Type'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1712
         id: 'type'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1713
         labelButtonType: Button
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1714
         columnAlignment: right
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1715
         width: 100
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1716
         minWidth: 50
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1717
         model: type
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1718
         canSelect: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1719
         showRowSeparator: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1720
         showColSeparator: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1721
       )
5222
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1722
      (DataSetColumnSpec
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1723
         label: 'Owner/Group'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1724
         id: 'ownerGroup'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1725
         labelButtonType: Button
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1726
         columnAlignment: right
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1727
         width: 100
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1728
         minWidth: 50
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1729
         model: ownerGroup
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1730
         canSelect: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1731
         showRowSeparator: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1732
         showColSeparator: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1733
       )
5222
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1734
      (DataSetColumnSpec
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1735
         label: 'Size'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1736
         id: 'size'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1737
         labelButtonType: Button
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1738
         columnAlignment: right
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1739
         width: 80
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1740
         model: size
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1741
         canSelect: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1742
         showRowSeparator: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1743
         showColSeparator: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1744
       )
5222
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1745
      (DataSetColumnSpec
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1746
         label: 'Date & Time'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1747
         id: 'dateAndTime'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1748
         labelAlignment: right
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1749
         labelButtonType: Button
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1750
         columnAlignment: right
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1751
         usePreferredWidth: true
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1752
         width: 140
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1753
         model: dateAndTime
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1754
         canSelect: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1755
         showRowSeparator: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1756
         showColSeparator: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1757
       )
5222
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1758
      (DataSetColumnSpec
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1759
         label: 'Method'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1760
         id: 'method'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1761
         labelButtonType: Button
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1762
         columnAlignment: center
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1763
         usePreferredWidth: true
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1764
         width: 140
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1765
         model: method
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1766
         canSelect: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1767
         showRowSeparator: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1768
         showColSeparator: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1769
       )
5222
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1770
      (DataSetColumnSpec
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1771
         label: 'CRC'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1772
         id: 'crc'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1773
         labelButtonType: Button
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1774
         usePreferredWidth: true
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1775
         width: 140
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1776
         model: crc
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1777
         canSelect: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1778
         showRowSeparator: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1779
         showColSeparator: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1780
       )
5222
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1781
      (DataSetColumnSpec
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1782
         label: 'Compress Size'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1783
         id: 'compressSize'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1784
         labelButtonType: Button
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1785
         columnAlignment: right
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1786
         usePreferredWidth: true
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1787
         width: 140
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1788
         model: compressSize
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1789
         canSelect: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1790
         showRowSeparator: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1791
         showColSeparator: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1792
       )
5222
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1793
      (DataSetColumnSpec
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1794
         label: 'Ratio'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1795
         id: 'ratio'
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1796
         labelButtonType: Button
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1797
         columnAlignment: right
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1798
         usePreferredWidth: true
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1799
         width: 140
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1800
         model: ratio
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1801
         canSelect: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1802
         showRowSeparator: false
a9bad3ac536e sort archive table columns disabled no selector was available
penk
parents: 5221
diff changeset
  1803
         showColSeparator: false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1804
       )
321c1729db5b initial checkin
penk
parents:
diff changeset
  1805
      )
5008
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  1806
    
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1807
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1808
321c1729db5b initial checkin
penk
parents:
diff changeset
  1809
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1810
321c1729db5b initial checkin
penk
parents:
diff changeset
  1811
archiver
321c1729db5b initial checkin
penk
parents:
diff changeset
  1812
    "return the value of the instance variable 'archiver' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1813
321c1729db5b initial checkin
penk
parents:
diff changeset
  1814
    ^ archiver
321c1729db5b initial checkin
penk
parents:
diff changeset
  1815
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1816
321c1729db5b initial checkin
penk
parents:
diff changeset
  1817
archiver:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  1818
    "set the value of the instance variable 'archiver' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1819
321c1729db5b initial checkin
penk
parents:
diff changeset
  1820
    archiver := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1821
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1822
321c1729db5b initial checkin
penk
parents:
diff changeset
  1823
columnDescriptors
321c1729db5b initial checkin
penk
parents:
diff changeset
  1824
    "return the value of the instance variable 'columnDescriptors' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1825
321c1729db5b initial checkin
penk
parents:
diff changeset
  1826
    ^ columnDescriptors
321c1729db5b initial checkin
penk
parents:
diff changeset
  1827
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1828
321c1729db5b initial checkin
penk
parents:
diff changeset
  1829
columnDescriptors:aListOfColumns
321c1729db5b initial checkin
penk
parents:
diff changeset
  1830
    "set the value of the instance variable 'columnDescriptors' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1831
321c1729db5b initial checkin
penk
parents:
diff changeset
  1832
    columnDescriptors = aListOfColumns ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1833
        ^ self
321c1729db5b initial checkin
penk
parents:
diff changeset
  1834
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1835
321c1729db5b initial checkin
penk
parents:
diff changeset
  1836
    columnDescriptors    := OrderedCollection new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1837
321c1729db5b initial checkin
penk
parents:
diff changeset
  1838
    aListOfColumns keysAndValuesDo:[:anIndex :aDesc| |col|
7765
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  1839
        col := aDesc isSequenceable ifTrue:[DataSetColumnSpec decodeFromLiteralArray:aDesc]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1840
                                   ifFalse:[aDesc].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1841
        columnDescriptors add:col.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1842
    ].
7765
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  1843
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  1844
    "Modified: / 27-03-2007 / 08:46:06 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1845
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1846
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  1847
item:anItem
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  1848
    super item:anItem.
4905
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  1849
4375
05dd38dadc66 archivapplication errors removed
penk
parents: 4360
diff changeset
  1850
    self removeErrorOutput.
4905
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  1851
    archiver := Archiver newFor:self fileName.
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  1852
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  1853
    archiver notNil ifTrue:[
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1854
        self 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1855
            makeProcessFor:[
4905
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  1856
                self archiver:archiver.
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1857
                self setColumnsForArchiver.
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1858
            ] 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1859
            with:'Setup archive'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1860
        ^ true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1861
    ]. 
321c1729db5b initial checkin
penk
parents:
diff changeset
  1862
    ^ false
321c1729db5b initial checkin
penk
parents:
diff changeset
  1863
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1864
321c1729db5b initial checkin
penk
parents:
diff changeset
  1865
temporaryDirectory
321c1729db5b initial checkin
penk
parents:
diff changeset
  1866
    "return the value of the instance variable 'temporaryDirectory' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1867
321c1729db5b initial checkin
penk
parents:
diff changeset
  1868
    temporaryDirectory isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1869
        temporaryDirectory := Filename newTemporary.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1870
        temporaryDirectory makeDirectory.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1871
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1872
    ^ temporaryDirectory
321c1729db5b initial checkin
penk
parents:
diff changeset
  1873
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1874
321c1729db5b initial checkin
penk
parents:
diff changeset
  1875
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1876
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  1877
changeItem:anItem 
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  1878
    self item:anItem.
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1879
    self clearFileList.
4905
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  1880
    self listAllFiles.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1881
    ^ true
321c1729db5b initial checkin
penk
parents:
diff changeset
  1882
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1883
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1884
clearFileList
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1885
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1886
    self archiveFileList value removeAll.
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1887
!
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  1888
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1889
copyFilesToClipboard
321c1729db5b initial checkin
penk
parents:
diff changeset
  1890
    |sel list stream|
321c1729db5b initial checkin
penk
parents:
diff changeset
  1891
321c1729db5b initial checkin
penk
parents:
diff changeset
  1892
    sel := self selectionHolder value.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1893
    list := self archiveFileList.
6482
00207f456339 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 6481
diff changeset
  1894
    (sel notEmptyOrNil) ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1895
        stream := WriteStream on:''.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1896
        sel do:[: key |
321c1729db5b initial checkin
penk
parents:
diff changeset
  1897
            stream nextPutAll:(key fileName asString).
321c1729db5b initial checkin
penk
parents:
diff changeset
  1898
            stream cr.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1899
        ].
6033
9393b570b70a *** empty log message ***
ca
parents: 5968
diff changeset
  1900
        self window setClipboardText:stream contents.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1901
        stream close.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1902
    ].
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
  1903
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
  1904
    "Modified (format): / 29-11-2011 / 18:57:40 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1905
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1906
321c1729db5b initial checkin
penk
parents:
diff changeset
  1907
dblClick
321c1729db5b initial checkin
penk
parents:
diff changeset
  1908
321c1729db5b initial checkin
penk
parents:
diff changeset
  1909
    self viewFile.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1910
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1911
321c1729db5b initial checkin
penk
parents:
diff changeset
  1912
doStopProcess
321c1729db5b initial checkin
penk
parents:
diff changeset
  1913
    | archiver |
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
  1914
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1915
    self stopProcess.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1916
    archiver := self archiver.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1917
    archiver notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1918
        self archiver stopProcess.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1919
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1920
    self enableStopButton value:false.
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
  1921
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
  1922
    "Modified (format): / 29-11-2011 / 18:57:50 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1923
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1924
321c1729db5b initial checkin
penk
parents:
diff changeset
  1925
removeErrorOutput
321c1729db5b initial checkin
penk
parents:
diff changeset
  1926
321c1729db5b initial checkin
penk
parents:
diff changeset
  1927
    self viewErrorList value:false.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1928
    self errorListHolder removeAll.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1929
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1930
321c1729db5b initial checkin
penk
parents:
diff changeset
  1931
removeTemporaryDirectory
321c1729db5b initial checkin
penk
parents:
diff changeset
  1932
321c1729db5b initial checkin
penk
parents:
diff changeset
  1933
    temporaryDirectory notNil ifTrue:[
4923
1aced17a14a7 Do not use obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 4913
diff changeset
  1934
        temporaryDirectory removeDirectory.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1935
        temporaryDirectory := nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1936
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1937
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1938
321c1729db5b initial checkin
penk
parents:
diff changeset
  1939
selectAll
321c1729db5b initial checkin
penk
parents:
diff changeset
  1940
321c1729db5b initial checkin
penk
parents:
diff changeset
  1941
    | sel listOfFiles|
321c1729db5b initial checkin
penk
parents:
diff changeset
  1942
321c1729db5b initial checkin
penk
parents:
diff changeset
  1943
    sel := OrderedCollection new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1944
    listOfFiles := self archiveFileList value.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1945
    1 to:(listOfFiles size) do:[ : el |
321c1729db5b initial checkin
penk
parents:
diff changeset
  1946
        sel add:el
321c1729db5b initial checkin
penk
parents:
diff changeset
  1947
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1948
    self selectionHolder value:sel.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1949
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1950
321c1729db5b initial checkin
penk
parents:
diff changeset
  1951
updateFileBrowserIfPresentWith:aDirectory
321c1729db5b initial checkin
penk
parents:
diff changeset
  1952
321c1729db5b initial checkin
penk
parents:
diff changeset
  1953
    | master|
321c1729db5b initial checkin
penk
parents:
diff changeset
  1954
321c1729db5b initial checkin
penk
parents:
diff changeset
  1955
    master := self masterApplication.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1956
    master notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1957
        master updateAndSelect:(OrderedCollection with:aDirectory).
321c1729db5b initial checkin
penk
parents:
diff changeset
  1958
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1959
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1960
321c1729db5b initial checkin
penk
parents:
diff changeset
  1961
viewFile
321c1729db5b initial checkin
penk
parents:
diff changeset
  1962
321c1729db5b initial checkin
penk
parents:
diff changeset
  1963
    | master item file tempDir|
321c1729db5b initial checkin
penk
parents:
diff changeset
  1964
4001
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  1965
    self canViewFile ifFalse:[^ self].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1966
    master := self masterApplication.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1967
    self selectionHolder value size = 1 ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1968
        Dialog warn:'only one file have to be selected'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1969
        ^ self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1970
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1971
    tempDir := self temporaryDirectory.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1972
    self extractSelectedFilesTo:tempDir askForExtractOptions:false.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1973
    process notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1974
        process waitUntilTerminated.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1975
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1976
    file := tempDir construct:self selectionHolder value first fileName.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1977
    file exists ifTrue:[
3982
fc30449d705d *** empty log message ***
penk
parents: 3962
diff changeset
  1978
        item := DirectoryContentsBrowser itemClass fileName:file.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1979
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1980
    master notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1981
        master openApplByFileItem:item.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1982
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1983
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1984
321c1729db5b initial checkin
penk
parents:
diff changeset
  1985
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'aspects'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1986
321c1729db5b initial checkin
penk
parents:
diff changeset
  1987
archiveFileList
321c1729db5b initial checkin
penk
parents:
diff changeset
  1988
321c1729db5b initial checkin
penk
parents:
diff changeset
  1989
    archiveFileList isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  1990
        archiveFileList := List new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1991
        archiveFileList addDependent:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1992
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  1993
    ^ archiveFileList.
321c1729db5b initial checkin
penk
parents:
diff changeset
  1994
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1995
321c1729db5b initial checkin
penk
parents:
diff changeset
  1996
enableRemoveErrorOutput
321c1729db5b initial checkin
penk
parents:
diff changeset
  1997
    "return/create the 'enableRemoveErrorOutput' value holder (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  1998
321c1729db5b initial checkin
penk
parents:
diff changeset
  1999
    enableRemoveErrorOutput isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2000
        enableRemoveErrorOutput := false asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2001
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2002
    ^ enableRemoveErrorOutput
321c1729db5b initial checkin
penk
parents:
diff changeset
  2003
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2004
321c1729db5b initial checkin
penk
parents:
diff changeset
  2005
enableStopButton
321c1729db5b initial checkin
penk
parents:
diff changeset
  2006
321c1729db5b initial checkin
penk
parents:
diff changeset
  2007
    enableStopButton isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2008
        enableStopButton := false asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2009
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2010
    ^ enableStopButton
321c1729db5b initial checkin
penk
parents:
diff changeset
  2011
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2012
321c1729db5b initial checkin
penk
parents:
diff changeset
  2013
errorListHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  2014
321c1729db5b initial checkin
penk
parents:
diff changeset
  2015
    errorListHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2016
        errorListHolder := List new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2017
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2018
    ^ errorListHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2019
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2020
321c1729db5b initial checkin
penk
parents:
diff changeset
  2021
errorListVisibilityHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  2022
321c1729db5b initial checkin
penk
parents:
diff changeset
  2023
    errorListVisibilityHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2024
        errorListVisibilityHolder := false asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2025
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2026
    ^ errorListVisibilityHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  2027
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2028
321c1729db5b initial checkin
penk
parents:
diff changeset
  2029
hasSelectionInList
321c1729db5b initial checkin
penk
parents:
diff changeset
  2030
    | sel |
6482
00207f456339 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 6481
diff changeset
  2031
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2032
    sel := self selectionHolder value.
6482
00207f456339 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 6481
diff changeset
  2033
    ^ sel notEmptyOrNil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2034
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2035
321c1729db5b initial checkin
penk
parents:
diff changeset
  2036
selectionHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  2037
    selectionHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2038
        selectionHolder := ValueHolder new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2039
        selectionHolder addDependent:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2040
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2041
    ^ selectionHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2042
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2043
321c1729db5b initial checkin
penk
parents:
diff changeset
  2044
tableColumns
321c1729db5b initial checkin
penk
parents:
diff changeset
  2045
321c1729db5b initial checkin
penk
parents:
diff changeset
  2046
    tableColumns isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2047
        tableColumns := self class tableColumns asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2048
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2049
    ^ tableColumns.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2050
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2051
321c1729db5b initial checkin
penk
parents:
diff changeset
  2052
viewErrorList
321c1729db5b initial checkin
penk
parents:
diff changeset
  2053
    "return/create the 'viewErrorList' value holder (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2054
321c1729db5b initial checkin
penk
parents:
diff changeset
  2055
    viewErrorList isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2056
        viewErrorList := false asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2057
        viewErrorList onChangeSend:#viewErrorListChanged to:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2058
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2059
    ^ viewErrorList
321c1729db5b initial checkin
penk
parents:
diff changeset
  2060
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2061
321c1729db5b initial checkin
penk
parents:
diff changeset
  2062
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'change & update'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2063
321c1729db5b initial checkin
penk
parents:
diff changeset
  2064
update:something with:aParameter from:changedObject
321c1729db5b initial checkin
penk
parents:
diff changeset
  2065
    changedObject == self archiveFileList ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2066
        self hasListEntriesHolder value:(changedObject notEmpty).
321c1729db5b initial checkin
penk
parents:
diff changeset
  2067
        ^ self
321c1729db5b initial checkin
penk
parents:
diff changeset
  2068
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2069
    super update:something with:aParameter from:changedObject
321c1729db5b initial checkin
penk
parents:
diff changeset
  2070
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2071
321c1729db5b initial checkin
penk
parents:
diff changeset
  2072
viewErrorListChanged
321c1729db5b initial checkin
penk
parents:
diff changeset
  2073
321c1729db5b initial checkin
penk
parents:
diff changeset
  2074
    | viewListValue|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2075
321c1729db5b initial checkin
penk
parents:
diff changeset
  2076
    viewListValue := self viewErrorList value.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2077
    self enableRemoveErrorOutput value:viewListValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2078
    self errorListVisibilityHolder value:viewListValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2079
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2080
321c1729db5b initial checkin
penk
parents:
diff changeset
  2081
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'command execution'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2082
321c1729db5b initial checkin
penk
parents:
diff changeset
  2083
getErrorBlock
321c1729db5b initial checkin
penk
parents:
diff changeset
  2084
321c1729db5b initial checkin
penk
parents:
diff changeset
  2085
    ^
321c1729db5b initial checkin
penk
parents:
diff changeset
  2086
    [: x |
321c1729db5b initial checkin
penk
parents:
diff changeset
  2087
        self viewErrorList value:true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2088
        self errorListHolder value add:x.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2089
    ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  2090
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2091
321c1729db5b initial checkin
penk
parents:
diff changeset
  2092
getErrorStream
321c1729db5b initial checkin
penk
parents:
diff changeset
  2093
321c1729db5b initial checkin
penk
parents:
diff changeset
  2094
    |errStream|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2095
321c1729db5b initial checkin
penk
parents:
diff changeset
  2096
    errStream := ActorStream new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2097
    errStream nextPutLineBlock:(self getErrorBlock).
321c1729db5b initial checkin
penk
parents:
diff changeset
  2098
    ^ errStream
321c1729db5b initial checkin
penk
parents:
diff changeset
  2099
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2100
321c1729db5b initial checkin
penk
parents:
diff changeset
  2101
getOutBlock
4961
7b1d05219028 no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 4953
diff changeset
  2102
    |archiveOutputParser|
7b1d05219028 no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 4953
diff changeset
  2103
7b1d05219028 no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 4953
diff changeset
  2104
    archiveOutputParser := archiver listFilesReader.
7b1d05219028 no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 4953
diff changeset
  2105
5413
7d58900ca76e extract in the current selected directory
penk
parents: 5406
diff changeset
  2106
    ^ [: line | |item|
4961
7b1d05219028 no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 4953
diff changeset
  2107
        item := archiveOutputParser parseLine:line forItemClass:ArchivItem.
7b1d05219028 no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 4953
diff changeset
  2108
        item notNil ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2109
            self archiveFileList value add:item
321c1729db5b initial checkin
penk
parents:
diff changeset
  2110
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2111
    ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  2112
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2113
321c1729db5b initial checkin
penk
parents:
diff changeset
  2114
getOutStream
321c1729db5b initial checkin
penk
parents:
diff changeset
  2115
321c1729db5b initial checkin
penk
parents:
diff changeset
  2116
    |outStream|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2117
321c1729db5b initial checkin
penk
parents:
diff changeset
  2118
    outStream := ActorStream new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2119
    outStream nextPutLineBlock:(self getOutBlock).
321c1729db5b initial checkin
penk
parents:
diff changeset
  2120
    ^ outStream
321c1729db5b initial checkin
penk
parents:
diff changeset
  2121
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2122
321c1729db5b initial checkin
penk
parents:
diff changeset
  2123
makeProcessFor:aBlock
321c1729db5b initial checkin
penk
parents:
diff changeset
  2124
    self makeProcessFor:aBlock with:''
321c1729db5b initial checkin
penk
parents:
diff changeset
  2125
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2126
321c1729db5b initial checkin
penk
parents:
diff changeset
  2127
makeProcessFor:aBlock with:string
321c1729db5b initial checkin
penk
parents:
diff changeset
  2128
    process notNil ifTrue:[
6054
ef93df40e07d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  2129
        (process waitUntilTerminatedWithTimeout:10) ifTrue:[
ef93df40e07d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  2130
            (Dialog confirm:'Terminate the current active archive operation ?') ifFalse:[^ self].
ef93df40e07d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  2131
            process terminate.
ef93df40e07d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  2132
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2133
        terminateByMe ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2134
            terminateByMe := false.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2135
            ^ self
321c1729db5b initial checkin
penk
parents:
diff changeset
  2136
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2137
    ].
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2138
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2139
    process := [   [        
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2140
                        self notify:string.
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2141
                        aBlock value.
6190
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6173
diff changeset
  2142
                        self notify:nil.
4890
b3f7edcf4981 Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents: 4880
diff changeset
  2143
                    ] ensure:[ 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2144
                        process := nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2145
                        self enableStopButton value:false.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2146
                    ] 
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2147
                ] newProcess.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2148
    process priority:(Processor systemBackgroundPriority).
321c1729db5b initial checkin
penk
parents:
diff changeset
  2149
    process name:'ArchiveApplicationProcess'.
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2150
    process resume.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2151
    self enableStopButton value:true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2152
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2153
321c1729db5b initial checkin
penk
parents:
diff changeset
  2154
setColumnsForArchiver
321c1729db5b initial checkin
penk
parents:
diff changeset
  2155
321c1729db5b initial checkin
penk
parents:
diff changeset
  2156
    | newColumns archiverColumns allColumns iconColumn|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2157
4965
a251b39fb4a2 dont use a column-descriptors id-field
Claus Gittinger <cg@exept.de>
parents: 4964
diff changeset
  2158
    archiverColumns := archiver columns collect:[:el| el first].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2159
    allColumns := OrderedCollection new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2160
    newColumns := OrderedCollection new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2161
    self class tableColumns do:[:el|
7765
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  2162
        allColumns add:(DataSetColumnSpec decodeFromLiteralArray:el).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2163
    ].
4965
a251b39fb4a2 dont use a column-descriptors id-field
Claus Gittinger <cg@exept.de>
parents: 4964
diff changeset
  2164
    iconColumn := allColumns detect:[: col | (col readSelector asSymbol) = #icon] ifNone:[nil].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2165
    iconColumn notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2166
        newColumns add:iconColumn.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2167
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2168
    allColumns do:[:col|
4965
a251b39fb4a2 dont use a column-descriptors id-field
Claus Gittinger <cg@exept.de>
parents: 4964
diff changeset
  2169
        (archiverColumns includes:(col readSelector asSymbol)) ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2170
            newColumns add:col.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2171
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2172
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2173
    self tableColumns value:newColumns.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2174
    self columnDescriptors:(self tableColumns value).
7765
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  2175
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  2176
    "Modified: / 27-03-2007 / 08:46:03 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2177
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2178
321c1729db5b initial checkin
penk
parents:
diff changeset
  2179
stopProcess
321c1729db5b initial checkin
penk
parents:
diff changeset
  2180
321c1729db5b initial checkin
penk
parents:
diff changeset
  2181
    |task|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2182
321c1729db5b initial checkin
penk
parents:
diff changeset
  2183
    terminateByMe := true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2184
    (task := process) notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2185
        process := nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2186
4645
fcf36da5b305 Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 4626
diff changeset
  2187
        Error handle:[:ex|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2188
            Dialog warn:ex description.
4645
fcf36da5b305 Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 4626
diff changeset
  2189
        ] do:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2190
            task isDead ifFalse:[
3919
c3cb2ca2f2c8 next stage
penk
parents: 3906
diff changeset
  2191
                task terminateWithAllSubprocessesInGroup.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2192
                task waitUntilTerminated.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2193
            ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  2194
        ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  2195
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2196
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2197
321c1729db5b initial checkin
penk
parents:
diff changeset
  2198
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'command helper'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2199
321c1729db5b initial checkin
penk
parents:
diff changeset
  2200
selectDirectoryDialog
321c1729db5b initial checkin
penk
parents:
diff changeset
  2201
321c1729db5b initial checkin
penk
parents:
diff changeset
  2202
    | dir directory haveDirectory|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2203
321c1729db5b initial checkin
penk
parents:
diff changeset
  2204
    directory := self fileName directory.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2205
    haveDirectory := false.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2206
    [haveDirectory] whileFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2207
        dir := Dialog requestDirectoryName:'Which directory ?' default:dir.
3988
fd7cc4e7983f *** empty log message ***
ca
parents: 3987
diff changeset
  2208
        dir isEmpty ifTrue:[ ^ nil].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2209
        dir := dir asFilename.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2210
        (dir isExecutable not or:[dir isWritable not]) ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2211
            Dialog warn:'cant write to: ', dir asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2212
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2213
        haveDirectory := true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2214
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2215
    ^ dir
3988
fd7cc4e7983f *** empty log message ***
ca
parents: 3987
diff changeset
  2216
!
fd7cc4e7983f *** empty log message ***
ca
parents: 3987
diff changeset
  2217
fd7cc4e7983f *** empty log message ***
ca
parents: 3987
diff changeset
  2218
selectDirectoryDialog:message
5413
7d58900ca76e extract in the current selected directory
penk
parents: 5406
diff changeset
  2219
    |dir haveDirectory answer|
7d58900ca76e extract in the current selected directory
penk
parents: 5406
diff changeset
  2220
7d58900ca76e extract in the current selected directory
penk
parents: 5406
diff changeset
  2221
    dir := self masterApplication currentDirectory.
7d58900ca76e extract in the current selected directory
penk
parents: 5406
diff changeset
  2222
    dir isNil ifTrue:[
7d58900ca76e extract in the current selected directory
penk
parents: 5406
diff changeset
  2223
        dir := archiver fileName withoutSuffix.        
5221
e18f159cd2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5202
diff changeset
  2224
"/        (fn exists and:[fn isDirectory]) ifTrue:[
e18f159cd2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5202
diff changeset
  2225
"/            dir := fn        
e18f159cd2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5202
diff changeset
  2226
"/        ] ifFalse:[
e18f159cd2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5202
diff changeset
  2227
"/            dir := fn directory       
e18f159cd2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5202
diff changeset
  2228
"/        ].
4981
0476a3d2d4ef archiver fix in SelectDirectoryDialog (nil fileName)
Claus Gittinger <cg@exept.de>
parents: 4977
diff changeset
  2229
    ].
5221
e18f159cd2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5202
diff changeset
  2230
3988
fd7cc4e7983f *** empty log message ***
ca
parents: 3987
diff changeset
  2231
    haveDirectory := false.
fd7cc4e7983f *** empty log message ***
ca
parents: 3987
diff changeset
  2232
    [haveDirectory] whileFalse:[
fd7cc4e7983f *** empty log message ***
ca
parents: 3987
diff changeset
  2233
        dir := Dialog requestDirectoryName:message default:dir.
fd7cc4e7983f *** empty log message ***
ca
parents: 3987
diff changeset
  2234
        dir isEmpty ifTrue:[ ^ nil].
4396
eb8622726488 dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents: 4393
diff changeset
  2235
3988
fd7cc4e7983f *** empty log message ***
ca
parents: 3987
diff changeset
  2236
        dir := dir asFilename.
4396
eb8622726488 dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents: 4393
diff changeset
  2237
        dir exists ifFalse:[
5610
bbb8d7ef1de8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5609
diff changeset
  2238
            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
  2239
            answer isNil ifTrue:[
eb8622726488 dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents: 4393
diff changeset
  2240
                ^ nil
eb8622726488 dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents: 4393
diff changeset
  2241
            ].
eb8622726488 dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents: 4393
diff changeset
  2242
            answer ifTrue:[
eb8622726488 dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents: 4393
diff changeset
  2243
                dir makeDirectory.
eb8622726488 dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents: 4393
diff changeset
  2244
                dir exists ifFalse:[
5610
bbb8d7ef1de8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5609
diff changeset
  2245
                    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
  2246
                ]
eb8622726488 dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents: 4393
diff changeset
  2247
            ].
3988
fd7cc4e7983f *** empty log message ***
ca
parents: 3987
diff changeset
  2248
        ].
4396
eb8622726488 dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents: 4393
diff changeset
  2249
        dir exists ifTrue:[
eb8622726488 dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents: 4393
diff changeset
  2250
            (dir isExecutable not or:[dir isWritable not]) ifTrue:[
5610
bbb8d7ef1de8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5609
diff changeset
  2251
                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
  2252
            ] ifFalse:[
eb8622726488 dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents: 4393
diff changeset
  2253
                haveDirectory := true.
eb8622726488 dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents: 4393
diff changeset
  2254
            ].
eb8622726488 dialog strings; added create directory to extract operation
Claus Gittinger <cg@exept.de>
parents: 4393
diff changeset
  2255
        ].
3988
fd7cc4e7983f *** empty log message ***
ca
parents: 3987
diff changeset
  2256
    ].
fd7cc4e7983f *** empty log message ***
ca
parents: 3987
diff changeset
  2257
    ^ dir
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2258
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2259
321c1729db5b initial checkin
penk
parents:
diff changeset
  2260
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands add'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2261
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2262
addFilesToArchive:colOfFiles 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2263
    self archiver 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2264
        outStream:nil
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2265
        errorStream:(self getErrorStream)
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2266
        synchron:true.
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2267
4961
7b1d05219028 no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 4953
diff changeset
  2268
"/    self 
7b1d05219028 no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 4953
diff changeset
  2269
"/        makeProcessFor:[ 
7b1d05219028 no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 4953
diff changeset
  2270
"/            self archiver addFilesToArchive:colOfFiles.
7b1d05219028 no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 4953
diff changeset
  2271
"/        ]
7b1d05219028 no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 4953
diff changeset
  2272
"/        with:'Adding files to archive'.
7b1d05219028 no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 4953
diff changeset
  2273
    "/ synchronous - otherwise list below fails
7b1d05219028 no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents: 4953
diff changeset
  2274
    self archiver addFilesToArchive:colOfFiles.
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2275
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2276
    "/ ugly code alarm.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2277
    (self archiver class == Archiver zipArchive) ifTrue:[
4905
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2278
        self listAllFiles
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2279
    ] ifFalse:[
4905
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2280
        self listFiles:colOfFiles
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2281
    ].
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2282
    ^ true
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2283
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2284
321c1729db5b initial checkin
penk
parents:
diff changeset
  2285
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands extract'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2286
321c1729db5b initial checkin
penk
parents:
diff changeset
  2287
extractAll
321c1729db5b initial checkin
penk
parents:
diff changeset
  2288
321c1729db5b initial checkin
penk
parents:
diff changeset
  2289
    self extractSelectedFilesTo:nil withSelection:#all
321c1729db5b initial checkin
penk
parents:
diff changeset
  2290
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2291
321c1729db5b initial checkin
penk
parents:
diff changeset
  2292
extractSelectedFilesTo:aDirectory askForExtractOptions:askForExtractOptionsBoolean
321c1729db5b initial checkin
penk
parents:
diff changeset
  2293
321c1729db5b initial checkin
penk
parents:
diff changeset
  2294
    self extractSelectedFilesTo:aDirectory withSelection:#selection askForExtractOptions:askForExtractOptionsBoolean
321c1729db5b initial checkin
penk
parents:
diff changeset
  2295
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2296
321c1729db5b initial checkin
penk
parents:
diff changeset
  2297
extractSelectedFilesTo:aDirectory withSelection:selectOrAll
321c1729db5b initial checkin
penk
parents:
diff changeset
  2298
321c1729db5b initial checkin
penk
parents:
diff changeset
  2299
    self extractSelectedFilesTo:aDirectory withSelection:selectOrAll askForExtractOptions:true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2300
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2301
321c1729db5b initial checkin
penk
parents:
diff changeset
  2302
extractSelectedFilesTo:aDirectory withSelection:selectOrAll askForExtractOptions:askForExtractOptionsBoolean
321c1729db5b initial checkin
penk
parents:
diff changeset
  2303
321c1729db5b initial checkin
penk
parents:
diff changeset
  2304
    | dir|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2305
321c1729db5b initial checkin
penk
parents:
diff changeset
  2306
    aDirectory isNil ifTrue:[
5413
7d58900ca76e extract in the current selected directory
penk
parents: 5406
diff changeset
  2307
        dir := self selectDirectoryDialog:'Extract into Directory?'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2308
        dir isNil ifTrue:[^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2309
    ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2310
        dir := aDirectory.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2311
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2312
    selectOrAll == #all ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2313
       self extractAllTo:dir.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2314
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2315
    selectOrAll == #selection ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2316
        self extractSelectionTo:dir askForExtractOptions:askForExtractOptionsBoolean
321c1729db5b initial checkin
penk
parents:
diff changeset
  2317
    ].
4001
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2318
"/    self updateFileBrowserIfPresentWith:dir.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2319
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2320
321c1729db5b initial checkin
penk
parents:
diff changeset
  2321
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands extract private'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2322
321c1729db5b initial checkin
penk
parents:
diff changeset
  2323
extractAllTo:aDirectory 
321c1729db5b initial checkin
penk
parents:
diff changeset
  2324
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2325
    self archiver 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2326
        outStream:nil 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2327
        errorStream:(self getErrorStream) 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2328
        synchron:true.
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2329
    self 
4905
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2330
        makeProcessFor:[ self archiver extractFilesTo:aDirectory ] 
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2331
        with:'Extracting all files'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2332
    ^ true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2333
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2334
5415
20210169445f allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents: 5414
diff changeset
  2335
extractSelection
20210169445f allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents: 5414
diff changeset
  2336
    self extractSelectedFilesTo:nil withSelection:#selection askForExtractOptions:true
20210169445f allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents: 5414
diff changeset
  2337
!
20210169445f allow single extract from an archive
Claus Gittinger <cg@exept.de>
parents: 5414
diff changeset
  2338
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2339
extractSelectionTo:aDirectory askForExtractOptions:askForExtractOptionsBoolean
321c1729db5b initial checkin
penk
parents:
diff changeset
  2340
    |  sel index extractWithDirectoryPart extractAllFilesInSelectedDirectories extractFiles|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2341
321c1729db5b initial checkin
penk
parents:
diff changeset
  2342
    extractWithDirectoryPart := true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2343
    extractAllFilesInSelectedDirectories := false.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2344
    sel := self selectionHolder value.
6482
00207f456339 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 6481
diff changeset
  2345
    (sel isEmptyOrNil) ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2346
        sel := self archiveFileList value.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2347
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2348
    sel := sel do:[:item|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2349
        item fileName: item fileName
321c1729db5b initial checkin
penk
parents:
diff changeset
  2350
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2351
    (askForExtractOptionsBoolean and:[self archiver class ~= Archiver zipArchive]) ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2352
        extractFiles := self selRemoveFilesForDirs:sel.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2353
    ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2354
        extractFiles := sel.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2355
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2356
    
321c1729db5b initial checkin
penk
parents:
diff changeset
  2357
    askForExtractOptionsBoolean ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2358
        index := extractFiles findFirst:[: el | el hasDirectoryPart].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2359
        index ~= 0 ifTrue:[
4964
911fb209dcfc output parsing refactored;
Claus Gittinger <cg@exept.de>
parents: 4961
diff changeset
  2360
            extractWithDirectoryPart := (Dialog confirmWithCancel:'Extract with directory part ?\\(I.e. create empty directories as required to preserve relative path)' withCRs default:true).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2361
            extractWithDirectoryPart isNil ifTrue:[^ false].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2362
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2363
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2364
    extractWithDirectoryPart ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2365
        self extractWithDirectoryPartTo:aDirectory with:extractFiles.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2366
    ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2367
        self extractWithOutDirectoryPartTo:aDirectory with:extractFiles.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2368
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2369
    ^ true
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
  2370
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
  2371
    "Modified (format): / 29-11-2011 / 18:57:54 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2372
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2373
321c1729db5b initial checkin
penk
parents:
diff changeset
  2374
extractWithDirectoryPartTo:aDirectory with:extractFiles
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2375
    self archiver 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2376
        outStream:nil 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2377
        errorStream:(self getErrorStream) 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2378
        synchron:true.
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2379
    self 
4905
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2380
        makeProcessFor:[ self archiver extractFiles:extractFiles to:aDirectory ] 
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2381
        with:('Extracting files to %1' bindWith:aDirectory asString).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2382
    ^ true.
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
  2383
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
  2384
    "Modified (format): / 29-11-2011 / 18:57:58 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2385
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2386
321c1729db5b initial checkin
penk
parents:
diff changeset
  2387
extractWithOutDirectoryPartTo:aDirectory with:extractFiles
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2388
    self archiver 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2389
        outStream:nil 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2390
        errorStream:(self getErrorStream) 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2391
        synchron:true.
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2392
    self 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2393
        makeProcessFor:[
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2394
            self archiver 
4905
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2395
                extractFiles:(extractFiles collect:[:item| item fileName])
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2396
                withoutDirectoryTo:aDirectory.
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2397
        ] 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2398
        with:('Extracting files to %1' bindWith:aDirectory asString).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2399
    ^ true.
10922
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
  2400
ad955bd3b4b1 added: #doAddArchiverOn:
Claus Gittinger <cg@exept.de>
parents: 10761
diff changeset
  2401
    "Modified (format): / 29-11-2011 / 18:58:01 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2402
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2403
321c1729db5b initial checkin
penk
parents:
diff changeset
  2404
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands list'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2405
4905
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2406
listAllFiles
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2407
    self archiveFileList value removeAll.
4905
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2408
    self listFiles:nil
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2409
!
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2410
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2411
listFiles:aColOfFilesOrNil 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2412
    process notNil ifTrue:[
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2413
        process waitUntilTerminated
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2414
    ].
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2415
4905
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2416
    archiver notNil ifTrue:[
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2417
        self archiver 
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2418
            outStream:(self getOutStream)
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2419
            errorStream:(self getErrorStream)
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2420
            synchron:true.
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2421
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2422
        self 
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2423
            makeProcessFor:[self archiver listFiles:aColOfFilesOrNil]
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2424
            with:'List files'
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2425
    ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2426
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2427
321c1729db5b initial checkin
penk
parents:
diff changeset
  2428
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands remove'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2429
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2430
removeFilesFromArchive
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2431
    |sel realSel list firtsPre stringCol stringRealSel|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2432
321c1729db5b initial checkin
penk
parents:
diff changeset
  2433
    sel := self selectionHolder value.
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2434
    stringCol := sel collect:[:item | item fileName].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2435
    firtsPre := stringCol at:1.
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2436
    stringCol from:2 do:[:el | firtsPre := firtsPre commonPrefixWith:el].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2437
    list := self archiveFileList value.
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2438
"/    realSel := OrderedCollection new.
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2439
"/    list do:[:item | 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2440
"/        ((item fileName) startsWith:firtsPre) ifTrue:[
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2441
"/            realSel add:item
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2442
"/        ]
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2443
"/    ].
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2444
    realSel := list select:[:item | (item fileName) startsWith:firtsPre].
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2445
    stringRealSel := realSel collect:[:item | item fileName].
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2446
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2447
    self archiver 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2448
        outStream:nil
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2449
        errorStream:(self getErrorStream)
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2450
        synchron:true.
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2451
    self 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2452
        makeProcessFor:[ self archiver removeFilesFromArchive:stringCol ]
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2453
        with:'Remove files'.
4462
b14fcc67ff8e removeAll: changed to removeAllFoundIn:
Michael Beyl <mb@exept.de>
parents: 4417
diff changeset
  2454
    self archiveFileList value removeAllFoundIn:realSel
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2455
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2456
321c1729db5b initial checkin
penk
parents:
diff changeset
  2457
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'drag & drop'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2458
3951
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2459
canDrop:aContext
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2460
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2461
    ^ inDropMode
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2462
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2463
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2464
doDrop:aContext 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2465
    |col source arg objects|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2466
321c1729db5b initial checkin
penk
parents:
diff changeset
  2467
    source := aContext dropSource.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2468
    arg := source argument.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2469
    objects := aContext dropObjects.
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2470
    col := objects collect:[:dropObject | dropObject theObject].
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2471
    ^ self addFilesToArchive:col
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2472
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2473
321c1729db5b initial checkin
penk
parents:
diff changeset
  2474
doStartDrag:aDropSource in:aView
9359
44d36e85cb39 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9172
diff changeset
  2475
    "set the cursors before starting the drag & drop operation"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2476
4018
43e02c59719d *** empty log message ***
penk
parents: 4001
diff changeset
  2477
    archiver class canDragnDrop ifFalse:[^ self].
9359
44d36e85cb39 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9172
diff changeset
  2478
    super doStartDrag:aDropSource in:aView
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2479
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2480
3951
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2481
dropEnter:aContext
6377
5c3a4c5d70cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
  2482
    | dropObjects|
3951
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2483
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2484
    inDropMode := false.
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2485
    (aContext dropSource receiver == self) ifTrue:[^ self].
6377
5c3a4c5d70cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
  2486
    dropObjects := aContext dropObjects.
5c3a4c5d70cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
  2487
5c3a4c5d70cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
  2488
    dropObjects do:[:aObject| |checkObject checkObjectString|
3951
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2489
        aObject isFileObject ifFalse:[^ self].
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2490
        checkObject := aObject theObject.
6250
5b0673ccff1c refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents: 6214
diff changeset
  2491
        checkObject isFilename ifFalse:[^ self].
3951
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2492
        checkObject isSpecialFile ifTrue:[^ self].
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2493
    ].
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2494
    inDropMode := true.
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2495
!
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2496
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2497
dropLeave:aContext
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2498
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2499
    inDropMode := false.
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2500
!
af8ef74cb43b next stage
penk
parents: 3950
diff changeset
  2501
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2502
getDisplayObjects:anArgument
9359
44d36e85cb39 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9172
diff changeset
  2503
    "retrieve the objects displayed during a drag"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2504
321c1729db5b initial checkin
penk
parents:
diff changeset
  2505
    | sel string size fnName stream|
9359
44d36e85cb39 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9172
diff changeset
  2506
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2507
    sel := self selectionHolder value.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2508
    size := sel size.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2509
    size == 0  ifTrue:[^ ''].
9359
44d36e85cb39 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9172
diff changeset
  2510
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2511
    stream := WriteStream on:''.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2512
    stream nextPutAll:(sel first fileName asFilename baseName asString).
321c1729db5b initial checkin
penk
parents:
diff changeset
  2513
    size == 1 ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2514
        fnName := 'ui_menuitem.xpm'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2515
    ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2516
        fnName := 'ui_submenu_open.xpm'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2517
        stream nextPutAll:' ... '.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2518
        stream nextPutAll:(sel last fileName asFilename baseName asString).
321c1729db5b initial checkin
penk
parents:
diff changeset
  2519
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2520
    string := stream contents.
9359
44d36e85cb39 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9172
diff changeset
  2521
44d36e85cb39 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9172
diff changeset
  2522
    ^ Array with:(LabelAndIcon 
44d36e85cb39 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9172
diff changeset
  2523
                    icon:(Image fromFile:fnName)
44d36e85cb39 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9172
diff changeset
  2524
                    string:(Text string:string emphasis:#bold))
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2525
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2526
321c1729db5b initial checkin
penk
parents:
diff changeset
  2527
getDropObjects:anArgument
9359
44d36e85cb39 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9172
diff changeset
  2528
    "common code, used in subclasses"
44d36e85cb39 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9172
diff changeset
  2529
44d36e85cb39 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9172
diff changeset
  2530
    |sel|
44d36e85cb39 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9172
diff changeset
  2531
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2532
    sel := self selectionHolder value.
9359
44d36e85cb39 support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents: 9172
diff changeset
  2533
    ^ sel collect:[:el| DropObject newFileInArchive:(el fileName asFilename) ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2534
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2535
321c1729db5b initial checkin
penk
parents:
diff changeset
  2536
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'event handling'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2537
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2538
processEvent:anEvent 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2539
    "filter keyboard events.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2540
     Return true, if I have eaten the event"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2541
321c1729db5b initial checkin
penk
parents:
diff changeset
  2542
    |focusView key rawKey|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2543
321c1729db5b initial checkin
penk
parents:
diff changeset
  2544
    anEvent isKeyPressEvent ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2545
        focusView := anEvent targetView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2546
        key := anEvent key.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2547
        rawKey := anEvent rawKey.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2548
        (focusView isSameOrComponentOf:self window) ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2549
            (key == #Delete) ifTrue:[
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2550
                self removeFilesFromArchive.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2551
                ^ true
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2552
            ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2553
        ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  2554
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2555
    ^ false
321c1729db5b initial checkin
penk
parents:
diff changeset
  2556
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2557
321c1729db5b initial checkin
penk
parents:
diff changeset
  2558
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'initialization & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2559
321c1729db5b initial checkin
penk
parents:
diff changeset
  2560
postBuildFileTable:aWidget
321c1729db5b initial checkin
penk
parents:
diff changeset
  2561
321c1729db5b initial checkin
penk
parents:
diff changeset
  2562
    fileTable := aWidget scrolledView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2563
    fileTable wantsFocusWithPointerEnter.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2564
"/    FileBrowser icons keysAndValuesDo:[:aKey :anIcon|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2565
"/        fileTable registerImage:anIcon key:aKey.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2566
"/    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2567
    self columnDescriptors:(self class tableColumns).
321c1729db5b initial checkin
penk
parents:
diff changeset
  2568
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2569
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2570
postOpenWith:aBuilder 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2571
    |currentDir contents suffix fileName file archivItem|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2572
321c1729db5b initial checkin
penk
parents:
diff changeset
  2573
    self windowGroup addPreEventHook:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2574
    self masterApplication isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2575
        self masterApplication:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2576
        currentDir := Filename homeDirectory.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2577
        contents := currentDir directoryContents.
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2578
        fileName := contents 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2579
                    detect:[:file | 
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2580
                        suffix := file asFilename suffix asLowercase.
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2581
                        suffix = 'tgz'
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2582
                    ]
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2583
                    ifNone:[nil].
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2584
        fileName isNil ifTrue:[
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2585
            Dialog warn:'cant find a Zip file in ' , currentDir asString.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2586
            ^ self
321c1729db5b initial checkin
penk
parents:
diff changeset
  2587
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2588
        file := currentDir construct:fileName.
3982
fc30449d705d *** empty log message ***
penk
parents: 3962
diff changeset
  2589
        archivItem := DirectoryContentsBrowser itemClass fileName:file.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2590
        (self item:archivItem) ifFalse:[
4803
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2591
            Dialog warn:'file type of ' , item fileName asString , ' not supported'.
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2592
            ^ self
9224c562e352 archiv -> archive
Claus Gittinger <cg@exept.de>
parents: 4774
diff changeset
  2593
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2594
    ].
4905
2fa2537a4a74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4890
diff changeset
  2595
    self listAllFiles.
6626
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  2596
    super postOpenWith:aBuilder
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2597
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2598
321c1729db5b initial checkin
penk
parents:
diff changeset
  2599
release
321c1729db5b initial checkin
penk
parents:
diff changeset
  2600
    self archiver release.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2601
    ^ super release.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2602
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2603
321c1729db5b initial checkin
penk
parents:
diff changeset
  2604
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2605
321c1729db5b initial checkin
penk
parents:
diff changeset
  2606
canDelete
321c1729db5b initial checkin
penk
parents:
diff changeset
  2607
321c1729db5b initial checkin
penk
parents:
diff changeset
  2608
    ^ (self hasOneSelectionInList and:[archiver class canRemoveFiles])
321c1729db5b initial checkin
penk
parents:
diff changeset
  2609
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2610
4001
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2611
canViewFile
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2612
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2613
    ^ self archiver class canViewFile and:[self hasOneSelectionInList]
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2614
!
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2615
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2616
hasListEntriesHolder
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2617
    "return/create the 'hasListEntriesHolder' value holder (automatically generated)"
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2618
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2619
    hasListEntriesHolder isNil ifTrue:[
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2620
        hasListEntriesHolder := false asValue.
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2621
    ].
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2622
    ^ hasListEntriesHolder
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2623
!
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2624
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2625
hasOneSelectionInList
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2626
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2627
    | sel |
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2628
    sel := self selectionHolder value.
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2629
    ^ (sel notNil and:[sel notEmpty and:[sel size = 1]])
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2630
!
ef0ac34526b0 archiver dont goes to extracted file
penk
parents: 3989
diff changeset
  2631
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2632
selRemoveFilesForDirs:aSel
321c1729db5b initial checkin
penk
parents:
diff changeset
  2633
321c1729db5b initial checkin
penk
parents:
diff changeset
  2634
    |stringCol newSel string|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2635
321c1729db5b initial checkin
penk
parents:
diff changeset
  2636
    stringCol := (aSel collect:[: item| item fileName]).
321c1729db5b initial checkin
penk
parents:
diff changeset
  2637
    newSel := aSel copy.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2638
    aSel do:[:item |
321c1729db5b initial checkin
penk
parents:
diff changeset
  2639
        item isDirectory ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2640
            string := item fileName.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2641
            stringCol doWithIndex:[:filename : index|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2642
                (filename ~= string and:[filename startsWith:string]) ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2643
                    newSel remove:(aSel at:index) ifAbsent:[nil].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2644
                ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  2645
            ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  2646
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2647
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2648
    ^ newSel.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2649
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2650
321c1729db5b initial checkin
penk
parents:
diff changeset
  2651
!FileApplicationNoteBook::ArchiveViewApplication methodsFor:'sorting'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2652
321c1729db5b initial checkin
penk
parents:
diff changeset
  2653
generateSortBlock:instanceName
321c1729db5b initial checkin
penk
parents:
diff changeset
  2654
321c1729db5b initial checkin
penk
parents:
diff changeset
  2655
    | aSymbol cmpOp sortCaselessLocal|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2656
321c1729db5b initial checkin
penk
parents:
diff changeset
  2657
    aSymbol := instanceName asSymbol.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2658
    sortCaselessLocal := self sortCaseless value.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2659
    currentSortOrder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2660
        currentSortOrder := aSymbol.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2661
        currentSortOrder := Dictionary new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2662
        currentSortOrder at:#column put:aSymbol.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2663
        currentSortOrder at:#reverse put:false.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2664
        currentSortOrder at:#sortCaseless put:sortCaselessLocal.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2665
    ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2666
        (currentSortOrder at:#column) = aSymbol ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2667
            "/ same column like before - change sort order
321c1729db5b initial checkin
penk
parents:
diff changeset
  2668
            | isReverse |
321c1729db5b initial checkin
penk
parents:
diff changeset
  2669
            isReverse := currentSortOrder at:#reverse.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2670
            currentSortOrder at:#reverse put:(isReverse not).
321c1729db5b initial checkin
penk
parents:
diff changeset
  2671
        ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2672
            "/ another column - remark column
321c1729db5b initial checkin
penk
parents:
diff changeset
  2673
            currentSortOrder at:#column put:aSymbol.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2674
        ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  2675
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2676
    (currentSortOrder at:#reverse) ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2677
        cmpOp := #'>'
321c1729db5b initial checkin
penk
parents:
diff changeset
  2678
    ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2679
        cmpOp := #'<'
321c1729db5b initial checkin
penk
parents:
diff changeset
  2680
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2681
    ^ [:a :b | 
321c1729db5b initial checkin
penk
parents:
diff changeset
  2682
            |entry1 entry2|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2683
321c1729db5b initial checkin
penk
parents:
diff changeset
  2684
            entry1 := (a perform:aSymbol).
321c1729db5b initial checkin
penk
parents:
diff changeset
  2685
            entry2 := (b perform:aSymbol).
321c1729db5b initial checkin
penk
parents:
diff changeset
  2686
            aSymbol = #fileName ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2687
                sortCaselessLocal ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2688
                    entry1 := entry1 asString asLowercase.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2689
                    entry2 := entry2 asString asLowercase.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2690
                ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  2691
                    entry1 := entry1 asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2692
                    entry2 := entry2 asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2693
                ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2694
            ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2695
            entry1 perform:cmpOp with:entry2
321c1729db5b initial checkin
penk
parents:
diff changeset
  2696
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  2697
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2698
321c1729db5b initial checkin
penk
parents:
diff changeset
  2699
sortList:instanceName 
321c1729db5b initial checkin
penk
parents:
diff changeset
  2700
321c1729db5b initial checkin
penk
parents:
diff changeset
  2701
321c1729db5b initial checkin
penk
parents:
diff changeset
  2702
    |sortBlock fileList sortCol|
321c1729db5b initial checkin
penk
parents:
diff changeset
  2703
321c1729db5b initial checkin
penk
parents:
diff changeset
  2704
    sortBlock := self generateSortBlock:instanceName.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2705
    fileList := self archiveFileList value.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2706
    sortCol := SortedCollection sortBlock:sortBlock.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2707
    sortCol addAll:fileList.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2708
    fileList removeAll.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2709
    fileList addAll:sortCol.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2710
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2711
321c1729db5b initial checkin
penk
parents:
diff changeset
  2712
!FileApplicationNoteBook::ArchiveViewApplication::ArchivItem methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2713
321c1729db5b initial checkin
penk
parents:
diff changeset
  2714
compressSize
321c1729db5b initial checkin
penk
parents:
diff changeset
  2715
    "return the value of the instance variable 'compressSize' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2716
321c1729db5b initial checkin
penk
parents:
diff changeset
  2717
    ^ compressSize
321c1729db5b initial checkin
penk
parents:
diff changeset
  2718
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2719
321c1729db5b initial checkin
penk
parents:
diff changeset
  2720
compressSize:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  2721
    "set the value of the instance variable 'compressSize' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2722
321c1729db5b initial checkin
penk
parents:
diff changeset
  2723
    compressSize := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2724
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2725
321c1729db5b initial checkin
penk
parents:
diff changeset
  2726
crc
321c1729db5b initial checkin
penk
parents:
diff changeset
  2727
    "return the value of the instance variable 'crc' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2728
321c1729db5b initial checkin
penk
parents:
diff changeset
  2729
    ^ crc
321c1729db5b initial checkin
penk
parents:
diff changeset
  2730
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2731
321c1729db5b initial checkin
penk
parents:
diff changeset
  2732
crc:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  2733
    "set the value of the instance variable 'crc' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2734
321c1729db5b initial checkin
penk
parents:
diff changeset
  2735
    crc := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2736
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2737
321c1729db5b initial checkin
penk
parents:
diff changeset
  2738
dateAndTime
321c1729db5b initial checkin
penk
parents:
diff changeset
  2739
    "return the value of the instance variable 'dateAndTime' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2740
321c1729db5b initial checkin
penk
parents:
diff changeset
  2741
    ^ dateAndTime
321c1729db5b initial checkin
penk
parents:
diff changeset
  2742
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2743
321c1729db5b initial checkin
penk
parents:
diff changeset
  2744
dateAndTime:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  2745
    "set the value of the instance variable 'dateAndTime' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2746
321c1729db5b initial checkin
penk
parents:
diff changeset
  2747
    dateAndTime := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2748
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2749
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2750
day:day
9402
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2751
    |ts|
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2752
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2753
    dateAndTime isNil ifTrue:[
5784
11ee27b3b78f Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents: 5745
diff changeset
  2754
        ts := Timestamp now.
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2755
    ] ifFalse:[
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2756
        ts := dateAndTime
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2757
    ].
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2758
5784
11ee27b3b78f Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents: 5745
diff changeset
  2759
    dateAndTime := Timestamp 
9402
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2760
                        year:ts year 
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2761
                        month:ts month 
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2762
                        day:day
9402
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2763
                        hour:ts hour
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2764
                        minute:ts minutes
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2765
                        second:ts minutes
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2766
!
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2767
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2768
dayString:dayString
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2769
    self day:(Integer readFrom:dayString)
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2770
!
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2771
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2772
fileName
321c1729db5b initial checkin
penk
parents:
diff changeset
  2773
    "return the value of the instance variable 'fileName' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2774
321c1729db5b initial checkin
penk
parents:
diff changeset
  2775
    ^ fileName
321c1729db5b initial checkin
penk
parents:
diff changeset
  2776
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2777
321c1729db5b initial checkin
penk
parents:
diff changeset
  2778
fileName:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  2779
    "set the value of the instance variable 'fileName' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2780
321c1729db5b initial checkin
penk
parents:
diff changeset
  2781
    fileName := something withoutSpaces.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2782
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2783
321c1729db5b initial checkin
penk
parents:
diff changeset
  2784
icon
321c1729db5b initial checkin
penk
parents:
diff changeset
  2785
    "return the value of the instance variable 'icon' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2786
321c1729db5b initial checkin
penk
parents:
diff changeset
  2787
    ^ icon
321c1729db5b initial checkin
penk
parents:
diff changeset
  2788
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2789
321c1729db5b initial checkin
penk
parents:
diff changeset
  2790
icon:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  2791
    "set the value of the instance variable 'icon' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2792
321c1729db5b initial checkin
penk
parents:
diff changeset
  2793
    icon := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2794
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2795
321c1729db5b initial checkin
penk
parents:
diff changeset
  2796
isDirectory
321c1729db5b initial checkin
penk
parents:
diff changeset
  2797
    "return the value of the instance variable 'directory' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2798
321c1729db5b initial checkin
penk
parents:
diff changeset
  2799
    ^ isDirectory
321c1729db5b initial checkin
penk
parents:
diff changeset
  2800
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2801
321c1729db5b initial checkin
penk
parents:
diff changeset
  2802
isDirectory:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  2803
    "set the value of the instance variable 'isDirectory' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2804
321c1729db5b initial checkin
penk
parents:
diff changeset
  2805
    isDirectory := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2806
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2807
321c1729db5b initial checkin
penk
parents:
diff changeset
  2808
method
321c1729db5b initial checkin
penk
parents:
diff changeset
  2809
    "return the value of the instance variable 'method' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2810
321c1729db5b initial checkin
penk
parents:
diff changeset
  2811
    ^ method
321c1729db5b initial checkin
penk
parents:
diff changeset
  2812
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2813
321c1729db5b initial checkin
penk
parents:
diff changeset
  2814
method:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  2815
    "set the value of the instance variable 'method' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2816
321c1729db5b initial checkin
penk
parents:
diff changeset
  2817
    method := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2818
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2819
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2820
month:month
9402
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2821
    |ts|
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2822
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2823
    dateAndTime isNil ifTrue:[
5784
11ee27b3b78f Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents: 5745
diff changeset
  2824
        ts := Timestamp now.
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2825
    ] ifFalse:[
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2826
        ts := dateAndTime
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2827
    ].
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2828
5784
11ee27b3b78f Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents: 5745
diff changeset
  2829
    dateAndTime := Timestamp 
9402
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2830
                        year:ts year 
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2831
                        month:month 
9402
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2832
                        day:ts day
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2833
                        hour:ts hour
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2834
                        minute:ts minutes
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2835
                        second:ts minutes
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2836
!
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2837
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2838
monthName:monthName
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2839
    self month:(Date indexOfMonth:monthName)
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2840
!
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2841
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2842
ownerGroup
321c1729db5b initial checkin
penk
parents:
diff changeset
  2843
    "return the value of the instance variable 'owner' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2844
321c1729db5b initial checkin
penk
parents:
diff changeset
  2845
    ^ ownerGroup
321c1729db5b initial checkin
penk
parents:
diff changeset
  2846
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2847
321c1729db5b initial checkin
penk
parents:
diff changeset
  2848
ownerGroup:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  2849
    "set the value of the instance variable 'owner' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2850
321c1729db5b initial checkin
penk
parents:
diff changeset
  2851
    ownerGroup := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2852
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2853
321c1729db5b initial checkin
penk
parents:
diff changeset
  2854
permissions
321c1729db5b initial checkin
penk
parents:
diff changeset
  2855
    "return the value of the instance variable 'permissions' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2856
321c1729db5b initial checkin
penk
parents:
diff changeset
  2857
    ^ permissions
321c1729db5b initial checkin
penk
parents:
diff changeset
  2858
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2859
321c1729db5b initial checkin
penk
parents:
diff changeset
  2860
permissions:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  2861
    "set the value of the instance variable 'permissions' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2862
321c1729db5b initial checkin
penk
parents:
diff changeset
  2863
    permissions := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2864
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2865
321c1729db5b initial checkin
penk
parents:
diff changeset
  2866
ratio
321c1729db5b initial checkin
penk
parents:
diff changeset
  2867
    "return the value of the instance variable 'ratio' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2868
321c1729db5b initial checkin
penk
parents:
diff changeset
  2869
    ^ ratio
321c1729db5b initial checkin
penk
parents:
diff changeset
  2870
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2871
321c1729db5b initial checkin
penk
parents:
diff changeset
  2872
ratio:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  2873
    "set the value of the instance variable 'ratio' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2874
321c1729db5b initial checkin
penk
parents:
diff changeset
  2875
    ratio := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2876
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2877
321c1729db5b initial checkin
penk
parents:
diff changeset
  2878
size
321c1729db5b initial checkin
penk
parents:
diff changeset
  2879
    "return the value of the instance variable 'size' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2880
321c1729db5b initial checkin
penk
parents:
diff changeset
  2881
    ^ size
321c1729db5b initial checkin
penk
parents:
diff changeset
  2882
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2883
321c1729db5b initial checkin
penk
parents:
diff changeset
  2884
size:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  2885
    "set the value of the instance variable 'size' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2886
321c1729db5b initial checkin
penk
parents:
diff changeset
  2887
    size := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2888
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2889
321c1729db5b initial checkin
penk
parents:
diff changeset
  2890
sizeAsNumber
321c1729db5b initial checkin
penk
parents:
diff changeset
  2891
    "return the value of the instance variable 'size' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2893
    ^ size asInteger
321c1729db5b initial checkin
penk
parents:
diff changeset
  2894
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2895
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2896
time:time
9402
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2897
    |ts|
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2898
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2899
    dateAndTime isNil ifTrue:[
5784
11ee27b3b78f Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents: 5745
diff changeset
  2900
        ts := Timestamp now.
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2901
    ] ifFalse:[
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2902
        ts := dateAndTime
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2903
    ].
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2904
5784
11ee27b3b78f Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents: 5745
diff changeset
  2905
    dateAndTime := Timestamp 
9402
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2906
                        year:ts day 
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2907
                        month:ts day 
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2908
                        day:ts day
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2909
                        hour:time hours
9402
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2910
                        minute:time minutes
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2911
                        second:time seconds
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2912
!
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2913
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2914
timeString:timeString
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2915
    self time:(Time readFrom:timeString)
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2916
!
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2917
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2918
type
321c1729db5b initial checkin
penk
parents:
diff changeset
  2919
    "return the value of the instance variable 'type' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2920
321c1729db5b initial checkin
penk
parents:
diff changeset
  2921
    ^ type
321c1729db5b initial checkin
penk
parents:
diff changeset
  2922
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2923
321c1729db5b initial checkin
penk
parents:
diff changeset
  2924
type:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  2925
    "set the value of the instance variable 'type' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2926
321c1729db5b initial checkin
penk
parents:
diff changeset
  2927
    type := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  2928
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2929
321c1729db5b initial checkin
penk
parents:
diff changeset
  2930
version
321c1729db5b initial checkin
penk
parents:
diff changeset
  2931
    "return the value of the instance variable 'version' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2932
321c1729db5b initial checkin
penk
parents:
diff changeset
  2933
    ^ version
321c1729db5b initial checkin
penk
parents:
diff changeset
  2934
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2935
321c1729db5b initial checkin
penk
parents:
diff changeset
  2936
version:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  2937
    "set the value of the instance variable 'version' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  2938
321c1729db5b initial checkin
penk
parents:
diff changeset
  2939
    version := something.
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2940
!
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2941
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2942
year:year
9402
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2943
    |ts|
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2944
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2945
    dateAndTime isNil ifTrue:[
5784
11ee27b3b78f Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents: 5745
diff changeset
  2946
        ts := Timestamp now.
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2947
    ] ifFalse:[
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2948
        ts := dateAndTime
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2949
    ].
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2950
5784
11ee27b3b78f Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents: 5745
diff changeset
  2951
    dateAndTime := Timestamp 
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2952
                        year:year 
9402
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2953
                        month:ts month 
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2954
                        day:ts day
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2955
                        hour:ts hour
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2956
                        minute:ts minutes
74b2643f677b Do not use obsolete methods
Stefan Vogel <sv@exept.de>
parents: 9399
diff changeset
  2957
                        second:ts minutes
5414
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2958
!
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2959
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2960
yearString:yearString
41ac318add1f more initializers
Claus Gittinger <cg@exept.de>
parents: 5413
diff changeset
  2961
    self year:(Integer readFrom:yearString)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2962
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2963
321c1729db5b initial checkin
penk
parents:
diff changeset
  2964
!FileApplicationNoteBook::ArchiveViewApplication::ArchivItem methodsFor:'printing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2965
8002
031dca544927 Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents: 7970
diff changeset
  2966
printOn:aStream
031dca544927 Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents: 7970
diff changeset
  2967
    aStream nextPutAll:self fileName asString
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2968
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2969
321c1729db5b initial checkin
penk
parents:
diff changeset
  2970
!FileApplicationNoteBook::ArchiveViewApplication::ArchivItem methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2971
321c1729db5b initial checkin
penk
parents:
diff changeset
  2972
hasDirectoryPart
321c1729db5b initial checkin
penk
parents:
diff changeset
  2973
321c1729db5b initial checkin
penk
parents:
diff changeset
  2974
    ^ self fileName asFilename components size ~= 1
321c1729db5b initial checkin
penk
parents:
diff changeset
  2975
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2976
321c1729db5b initial checkin
penk
parents:
diff changeset
  2977
!FileApplicationNoteBook::CommandResult class methodsFor:'defaults'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2978
321c1729db5b initial checkin
penk
parents:
diff changeset
  2979
tabStringFor:aApplicationType
7687
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  2980
    "the formatString shown in a tab (language translated)"
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  2981
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  2982
    ^ 'Command Output'
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  2983
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  2984
    "Modified: / 01-03-2007 / 21:43:31 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2985
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2986
321c1729db5b initial checkin
penk
parents:
diff changeset
  2987
wantNewApplicationAnyway
321c1729db5b initial checkin
penk
parents:
diff changeset
  2988
321c1729db5b initial checkin
penk
parents:
diff changeset
  2989
    ^ false
321c1729db5b initial checkin
penk
parents:
diff changeset
  2990
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2991
321c1729db5b initial checkin
penk
parents:
diff changeset
  2992
!FileApplicationNoteBook::CommandResult class methodsFor:'interface specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2993
321c1729db5b initial checkin
penk
parents:
diff changeset
  2994
windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  2995
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  2996
     by the UIPainter of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  2997
321c1729db5b initial checkin
penk
parents:
diff changeset
  2998
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  2999
     the UIPainter may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  3000
321c1729db5b initial checkin
penk
parents:
diff changeset
  3001
    "
4169
ff1be729f504 progressIndicator added
penk
parents: 4161
diff changeset
  3002
     UIPainter new openOnClass:FileApplicationNoteBook::CommandResult andSelector:#windowSpec
ff1be729f504 progressIndicator added
penk
parents: 4161
diff changeset
  3003
     FileApplicationNoteBook::CommandResult new openInterface:#windowSpec
ff1be729f504 progressIndicator added
penk
parents: 4161
diff changeset
  3004
     FileApplicationNoteBook::CommandResult open
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3005
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  3006
321c1729db5b initial checkin
penk
parents:
diff changeset
  3007
    <resource: #canvas>
321c1729db5b initial checkin
penk
parents:
diff changeset
  3008
321c1729db5b initial checkin
penk
parents:
diff changeset
  3009
    ^ 
321c1729db5b initial checkin
penk
parents:
diff changeset
  3010
     #(#FullSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3011
        #name: #windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3012
        #window: 
321c1729db5b initial checkin
penk
parents:
diff changeset
  3013
       #(#WindowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3014
          #label: 'NoteBookApplication::CommandResult'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3015
          #name: 'NoteBookApplication::CommandResult'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3016
          #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
  3017
          #bounds: #(#Rectangle 220 193 723 546)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3018
          #menu: #mainMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
  3019
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3020
        #component: 
321c1729db5b initial checkin
penk
parents:
diff changeset
  3021
       #(#SpecCollection
321c1729db5b initial checkin
penk
parents:
diff changeset
  3022
          #collection: #(
321c1729db5b initial checkin
penk
parents:
diff changeset
  3023
           #(#MenuPanelSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3024
              #name: 'ToolBar1'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3025
              #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
  3026
              #level: 0
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3027
              #menu: #menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  3028
              #textDefault: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  3029
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3030
           #(#ArbitraryComponentSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3031
              #name: 'ArbitraryComponent1'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3032
              #layout: #(#LayoutFrame 0 0.0 32 0 0 1.0 0 1)
321c1729db5b initial checkin
penk
parents:
diff changeset
  3033
              #hasHorizontalScrollBar: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  3034
              #hasVerticalScrollBar: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  3035
              #hasBorder: false
321c1729db5b initial checkin
penk
parents:
diff changeset
  3036
              #component: #TextCollector
321c1729db5b initial checkin
penk
parents:
diff changeset
  3037
              #postBuildCallback: #postBuildTextCollector:
321c1729db5b initial checkin
penk
parents:
diff changeset
  3038
            )
4169
ff1be729f504 progressIndicator added
penk
parents: 4161
diff changeset
  3039
           #(#ProgressIndicatorSpec
ff1be729f504 progressIndicator added
penk
parents: 4161
diff changeset
  3040
              #name: 'ProgressIndicator1'
ff1be729f504 progressIndicator added
penk
parents: 4161
diff changeset
  3041
              #layout: #(#LayoutFrame 125 0 11 0 231 0 21 0)
4180
e3e587a5fe65 change the window label
penk
parents: 4177
diff changeset
  3042
              #visibilityChannel: #enableStopButton
4169
ff1be729f504 progressIndicator added
penk
parents: 4161
diff changeset
  3043
              #backgroundColor: #(#Color 0.0 66.9993 66.9993)
ff1be729f504 progressIndicator added
penk
parents: 4161
diff changeset
  3044
              #showPercentage: false
ff1be729f504 progressIndicator added
penk
parents: 4161
diff changeset
  3045
              #isActivityIndicator: true
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3046
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3047
           )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3048
         
321c1729db5b initial checkin
penk
parents:
diff changeset
  3049
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3050
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3051
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3052
321c1729db5b initial checkin
penk
parents:
diff changeset
  3053
!FileApplicationNoteBook::CommandResult class methodsFor:'menu specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3054
321c1729db5b initial checkin
penk
parents:
diff changeset
  3055
menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  3056
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  3057
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  3058
321c1729db5b initial checkin
penk
parents:
diff changeset
  3059
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  3060
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  3061
321c1729db5b initial checkin
penk
parents:
diff changeset
  3062
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  3063
     MenuEditor new openOnClass:FileApplicationNoteBook::CommandResult andSelector:#menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  3064
     (Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::CommandResult menu)) startUp
321c1729db5b initial checkin
penk
parents:
diff changeset
  3065
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  3066
321c1729db5b initial checkin
penk
parents:
diff changeset
  3067
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
  3068
321c1729db5b initial checkin
penk
parents:
diff changeset
  3069
    ^ 
321c1729db5b initial checkin
penk
parents:
diff changeset
  3070
     #(#Menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  3071
        #(
321c1729db5b initial checkin
penk
parents:
diff changeset
  3072
         #(#MenuItem
321c1729db5b initial checkin
penk
parents:
diff changeset
  3073
            #label: 'Stop'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3074
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  3075
            #isButton: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  3076
            #nameKey: #Stop
321c1729db5b initial checkin
penk
parents:
diff changeset
  3077
            #value: #doStopProcess
321c1729db5b initial checkin
penk
parents:
diff changeset
  3078
            #enabled: #enableStopButton
321c1729db5b initial checkin
penk
parents:
diff changeset
  3079
            #labelImage: #(#ResourceRetriever #ToolbarIconLibrary #stop22x22Icon 'Stop')
321c1729db5b initial checkin
penk
parents:
diff changeset
  3080
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3081
         #(#MenuItem
6100
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3082
            #activeHelpKey: #closeTabButton
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3083
            #label: 'Close'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3084
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  3085
            #isButton: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  3086
            #nameKey: #Close
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  3087
            #isVisible: #closeButtonShown
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3088
            #startGroup: #right
321c1729db5b initial checkin
penk
parents:
diff changeset
  3089
            #value: #doClose
6093
cab3a82eaa34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6091
diff changeset
  3090
            #labelImage: #(#ResourceRetriever #ToolbarIconLibrary #removeTabIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3091
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3092
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3093
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  3094
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  3095
      )
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  3096
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  3097
    "Modified: / 12-01-2012 / 00:33:56 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3098
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3099
321c1729db5b initial checkin
penk
parents:
diff changeset
  3100
!FileApplicationNoteBook::CommandResult methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3101
321c1729db5b initial checkin
penk
parents:
diff changeset
  3102
resultStream
321c1729db5b initial checkin
penk
parents:
diff changeset
  3103
    "return the value of the instance variable 'resultStream' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  3104
321c1729db5b initial checkin
penk
parents:
diff changeset
  3105
    ^ resultStream
321c1729db5b initial checkin
penk
parents:
diff changeset
  3106
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3107
321c1729db5b initial checkin
penk
parents:
diff changeset
  3108
resultStream:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  3109
    "set the value of the instance variable 'resultStream' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  3110
321c1729db5b initial checkin
penk
parents:
diff changeset
  3111
    resultStream := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3112
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3113
321c1729db5b initial checkin
penk
parents:
diff changeset
  3114
!FileApplicationNoteBook::CommandResult methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3115
321c1729db5b initial checkin
penk
parents:
diff changeset
  3116
changeTabTo:aString 
321c1729db5b initial checkin
penk
parents:
diff changeset
  3117
321c1729db5b initial checkin
penk
parents:
diff changeset
  3118
    | masterApplication |
321c1729db5b initial checkin
penk
parents:
diff changeset
  3119
321c1729db5b initial checkin
penk
parents:
diff changeset
  3120
    masterApplication := self masterApplication.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3121
    masterApplication isNil ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  3122
        masterApplication tabStringChangeTo:aString for:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3123
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  3124
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3125
321c1729db5b initial checkin
penk
parents:
diff changeset
  3126
doStopProcess
321c1729db5b initial checkin
penk
parents:
diff changeset
  3127
321c1729db5b initial checkin
penk
parents:
diff changeset
  3128
    | myProcess |
321c1729db5b initial checkin
penk
parents:
diff changeset
  3129
321c1729db5b initial checkin
penk
parents:
diff changeset
  3130
    myProcess := self process value.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3131
    myProcess notNil ifTrue:[
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4520
diff changeset
  3132
        self notify:('kill ', myProcess name).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3133
        myProcess terminate.    
321c1729db5b initial checkin
penk
parents:
diff changeset
  3134
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  3135
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3136
321c1729db5b initial checkin
penk
parents:
diff changeset
  3137
!FileApplicationNoteBook::CommandResult methodsFor:'aspects'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3138
321c1729db5b initial checkin
penk
parents:
diff changeset
  3139
enableStopButton
321c1729db5b initial checkin
penk
parents:
diff changeset
  3140
321c1729db5b initial checkin
penk
parents:
diff changeset
  3141
    enableStopButton isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  3142
        enableStopButton := false asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3143
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  3144
    ^ enableStopButton
321c1729db5b initial checkin
penk
parents:
diff changeset
  3145
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3146
321c1729db5b initial checkin
penk
parents:
diff changeset
  3147
process
321c1729db5b initial checkin
penk
parents:
diff changeset
  3148
    "return/create the 'process' value holder (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  3149
321c1729db5b initial checkin
penk
parents:
diff changeset
  3150
    process isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  3151
        process := ValueHolder new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3152
        process addDependent:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3153
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  3154
    ^ process
321c1729db5b initial checkin
penk
parents:
diff changeset
  3155
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3156
321c1729db5b initial checkin
penk
parents:
diff changeset
  3157
!FileApplicationNoteBook::CommandResult methodsFor:'change & update'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3158
321c1729db5b initial checkin
penk
parents:
diff changeset
  3159
update:something with:aParameter from:changedObject
321c1729db5b initial checkin
penk
parents:
diff changeset
  3160
    changedObject == self process ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  3161
        self enableStopButton value:changedObject value notNil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3162
        ^ self
321c1729db5b initial checkin
penk
parents:
diff changeset
  3163
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  3164
    super update:something with:aParameter from:changedObject
321c1729db5b initial checkin
penk
parents:
diff changeset
  3165
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3166
321c1729db5b initial checkin
penk
parents:
diff changeset
  3167
!FileApplicationNoteBook::CommandResult methodsFor:'initialization & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3168
321c1729db5b initial checkin
penk
parents:
diff changeset
  3169
postBuildTextCollector:aBuilder
321c1729db5b initial checkin
penk
parents:
diff changeset
  3170
321c1729db5b initial checkin
penk
parents:
diff changeset
  3171
    self resultStream:aBuilder scrolledView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3172
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3173
321c1729db5b initial checkin
penk
parents:
diff changeset
  3174
postOpenWith:aBuilder
321c1729db5b initial checkin
penk
parents:
diff changeset
  3175
    "This is a hook method generated by the Browser.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3176
     It will be invoked right after the applications window has been opened.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3177
     Add any app-specific actions here (starting background processes etc.).
321c1729db5b initial checkin
penk
parents:
diff changeset
  3178
     See also #postBuildWith:, which is invoked before opening."
321c1729db5b initial checkin
penk
parents:
diff changeset
  3179
321c1729db5b initial checkin
penk
parents:
diff changeset
  3180
    "/ add any code here ...
321c1729db5b initial checkin
penk
parents:
diff changeset
  3181
321c1729db5b initial checkin
penk
parents:
diff changeset
  3182
    self masterApplication isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  3183
        self masterApplication:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3184
    ].
6626
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  3185
    super postOpenWith:aBuilder
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3186
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3187
321c1729db5b initial checkin
penk
parents:
diff changeset
  3188
release
321c1729db5b initial checkin
penk
parents:
diff changeset
  3189
321c1729db5b initial checkin
penk
parents:
diff changeset
  3190
    self doStopProcess.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3191
    ^ super release
321c1729db5b initial checkin
penk
parents:
diff changeset
  3192
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3193
321c1729db5b initial checkin
penk
parents:
diff changeset
  3194
!FileApplicationNoteBook::CommandResult methodsFor:'printing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3195
8002
031dca544927 Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents: 7970
diff changeset
  3196
printOn:aStream
031dca544927 Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents: 7970
diff changeset
  3197
    aStream nextPutAll:'CommandResult Application'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3198
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3199
7909
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3200
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'defaults'!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3201
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3202
tabStringFor:anApplicationType
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3203
    "the formatString shown in a tab (language translated)"
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3204
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3205
    ^ 'Note in %1'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3206
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3207
    "Modified: / 01-03-2007 / 21:43:23 / cg"
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3208
! !
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3209
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3210
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'documentation'!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3211
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3212
documentation
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3213
"
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3214
    a previewer-plugin for digital-notepad recordings as
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3215
    provided by the waltop (tevion) MD85276 digital ink notepad.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3216
"
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3217
! !
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3218
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3219
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'help specs'!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3220
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3221
flyByHelpSpec
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3222
    "This resource specification was automatically generated
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3223
     by the UIHelpTool of ST/X."
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3224
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3225
    "Do not manually edit this!! If it is corrupted,
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3226
     the UIHelpTool may not be able to read the specification."
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3227
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3228
    "
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3229
     UIHelpTool openOnClass:FileApplicationNoteBook::HtmlViewApplication    
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3230
    "
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3231
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3232
    <resource: #help>
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3233
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3234
    ^ super flyByHelpSpec addPairsFrom:#(
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3235
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3236
#'fitImageSize'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3237
'Shrink to Fit View'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3238
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3239
)
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3240
! !
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3241
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3242
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'interface specs'!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3243
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3244
windowSpec
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3245
    "This resource specification was automatically generated
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3246
     by the UIPainter of ST/X."
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3247
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3248
    "Do not manually edit this!! If it is corrupted,
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3249
     the UIPainter may not be able to read the specification."
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3250
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3251
    "
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3252
     UIPainter new openOnClass:FileApplicationNoteBook::DigitalNotepadFileViewApplication andSelector:#windowSpec
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3253
     FileApplicationNoteBook::DigitalNotepadFileViewApplication new openInterface:#windowSpec
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3254
     FileApplicationNoteBook::DigitalNotepadFileViewApplication open
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3255
    "
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3256
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3257
    <resource: #canvas>
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3258
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3259
    ^ 
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3260
     #(FullSpec
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3261
        name: windowSpec
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3262
        window: 
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3263
       (WindowSpec
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3264
          label: 'NotepadViewer'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3265
          name: 'NotepadViewer'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3266
          min: (Point 10 10)
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3267
          bounds: (Rectangle 0 0 676 492)
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3268
          menu: mainMenu
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3269
        )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3270
        component: 
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3271
       (SpecCollection
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3272
          collection: (
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3273
           (MenuPanelSpec
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3274
              name: 'Menu'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3275
              layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3276
              level: 0
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3277
              visibilityChannel: isEmbeddedApplication
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3278
              menu: menu
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3279
              textDefault: true
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3280
            )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3281
           (ArbitraryComponentSpec
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3282
              name: 'TOPFileView'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3283
              layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0)
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3284
              hasHorizontalScrollBar: true
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3285
              hasVerticalScrollBar: true
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3286
              miniScrollerHorizontal: false
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3287
              miniScrollerVertical: false
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3288
              hasBorder: false
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3289
              component: TOPFileViewer
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3290
              postBuildCallback: postBuildImageView:
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3291
            )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3292
           )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3293
         
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3294
        )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3295
      )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3296
! !
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3297
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3298
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'menu specs'!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3299
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3300
menu
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3301
    "This resource specification was automatically generated
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3302
     by the MenuEditor of ST/X."
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3303
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3304
    "Do not manually edit this!! If it is corrupted,
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3305
     the MenuEditor may not be able to read the specification."
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3306
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3307
    "
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3308
     MenuEditor new openOnClass:FileApplicationNoteBook::ImageViewApplication andSelector:#menu
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3309
     (Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ImageViewApplication menu)) startUp
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3310
    "
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3311
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3312
    <resource: #menu>
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3313
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3314
    ^ 
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3315
     #(#Menu
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3316
        #(
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3317
"/         #(#MenuItem
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3318
"/            #label: 'Edit'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3319
"/            #itemValue: #editImage
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3320
"/            #nameKey: #EditImage
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3321
"/            #translateLabel: true
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3322
"/            #isButton: true
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3323
"/            #labelImage: #(#ResourceRetriever #ToolbarIconLibrary #startImageEditorIcon)
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3324
"/          )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3325
"/         #(#MenuItem
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3326
"/            #label: '-'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3327
"/          )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3328
         #(#MenuItem
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3329
            #activeHelpKey: #fitImageSize
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3330
            #label: 'FitSize'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3331
            #translateLabel: true
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3332
            #isButton: true
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3333
            #triggerOnDown: true
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3334
            #indication: #fitSize
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3335
            #labelImage: #(#ResourceRetriever #ToolbarIconLibrary #fitImageSizeToViewIcon)
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3336
          )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3337
         #(#MenuItem
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3338
            #label: '-'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3339
          )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3340
         #(#MenuItem
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3341
            #activeHelpKey: #closeTabButton
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3342
            #label: 'Close'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3343
            #itemValue: #doClose
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3344
            #translateLabel: true
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3345
            #isButton: true
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3346
            #startGroup: #right
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3347
            #hideMenuOnActivated: false
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3348
            #labelImage: #(#ResourceRetriever #ToolbarIconLibrary #removeTabIcon)
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3349
          )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3350
         )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3351
        nil
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3352
        nil
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3353
      )
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3354
! !
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3355
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3356
!FileApplicationNoteBook::DigitalNotepadFileViewApplication class methodsFor:'queries'!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3357
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3358
canOpenItem:anItem
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3359
    ^ anItem mimeType = 'application/x-waltop-digital-notepad'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3360
!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3361
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3362
wantNewApplicationAnyway
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3363
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3364
    ^ false
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3365
! !
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3366
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3367
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'accessing'!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3368
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3369
imageView
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3370
    ^ imageView
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3371
!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3372
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3373
imageView:something
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3374
    imageView := something.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3375
!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3376
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3377
updateImageInfo
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3378
"/    |fn msg|
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3379
"/
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3380
"/    image notNil ifTrue:[
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3381
"/        fn := image fileName.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3382
"/        fn isNil ifTrue:[
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3383
"/            fn := 'unnamed'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3384
"/        ] ifFalse:[
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3385
"/            fn :=  fn asFilename baseName.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3386
"/        ].
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3387
"/        msg := '%1  %2x%3 depth:%4'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3388
"/                bindWith:fn allBold
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3389
"/                with:image width
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3390
"/                with:image height
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3391
"/                with:image depth.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3392
"/    ].
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3393
"/    self notify:msg.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3394
! !
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3395
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3396
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'actions'!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3397
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3398
changeItem:anItem
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3399
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3400
    self item:anItem.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3401
    self setupImageView.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3402
    ^ true
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3403
!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3404
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3405
setupImageView
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3406
    imageView readFile:self fileName
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3407
! !
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3408
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3409
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'aspects'!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3410
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3411
fitSize
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3412
    "return/create the 'fitSize' value holder (automatically generated)"
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3413
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3414
    fitSize isNil ifTrue:[
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3415
        fitSize := ValueHolder new.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3416
        fitSize addDependent:self.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3417
    ].
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3418
    ^ fitSize
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3419
! !
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3420
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3421
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'change & update'!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3422
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3423
update:something with:aParameter from:changedObject
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3424
    changedObject == self fitSize ifTrue:[
7910
cd3856f32730 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7909
diff changeset
  3425
        changedObject value ifTrue:[
cd3856f32730 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7909
diff changeset
  3426
            imageView adjust:#fit.
cd3856f32730 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7909
diff changeset
  3427
        ] ifFalse:[
cd3856f32730 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7909
diff changeset
  3428
            imageView adjust:nil.
cd3856f32730 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7909
diff changeset
  3429
        ].
7909
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3430
        ^ self
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3431
    ].
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3432
    super update:something with:aParameter from:changedObject
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3433
! !
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3434
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3435
!FileApplicationNoteBook::DigitalNotepadFileViewApplication methodsFor:'initialization & release'!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3436
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3437
postBuildImageView:aWidget
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3438
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3439
    self imageView: aWidget scrolledView.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3440
"/    self imageView wantsFocusWithPointerEnter.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3441
!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3442
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3443
postOpenWith:aBuilder 
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3444
    "only invoked if the application is not started from a master"
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3445
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3446
    |currentDir contents fileName|
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3447
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3448
    self masterApplication isNil ifTrue:[
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3449
        self masterApplication:nil.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3450
        currentDir := Filename currentDirectory.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3451
        contents := currentDir directoryContents.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3452
        fileName := contents 
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3453
                    detect:[:file | 
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3454
                        file asFilename mimeTypeOfContents = 'application/x-waltop-digital-notepad'
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3455
                    ]
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3456
                    ifNone:[nil].
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3457
        fileName isNil ifTrue:[
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3458
            Dialog warn:'Cant find a TOP-file in ' , currentDir asString.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3459
            ^ self
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3460
        ].
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3461
        self item:(DirectoryContentsBrowser itemClass fileName:(currentDir construct:fileName))
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3462
    ].
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3463
    self setupImageView.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3464
    super postOpenWith:aBuilder
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3465
! !
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3466
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3467
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'defaults'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3468
321c1729db5b initial checkin
penk
parents:
diff changeset
  3469
tabStringFor:aApplicationType
7687
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  3470
    "the formatString shown in a tab (language translated)"
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  3471
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  3472
    ^ 'HTML View for %1'
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  3473
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  3474
    "Modified: / 01-03-2007 / 21:43:18 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3475
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3476
5406
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3477
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'help specs'!
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3478
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3479
helpSpec
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3480
    "This resource specification was automatically generated
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3481
     by the UIHelpTool of ST/X."
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3482
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3483
    "Do not manually edit this!! If it is corrupted,
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3484
     the UIHelpTool may not be able to read the specification."
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3485
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3486
    "
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3487
     UIHelpTool openOnClass:FileApplicationNoteBook::HtmlViewApplication    
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3488
    "
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3489
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3490
    <resource: #help>
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3491
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3492
    ^ super helpSpec addPairsFrom:#(
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3493
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3494
#'Edit Source'
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3495
''
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3496
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3497
)
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3498
! !
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3499
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3500
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'interface specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3501
321c1729db5b initial checkin
penk
parents:
diff changeset
  3502
windowSpec
10566
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3503
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3504
    | webKitView |
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3505
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3506
    ^((webKitView := (Smalltalk at:#WebKitView)) notNil 
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3507
        and:[webKitView isAvailable])
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3508
        ifTrue:[self windowSpec_WebBrowserPage]
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3509
        ifFalse:[self windowSpec_HTMLView]
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3510
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3511
    "Modified: / 11-08-2011 / 00:33:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3512
!
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3513
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3514
windowSpec_HTMLView
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3515
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  3516
     by the UIPainter of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  3517
321c1729db5b initial checkin
penk
parents:
diff changeset
  3518
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  3519
     the UIPainter may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  3520
321c1729db5b initial checkin
penk
parents:
diff changeset
  3521
    "
4336
b4228ddf2183 change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents: 4293
diff changeset
  3522
     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
  3523
     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
  3524
     FileApplicationNoteBook::HtmlViewApplication open
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3525
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  3526
321c1729db5b initial checkin
penk
parents:
diff changeset
  3527
    <resource: #canvas>
321c1729db5b initial checkin
penk
parents:
diff changeset
  3528
321c1729db5b initial checkin
penk
parents:
diff changeset
  3529
    ^ 
321c1729db5b initial checkin
penk
parents:
diff changeset
  3530
     #(#FullSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3531
        #name: #windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3532
        #window: 
321c1729db5b initial checkin
penk
parents:
diff changeset
  3533
       #(#WindowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3534
          #label: 'NoteBookApplication::HtmlView'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3535
          #name: 'NoteBookApplication::HtmlView'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3536
          #min: #(#Point 10 10)
321c1729db5b initial checkin
penk
parents:
diff changeset
  3537
          #bounds: #(#Rectangle 16 42 692 534)
321c1729db5b initial checkin
penk
parents:
diff changeset
  3538
          #menu: #mainMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
  3539
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3540
        #component: 
321c1729db5b initial checkin
penk
parents:
diff changeset
  3541
       #(#SpecCollection
321c1729db5b initial checkin
penk
parents:
diff changeset
  3542
          #collection: #(
321c1729db5b initial checkin
penk
parents:
diff changeset
  3543
           #(#MenuPanelSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3544
              #name: 'MenuHtml'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3545
              #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
  3546
              #level: 0
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3547
              #visibilityChannel: #isEmbeddedApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
  3548
              #menu: #menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  3549
              #textDefault: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  3550
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3551
           #(#ArbitraryComponentSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3552
              #name: 'HTMLView'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3553
              #layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1)
321c1729db5b initial checkin
penk
parents:
diff changeset
  3554
              #hasHorizontalScrollBar: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  3555
              #hasVerticalScrollBar: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  3556
              #miniScrollerHorizontal: false
321c1729db5b initial checkin
penk
parents:
diff changeset
  3557
              #miniScrollerVertical: false
321c1729db5b initial checkin
penk
parents:
diff changeset
  3558
              #hasBorder: false
321c1729db5b initial checkin
penk
parents:
diff changeset
  3559
              #component: #HTMLDocumentView
321c1729db5b initial checkin
penk
parents:
diff changeset
  3560
              #postBuildCallback: #postBuildHtmlView:
321c1729db5b initial checkin
penk
parents:
diff changeset
  3561
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3562
           #(#LabelSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3563
              #label: 'FileLabel'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3564
              #name: 'FileLabel'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3565
              #layout: #(#LayoutFrame 212 0 2 0 -73 1 30 0)
321c1729db5b initial checkin
penk
parents:
diff changeset
  3566
              #level: -1
321c1729db5b initial checkin
penk
parents:
diff changeset
  3567
              #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  3568
              #labelChannel: #labelHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  3569
              #adjust: #left
321c1729db5b initial checkin
penk
parents:
diff changeset
  3570
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3571
           )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3572
         
321c1729db5b initial checkin
penk
parents:
diff changeset
  3573
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3574
      )
10566
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3575
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3576
    "Created: / 11-08-2011 / 00:19:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3577
!
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3578
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3579
windowSpec_WebBrowserPage
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3580
    "This resource specification was automatically generated
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3581
     by the UIPainter of ST/X."
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3582
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3583
    "Do not manually edit this!! If it is corrupted,
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3584
     the UIPainter may not be able to read the specification."
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3585
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3586
    "
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3587
     UIPainter new openOnClass:FileApplicationNoteBook::HtmlViewApplication andSelector:#windowSpec_WebBrowserPage
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3588
     FileApplicationNoteBook::HtmlViewApplication new openInterface:#windowSpec_WebBrowserPage
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3589
    "
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3590
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3591
    <resource: #canvas>
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3592
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3593
    ^ 
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3594
     #(FullSpec
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3595
        name: #'windowSpec_WebBrowserPage'
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3596
        window: 
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3597
       (WindowSpec
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3598
          label: 'NoteBookApplication::HtmlView'
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3599
          name: 'NoteBookApplication::HtmlView'
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3600
          min: (Point 10 10)
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3601
          bounds: (Rectangle 0 0 676 492)
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3602
          menu: menuJustClose
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3603
        )
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3604
        component: 
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3605
       (SpecCollection
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3606
          collection: (
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3607
           (MenuPanelSpec
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3608
              name: 'MenuClose'
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3609
              layout: (LayoutFrame -25 1 0 0 0 1.0 30 0)
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3610
              level: 0
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3611
              visibilityChannel: isEmbeddedApplication
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3612
              menu: menuJustClose
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3613
              textDefault: true
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3614
            )
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3615
           (SubCanvasSpec
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3616
              name: 'ToolBar'
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3617
              layout: (LayoutFrame 0 0 0 0 -25 1 30 0)
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3618
              hasHorizontalScrollBar: false
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3619
              hasVerticalScrollBar: false
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3620
              minorKey: toolBarSpec
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3621
              clientKey: webBrowserPage
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3622
              createNewBuilder: false
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3623
            )
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3624
           (SubCanvasSpec
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3625
              name: 'Content'
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3626
              layout: (LayoutFrame 0 0 30 0 0 1 0 1)
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3627
              hasHorizontalScrollBar: false
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3628
              hasVerticalScrollBar: false
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3629
              minorKey: contentSpec
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3630
              clientKey: webBrowserPage
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3631
              createNewBuilder: false
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3632
            )
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3633
           )
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3634
         
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3635
        )
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3636
      )
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3637
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3638
    "Modified: / 11-08-2011 / 00:34:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3639
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3640
321c1729db5b initial checkin
penk
parents:
diff changeset
  3641
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'menu specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3642
321c1729db5b initial checkin
penk
parents:
diff changeset
  3643
menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  3644
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  3645
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  3646
321c1729db5b initial checkin
penk
parents:
diff changeset
  3647
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  3648
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  3649
321c1729db5b initial checkin
penk
parents:
diff changeset
  3650
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  3651
     MenuEditor new openOnClass:FileApplicationNoteBook::HtmlViewApplication andSelector:#menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  3652
     (Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::HtmlViewApplication menu)) startUp
321c1729db5b initial checkin
penk
parents:
diff changeset
  3653
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  3654
321c1729db5b initial checkin
penk
parents:
diff changeset
  3655
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
  3656
321c1729db5b initial checkin
penk
parents:
diff changeset
  3657
    ^ 
5406
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3658
     #(Menu
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3659
        (
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3660
         (MenuItem
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3661
            label: 'Reload'
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3662
            itemValue: doReload
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3663
            translateLabel: true
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3664
            isButton: true
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  3665
            labelImage: (ResourceRetriever ToolbarIconLibrary reloadTextFromFileIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3666
          )
5406
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3667
         (MenuItem
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3668
            label: 'Back'
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3669
            itemValue: doGoBack
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3670
            translateLabel: true
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3671
            isButton: true
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  3672
            labelImage: (ResourceRetriever ToolbarIconLibrary historyBackIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3673
          )
5406
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3674
         (MenuItem
8087
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  3675
            label: '-'
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  3676
          )
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  3677
         (MenuItem
5406
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3678
            label: 'Print'
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3679
            itemValue: doPrint
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3680
            translateLabel: true
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3681
            isButton: true
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  3682
            labelImage: (ResourceRetriever ToolbarIconLibrary printerIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3683
          )
5406
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3684
         (MenuItem
8087
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  3685
            label: '-'
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  3686
          )
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  3687
         (MenuItem
5406
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3688
            activeHelpKey: #'Edit Source'
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3689
            label: 'Edit'
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3690
            itemValue: doEdit
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3691
            translateLabel: true
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3692
            isButton: true
6093
cab3a82eaa34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6091
diff changeset
  3693
            labelImage: (ResourceRetriever ToolbarIconLibrary editFileIcon)
5406
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3694
          )
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3695
         (MenuItem
8087
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  3696
            activeHelpKey: closeTabButton
5406
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3697
            label: 'Close'
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3698
            itemValue: doClose
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3699
            translateLabel: true
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3700
            isButton: true
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3701
            startGroup: right
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3702
            hideMenuOnActivated: false
6093
cab3a82eaa34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6091
diff changeset
  3703
            labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3704
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3705
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3706
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  3707
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  3708
      )
10566
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3709
!
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3710
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3711
menuJustClose
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3712
    "This resource specification was automatically generated
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3713
     by the MenuEditor of ST/X."
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3714
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3715
    "Do not manually edit this!! If it is corrupted,
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3716
     the MenuEditor may not be able to read the specification."
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3717
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3718
    "
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3719
     MenuEditor new openOnClass:FileApplicationNoteBook::HtmlViewApplication andSelector:#menuJustClose
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3720
     (Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::HtmlViewApplication menuJustClose)) startUp
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3721
    "
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3722
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3723
    <resource: #menu>
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3724
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3725
    ^ 
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3726
     #(Menu
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3727
        (
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3728
         (MenuItem
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3729
            activeHelpKey: closeTabButton
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3730
            label: 'Close'
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3731
            itemValue: doClose
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3732
            translateLabel: true
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3733
            isButton: true
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3734
            startGroup: right
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3735
            hideMenuOnActivated: false
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3736
            labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon)
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3737
          )
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3738
         )
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3739
        nil
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3740
        nil
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3741
      )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3742
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3743
321c1729db5b initial checkin
penk
parents:
diff changeset
  3744
!FileApplicationNoteBook::HtmlViewApplication class methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3745
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  3746
canOpenItem:anItem
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  3747
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  3748
    ^ (anItem hasMimeType and:[anItem mimeType isHtml])
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3749
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3750
321c1729db5b initial checkin
penk
parents:
diff changeset
  3751
wantNewApplicationAnyway
321c1729db5b initial checkin
penk
parents:
diff changeset
  3752
321c1729db5b initial checkin
penk
parents:
diff changeset
  3753
    ^ false
321c1729db5b initial checkin
penk
parents:
diff changeset
  3754
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3755
321c1729db5b initial checkin
penk
parents:
diff changeset
  3756
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3757
321c1729db5b initial checkin
penk
parents:
diff changeset
  3758
htmlView
321c1729db5b initial checkin
penk
parents:
diff changeset
  3759
    "return the value of the instance variable 'imageView' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  3760
321c1729db5b initial checkin
penk
parents:
diff changeset
  3761
    ^ htmlView
321c1729db5b initial checkin
penk
parents:
diff changeset
  3762
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3763
321c1729db5b initial checkin
penk
parents:
diff changeset
  3764
htmlView:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  3765
    "set the value of the instance variable 'imageView' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  3766
321c1729db5b initial checkin
penk
parents:
diff changeset
  3767
    htmlView := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3768
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3769
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  3770
item:anItem 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3771
321c1729db5b initial checkin
penk
parents:
diff changeset
  3772
    |retVal|
321c1729db5b initial checkin
penk
parents:
diff changeset
  3773
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  3774
    self labelHolder value:anItem fileName asString.
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  3775
    retVal := super item:anItem.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3776
    self setupHtmlView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3777
    ^ retVal
321c1729db5b initial checkin
penk
parents:
diff changeset
  3778
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3779
10566
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3780
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'accessing - subapps'!
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3781
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3782
webBrowserPage
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3783
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3784
    webBrowserPage isNil ifTrue:[
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3785
        webBrowserPage := Tools::WebBrowserPage new.
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3786
        webBrowserPage urlHolder: self labelHolder
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3787
    ].
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3788
    ^webBrowserPage
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3789
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3790
    "Created: / 11-08-2011 / 00:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3791
! !
8b18bf86bef4 Uses WebKit based WebBrowserPage if available
vrany
parents: 10382
diff changeset
  3792
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3793
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3794
5406
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3795
doEdit
7540
69a739c09f2c edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
  3796
    self masterApplication 
69a739c09f2c edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
  3797
        openTextEditorForFile:(htmlView currentDocument)
69a739c09f2c edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
  3798
"/        openTextEditorOn:item.
69a739c09f2c edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
  3799
69a739c09f2c edit the shown (not the initial) file of the html view
Claus Gittinger <cg@exept.de>
parents: 7487
diff changeset
  3800
    "Modified: / 24-11-2006 / 11:14:51 / cg"
5406
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3801
!
abf2d30dfb17 add edit button fot HTML Viewer
penk
parents: 5335
diff changeset
  3802
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3803
doGoBack
321c1729db5b initial checkin
penk
parents:
diff changeset
  3804
321c1729db5b initial checkin
penk
parents:
diff changeset
  3805
    self htmlView menu_back.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3806
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3807
321c1729db5b initial checkin
penk
parents:
diff changeset
  3808
doGoHome
321c1729db5b initial checkin
penk
parents:
diff changeset
  3809
321c1729db5b initial checkin
penk
parents:
diff changeset
  3810
    self htmlView menu_home.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3811
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3812
321c1729db5b initial checkin
penk
parents:
diff changeset
  3813
doHelp
321c1729db5b initial checkin
penk
parents:
diff changeset
  3814
321c1729db5b initial checkin
penk
parents:
diff changeset
  3815
    self htmlView menu_help.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3816
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3817
321c1729db5b initial checkin
penk
parents:
diff changeset
  3818
doPrint
321c1729db5b initial checkin
penk
parents:
diff changeset
  3819
321c1729db5b initial checkin
penk
parents:
diff changeset
  3820
    self htmlView menu_print.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3821
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3822
321c1729db5b initial checkin
penk
parents:
diff changeset
  3823
doReload
321c1729db5b initial checkin
penk
parents:
diff changeset
  3824
321c1729db5b initial checkin
penk
parents:
diff changeset
  3825
    self htmlView menu_reload.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3826
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3827
321c1729db5b initial checkin
penk
parents:
diff changeset
  3828
setupHtmlView
321c1729db5b initial checkin
penk
parents:
diff changeset
  3829
321c1729db5b initial checkin
penk
parents:
diff changeset
  3830
    | html file directory|
321c1729db5b initial checkin
penk
parents:
diff changeset
  3831
321c1729db5b initial checkin
penk
parents:
diff changeset
  3832
    html := self htmlView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3833
    html isNil ifTrue:[^ self].
9785
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  3834
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3835
    file := self fileName.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3836
    directory := file directoryName.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3837
    html homeDocument:(file asString).
321c1729db5b initial checkin
penk
parents:
diff changeset
  3838
    html setTopDirectoryName:directory.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3839
    html uriHolder:self labelHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3840
    html infoHolder:self notifyChannel.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3841
    html linkButtonPanel:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3842
    ^ html
9785
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  3843
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  3844
    "Modified: / 17-02-2011 / 14:01:35 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3845
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3846
321c1729db5b initial checkin
penk
parents:
diff changeset
  3847
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'aspects'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3848
321c1729db5b initial checkin
penk
parents:
diff changeset
  3849
labelHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  3850
321c1729db5b initial checkin
penk
parents:
diff changeset
  3851
    labelHolder isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  3852
        labelHolder := '' asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3853
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  3854
    ^ labelHolder.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3855
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3856
321c1729db5b initial checkin
penk
parents:
diff changeset
  3857
!FileApplicationNoteBook::HtmlViewApplication methodsFor:'initialization & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3858
321c1729db5b initial checkin
penk
parents:
diff changeset
  3859
postBuildHtmlView:aWidget
321c1729db5b initial checkin
penk
parents:
diff changeset
  3860
321c1729db5b initial checkin
penk
parents:
diff changeset
  3861
    self htmlView: aWidget scrolledView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3862
    self htmlView wantsFocusWithPointerEnter.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3863
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3864
321c1729db5b initial checkin
penk
parents:
diff changeset
  3865
postOpenWith:aBuilder 
6626
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  3866
    "only invoked if the application not started from a master"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3867
321c1729db5b initial checkin
penk
parents:
diff changeset
  3868
    |currentDir contents suffix fileName|
321c1729db5b initial checkin
penk
parents:
diff changeset
  3869
321c1729db5b initial checkin
penk
parents:
diff changeset
  3870
    self masterApplication isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  3871
        self masterApplication:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3872
        currentDir := Filename homeDirectory.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3873
321c1729db5b initial checkin
penk
parents:
diff changeset
  3874
        contents := currentDir directoryContents.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3875
        fileName := contents 
321c1729db5b initial checkin
penk
parents:
diff changeset
  3876
                    detect:[:file | 
321c1729db5b initial checkin
penk
parents:
diff changeset
  3877
                        suffix := file asFilename suffix asLowercase.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3878
                        suffix = 'html'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3879
                    ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  3880
                    ifNone:[nil].
321c1729db5b initial checkin
penk
parents:
diff changeset
  3881
        fileName isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  3882
            Dialog warn:'cant find a HTML file in ' , currentDir asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3883
            ^ self
321c1729db5b initial checkin
penk
parents:
diff changeset
  3884
        ].
9785
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  3885
        self item:(DirectoryContentsBrowser itemClass 
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  3886
                        fileName:('../../doc/online/english/TOP.html') asFilename asAbsoluteFilename).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3887
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  3888
    self setupHtmlView.
6626
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  3889
    super postOpenWith:aBuilder
9785
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  3890
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  3891
    "Modified: / 17-02-2011 / 13:27:12 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3892
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3893
321c1729db5b initial checkin
penk
parents:
diff changeset
  3894
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'defaults'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3895
321c1729db5b initial checkin
penk
parents:
diff changeset
  3896
tabStringFor:aApplicationType
7687
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  3897
    "the formatString shown in a tab (language translated)"
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  3898
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  3899
    ^ 'Image in %1'
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  3900
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  3901
    "Modified: / 01-03-2007 / 21:43:23 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3902
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3903
7909
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3904
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'documentation'!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3905
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3906
documentation
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3907
"
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3908
    a previewer-plugin for bitmap images (jpg, xpm, tiff, gif, etc.)
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3909
    Offers edit and adjust-size button functions.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3910
"
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3911
! !
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  3912
6100
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3913
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'help specs'!
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3914
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3915
flyByHelpSpec
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3916
    "This resource specification was automatically generated
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3917
     by the UIHelpTool of ST/X."
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3918
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3919
    "Do not manually edit this!! If it is corrupted,
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3920
     the UIHelpTool may not be able to read the specification."
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3921
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3922
    "
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3923
     UIHelpTool openOnClass:FileApplicationNoteBook::HtmlViewApplication    
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3924
    "
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3925
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3926
    <resource: #help>
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3927
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3928
    ^ super flyByHelpSpec addPairsFrom:#(
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3929
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3930
#'fitImageSize'
6310
75c523340406 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6295
diff changeset
  3931
'Shrink Image to Fit View'
6100
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3932
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3933
)
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3934
! !
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  3935
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3936
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'image specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3937
321c1729db5b initial checkin
penk
parents:
diff changeset
  3938
fitSize20x20Icon
321c1729db5b initial checkin
penk
parents:
diff changeset
  3939
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  3940
     by the ImageEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  3941
321c1729db5b initial checkin
penk
parents:
diff changeset
  3942
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  3943
     the ImageEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  3944
321c1729db5b initial checkin
penk
parents:
diff changeset
  3945
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  3946
     self fitSize20x20Icon inspect
321c1729db5b initial checkin
penk
parents:
diff changeset
  3947
     ImageEditor openOnClass:self andSelector:#fitSize20x20Icon
321c1729db5b initial checkin
penk
parents:
diff changeset
  3948
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  3949
321c1729db5b initial checkin
penk
parents:
diff changeset
  3950
    <resource: #image>
321c1729db5b initial checkin
penk
parents:
diff changeset
  3951
321c1729db5b initial checkin
penk
parents:
diff changeset
  3952
    ^Icon
321c1729db5b initial checkin
penk
parents:
diff changeset
  3953
        constantNamed:#'FileApplicationNoteBook::ImageViewApplication class fitSize20x20Icon'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3954
        ifAbsentPut:[(Depth4Image new) width: 20; height: 20; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3955
@@DQDQDQDQDP@@@PDQDQDQDQ@P@A@ADQDQDQDP@PD@@PDQDQDPD@@QDQ@ADQDQ@@DQDQD@@@@@@@@@DQDQDPQDQDQ@DQDQDQDDQUUTPADQDQDQAEUUUT@QDQ
321c1729db5b initial checkin
penk
parents:
diff changeset
  3956
DQDPQEUUQ@DQDQDQDDQFQDPADQDQDQADQ$QD@QDQDQDPL3X3Q@DQDQDQDCL3L3LADQDQD@@@@@@@@@DQDQD@DQDQDP@QDQ@@DADQDQDA@@DA@ADQDQDQDP@P
321c1729db5b initial checkin
penk
parents:
diff changeset
  3957
@@@QDQDQDQDA@@@ADQDQDQDQD@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
321c1729db5b initial checkin
penk
parents:
diff changeset
  3958
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
321c1729db5b initial checkin
penk
parents:
diff changeset
  3959
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 0 0 137 0 174 218 230 0 206 0 133 60 36]; mask:((Depth1Image new) width: 20; height: 20; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3960
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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
321c1729db5b initial checkin
penk
parents:
diff changeset
  3961
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
321c1729db5b initial checkin
penk
parents:
diff changeset
  3962
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
321c1729db5b initial checkin
penk
parents:
diff changeset
  3963
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
321c1729db5b initial checkin
penk
parents:
diff changeset
  3964
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself]
321c1729db5b initial checkin
penk
parents:
diff changeset
  3965
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3966
321c1729db5b initial checkin
penk
parents:
diff changeset
  3967
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'interface specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3968
321c1729db5b initial checkin
penk
parents:
diff changeset
  3969
windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3970
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  3971
     by the UIPainter of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  3972
321c1729db5b initial checkin
penk
parents:
diff changeset
  3973
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  3974
     the UIPainter may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  3975
321c1729db5b initial checkin
penk
parents:
diff changeset
  3976
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  3977
     UIPainter new openOnClass:FileApplicationNoteBook::ImageViewApplication andSelector:#windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3978
     FileApplicationNoteBook::ImageViewApplication new openInterface:#windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3979
     FileApplicationNoteBook::ImageViewApplication open
321c1729db5b initial checkin
penk
parents:
diff changeset
  3980
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  3981
321c1729db5b initial checkin
penk
parents:
diff changeset
  3982
    <resource: #canvas>
321c1729db5b initial checkin
penk
parents:
diff changeset
  3983
321c1729db5b initial checkin
penk
parents:
diff changeset
  3984
    ^ 
321c1729db5b initial checkin
penk
parents:
diff changeset
  3985
     #(#FullSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3986
        #name: #windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3987
        #window: 
321c1729db5b initial checkin
penk
parents:
diff changeset
  3988
       #(#WindowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  3989
          #label: 'ImageViewer'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3990
          #name: 'ImageViewer'
321c1729db5b initial checkin
penk
parents:
diff changeset
  3991
          #min: #(#Point 10 10)
321c1729db5b initial checkin
penk
parents:
diff changeset
  3992
          #bounds: #(#Rectangle 16 42 692 534)
321c1729db5b initial checkin
penk
parents:
diff changeset
  3993
          #menu: #mainMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
  3994
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
  3995
        #component: 
321c1729db5b initial checkin
penk
parents:
diff changeset
  3996
       #(#SpecCollection
321c1729db5b initial checkin
penk
parents:
diff changeset
  3997
          #collection: #(
321c1729db5b initial checkin
penk
parents:
diff changeset
  3998
           #(#MenuPanelSpec
4261
8cfc011b2c0c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4201
diff changeset
  3999
              #name: 'MenuImage'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4000
              #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
  4001
              #level: 0
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4002
              #visibilityChannel: #isEmbeddedApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
  4003
              #menu: #menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  4004
              #textDefault: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  4005
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4006
           #(#ArbitraryComponentSpec
4261
8cfc011b2c0c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4201
diff changeset
  4007
              #name: 'ImageView'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4008
              #layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0)
321c1729db5b initial checkin
penk
parents:
diff changeset
  4009
              #hasHorizontalScrollBar: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  4010
              #hasVerticalScrollBar: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  4011
              #miniScrollerHorizontal: false
321c1729db5b initial checkin
penk
parents:
diff changeset
  4012
              #miniScrollerVertical: false
321c1729db5b initial checkin
penk
parents:
diff changeset
  4013
              #hasBorder: false
321c1729db5b initial checkin
penk
parents:
diff changeset
  4014
              #component: #ImageView
321c1729db5b initial checkin
penk
parents:
diff changeset
  4015
              #postBuildCallback: #postBuildImageView:
321c1729db5b initial checkin
penk
parents:
diff changeset
  4016
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4017
           )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4018
         
321c1729db5b initial checkin
penk
parents:
diff changeset
  4019
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4020
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4021
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4022
321c1729db5b initial checkin
penk
parents:
diff changeset
  4023
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'menu specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4024
321c1729db5b initial checkin
penk
parents:
diff changeset
  4025
menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  4026
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  4027
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  4028
321c1729db5b initial checkin
penk
parents:
diff changeset
  4029
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  4030
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  4031
321c1729db5b initial checkin
penk
parents:
diff changeset
  4032
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4033
     MenuEditor new openOnClass:FileApplicationNoteBook::ImageViewApplication andSelector:#menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  4034
     (Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::ImageViewApplication menu)) startUp
321c1729db5b initial checkin
penk
parents:
diff changeset
  4035
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4036
321c1729db5b initial checkin
penk
parents:
diff changeset
  4037
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
  4038
321c1729db5b initial checkin
penk
parents:
diff changeset
  4039
    ^ 
321c1729db5b initial checkin
penk
parents:
diff changeset
  4040
     #(#Menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  4041
        #(
321c1729db5b initial checkin
penk
parents:
diff changeset
  4042
         #(#MenuItem
321c1729db5b initial checkin
penk
parents:
diff changeset
  4043
            #label: 'Edit'
4353
fe7b65eee458 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  4044
            #itemValue: #editImage
fe7b65eee458 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  4045
            #nameKey: #EditImage
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4046
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  4047
            #isButton: true
6106
b9f7c407542d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6100
diff changeset
  4048
            #labelImage: #(#ResourceRetriever #ToolbarIconLibrary #startImageEditorIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4049
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4050
         #(#MenuItem
321c1729db5b initial checkin
penk
parents:
diff changeset
  4051
            #label: '-'
321c1729db5b initial checkin
penk
parents:
diff changeset
  4052
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4053
         #(#MenuItem
6100
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  4054
            #activeHelpKey: #fitImageSize
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4055
            #label: 'FitSize'
321c1729db5b initial checkin
penk
parents:
diff changeset
  4056
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  4057
            #isButton: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  4058
            #triggerOnDown: true
4353
fe7b65eee458 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  4059
            #indication: #fitSize
6100
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  4060
            #labelImage: #(#ResourceRetriever #ToolbarIconLibrary #fitImageSizeToViewIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4061
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4062
         #(#MenuItem
321c1729db5b initial checkin
penk
parents:
diff changeset
  4063
            #label: '-'
321c1729db5b initial checkin
penk
parents:
diff changeset
  4064
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4065
         #(#MenuItem
6100
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  4066
            #activeHelpKey: #closeTabButton
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4067
            #label: 'Close'
4353
fe7b65eee458 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  4068
            #itemValue: #doClose
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4069
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  4070
            #isButton: true
4353
fe7b65eee458 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
  4071
            #startGroup: #right
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4072
            #hideMenuOnActivated: false
6093
cab3a82eaa34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6091
diff changeset
  4073
            #labelImage: #(#ResourceRetriever #ToolbarIconLibrary #removeTabIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4074
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4075
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4076
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  4077
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  4078
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4079
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4080
321c1729db5b initial checkin
penk
parents:
diff changeset
  4081
!FileApplicationNoteBook::ImageViewApplication class methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4082
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  4083
canOpenItem:anItem
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  4084
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  4085
    ^ (anItem hasMimeType and:[anItem mimeType isImage])
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4086
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4087
321c1729db5b initial checkin
penk
parents:
diff changeset
  4088
wantNewApplicationAnyway
321c1729db5b initial checkin
penk
parents:
diff changeset
  4089
321c1729db5b initial checkin
penk
parents:
diff changeset
  4090
    ^ false
321c1729db5b initial checkin
penk
parents:
diff changeset
  4091
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4092
321c1729db5b initial checkin
penk
parents:
diff changeset
  4093
!FileApplicationNoteBook::ImageViewApplication methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4094
321c1729db5b initial checkin
penk
parents:
diff changeset
  4095
image:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  4096
    image := something.
4417
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4097
    self updateImageInfo.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4098
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4099
321c1729db5b initial checkin
penk
parents:
diff changeset
  4100
imageView
321c1729db5b initial checkin
penk
parents:
diff changeset
  4101
    ^ imageView
321c1729db5b initial checkin
penk
parents:
diff changeset
  4102
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4103
321c1729db5b initial checkin
penk
parents:
diff changeset
  4104
imageView:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  4105
    imageView := something.
4417
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4106
!
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4107
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4108
updateImageInfo
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4109
    |fn msg|
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4110
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4111
    image notNil ifTrue:[
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4112
        fn := image fileName.
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4113
        fn isNil ifTrue:[
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4114
            fn := 'unnamed'
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4115
        ] ifFalse:[
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4116
            fn :=  fn asFilename baseName.
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4117
        ].
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4118
        msg := '%1  %2x%3 depth:%4'
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4119
                bindWith:fn allBold
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4120
                with:image width
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4121
                with:image height
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4122
                with:image depth.
8f0a9e2bafc1 image info
Claus Gittinger <cg@exept.de>
parents: 4396
diff changeset
  4123
    ].
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4520
diff changeset
  4124
    self notify:msg.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4125
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4126
321c1729db5b initial checkin
penk
parents:
diff changeset
  4127
!FileApplicationNoteBook::ImageViewApplication methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4128
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  4129
changeItem:anItem
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  4130
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5008
diff changeset
  4131
    self item:anItem.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4132
    self setupImageView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4133
    ^ true
321c1729db5b initial checkin
penk
parents:
diff changeset
  4134
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4135
321c1729db5b initial checkin
penk
parents:
diff changeset
  4136
editImage
321c1729db5b initial checkin
penk
parents:
diff changeset
  4137
    |img|
321c1729db5b initial checkin
penk
parents:
diff changeset
  4138
321c1729db5b initial checkin
penk
parents:
diff changeset
  4139
    img := self image.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4140
    img notNil ifTrue:[
6833
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  4141
"/        self withWaitCursorDo:[
4855
c113852ec9ba waitCursor
Claus Gittinger <cg@exept.de>
parents: 4803
diff changeset
  4142
            img edit.
6833
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  4143
"/        ]
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  4144
    ].
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  4145
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  4146
    "Modified: / 25-07-2006 / 09:09:20 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4147
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4148
321c1729db5b initial checkin
penk
parents:
diff changeset
  4149
image
321c1729db5b initial checkin
penk
parents:
diff changeset
  4150
    |img fn e|
321c1729db5b initial checkin
penk
parents:
diff changeset
  4151
321c1729db5b initial checkin
penk
parents:
diff changeset
  4152
    fn := self fileName.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4153
    img := Image fromFile:fn.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4154
    img isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  4155
        fn exists ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  4156
            e := 'Unknown/unsupported image format'
321c1729db5b initial checkin
penk
parents:
diff changeset
  4157
        ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  4158
            e := 'No such image'
321c1729db5b initial checkin
penk
parents:
diff changeset
  4159
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4160
        Dialog warn:e.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4161
        ^ nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  4162
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4163
    ^ img.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4164
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4165
321c1729db5b initial checkin
penk
parents:
diff changeset
  4166
setupImageView
4020
d1cfbddb1e5d *** empty log message ***
penk
parents: 4018
diff changeset
  4167
    [
4744
36dfe96e5d23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4698
diff changeset
  4168
        |img|
36dfe96e5d23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4698
diff changeset
  4169
6833
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  4170
"/        imageView withCursor:(Cursor wait) do:[
4744
36dfe96e5d23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4698
diff changeset
  4171
            img := self image.
36dfe96e5d23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4698
diff changeset
  4172
            img notNil ifTrue:[
36dfe96e5d23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4698
diff changeset
  4173
                self image:img.
36dfe96e5d23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4698
diff changeset
  4174
                imageView image:img
36dfe96e5d23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4698
diff changeset
  4175
            ].
6833
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  4176
"/        ].
4174
868e973add35 *** empty log message ***
penk
parents: 4169
diff changeset
  4177
    ] fork.
6833
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  4178
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  4179
    "Modified: / 25-07-2006 / 09:09:33 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4180
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4181
321c1729db5b initial checkin
penk
parents:
diff changeset
  4182
!FileApplicationNoteBook::ImageViewApplication methodsFor:'aspects'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4183
321c1729db5b initial checkin
penk
parents:
diff changeset
  4184
fitSize
321c1729db5b initial checkin
penk
parents:
diff changeset
  4185
    "return/create the 'fitSize' value holder (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  4186
321c1729db5b initial checkin
penk
parents:
diff changeset
  4187
    fitSize isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  4188
        fitSize := ValueHolder new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4189
        fitSize addDependent:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4190
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4191
    ^ fitSize
321c1729db5b initial checkin
penk
parents:
diff changeset
  4192
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4193
321c1729db5b initial checkin
penk
parents:
diff changeset
  4194
!FileApplicationNoteBook::ImageViewApplication methodsFor:'change & update'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4195
321c1729db5b initial checkin
penk
parents:
diff changeset
  4196
update:something with:aParameter from:changedObject
321c1729db5b initial checkin
penk
parents:
diff changeset
  4197
    changedObject == self fitSize ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  4198
        changedObject value ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  4199
            imageView adjust:#fitBig.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4200
        ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  4201
            imageView adjust:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4202
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4203
        ^ self
321c1729db5b initial checkin
penk
parents:
diff changeset
  4204
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4205
    super update:something with:aParameter from:changedObject
321c1729db5b initial checkin
penk
parents:
diff changeset
  4206
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4207
321c1729db5b initial checkin
penk
parents:
diff changeset
  4208
!FileApplicationNoteBook::ImageViewApplication methodsFor:'initialization & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4209
321c1729db5b initial checkin
penk
parents:
diff changeset
  4210
postBuildImageView:aWidget
321c1729db5b initial checkin
penk
parents:
diff changeset
  4211
321c1729db5b initial checkin
penk
parents:
diff changeset
  4212
    self imageView: aWidget scrolledView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4213
    self imageView wantsFocusWithPointerEnter.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4214
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4215
321c1729db5b initial checkin
penk
parents:
diff changeset
  4216
postOpenWith:aBuilder 
7909
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  4217
    "only invoked if the application is not started from a master"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4218
321c1729db5b initial checkin
penk
parents:
diff changeset
  4219
    |currentDir contents suffix fileName|
321c1729db5b initial checkin
penk
parents:
diff changeset
  4220
321c1729db5b initial checkin
penk
parents:
diff changeset
  4221
    self masterApplication isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  4222
        self masterApplication:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4223
        currentDir := Filename currentDirectory.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4224
        contents := currentDir directoryContents.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4225
        fileName := contents 
321c1729db5b initial checkin
penk
parents:
diff changeset
  4226
                    detect:[:file | 
321c1729db5b initial checkin
penk
parents:
diff changeset
  4227
                        suffix := file asFilename suffix asLowercase.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4228
                        Image isImageFileSuffix:suffix
321c1729db5b initial checkin
penk
parents:
diff changeset
  4229
                    ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  4230
                    ifNone:[nil].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4231
        fileName isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  4232
            Dialog warn:'cant find a Image in ' , currentDir asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4233
            ^ self
321c1729db5b initial checkin
penk
parents:
diff changeset
  4234
        ].
3982
fc30449d705d *** empty log message ***
penk
parents: 3962
diff changeset
  4235
        self item:(DirectoryContentsBrowser itemClass fileName:(currentDir construct:fileName))
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4236
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4237
    self setupImageView.
6626
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  4238
    super postOpenWith:aBuilder
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4239
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4240
321c1729db5b initial checkin
penk
parents:
diff changeset
  4241
!FileApplicationNoteBook::Terminal class methodsFor:'defaults'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4242
4758
553688ada6b3 transcript buffer size
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4243
defaultLineLimit
553688ada6b3 transcript buffer size
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4244
    "the number of buffered lines"
553688ada6b3 transcript buffer size
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4245
4759
cdc53b0b3e52 transcript buffer size
Claus Gittinger <cg@exept.de>
parents: 4758
diff changeset
  4246
    ^ DefaultLineLimit ? TextCollector defaultLineLimit
7787
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  4247
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  4248
    "
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  4249
     DefaultLineLimit := 30000
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  4250
    "
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  4251
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  4252
    "Modified: / 05-04-2007 / 17:03:11 / cg"
4758
553688ada6b3 transcript buffer size
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4253
!
553688ada6b3 transcript buffer size
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4254
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4255
tabStringFor:aApplicationType
7687
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4256
    "the formatString shown in a tab (language translated)"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4257
4336
b4228ddf2183 change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents: 4293
diff changeset
  4258
    ^ 'Terminal'
7687
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4259
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4260
    "Modified: / 01-03-2007 / 21:43:38 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4261
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4262
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4263
!FileApplicationNoteBook::Terminal class methodsFor:'help specs'!
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4264
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4265
helpSpec
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4266
    "This resource specification was automatically generated
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4267
     by the UIHelpTool of ST/X."
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4268
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4269
    "Do not manually edit this!! If it is corrupted,
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4270
     the UIHelpTool may not be able to read the specification."
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4271
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4272
    "
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4273
     UIHelpTool openOnClass:FileApplicationNoteBook::Terminal    
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4274
    "
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4275
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4276
    <resource: #help>
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4277
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4278
    ^ super helpSpec addPairsFrom:#(
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4279
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4280
#closeTabButton
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4281
''
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4282
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4283
)
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4284
! !
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4285
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4286
!FileApplicationNoteBook::Terminal class methodsFor:'interface specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4287
321c1729db5b initial checkin
penk
parents:
diff changeset
  4288
windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  4289
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  4290
     by the UIPainter of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  4291
321c1729db5b initial checkin
penk
parents:
diff changeset
  4292
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  4293
     the UIPainter may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  4294
321c1729db5b initial checkin
penk
parents:
diff changeset
  4295
    "
4336
b4228ddf2183 change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents: 4293
diff changeset
  4296
     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
  4297
     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
  4298
     FileApplicationNoteBook::Terminal open
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4299
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4300
321c1729db5b initial checkin
penk
parents:
diff changeset
  4301
    <resource: #canvas>
321c1729db5b initial checkin
penk
parents:
diff changeset
  4302
321c1729db5b initial checkin
penk
parents:
diff changeset
  4303
    ^ 
5661
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4304
     #(FullSpec
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4305
        name: windowSpec
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4306
        window: 
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4307
       (WindowSpec
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4308
          label: 'Terminal'
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4309
          name: 'Terminal'
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4310
          min: (Point 10 10)
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4311
          bounds: (Rectangle 0 0 692 537)
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4312
          menu: mainMenu
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4313
        )
5661
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4314
        component: 
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4315
       (SpecCollection
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4316
          collection: (
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4317
           (MenuPanelSpec
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4318
              name: 'MenuTerminal'
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4319
              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
  4320
              level: 0
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4321
              menu: menu
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4322
              textDefault: true
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4323
            )
5661
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4324
           (ArbitraryComponentSpec
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4325
              name: 'TerminalView'
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4326
              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
  4327
              hasHorizontalScrollBar: true
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4328
              hasVerticalScrollBar: true
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4329
              miniScrollerHorizontal: true
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4330
              miniScrollerVertical: false
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4331
              autoHideScrollBars: false
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4332
              hasBorder: false
706b3e6cfd1f terminal has a fixed scrollbar to avoid
Claus Gittinger <cg@exept.de>
parents: 5646
diff changeset
  4333
              component: terminalView
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4334
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4335
           )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4336
         
321c1729db5b initial checkin
penk
parents:
diff changeset
  4337
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4338
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4339
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4340
321c1729db5b initial checkin
penk
parents:
diff changeset
  4341
!FileApplicationNoteBook::Terminal class methodsFor:'menu specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4342
321c1729db5b initial checkin
penk
parents:
diff changeset
  4343
menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  4344
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  4345
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  4346
321c1729db5b initial checkin
penk
parents:
diff changeset
  4347
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  4348
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  4349
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4350
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4351
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4352
     MenuEditor new openOnClass:FileApplicationNoteBook::Terminal andSelector:#menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  4353
     (Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::Terminal menu)) startUp
321c1729db5b initial checkin
penk
parents:
diff changeset
  4354
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4355
321c1729db5b initial checkin
penk
parents:
diff changeset
  4356
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
  4357
321c1729db5b initial checkin
penk
parents:
diff changeset
  4358
    ^ 
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4359
     #(Menu
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4360
        (
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4361
         (MenuItem
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4362
            label: 'Save As...'
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4363
            itemValue: saveAs
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4364
            nameKey: Save
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4365
            translateLabel: true
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4366
            isButton: true
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4367
            labelImage: (ResourceRetriever ToolbarIconLibrary saveToFileAsIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4368
          )
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4369
         (MenuItem
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4370
            activeHelpKey: closeTabButton
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4371
            label: 'Close'
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4372
            itemValue: doClose
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4373
            translateLabel: true
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4374
            isButton: true
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4375
            startGroup: right
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4376
            isVisible: closeButtonShown
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4377
            hideMenuOnActivated: false
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4378
            labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4379
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4380
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4381
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  4382
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  4383
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4384
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4385
321c1729db5b initial checkin
penk
parents:
diff changeset
  4386
!FileApplicationNoteBook::Terminal methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4387
321c1729db5b initial checkin
penk
parents:
diff changeset
  4388
terminalView
321c1729db5b initial checkin
penk
parents:
diff changeset
  4389
321c1729db5b initial checkin
penk
parents:
diff changeset
  4390
    terminalView isNil ifTrue:[
6435
a8b5ed32c036 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6377
diff changeset
  4391
        VT100TerminalView isNil ifTrue:[
a8b5ed32c036 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6377
diff changeset
  4392
            Dialog warn:('Missing class: ' , 'VT100TerminalView' allBold).
a8b5ed32c036 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6377
diff changeset
  4393
            AbortOperationRequest raise 
a8b5ed32c036 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6377
diff changeset
  4394
        ].
a8b5ed32c036 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6377
diff changeset
  4395
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4396
        terminalView := VT100TerminalView new.
4758
553688ada6b3 transcript buffer size
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4397
        terminalView lineLimit:(self class defaultLineLimit).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4398
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4399
    ^ terminalView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4400
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4401
321c1729db5b initial checkin
penk
parents:
diff changeset
  4402
!FileApplicationNoteBook::Terminal methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4403
321c1729db5b initial checkin
penk
parents:
diff changeset
  4404
saveAs
321c1729db5b initial checkin
penk
parents:
diff changeset
  4405
321c1729db5b initial checkin
penk
parents:
diff changeset
  4406
    self terminalView save.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4407
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4408
321c1729db5b initial checkin
penk
parents:
diff changeset
  4409
!FileApplicationNoteBook::Terminal methodsFor:'initialization & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4410
321c1729db5b initial checkin
penk
parents:
diff changeset
  4411
shellFinished
321c1729db5b initial checkin
penk
parents:
diff changeset
  4412
    | master text string|
321c1729db5b initial checkin
penk
parents:
diff changeset
  4413
321c1729db5b initial checkin
penk
parents:
diff changeset
  4414
    master := self masterApplication.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4415
    master notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  4416
        string := ' - closed'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4417
        master tabStringAdd:string for:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4418
    ].
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4520
diff changeset
  4419
    self notify:'shell in ' , self fileName asString, ' finished'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4420
    terminalView cr.
4515
5345a8da0455 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4508
diff changeset
  4421
5305
5e3c955b7c4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5290
diff changeset
  4422
    text := '>> shell terminated.' allBold.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4423
    text colorizeAllWith:Color red.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4424
    terminalView nextPutAll:text.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4425
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4426
321c1729db5b initial checkin
penk
parents:
diff changeset
  4427
startShell
321c1729db5b initial checkin
penk
parents:
diff changeset
  4428
    |vt100|
321c1729db5b initial checkin
penk
parents:
diff changeset
  4429
321c1729db5b initial checkin
penk
parents:
diff changeset
  4430
    vt100 := self terminalView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4431
    vt100 shellTerminateAction:[ self shellFinished ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4432
    vt100 startShellIn:(self fileName).
321c1729db5b initial checkin
penk
parents:
diff changeset
  4433
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4434
321c1729db5b initial checkin
penk
parents:
diff changeset
  4435
!FileApplicationNoteBook::Terminal methodsFor:'printing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4436
8002
031dca544927 Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents: 7970
diff changeset
  4437
printOn:aStream
031dca544927 Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents: 7970
diff changeset
  4438
    aStream nextPutAll:'Terminal on:'.
031dca544927 Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents: 7970
diff changeset
  4439
    self fileName baseName printOn:aStream.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4440
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4441
321c1729db5b initial checkin
penk
parents:
diff changeset
  4442
!FileApplicationNoteBook::Terminal methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4443
7687
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4444
getTabValueString
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4445
    "the item shown in a tab (not language translated)"
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4446
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4447
    ^ nil
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4448
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4449
    "Created: / 01-03-2007 / 21:39:56 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4450
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4451
321c1729db5b initial checkin
penk
parents:
diff changeset
  4452
!FileApplicationNoteBook::Terminal methodsFor:'startup & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4453
321c1729db5b initial checkin
penk
parents:
diff changeset
  4454
postOpenWith:aBuilder
6626
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  4455
    "only invoked if the application not started from a master"
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  4456
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4457
    self masterApplication isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  4458
        self masterApplication:nil.
3982
fc30449d705d *** empty log message ***
penk
parents: 3962
diff changeset
  4459
        self item:(DirectoryContentsBrowser itemClass fileName:(Filename currentDirectory asAbsoluteFilename)).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4460
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4461
    self startShell.
6626
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  4462
    super postOpenWith:aBuilder.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4463
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4464
321c1729db5b initial checkin
penk
parents:
diff changeset
  4465
!FileApplicationNoteBook::TextEditor class methodsFor:'defaults'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4466
5461
acf501391ddd change delay time for check files in text editor
penk
parents: 5459
diff changeset
  4467
checkModifiedDelayTime
8614
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  4468
    ^ 30    "seconds"
5461
acf501391ddd change delay time for check files in text editor
penk
parents: 5459
diff changeset
  4469
!
acf501391ddd change delay time for check files in text editor
penk
parents: 5459
diff changeset
  4470
10761
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  4471
defaultTagsBrowserVisible
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  4472
    ^ DefaultTagsBrowserVisible ? true
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  4473
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  4474
    "Created: / 06-10-2011 / 12:45:58 / cg"
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  4475
!
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  4476
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4477
tabStringFor:aApplicationType
7687
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4478
    "the formatString shown in a tab (language translated)"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4479
321c1729db5b initial checkin
penk
parents:
diff changeset
  4480
    aApplicationType == #directoryDescription ifTrue:[
7687
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4481
        ^ 'Directory Description of %1'
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4482
    ].
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4483
    ^ '%1'
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4484
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  4485
    "Modified: / 01-03-2007 / 21:46:24 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4486
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4487
321c1729db5b initial checkin
penk
parents:
diff changeset
  4488
wantNewApplicationAnyway
321c1729db5b initial checkin
penk
parents:
diff changeset
  4489
321c1729db5b initial checkin
penk
parents:
diff changeset
  4490
    ^ false
321c1729db5b initial checkin
penk
parents:
diff changeset
  4491
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4492
7909
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  4493
!FileApplicationNoteBook::TextEditor class methodsFor:'documentation'!
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  4494
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  4495
documentation
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  4496
"
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  4497
    a previewer-plugin for plain text
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  4498
    Offers edit, hex-display and diff functions.
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  4499
"
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  4500
! !
db9abaf71a0b top file support
Claus Gittinger <cg@exept.de>
parents: 7840
diff changeset
  4501
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4502
!FileApplicationNoteBook::TextEditor class methodsFor:'help specs'!
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4503
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4504
helpSpec
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4505
    "This resource specification was automatically generated
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4506
     by the UIHelpTool of ST/X."
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4507
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4508
    "Do not manually edit this!! If it is corrupted,
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4509
     the UIHelpTool may not be able to read the specification."
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4510
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4511
    "
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4512
     UIHelpTool openOnClass:FileApplicationNoteBook::TextEditor    
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4513
    "
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4514
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4515
    <resource: #help>
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4516
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4517
    ^ super helpSpec addPairsFrom:#(
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4518
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4519
#closeTabButton
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4520
''
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4521
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4522
)
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4523
! !
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4524
8912
4ee5a8847d06 category changes
Claus Gittinger <cg@exept.de>
parents: 8783
diff changeset
  4525
!FileApplicationNoteBook::TextEditor class methodsFor:'interface specs'!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4526
321c1729db5b initial checkin
penk
parents:
diff changeset
  4527
windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  4528
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  4529
     by the UIPainter of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  4530
321c1729db5b initial checkin
penk
parents:
diff changeset
  4531
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  4532
     the UIPainter may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  4533
321c1729db5b initial checkin
penk
parents:
diff changeset
  4534
    "
3950
b16ce71ea664 allowDoIt
Claus Gittinger <cg@exept.de>
parents: 3948
diff changeset
  4535
     UIPainter new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#windowSpec
b16ce71ea664 allowDoIt
Claus Gittinger <cg@exept.de>
parents: 3948
diff changeset
  4536
     FileApplicationNoteBook::TextEditor new openInterface:#windowSpec
b16ce71ea664 allowDoIt
Claus Gittinger <cg@exept.de>
parents: 3948
diff changeset
  4537
     FileApplicationNoteBook::TextEditor open
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4538
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4539
321c1729db5b initial checkin
penk
parents:
diff changeset
  4540
    <resource: #canvas>
321c1729db5b initial checkin
penk
parents:
diff changeset
  4541
321c1729db5b initial checkin
penk
parents:
diff changeset
  4542
    ^ 
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4543
     #(FullSpec
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4544
        name: windowSpec
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4545
        window: 
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4546
       (WindowSpec
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4547
          label: 'TextEditor'
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4548
          name: 'TextEditor'
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4549
          min: (Point 10 10)
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  4550
          bounds: (Rectangle 0 0 650 300)
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4551
        )
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4552
        component: 
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4553
       (SpecCollection
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4554
          collection: (
9949
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4555
           (VariableHorizontalPanelSpec
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4556
              name: 'Panel'
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4557
              layout: (LayoutFrame 0 0 0 0 0 1 0 1)
11588
2a4222b491ab Add handle for panel for fast hiding CBrowser subwindow
Stefan Vogel <sv@exept.de>
parents: 11284
diff changeset
  4558
              showHandle: true
2a4222b491ab Add handle for panel for fast hiding CBrowser subwindow
Stefan Vogel <sv@exept.de>
parents: 11284
diff changeset
  4559
              snapMode: max
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  4560
              component: 
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  4561
             (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  4562
                collection: (
9949
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4563
                 (ViewSpec
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4564
                    name: 'EditorBox'
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4565
                    component: 
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4566
                   (SpecCollection
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4567
                      collection: (
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4568
                       (MenuPanelSpec
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4569
                          name: 'MenuTextEditor'
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4570
                          layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4571
                          level: 0
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4572
                          menu: menu
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4573
                          textDefault: true
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4574
                        )
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4575
                       (TextEditorSpec
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4576
                          name: 'TextEditor'
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4577
                          layout: (LayoutFrame 0 0.0 32 0 0 1.0 0 1.0)
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4578
                          model: fileContentsModel
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4579
                          hasHorizontalScrollBar: true
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4580
                          hasVerticalScrollBar: true
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4581
                          modifiedChannel: viewModifiedChannel
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4582
                          acceptCallBack: accept
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4583
                          allowDoIt: true
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4584
                          hasKeyboardFocusInitially: false
10754
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  4585
                          viewClassName: 'getEditorClass'
9949
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4586
                          postBuildCallback: postBuildTextEditor:
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4587
                        )
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4588
                       )
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4589
                     
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4590
                    )
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  4591
                  )
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  4592
                 )
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  4593
               
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  4594
              )
9949
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  4595
              handles: (Any 1.0)
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4596
            )
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4597
           )
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4598
         
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4599
        )
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4600
      )
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4601
!
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4602
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4603
xwindowSpec
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4604
    "This resource specification was automatically generated
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4605
     by the UIPainter of ST/X."
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4606
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4607
    "Do not manually edit this!! If it is corrupted,
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4608
     the UIPainter may not be able to read the specification."
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4609
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4610
    "
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4611
     UIPainter new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#windowSpec
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4612
     FileApplicationNoteBook::TextEditor new openInterface:#windowSpec
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4613
     FileApplicationNoteBook::TextEditor open
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4614
    "
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4615
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4616
    <resource: #canvas>
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4617
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4618
    ^ 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4619
     #(#FullSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  4620
        #name: #windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  4621
        #window: 
321c1729db5b initial checkin
penk
parents:
diff changeset
  4622
       #(#WindowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  4623
          #label: 'TextEditor'
321c1729db5b initial checkin
penk
parents:
diff changeset
  4624
          #name: 'TextEditor'
321c1729db5b initial checkin
penk
parents:
diff changeset
  4625
          #min: #(#Point 10 10)
321c1729db5b initial checkin
penk
parents:
diff changeset
  4626
          #max: #(#Point 1024 768)
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  4627
          #bounds: #(#Rectangle 16 42 666 342)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4628
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4629
        #component: 
321c1729db5b initial checkin
penk
parents:
diff changeset
  4630
       #(#SpecCollection
321c1729db5b initial checkin
penk
parents:
diff changeset
  4631
          #collection: #(
321c1729db5b initial checkin
penk
parents:
diff changeset
  4632
           #(#MenuPanelSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  4633
              #name: 'MenuTextEditor'
321c1729db5b initial checkin
penk
parents:
diff changeset
  4634
              #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
  4635
              #level: 0
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4636
              #menu: #menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  4637
              #textDefault: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  4638
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4639
           #(#TextEditorSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  4640
              #name: 'TextEditor'
321c1729db5b initial checkin
penk
parents:
diff changeset
  4641
              #layout: #(#LayoutFrame 0 0.0 32 0 0 1.0 0 1.0)
321c1729db5b initial checkin
penk
parents:
diff changeset
  4642
              #model: #fileContentsModel
321c1729db5b initial checkin
penk
parents:
diff changeset
  4643
              #hasHorizontalScrollBar: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  4644
              #hasVerticalScrollBar: true
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  4645
              #modifiedChannel: #viewModifiedChannel
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4646
              #acceptCallBack: #accept
3950
b16ce71ea664 allowDoIt
Claus Gittinger <cg@exept.de>
parents: 3948
diff changeset
  4647
              #allowDoIt: true
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4648
              #postBuildCallback: #postBuildTextEditor:
321c1729db5b initial checkin
penk
parents:
diff changeset
  4649
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4650
           )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4651
         
321c1729db5b initial checkin
penk
parents:
diff changeset
  4652
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4653
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4654
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4655
321c1729db5b initial checkin
penk
parents:
diff changeset
  4656
!FileApplicationNoteBook::TextEditor class methodsFor:'menu specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4657
321c1729db5b initial checkin
penk
parents:
diff changeset
  4658
menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  4659
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  4660
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  4661
321c1729db5b initial checkin
penk
parents:
diff changeset
  4662
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  4663
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  4664
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4665
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4666
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4667
     MenuEditor new openOnClass:FileApplicationNoteBook::TextEditor andSelector:#menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  4668
     (Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::TextEditor menu)) startUp
321c1729db5b initial checkin
penk
parents:
diff changeset
  4669
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4670
321c1729db5b initial checkin
penk
parents:
diff changeset
  4671
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
  4672
321c1729db5b initial checkin
penk
parents:
diff changeset
  4673
    ^ 
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4674
     #(Menu
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4675
        (
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4676
         (MenuItem
8087
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4677
            activeHelpKey: saveFile
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4678
            enabled: enableSave
5429
2567fdcf2d8b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5428
diff changeset
  4679
            label: 'Save'
2567fdcf2d8b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5428
diff changeset
  4680
            itemValue: accept
2567fdcf2d8b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5428
diff changeset
  4681
            nameKey: Save
2567fdcf2d8b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5428
diff changeset
  4682
            translateLabel: true
2567fdcf2d8b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5428
diff changeset
  4683
            isButton: true
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4684
            isVisible: saveButtonVisible
6117
14c3f5a404b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6106
diff changeset
  4685
            labelImage: (ResourceRetriever ToolbarIconLibrary saveTextToFileIcon)
5429
2567fdcf2d8b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5428
diff changeset
  4686
          )
2567fdcf2d8b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5428
diff changeset
  4687
         (MenuItem
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  4688
            activeHelpKey: saveFileAs
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  4689
            enabled: enableSaveAs
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  4690
            label: 'Save As...'
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  4691
            itemValue: saveFileAs
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  4692
            nameKey: SaveAs
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  4693
            translateLabel: true
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  4694
            isButton: true
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4695
            isVisible: saveAsButtonVisible
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  4696
            labelImage: (ResourceRetriever ToolbarIconLibrary saveToFileAsIcon)
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  4697
          )
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  4698
         (MenuItem
8087
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4699
            activeHelpKey: reloadFile
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4700
            enabled: enableReload
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4701
            label: 'Reload'
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4702
            itemValue: reload
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4703
            nameKey: Reload
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4704
            translateLabel: true
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4705
            isButton: true
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4706
            isVisible: reloadButtonVisible
6117
14c3f5a404b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6106
diff changeset
  4707
            labelImage: (ResourceRetriever ToolbarIconLibrary reloadTextFromFileIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4708
          )
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4709
         (MenuItem
8087
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4710
            activeHelpKey: findInBrowser
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4711
            enabled: enableSelectInBrowser
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4712
            label: 'Select in Browser'
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4713
            itemValue: selectInBrowser
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4714
            nameKey: SelectInBrowser
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4715
            translateLabel: true
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4716
            isButton: true
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4717
            isVisible: selectInBrowserButtonVisible
8087
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4718
            labelImage: (ResourceRetriever ToolbarIconLibrary searchFileIcon)
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4719
          )
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4720
         (MenuItem
6681
b93c9a6b607d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6626
diff changeset
  4721
            label: '-'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4722
          )
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4723
         (MenuItem
8087
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4724
            activeHelpKey: print
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4725
            enabled: enableHexToggle
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4726
            label: 'Print'
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4727
            itemValue: doPrint
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4728
            nameKey: Print
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4729
            translateLabel: true
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4730
            isButton: true
6117
14c3f5a404b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6106
diff changeset
  4731
            labelImage: (ResourceRetriever ToolbarIconLibrary printerIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4732
          )
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4733
         (MenuItem
6681
b93c9a6b607d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6626
diff changeset
  4734
            label: '-'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4735
          )
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4736
         (MenuItem
8087
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4737
            activeHelpKey: toggleHexDisplay
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4738
            enabled: enableHexToggle
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4739
            label: 'Hex'
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4740
            translateLabel: true
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4741
            isButton: true
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4742
            indication: printAsHexDump
6096
ad7437953ee4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6093
diff changeset
  4743
            labelImage: (ResourceRetriever ToolbarIconLibrary hexToggleIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4744
          )
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4745
         (MenuItem
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4746
            label: ''
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  4747
            isVisible: diffTextButtonVisible
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  4748
          )
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4749
         (MenuItem
8087
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4750
            activeHelpKey: showDifferences
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4751
            label: 'Diff to Current'
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4752
            itemValue: openDiffView
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4753
            translateLabel: true
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4754
            isButton: true
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4755
            isVisible: diffTextButtonVisible
6096
ad7437953ee4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6093
diff changeset
  4756
            labelImage: (ResourceRetriever ToolbarIconLibrary diffIcon)
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  4757
          )
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4758
         (MenuItem
6681
b93c9a6b607d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6626
diff changeset
  4759
            activeHelpKey: closeTabButton
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4760
            label: 'Close'
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4761
            itemValue: doClose
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4762
            translateLabel: true
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4763
            isButton: true
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4764
            startGroup: right
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  4765
            isVisible: closeButtonShown
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4766
            hideMenuOnActivated: false
6093
cab3a82eaa34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6091
diff changeset
  4767
            labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4768
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4769
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4770
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  4771
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  4772
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
  4773
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4774
321c1729db5b initial checkin
penk
parents:
diff changeset
  4775
!FileApplicationNoteBook::TextEditor methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4776
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  4777
fileEncoding
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  4778
    ^ self fileEncodingHolder value
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  4779
!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  4780
5534
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  4781
fileEncoding:newEncoding
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  4782
    self fileEncodingHolder value:newEncoding.
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  4783
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  4784
    editView notNil ifTrue:[
5705
e7559e531af5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5693
diff changeset
  4785
        self enableReload value:true.
5534
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  4786
        editView externalEncoding:newEncoding.
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  4787
    ].
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  4788
!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  4789
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4790
item:aDirContentsItem
321c1729db5b initial checkin
penk
parents:
diff changeset
  4791
4977
621cc3cb454d checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents: 4971
diff changeset
  4792
    self releaseCheckModify.
4620
59601a37cc0b hexDump from tools menu implemented
penk
parents: 4616
diff changeset
  4793
    (self item = aDirContentsItem and:[(self presentation == #hexDump) == self printAsHexDump value]) ifTrue:[^ true].
7947
32baaebb4943 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7910
diff changeset
  4794
5534
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  4795
    self askForChangeWithReload:false "true".
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4796
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4797
    super item:aDirContentsItem.
4698
14a71be57ecf dont load twice on startup TextEditor
penk
parents: 4677
diff changeset
  4798
    self printAsHexDump value:(self presentation == #hexDump) withoutNotifying:self.
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  4799
    self updateTagsBrowser.
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4188
diff changeset
  4800
    self setContents ifFalse:[ ^ false].
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  4801
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  4802
    self setUpTextView.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  4803
4977
621cc3cb454d checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents: 4971
diff changeset
  4804
    textEditorModificationTime := self fileName modificationTime.
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4805
    self releaseCheckModify.
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  4806
    self setupCheckModify.
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4807
    self changeInformation.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4808
    ^ true
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  4809
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  4810
    "Modified: / 23-06-2011 / 16:45:13 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4811
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4812
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
  4813
lockFileEncoding:aBoolean
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
  4814
    self lockFileEncodingHolder value:aBoolean.
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
  4815
!
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
  4816
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4817
presentation
321c1729db5b initial checkin
penk
parents:
diff changeset
  4818
    "return the value of the instance variable 'presentation' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  4819
321c1729db5b initial checkin
penk
parents:
diff changeset
  4820
    presentation isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  4821
        presentation := #asText.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4822
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4823
    ^ presentation
321c1729db5b initial checkin
penk
parents:
diff changeset
  4824
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4825
321c1729db5b initial checkin
penk
parents:
diff changeset
  4826
presentation:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  4827
    "set the value of the instance variable 'presentation' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  4828
321c1729db5b initial checkin
penk
parents:
diff changeset
  4829
    presentation := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4830
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4831
321c1729db5b initial checkin
penk
parents:
diff changeset
  4832
semaChangeItem
321c1729db5b initial checkin
penk
parents:
diff changeset
  4833
    ^ semaChangeItem
5459
d90defc58d51 window label and tab string changed
penk
parents: 5458
diff changeset
  4834
!
d90defc58d51 window label and tab string changed
penk
parents: 5458
diff changeset
  4835
d90defc58d51 window label and tab string changed
penk
parents: 5458
diff changeset
  4836
type:aType
d90defc58d51 window label and tab string changed
penk
parents: 5458
diff changeset
  4837
d90defc58d51 window label and tab string changed
penk
parents: 5458
diff changeset
  4838
    super type:aType.
d90defc58d51 window label and tab string changed
penk
parents: 5458
diff changeset
  4839
    self changeInformation.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4840
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4841
321c1729db5b initial checkin
penk
parents:
diff changeset
  4842
!FileApplicationNoteBook::TextEditor methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4843
321c1729db5b initial checkin
penk
parents:
diff changeset
  4844
accept
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4845
    self saveWithAskForFilename:false.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4846
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4847
5198
ea3f838e1353 do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents: 5197
diff changeset
  4848
askForChangeWithReload:doReload
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4849
    "ask for save changes; 
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4850
     if modified and answered true, the current contents is written back (accepted)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4851
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4852
5578
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4853
    self askForChangeWithReload:doReload forClose:false
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4854
!
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4855
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4856
askForChangeWithReload:doReload forClose:forClose
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4857
    "ask for save changes; 
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4858
     if modified and answered true, the current contents is written back (accepted)
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4859
    "
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4860
5471
ad6c1fc272de care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
  4861
    |fn answer string arg|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4862
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4863
    self modifiedChannel value ifFalse:[ ^ false].
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4864
5471
ad6c1fc272de care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
  4865
    fn := self fileName.
ad6c1fc272de care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
  4866
    fn isNil ifTrue:[
ad6c1fc272de care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
  4867
        fn := 'unknown'
ad6c1fc272de care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
  4868
    ] ifFalse:[
ad6c1fc272de care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
  4869
        fn := fn baseName.
ad6c1fc272de care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
  4870
    ].
ad6c1fc272de care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
  4871
    arg := fn allBold.
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4872
5578
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4873
    string := 'Save changed file "%1" ?'.
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4874
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4875
    forClose ifTrue:[
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4876
        self itemChanged value ifTrue:[
9568
24784f4fcafd info message
Claus Gittinger <cg@exept.de>
parents: 9459
diff changeset
  4877
            string := 'Modified %1 was changed by someone else.\\Save your changes (overwrite someone''s changes) ?' 
5578
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4878
        ] ifFalse:[
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4879
            self itemRemoved value ifTrue:[
6376
2d3996297468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6336
diff changeset
  4880
                string := 'Modified %1 was removed by someone else.\\Save your changes (recreate the removed file) ?' 
5578
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4881
            ]
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4882
        ].
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4883
    ] ifFalse:[
5578
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4884
        self itemChanged value ifTrue:[
9568
24784f4fcafd info message
Claus Gittinger <cg@exept.de>
parents: 9459
diff changeset
  4885
            string := '%1 was changed by someone else.\\Save your changes anyway (overwrite someon''es changes) ?' 
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4886
        ] ifFalse:[
5578
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4887
            self itemRemoved value ifTrue:[
6376
2d3996297468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6336
diff changeset
  4888
                string := '%1 was removed by someone else.\\Save your changes anyway (recreate the removed file) ?' 
5578
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4889
            ]
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4890
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4891
    ].
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4892
5199
f8f257045045 added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents: 5198
diff changeset
  4893
    answer := OptionBox 
6376
2d3996297468 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6336
diff changeset
  4894
                request:(resources stringWithCRs:string with:arg) 
5199
f8f257045045 added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents: 5198
diff changeset
  4895
                buttonLabels:(resources array:#('Cancel' 'Show Diffs' 'No' 'Yes')) 
f8f257045045 added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents: 5198
diff changeset
  4896
                values:#(nil showDiffs false true) 
f8f257045045 added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents: 5198
diff changeset
  4897
                default:nil.
f8f257045045 added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents: 5198
diff changeset
  4898
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4899
    answer isNil ifTrue:[^ AbortOperationRequest raise ].
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4900
5199
f8f257045045 added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents: 5198
diff changeset
  4901
    answer == #showDiffs ifTrue:[
5201
979c36ed9a22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5199
diff changeset
  4902
        self openDiffView.
5199
f8f257045045 added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents: 5198
diff changeset
  4903
        AbortOperationRequest raise
f8f257045045 added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents: 5198
diff changeset
  4904
    ].
f8f257045045 added showDiffs option to askForChange
Claus Gittinger <cg@exept.de>
parents: 5198
diff changeset
  4905
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4906
    answer ifTrue:[
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4907
        self accept
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  4908
    ] ifFalse:[
5198
ea3f838e1353 do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents: 5197
diff changeset
  4909
        doReload ifTrue:[
ea3f838e1353 do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents: 5197
diff changeset
  4910
            self setContents.
ea3f838e1353 do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents: 5197
diff changeset
  4911
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4912
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4913
    ^ answer
9568
24784f4fcafd info message
Claus Gittinger <cg@exept.de>
parents: 9459
diff changeset
  4914
24784f4fcafd info message
Claus Gittinger <cg@exept.de>
parents: 9459
diff changeset
  4915
    "Modified: / 11-09-2010 / 13:07:37 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4916
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4917
321c1729db5b initial checkin
penk
parents:
diff changeset
  4918
changeInformation 
321c1729db5b initial checkin
penk
parents:
diff changeset
  4919
4621
d033f85c8cc3 hexDump from tools menu implemented
penk
parents: 4620
diff changeset
  4920
    | stream win|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4921
321c1729db5b initial checkin
penk
parents:
diff changeset
  4922
    stream := WriteStream with:(self getTabString).
321c1729db5b initial checkin
penk
parents:
diff changeset
  4923
    masterApplication isNil ifTrue:[
4621
d033f85c8cc3 hexDump from tools menu implemented
penk
parents: 4620
diff changeset
  4924
        win := self window.
d033f85c8cc3 hexDump from tools menu implemented
penk
parents: 4620
diff changeset
  4925
        win notNil ifTrue:[
d033f85c8cc3 hexDump from tools menu implemented
penk
parents: 4620
diff changeset
  4926
            self window label:stream contents.
d033f85c8cc3 hexDump from tools menu implemented
penk
parents: 4620
diff changeset
  4927
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4928
    ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  4929
        masterApplication tabStringChangeTo:stream contents for:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4930
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4931
    stream close.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4932
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4933
4161
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  4934
changeInformationForModified:aSymbol 
4045
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
  4935
    masterApplication isNil ifTrue:[ ^ self].
4161
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  4936
    masterApplication changeModified:aSymbol for:self.
4045
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
  4937
!
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
  4938
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4939
doClose
321c1729db5b initial checkin
penk
parents:
diff changeset
  4940
5578
068f032a49ee dialog box string
Claus Gittinger <cg@exept.de>
parents: 5574
diff changeset
  4941
    self askForChangeWithReload:false forClose:true.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4942
    self masterApplication notNil ifTrue:[
3954
78e29a3ea4c1 next stage
penk
parents: 3951
diff changeset
  4943
        ^ super doClose
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4944
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4945
    ^ true
321c1729db5b initial checkin
penk
parents:
diff changeset
  4946
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4947
321c1729db5b initial checkin
penk
parents:
diff changeset
  4948
doPrint
321c1729db5b initial checkin
penk
parents:
diff changeset
  4949
    "print the contents
321c1729db5b initial checkin
penk
parents:
diff changeset
  4950
    "
4473
a0ab7a61208e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4462
diff changeset
  4951
    (Dialog confirm:'Print contents of editView ?') ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4952
        editView doPrint.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4953
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4954
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4955
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4956
doSaveAs
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4957
    self saveWithAskForFilename:true.
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4958
!
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  4959
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  4960
getContents
8471
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4961
    |file fileSize contents presentation alreadyConfirmed answer sizeLimit showLastPart|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4962
321c1729db5b initial checkin
penk
parents:
diff changeset
  4963
    file := self fileName.
5831
6db521464804 care for no-selection when toggling hex-mode
Claus Gittinger <cg@exept.de>
parents: 5784
diff changeset
  4964
    file isNil ifTrue:[
6db521464804 care for no-selection when toggling hex-mode
Claus Gittinger <cg@exept.de>
parents: 5784
diff changeset
  4965
        ^ nil
6db521464804 care for no-selection when toggling hex-mode
Claus Gittinger <cg@exept.de>
parents: 5784
diff changeset
  4966
    ].
7487
d1b696d27ff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7467
diff changeset
  4967
    fileSize := file fileSize.
d1b696d27ff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7467
diff changeset
  4968
    fileSize isNil ifTrue:[
d1b696d27ff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7467
diff changeset
  4969
        ^ nil
d1b696d27ff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7467
diff changeset
  4970
    ].
5831
6db521464804 care for no-selection when toggling hex-mode
Claus Gittinger <cg@exept.de>
parents: 5784
diff changeset
  4971
8087
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4972
    self enableSelectInBrowser value:true.
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  4973
6295
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  4974
    presentation := self presentation.
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  4975
    presentation == #asText ifTrue:[
8471
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4976
        fileSize > (8 * 1024 * 1024) ifTrue:[
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4977
            answer := OptionBox  
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4978
                        request:(resources
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4979
                                    stringWithCRs:'%1 is very large (%2).\\Show all or only the first 8 Mb ?' 
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4980
                                    with:file baseName allBold 
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4981
                                    with:(UnitConverter fileSizeStringFor:fileSize))
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4982
                        label:(resources string:'Large File')
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4983
                        buttonLabels:(resources array:#('Cancel' 'Show All' 'Show Last Part' 'Show First Part' ))
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4984
                        values:#(#abort #all #last #first)
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4985
                        default:#abort.
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4986
"/            answer := Dialog
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4987
"/                            confirmWithCancel:(resources
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4988
"/                                                stringWithCRs:'%1 is very large (%2).\\Show all or only the first 4 Mb ?' 
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4989
"/                                                with:file baseName allBold 
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4990
"/                                                with:(UnitConverter fileSizeStringFor:fileSize))
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4991
"/                            labels:#('Cancel' 'Show All' 'Show First Part' ).
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4992
"/            answer isNil ifTrue:[^ nil].
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4993
"/            answer ifTrue:[
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4994
"/                sizeLimit := 4 * 1024 * 1024
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4995
"/            ].
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4996
            answer == #abort ifTrue:[^ nil ].
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4997
            answer ~~ #all ifTrue:[
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4998
                sizeLimit := 4 * 1024 * 1024.
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  4999
                showLastPart := (answer == #last).
6295
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5000
            ].
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5001
        ].
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5002
    ].
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5003
5037
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5004
    ExternalStream readErrorSignal handle:[:ex |
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5005
        (Dialog confirm:('Read Error.\\Retry ?' withCRs))    
5019
f54a8b10ac1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
  5006
        ifTrue:[
5037
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5007
            ^ ex restart
5019
f54a8b10ac1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5010
diff changeset
  5008
        ].
5037
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5009
    ] do:[    
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5010
        ExternalStream lineTooLongErrorSignal handle:[ :ex |
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5011
            (alreadyConfirmed==true
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5012
            or:[ Dialog confirm:(file asString, ' contains very long line(s).\\Load anyway ?' withCRs)])    
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5013
            ifTrue:[
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5014
                alreadyConfirmed := true.
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5015
                ^ ex parameter second , ex parameter first nextLine
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5016
            ].
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5017
            ^ nil.
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5018
        ] do:[
6295
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5019
            presentation == #asText ifTrue:[
8471
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  5020
                contents := self getContentsAsTextWithSizeLimit:sizeLimit lastPart:showLastPart.
5037
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5021
            ] ifFalse:[
6295
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5022
                presentation == #hexDump ifTrue:[
6833
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  5023
"/                    self withWaitCursorDo:[
8471
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  5024
                        contents := AbstractFileBrowser 
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  5025
                                        contentsOfFileAsHexDump:file
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  5026
                                        withLimit:sizeLimit 
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  5027
                                        lastPart:showLastPart.
6833
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  5028
"/                    ]
4677
549c732836f6 wait cursor
Claus Gittinger <cg@exept.de>
parents: 4645
diff changeset
  5029
                ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5030
            ]
5037
d40f57420be0 read error handling
Claus Gittinger <cg@exept.de>
parents: 5019
diff changeset
  5031
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5032
    ].
4608
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5033
    ^ contents.
6833
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  5034
7769
6cd2993fa017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7765
diff changeset
  5035
    "Modified: / 27-03-2007 / 13:41:35 / cg"
4608
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5036
!
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5037
6295
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5038
getContentsAsTextWithSizeLimit:sizeLimitOrNil
5540
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5039
    "returns the contents as unicode"
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5040
8471
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  5041
    ^ self getContentsAsTextWithSizeLimit:sizeLimitOrNil lastPart:false
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  5042
!
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  5043
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  5044
getContentsAsTextWithSizeLimit:sizeLimitOrNil lastPart:showLastPartOrNil
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  5045
    "returns the contents as unicode"
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  5046
5540
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5047
    |text guessedEncoding s|
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5048
8390
f03711c97860 encoder error reporting
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
  5049
    (self lockFileEncodingHolder value ? false) ifFalse:[
6173
4ba4589e4952 guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 6120
diff changeset
  5050
        guessedEncoding := CharacterEncoder guessEncodingOfFile:item fileName asFilename.
11589
bb69ef59a32f Return symbols for encoding
Stefan Vogel <sv@exept.de>
parents: 11588
diff changeset
  5051
        guessedEncoding := guessedEncoding ? #'iso8859-1' "(self fileEncoding)".
bb69ef59a32f Return symbols for encoding
Stefan Vogel <sv@exept.de>
parents: 11588
diff changeset
  5052
        self fileEncoding:guessedEncoding asSymbol.
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
  5053
    ].
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5054
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5055
    editView notNil ifTrue:[
5540
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5056
"/        self validateEditViewsFontEncoding.
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5057
        editView externalEncoding:self fileEncoding.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5058
    ].
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5059
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5060
    s := self fileName readStream.
7594
86a9efd53284 Close file after reading
Stefan Vogel <sv@exept.de>
parents: 7582
diff changeset
  5061
    [
8471
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  5062
        showLastPartOrNil == true ifTrue:[
11590
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5063
            s position:(s fileSize - sizeLimitOrNil).
8471
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  5064
        ].
4f7900a058bd last part
Claus Gittinger <cg@exept.de>
parents: 8390
diff changeset
  5065
7594
86a9efd53284 Close file after reading
Stefan Vogel <sv@exept.de>
parents: 7582
diff changeset
  5066
        text := self 
86a9efd53284 Close file after reading
Stefan Vogel <sv@exept.de>
parents: 7582
diff changeset
  5067
                    readStream:s 
86a9efd53284 Close file after reading
Stefan Vogel <sv@exept.de>
parents: 7582
diff changeset
  5068
                    lineDelimiter:(Character cr) 
86a9efd53284 Close file after reading
Stefan Vogel <sv@exept.de>
parents: 7582
diff changeset
  5069
                    sizeLimit:sizeLimitOrNil
86a9efd53284 Close file after reading
Stefan Vogel <sv@exept.de>
parents: 7582
diff changeset
  5070
                    encoding:self fileEncoding.
86a9efd53284 Close file after reading
Stefan Vogel <sv@exept.de>
parents: 7582
diff changeset
  5071
    ] ensure:[
86a9efd53284 Close file after reading
Stefan Vogel <sv@exept.de>
parents: 7582
diff changeset
  5072
        s close.
86a9efd53284 Close file after reading
Stefan Vogel <sv@exept.de>
parents: 7582
diff changeset
  5073
    ].
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5074
    ^ text
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5075
!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5076
4608
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5077
getHashForContents:contents
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5078
    | hashStream|
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5079
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5080
    self hasMD5 ifFalse:[^ nil].
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5081
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5082
    hashStream := MD5Stream new.
11284
ebb519afb53d handle non-string collections as contents (virtualArray)
Claus Gittinger <cg@exept.de>
parents: 11104
diff changeset
  5083
    (contents isCollection and:[ contents isString not ]) ifTrue:[
4608
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5084
        contents do:[:eachLine |
4616
e877ab5a2237 hashing for empty lines
Claus Gittinger <cg@exept.de>
parents: 4612
diff changeset
  5085
            eachLine notNil ifTrue:[
e877ab5a2237 hashing for empty lines
Claus Gittinger <cg@exept.de>
parents: 4612
diff changeset
  5086
                hashStream nextPutAll:(eachLine string withTabs).
e877ab5a2237 hashing for empty lines
Claus Gittinger <cg@exept.de>
parents: 4612
diff changeset
  5087
            ].
e877ab5a2237 hashing for empty lines
Claus Gittinger <cg@exept.de>
parents: 4612
diff changeset
  5088
            hashStream nextPut:Character cr.
4608
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5089
        ].
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5090
    ] ifFalse:[
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5091
        hashStream nextPutAll:(contents string).
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5092
    ].
4608
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5093
    ^ hashStream hashValue.
11284
ebb519afb53d handle non-string collections as contents (virtualArray)
Claus Gittinger <cg@exept.de>
parents: 11104
diff changeset
  5094
ebb519afb53d handle non-string collections as contents (virtualArray)
Claus Gittinger <cg@exept.de>
parents: 11104
diff changeset
  5095
    "Modified: / 27-02-2012 / 22:10:18 / cg"
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5096
!
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5097
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5098
openDiffView
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5099
    |fn diffView text1 l1 text2 l2|
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5100
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5101
    (fn := self fileName) notNil ifTrue:[
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5102
        text1 := editView contents asText.
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5103
        l1 := 'Editor'.
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5104
        text2 := self getContents.
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5105
        l2 := 'File: ' , fn baseName.
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5106
        diffView := DiffTextView openOn:text1 label:l1 and:text2 label:l2.
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5107
        diffView topView label:'File ' , fn baseName , ' vs. Editor Contents'.
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5108
    ].
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5109
!
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5110
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5111
readStream:aStream lineDelimiter:aCharacter encoding:fileEncodingArg 
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5112
    "read from aStream, answer its contents as StringCollection. 
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5113
     The files lines are delimited by aCharacter.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5114
     If encoding is nonNil, the file is assumed to be coded according to
5540
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5115
     that symbol, and #decodeString: should be able to convert it into unicode.
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5116
     Always returns a unicode string."
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5117
6295
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5118
    ^ self readStream:aStream lineDelimiter:aCharacter sizeLimit:nil encoding:fileEncodingArg
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5119
!
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5120
6796
23a7b7f0bd39 bug in long line handling fixed
Claus Gittinger <cg@exept.de>
parents: 6793
diff changeset
  5121
readStream:aStream lineDelimiter:lineDelimiter sizeLimit:sizeLimitOrNil encoding:fileEncodingArg 
6295
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5122
    "read from aStream, answer its contents as StringCollection. 
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5123
     The files lines are delimited by aCharacter.
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5124
     If encoding is nonNil, the file is assumed to be coded according to
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5125
     that symbol, and #decodeString: should be able to convert it into unicode.
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5126
     Always returns a unicode string."
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5127
8390
f03711c97860 encoder error reporting
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
  5128
    |text fileEncoding decoder firstDecoderError line lineNr|
5540
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5129
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5130
    fileEncoding := fileEncodingArg ? #'iso8859-1'.
5718
a16c274a18ef *** empty log message ***
ca
parents: 5717
diff changeset
  5131
    decoder := CharacterEncoder encoderFor:fileEncoding.
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5132
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5133
    text := StringCollection new.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5134
5534
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5135
    firstDecoderError := true.
8390
f03711c97860 encoder error reporting
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
  5136
    lineNr := 1.
5534
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5137
5646
123550dd90f6 handle decoder errors
Claus Gittinger <cg@exept.de>
parents: 5612
diff changeset
  5138
    DecodingError handle:[:ex | 
11590
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5139
        |msg answer labels values|
5646
123550dd90f6 handle decoder errors
Claus Gittinger <cg@exept.de>
parents: 5612
diff changeset
  5140
5534
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5141
        firstDecoderError ifTrue:[
8390
f03711c97860 encoder error reporting
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
  5142
            msg := resources stringWithCRs:'Error in decoder: %1\In Line: %2\\%3' with:ex errorString with:lineNr with:line.
11590
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5143
            ex mayProceed ifTrue:[
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5144
                labels := #('Cancel' 'Ignore' 'Ignore All' 'Inspect Line').
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5145
                values := #(nil ignore ignoreAll inspectLine).
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5146
            ] ifFalse:[
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5147
                labels := #('Cancel' 'Inspect Line').
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5148
                values := #(nil inspectLine).
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5149
            ].
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5150
5646
123550dd90f6 handle decoder errors
Claus Gittinger <cg@exept.de>
parents: 5612
diff changeset
  5151
            answer := Dialog 
123550dd90f6 handle decoder errors
Claus Gittinger <cg@exept.de>
parents: 5612
diff changeset
  5152
                confirmWithCancel:msg
11590
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5153
                labels:(resources array:labels)
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5154
                values:values
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5155
                default:1
7693
d266b8b66638 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7687
diff changeset
  5156
                title:'Error during decode'.
5646
123550dd90f6 handle decoder errors
Claus Gittinger <cg@exept.de>
parents: 5612
diff changeset
  5157
            answer isNil ifTrue:[ AbortOperationRequest raise ].
123550dd90f6 handle decoder errors
Claus Gittinger <cg@exept.de>
parents: 5612
diff changeset
  5158
            answer == #ignoreAll ifTrue:[ firstDecoderError := false ].
8390
f03711c97860 encoder error reporting
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
  5159
            answer == #inspectLine ifTrue:[ line inspect. AbortOperationRequest raise ].
5534
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5160
        ].
8389
0c1050ff7f88 encoding error handling
Claus Gittinger <cg@exept.de>
parents: 8366
diff changeset
  5161
        ex proceedWith:(ex defaultValue).
5534
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5162
    ] do:[
6295
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5163
        FileStream lineTooLongErrorSignal handle:[:ex |
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5164
            |s partialLine|
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5165
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5166
            s := ex parameter at:1.
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5167
            partialLine := ex parameter at:2.
6796
23a7b7f0bd39 bug in long line handling fixed
Claus Gittinger <cg@exept.de>
parents: 6793
diff changeset
  5168
            ex proceedWith:(partialLine , (s upTo:lineDelimiter))
6295
11ae28df92c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  5169
        ] do:[
9172
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5170
            (decoder characterSize:0) == 2 ifTrue:[
11590
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5171
                "a TwoByte decoder. Decode first an then process line breaks."
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5172
            
9172
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5173
                |buffer|
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5174
11590
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  5175
                buffer := line := aStream upToEnd.
9172
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5176
                buffer := decoder decodeString:buffer.
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5177
                buffer asCollectionOfLines do:[:line |
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5178
                    text add:line withTabsExpanded.
5534
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5179
                ].
9172
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5180
            ] ifFalse:[
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5181
                [aStream atEnd] whileFalse:[
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5182
                    lineDelimiter == Character cr ifTrue:[
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5183
                        line := aStream nextLine.
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5184
                    ] ifFalse:[
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5185
                        line := aStream upTo:lineDelimiter.
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5186
                    ].
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5187
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5188
                    line := line withTabsExpanded.
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5189
                    text add:(decoder decodeString:line).
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5190
                    sizeLimitOrNil notNil ifTrue:[
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5191
                        aStream position > sizeLimitOrNil ifTrue:[
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5192
                            ^ text
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5193
                        ]
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5194
                    ].
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5195
                    lineNr := lineNr + 1.
e7632f98f762 handle utf16 encoded files more gracefully
Claus Gittinger <cg@exept.de>
parents: 8912
diff changeset
  5196
                ]
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5197
            ].
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5198
        ].
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5199
    ].
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5200
    ^ text
7693
d266b8b66638 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7687
diff changeset
  5201
d266b8b66638 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7687
diff changeset
  5202
    "Modified: / 02-03-2007 / 15:09:30 / cg"
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5203
!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5204
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5205
reload
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5206
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5207
    textEditorModificationTime := self fileName modificationTime.
6833
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  5208
"/    self withWaitCursorDo:[
5287
693e3ca577aa avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents: 5279
diff changeset
  5209
        self setContents.
6833
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  5210
"/    ].
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  5211
caeedd92f25c wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6796
diff changeset
  5212
    "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
  5213
!
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5214
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5215
saveFileAs
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5216
    self saveWithAskForFilename:true
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5217
!
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5218
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5219
saveWithAskForFilename:ask
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5220
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5221
    |answer fn master defaultDir dir base fnDir|
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5222
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5223
    master := self masterApplication.
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5224
    self fileName notNil ifTrue:[
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5225
        dir := self fileName directory.
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5226
        base := self fileName baseName.
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5227
    ].
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5228
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5229
    ask ifTrue:[
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5230
        defaultDir := master notNil ifTrue:[ master currentDirectory ] ifFalse:[ nil ].
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5231
        defaultDir isNil ifTrue:[
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5232
            self fileName notNil ifTrue:[
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5233
                defaultDir := dir.
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5234
            ]
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5235
        ].
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5236
        answer := Dialog
9611
Claus Gittinger <cg@exept.de>
parents: 9568
diff changeset
  5237
            requestFileNameForSave:(resources string:'Save contents in:') 
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5238
            default:base 
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5239
            fromDirectory:defaultDir.
9611
Claus Gittinger <cg@exept.de>
parents: 9568
diff changeset
  5240
        answer isEmptyOrNil ifTrue:[^ self].
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5241
        fn := answer asFilename.
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5242
    ] ifFalse:[
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5243
        fn := self fileName
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5244
    ].
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5245
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5246
    (master notNil and:[master class openAnotherApplicationOnSameItem]) ifTrue:[
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5247
        (self updateSameFilesFor:fn) ifFalse:[ ^ self ].
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5248
    ].
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5249
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5250
    fnDir := fn directory.
6250
5b0673ccff1c refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents: 6214
diff changeset
  5251
    fnDir exists ifFalse:[
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5252
        fnDir recursiveMakeDirectory.
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5253
    ].
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5254
    (editView saveAs:fn) ifFalse:[^ self].
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5255
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5256
    textEditorModificationTime := self fileName modificationTime.
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5257
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5258
    self hasMD5 ifTrue:[
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5259
        md5CheckSum := self getHashForContents:self fileContentsModel value.
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5260
    ].
5471
ad6c1fc272de care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
  5261
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5262
    self enableReload value:false.
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5263
    self itemChanged value:false.
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5264
    self itemRemoved value:false.
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5265
    self modifiedChannel value:false.
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5266
    self notify:self fileName asString, ' saved'.
9611
Claus Gittinger <cg@exept.de>
parents: 9568
diff changeset
  5267
Claus Gittinger <cg@exept.de>
parents: 9568
diff changeset
  5268
    "Modified: / 27-10-2010 / 10:41:29 / cg"
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5269
!
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5270
4146
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
  5271
searchForPattern:aContentsPattern ignoreCase:ign
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
  5272
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
  5273
    | pattern |
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
  5274
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
  5275
    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
  5276
    pattern notEmpty ifTrue:[
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
  5277
        editView rememberSearchPattern:pattern.
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
  5278
        editView searchFwd:pattern ignoreCase:ign.
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
  5279
    ]
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
  5280
!
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
  5281
8087
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5282
selectInBrowser
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5283
    |application|
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5284
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5285
    application := self masterApplication.
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5286
    application notNil ifTrue:[
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5287
        application gotoFile:(self fileName).
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5288
    ].
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5289
!
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5290
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5291
setContents
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5292
    |text|
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5293
7970
337b8efd934e readcursor while reading a file
Claus Gittinger <cg@exept.de>
parents: 7947
diff changeset
  5294
    self withReadCursorDo:[
337b8efd934e readcursor while reading a file
Claus Gittinger <cg@exept.de>
parents: 7947
diff changeset
  5295
        text := self getContents.
337b8efd934e readcursor while reading a file
Claus Gittinger <cg@exept.de>
parents: 7947
diff changeset
  5296
    ].
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4188
diff changeset
  5297
    text isNil ifTrue:[ ^ false].
9885
62bac7ad7d0c changed: #startApplication:
ab
parents: 9882
diff changeset
  5298
    self withWaitCursorDo:[
62bac7ad7d0c changed: #startApplication:
ab
parents: 9882
diff changeset
  5299
        self setContentsFor:text.
62bac7ad7d0c changed: #startApplication:
ab
parents: 9882
diff changeset
  5300
    ].
4953
d6561bb214d5 red text color for outdated files only
penk
parents: 4946
diff changeset
  5301
    ^ true
d6561bb214d5 red text color for outdated files only
penk
parents: 4946
diff changeset
  5302
!
d6561bb214d5 red text color for outdated files only
penk
parents: 4946
diff changeset
  5303
5540
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5304
setContentsFor:aUnicodeText
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5305
    self itemChanged value:false.
5534
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5306
5540
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5307
    self validateEditViewsFontEncoding.
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5308
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5309
    self fileContentsModel value:aUnicodeText.
5534
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5310
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5311
    self hasMD5 ifTrue:[
5540
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5312
        md5CheckSum := self getHashForContents:aUnicodeText.
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5313
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5314
    self enableReload value:false.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5315
    self itemChanged value:false.
4045
9271a4ffbba4 make tab to red for changed file
penk
parents: 4020
diff changeset
  5316
    self modifiedChannel value:false.
8614
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5317
    self notify:nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5318
    ^ true
5534
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5319
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5320
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5321
"/
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5322
"/        oldEncoding := editView characterEncoding.
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5323
"/        oldEncoding ~= newEncoding ifTrue:[
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5324
"/self halt.
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5325
"/            (lines := editView contents) size > 0 ifTrue:[
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5326
"/                (Dialog 
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5327
"/                    confirm:('Re-Encode contents (from %1 to %2) ?'
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5328
"/                                bindWith:oldEncoding
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5329
"/                                with:newEncoding)
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5330
"/                ) ifTrue:[
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5331
"/                    recoder := CharacterEncoder 
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5332
"/                                encoderToEncodeFrom:oldEncoding
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5333
"/                                into:newEncoding.
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5334
"/                    lines keysAndValuesDo:[:lineNr :line |
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5335
"/                        line notNil ifTrue:[
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5336
"/                            editView at:lineNr put:(recoder encodeString:line).
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5337
"/                        ].
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5338
"/                    ].
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5339
"/                ]
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5340
"/            ].
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5341
"/        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5342
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5343
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5344
tagSelected:aTag
11032
67fc45edcaac tag-selection fix (when textselection is present)
Claus Gittinger <cg@exept.de>
parents: 10955
diff changeset
  5345
    editView deselect.  "/ otherwise, it might jump back to show the selection
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5346
    editView cursorLine:(aTag lineNumber) col:1.
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5347
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5348
    "Created: / 23-06-2011 / 16:38:07 / cg"
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5349
!
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5350
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5351
updateSameFilesFor:aFilename
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5352
321c1729db5b initial checkin
penk
parents:
diff changeset
  5353
    | master modifiedApplications stream filename action|
321c1729db5b initial checkin
penk
parents:
diff changeset
  5354
321c1729db5b initial checkin
penk
parents:
diff changeset
  5355
    master := self masterApplication.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5356
    master notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5357
        modifiedApplications := master getSameFilesModifiedFor:self.
6482
00207f456339 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 6481
diff changeset
  5358
        (modifiedApplications isEmptyOrNil) ifTrue:[^ true ].
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5359
        filename := aFilename asString.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5360
        stream := WriteStream on:''.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5361
        stream nextPutAll:filename.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5362
        stream nextPutAll:' is modified in tab'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5363
        modifiedApplications size > 1 ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5364
            stream nextPutAll:'s'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5365
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5366
        stream cr.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5367
        modifiedApplications do:[ : el |
321c1729db5b initial checkin
penk
parents:
diff changeset
  5368
            stream space.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5369
            stream nextPutAll:filename.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5370
            stream space.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5371
            el sameFileIndex notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5372
                stream nextPutAll:el sameFileIndex asString.        
321c1729db5b initial checkin
penk
parents:
diff changeset
  5373
            ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5374
            stream cr.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5375
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5376
        stream nextPutAll:'forget changes on other tab'.        
321c1729db5b initial checkin
penk
parents:
diff changeset
  5377
        modifiedApplications size > 1 ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5378
            stream nextPutAll:'s'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5379
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5380
        stream nextPutAll:' ?'.        
321c1729db5b initial checkin
penk
parents:
diff changeset
  5381
        action := Dialog 
321c1729db5b initial checkin
penk
parents:
diff changeset
  5382
            choose:stream contents 
321c1729db5b initial checkin
penk
parents:
diff changeset
  5383
            labels:#('cancel' 'no' 'yes') 
321c1729db5b initial checkin
penk
parents:
diff changeset
  5384
            values:#(#cancel #no #yes) 
321c1729db5b initial checkin
penk
parents:
diff changeset
  5385
            default:#cancel. 
321c1729db5b initial checkin
penk
parents:
diff changeset
  5386
321c1729db5b initial checkin
penk
parents:
diff changeset
  5387
        stream close.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5388
        action == #cancel ifTrue:[ ^ false ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5389
        action == #yes ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5390
            "/ here force reload for other applications
321c1729db5b initial checkin
penk
parents:
diff changeset
  5391
            modifiedApplications do:[ : el |
321c1729db5b initial checkin
penk
parents:
diff changeset
  5392
                el reload.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5393
            ]            
321c1729db5b initial checkin
penk
parents:
diff changeset
  5394
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5395
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5396
    ^ true.
5540
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5397
!
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5398
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5399
validateEditViewsFontEncoding
5717
f2ec29a73239 do not ask again about encoding
penk
parents: 5705
diff changeset
  5400
    |fileEncoding preferredFontEncoding fontsEncoding action|
5540
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5401
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5402
    editView isNil ifTrue:[^ self].
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5403
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5404
    fileEncoding := self fileEncoding.
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5405
11589
bb69ef59a32f Return symbols for encoding
Stefan Vogel <sv@exept.de>
parents: 11588
diff changeset
  5406
    fontsEncoding := editView font encoding ? #'iso8859-1'.
5540
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5407
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5408
    preferredFontEncoding := FontDescription preferredFontEncodingFor:fileEncoding.
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5409
    (CharacterEncoder isEncoding:preferredFontEncoding subSetOf:fontsEncoding) ifFalse:[
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5410
            doNotShowFontDialog == true ifTrue:[
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5411
                action := #show
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5412
            ] ifFalse:[
5609
9ea9d7e7ef95 characterEncoding stuff
Claus Gittinger <cg@exept.de>
parents: 5586
diff changeset
  5413
                action := Dialog choose:(resources string:'''%1'' seems to require a %2 (or unicode) font (file encoding is %3).' 
5540
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5414
                                                     with:self fileName baseName 
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5415
                                                     with:preferredFontEncoding allBold 
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5416
                                                     with:fileEncoding)
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5417
                               labels:(resources array:#('Cancel' 'Show' 'Don''t Ask Again' 'Change Font'))
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5418
                               values:#(nil #show #showAlways #encoding)
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5419
                               default:#encoding.
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5420
            ].
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5421
            action == #showAlways ifTrue:[
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5422
                doNotShowFontDialog := true.
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5423
                action := #show.
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5424
            ].
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5425
            action isNil ifTrue:[
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5426
                AbortSignal raise
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5427
            ].
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5428
            action == #encoding ifTrue:[
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5429
                editView validateFontEncodingFor:fileEncoding ask:false.
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5430
            ].
9e1262cf0612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5534
diff changeset
  5431
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5432
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  5433
321c1729db5b initial checkin
penk
parents:
diff changeset
  5434
!FileApplicationNoteBook::TextEditor methodsFor:'aspects'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5435
5120
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5436
cursorColLabelHolder
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5437
    ^ BlockValue 
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5438
        with:[:v | v printString]
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5439
        argument:editView cursorColHolder.
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5440
!
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5441
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5442
cursorLineLabelHolder
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5443
    ^ BlockValue 
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5444
        with:[:v | v printString]
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5445
        argument:editView cursorLineHolder.
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5446
!
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5447
7103
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5448
editModeInsert
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5449
    editView editModeInsert
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5450
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5451
    "Created: / 11-09-2006 / 12:46:50 / cg"
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5452
!
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5453
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5454
editModeInsertAndSelect
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5455
    editView editModeInsertAndSelect
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5456
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5457
    "Created: / 11-09-2006 / 12:47:01 / cg"
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5458
!
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5459
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5460
editModeOverwrite
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5461
    editView editModeOverwrite
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5462
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5463
    "Created: / 11-09-2006 / 12:46:47 / cg"
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5464
!
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5465
7596
6ea35d883f1f gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents: 7594
diff changeset
  5466
editView
6ea35d883f1f gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents: 7594
diff changeset
  5467
    ^ editView
6ea35d883f1f gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents: 7594
diff changeset
  5468
!
6ea35d883f1f gotoLine on double-click line-nr-label
Claus Gittinger <cg@exept.de>
parents: 7594
diff changeset
  5469
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5470
enableHexToggle
321c1729db5b initial checkin
penk
parents:
diff changeset
  5471
    enableHexToggle isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5472
        enableHexToggle := true asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5473
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5474
    ^ enableHexToggle
321c1729db5b initial checkin
penk
parents:
diff changeset
  5475
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5476
321c1729db5b initial checkin
penk
parents:
diff changeset
  5477
enableReload
321c1729db5b initial checkin
penk
parents:
diff changeset
  5478
    enableReload isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5479
        enableReload := false asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5480
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5481
    ^ enableReload.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5482
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5483
321c1729db5b initial checkin
penk
parents:
diff changeset
  5484
enableSave
321c1729db5b initial checkin
penk
parents:
diff changeset
  5485
    enableSave isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5486
        enableSave := false asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5487
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5488
    ^ enableSave.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5489
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5490
8783
5dddc5a42858 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8684
diff changeset
  5491
enableSaveAs
5dddc5a42858 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8684
diff changeset
  5492
    ^ true.
5dddc5a42858 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8684
diff changeset
  5493
!
5dddc5a42858 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8684
diff changeset
  5494
8087
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5495
enableSelectInBrowser
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5496
    enableSelectInBrowser isNil ifTrue:[
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5497
        enableSelectInBrowser := false asValue.
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5498
    ].
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5499
    ^ enableSelectInBrowser.
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5500
!
584a2658a4fe menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8004
diff changeset
  5501
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5502
fileContentsModel
321c1729db5b initial checkin
penk
parents:
diff changeset
  5503
    fileContentsModel isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5504
        fileContentsModel := ValueHolder new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5505
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5506
    ^ fileContentsModel.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5507
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5508
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5509
fileEncodingHolder
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5510
    fileEncodingHolder isNil ifTrue:[
5534
1536730810c0 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  5511
        fileEncodingHolder := #'iso8859-1' asValue
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5512
    ].
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5513
    ^ fileEncodingHolder
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5514
!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5515
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5516
itemChanged
321c1729db5b initial checkin
penk
parents:
diff changeset
  5517
    itemChanged isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5518
        itemChanged := false asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5519
        itemChanged addDependent:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5520
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5521
    ^ itemChanged
321c1729db5b initial checkin
penk
parents:
diff changeset
  5522
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5523
321c1729db5b initial checkin
penk
parents:
diff changeset
  5524
itemRemoved
321c1729db5b initial checkin
penk
parents:
diff changeset
  5525
    itemRemoved isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5526
        itemRemoved := false asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5527
        itemRemoved addDependent:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5528
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5529
    ^ itemRemoved
321c1729db5b initial checkin
penk
parents:
diff changeset
  5530
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5531
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
  5532
lockFileEncodingHolder
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
  5533
    lockFileEncodingHolder isNil ifTrue:[
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
  5534
        lockFileEncodingHolder := false asValue.
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
  5535
    ].
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
  5536
    ^ lockFileEncodingHolder
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
  5537
!
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5718
diff changeset
  5538
5120
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5539
modeLabelHolder
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5540
    ^ editView modeLabelHolder.
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5541
!
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5542
7103
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5543
modeLabelMenu
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5544
    ^ FileBrowserV2 editModeInfoLabelMenu
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5545
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5546
    "Created: / 11-09-2006 / 12:36:26 / cg"
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5547
!
a95f550bd9bd edit mode menu
Claus Gittinger <cg@exept.de>
parents: 6833
diff changeset
  5548
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5549
modifiedChannel
321c1729db5b initial checkin
penk
parents:
diff changeset
  5550
    modifiedChannel isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5551
        modifiedChannel := false asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5552
        modifiedChannel addDependent:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5553
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5554
    ^ modifiedChannel.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5555
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5556
321c1729db5b initial checkin
penk
parents:
diff changeset
  5557
printAsHexDump
321c1729db5b initial checkin
penk
parents:
diff changeset
  5558
    printAsHexDump isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5559
        printAsHexDump := false asValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5560
        printAsHexDump addDependent:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5561
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5562
    ^ printAsHexDump.
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5563
!
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5564
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5565
viewModifiedChannel
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5566
    viewModifiedChannel isNil ifTrue:[
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5567
        viewModifiedChannel := false asValue.
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5568
        viewModifiedChannel addDependent:self.
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5569
    ].
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5570
    ^ viewModifiedChannel.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5571
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  5572
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5573
!FileApplicationNoteBook::TextEditor methodsFor:'aspects-visibility'!
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5574
11099
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  5575
closeButtonShown
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  5576
    ^ false.
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  5577
"/    ^ self isEmbeddedApplication.
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  5578
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  5579
    "Created: / 12-01-2012 / 00:32:15 / cg"
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  5580
!
588f93b5f145 added: #destroyTabAt:
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
  5581
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5582
diffTextButtonVisible
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5583
    ^ self fileName notNil "/ true
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5584
!
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5585
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5586
reloadButtonVisible
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5587
    ^ self fileName notNil "/ true
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5588
!
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5589
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5590
saveAsButtonVisible
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5591
    ^ true
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5592
!
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5593
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5594
saveButtonVisible
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5595
    ^ self fileName notNil "/ true
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5596
!
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5597
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5598
selectInBrowserButtonVisible
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5599
    ^ self masterApplication notNil
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5600
!
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5601
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5602
tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5603
    tagsBrowserVisibleHolder isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5604
        masterApplication notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5605
            tagsBrowserVisibleHolder := masterApplication tagsBrowserVisibleHolder.
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5606
        ] ifFalse:[
10761
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  5607
            tagsBrowserVisibleHolder := self class defaultTagsBrowserVisible asValue.
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5608
        ].
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5609
        tagsBrowserVisibleHolder addDependent:self.
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5610
    ].
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5611
    ^ tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5612
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5613
    "Created: / 23-06-2011 / 09:19:18 / cg"
10761
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  5614
    "Modified: / 06-10-2011 / 12:46:41 / cg"
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5615
! !
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5616
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5617
!FileApplicationNoteBook::TextEditor methodsFor:'change & update'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5618
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5619
changeTextColorForChanged
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5620
    |text prevCursorBehavior|
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5621
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5622
    prevCursorBehavior := editView cursorMovementWhenUpdating.
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5623
    editView cursorMovementWhenUpdating:nil.
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5624
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5625
    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
  5626
        text := editView contents.
4499
395d7282b2f0 emphasis stuff
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
  5627
        self fileContentsModel 
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5628
            value:(text asText emphasizeAllWith:UserPreferences current emphasisForChangedCode).
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5629
        [editView flash] fork.
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5630
    ] ifFalse:[
5287
693e3ca577aa avoid autoloading Archiver if an obviously non-archive is double clicked.
Claus Gittinger <cg@exept.de>
parents: 5279
diff changeset
  5631
"/        self fileContentsModel value:text string.
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5632
    ].
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5633
    editView cursorMovementWhenUpdating:prevCursorBehavior.
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5634
    "/ self fileContentsModel changed:#value.
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5635
!
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5636
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5637
itemModified
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5638
4161
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5639
    | modified outDated removed|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5640
321c1729db5b initial checkin
penk
parents:
diff changeset
  5641
    modified := self modifiedChannel value.
4161
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5642
    outDated := self itemChanged value.    
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5643
    removed := self itemRemoved value.    
321c1729db5b initial checkin
penk
parents:
diff changeset
  5644
4161
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5645
    ((modified or:[outDated]) or:[removed]) ifTrue:[
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5646
        modified ifTrue:[
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5647
            self changeInformationForModified:#modified.
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5648
        ].
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5649
        outDated ifTrue:[
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5650
            self changeInformationForModified:#outDated.
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5651
        ].
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5652
        removed ifTrue:[
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5653
            self changeInformationForModified:#removed.
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5654
        ].
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5655
    ] ifFalse:[
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5656
        self changeInformationForModified:#unchanged.
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5657
    ].
5471
ad6c1fc272de care for no-filename-editors
Claus Gittinger <cg@exept.de>
parents: 5461
diff changeset
  5658
4161
a318d1adcf08 treeBrowser has his own sort now
penk
parents: 4146
diff changeset
  5659
    self enableReload value:((modified or:[outDated]) and:[removed not]).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5660
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5661
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5662
postBuildTagsBrowser:aTagsBrowserCanvas
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5663
    tagsBrowser := aTagsBrowserCanvas application.
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5664
    tagsBrowser action:[:selectedTag | self tagSelected:selectedTag ].
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5665
    self updateTagsBrowser.
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5666
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5667
    "Created: / 23-06-2011 / 16:30:00 / cg"
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5668
!
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5669
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5670
tagsBrowserVisibilityChanged
10761
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  5671
    |visible tagsBrowserCanvas|
9949
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5672
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5673
    tagsBrowser notNil ifTrue:[
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5674
        tagsBrowserCanvas := tagsBrowser window.
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5675
    ].
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5676
10761
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  5677
    (visible := self tagsBrowserVisibleHolder value) ifTrue:[
9949
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5678
        tagsBrowser isNil ifTrue:[
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5679
            tagsBrowserCanvas := ApplicationSubView new.
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5680
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5681
            tagsBrowser := Tools::TagsBrowser new.
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5682
            tagsBrowser window:tagsBrowserCanvas.
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5683
            tagsBrowser allButOpen.
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5684
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5685
            (self builder componentAt:#Panel) 
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5686
                addComponent:tagsBrowserCanvas;
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5687
                relativeCorners:#(0.75 1.0).
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5688
            tagsBrowserCanvas realize.
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5689
            self postBuildTagsBrowser:tagsBrowserCanvas.
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5690
        ] ifFalse:[
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5691
            tagsBrowserCanvas map.
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5692
            (self builder componentAt:#Panel) 
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5693
                relativeCorners:#(0.75 1.0).
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5694
        ].
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5695
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5696
        self updateTagsBrowser.
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5697
    ] ifFalse:[
9949
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5698
        tagsBrowser notNil ifTrue:[
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5699
            tagsBrowserCanvas unmap.
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5700
            (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
  5701
        ].
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5702
    ].
10761
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  5703
    DefaultTagsBrowserVisible := visible
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5704
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5705
    "Created: / 27-06-2011 / 16:06:00 / cg"
10761
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  5706
    "Modified: / 06-10-2011 / 12:45:20 / cg"
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5707
!
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5708
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5709
update:something with:aParameter from:changedObject
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5710
    |itemRem contMd5CheckSum viewModified p|
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5711
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5712
    changedObject == self viewModifiedChannel ifTrue:[
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5713
        viewModified := changedObject value.
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5714
        self hasMD5 ifTrue:[
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5715
            self viewModifiedChannel value:false withoutNotifying:self.
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5716
            viewModified ifTrue:[
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5717
                (p := md5HashValueComputationProcess) notNil ifTrue:[
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5718
                    p terminate.
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5719
                ].
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5720
                md5HashValueComputationProcess := 
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5721
                    [
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5722
                        contMd5CheckSum := self getHashForContents:(editView list).
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5723
                        self modifiedChannel value:(contMd5CheckSum ~= md5CheckSum).
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5724
                        md5HashValueComputationProcess := nil.
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5725
                    ] newProcess.
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5726
                md5HashValueComputationProcess priority:(Processor userBackgroundPriority).
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5727
                md5HashValueComputationProcess resume.
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5728
            ].
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5729
        ] ifFalse:[
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5730
            self modifiedChannel value:viewModified.
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5731
        ]
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5732
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5733
    changedObject == self modifiedChannel ifTrue:[
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5734
        self enableSave value:changedObject value.
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5735
        self itemModified.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5736
        ^ self
321c1729db5b initial checkin
penk
parents:
diff changeset
  5737
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5738
    changedObject == self itemRemoved ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5739
        itemRem := changedObject value.
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5740
        self enableSave value:(itemRem ? false).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5741
        self enableHexToggle value:itemRem not.
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5742
        self itemModified.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5743
        ^ self
321c1729db5b initial checkin
penk
parents:
diff changeset
  5744
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5745
    changedObject == self itemChanged ifTrue:[
8228
6be70d6b485c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8176
diff changeset
  5746
        self enqueueMessage:#changeTextColorForChanged for:self arguments:#().
4047
e432ab54d1e7 contents color changed to red if modified by someone else
penk
parents: 4045
diff changeset
  5747
        self itemModified.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5748
        ^ self
321c1729db5b initial checkin
penk
parents:
diff changeset
  5749
    ].
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  5750
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5751
    changedObject == self printAsHexDump ifTrue:[
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  5752
        AbortOperationRequest handle:[:ex |
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  5753
            self printAsHexDump value:false withoutNotifying:self.
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  5754
            ^ self.
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  5755
        ] do:[
5198
ea3f838e1353 do not attempt to reload when closing
Claus Gittinger <cg@exept.de>
parents: 5197
diff changeset
  5756
            self askForChangeWithReload:true. 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5757
        ].
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  5758
        self presentation:(changedObject value ifTrue:[#hexDump] ifFalse:[#asText]).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5759
        self changeInformation.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5760
        self setContents.
4621
d033f85c8cc3 hexDump from tools menu implemented
penk
parents: 4620
diff changeset
  5761
        editView notNil ifTrue:[
5197
17755f89feab save changed fixed
Claus Gittinger <cg@exept.de>
parents: 5186
diff changeset
  5762
            editView readOnly:(self presentation == #hexDump).   
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5763
        ].
4621
d033f85c8cc3 hexDump from tools menu implemented
penk
parents: 4620
diff changeset
  5764
        ^ self
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5765
    ].
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5766
    changedObject == editView cursorLineHolder ifTrue:[
9951
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
  5767
        tagsBrowser notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
  5768
            tagsBrowser updateForLine:(changedObject value).
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
  5769
        ].
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5770
        ^ self
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5771
    ].
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5772
    changedObject == tagsBrowserVisibleHolder ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5773
        self tagsBrowserVisibilityChanged.
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5774
        ^ self
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5775
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5776
321c1729db5b initial checkin
penk
parents:
diff changeset
  5777
    super update:something with:aParameter from:changedObject
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5778
9951
Claus Gittinger <cg@exept.de>
parents: 9949
diff changeset
  5779
    "Modified: / 29-06-2011 / 19:36:03 / cg"
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5780
!
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5781
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5782
updateTagsBrowser
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5783
    tagsBrowser notNil ifTrue:[
9949
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5784
        self tagsBrowserVisibleHolder value ifTrue:[
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5785
            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
  5786
        ]
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5787
    ]
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5788
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5789
    "Created: / 23-06-2011 / 16:32:44 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5790
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  5791
9399
dae73aa739a8 no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents: 9359
diff changeset
  5792
!FileApplicationNoteBook::TextEditor methodsFor:'initialization'!
dae73aa739a8 no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents: 9359
diff changeset
  5793
dae73aa739a8 no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents: 9359
diff changeset
  5794
initialize
dae73aa739a8 no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents: 9359
diff changeset
  5795
    super initialize.
dae73aa739a8 no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents: 9359
diff changeset
  5796
    semaChangeItem := Semaphore forMutualExclusion.
dae73aa739a8 no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents: 9359
diff changeset
  5797
! !
dae73aa739a8 no lazy initialization of semas and locks, please
Claus Gittinger <cg@exept.de>
parents: 9359
diff changeset
  5798
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5799
!FileApplicationNoteBook::TextEditor methodsFor:'printing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5800
8002
031dca544927 Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents: 7970
diff changeset
  5801
printOn:aStream
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5802
    |fn|
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5803
8002
031dca544927 Define #printOn: for each method defining #printString
Stefan Vogel <sv@exept.de>
parents: 7970
diff changeset
  5804
    aStream nextPutAll:'TextEditor for:'.
8684
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5805
    (fn := self fileName) notNil ifTrue:[
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5806
        fn baseName printOn:aStream.
61529797005d care for stand alone usage
Claus Gittinger <cg@exept.de>
parents: 8614
diff changeset
  5807
    ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5808
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  5809
6481
fd4f39c392fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6477
diff changeset
  5810
!FileApplicationNoteBook::TextEditor methodsFor:'private-process'!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5811
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5812
checkItemForChanges
8614
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5813
    |exists fileModificationTime message|
5584
6f7e25365480 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5578
diff changeset
  5814
5612
7b0fa57f046e Allow opening of a file in an empty text editor
Stefan Vogel <sv@exept.de>
parents: 5610
diff changeset
  5815
    item isNil ifTrue:[
7b0fa57f046e Allow opening of a file in an empty text editor
Stefan Vogel <sv@exept.de>
parents: 5610
diff changeset
  5816
        ^ self
7b0fa57f046e Allow opening of a file in an empty text editor
Stefan Vogel <sv@exept.de>
parents: 5610
diff changeset
  5817
    ].
7b0fa57f046e Allow opening of a file in an empty text editor
Stefan Vogel <sv@exept.de>
parents: 5610
diff changeset
  5818
5584
6f7e25365480 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5578
diff changeset
  5819
    exists := self item exists.
6f7e25365480 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5578
diff changeset
  5820
    self itemRemoved value:(exists not).
6f7e25365480 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5578
diff changeset
  5821
    exists ifTrue:[
8614
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5822
        fileModificationTime := self fileName modificationTime.
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5823
        textEditorModificationTime isNil ifTrue:[
8614
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5824
            textEditorModificationTime := fileModificationTime.
4608
990e5559a904 md5 computation fixed and tuned
Claus Gittinger <cg@exept.de>
parents: 4572
diff changeset
  5825
        ].
5584
6f7e25365480 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5578
diff changeset
  5826
        message := '%1 was changed by someone else.'.
6f7e25365480 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5578
diff changeset
  5827
    ] ifFalse:[
6f7e25365480 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5578
diff changeset
  5828
        message := '%1 was removed by someone else.'.
6f7e25365480 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5578
diff changeset
  5829
    ].
6f7e25365480 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5578
diff changeset
  5830
8614
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5831
    (textEditorModificationTime ~= fileModificationTime) ifTrue:[
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5832
        "file contents has been changed by someone else"
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5833
        message := (resources string:message with:item fileName baseName) allBold
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5834
                        emphasisAllAdd:(UserPreferences current emphasisForModifiedBuffer).
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5835
        message = self notifyChannel value ifFalse:[
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5836
            self notify:message.
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5837
            self itemChanged value:true.
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5838
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5839
    ].
5457
204d1be00e9a add new item if it is modified in the meanwhile
penk
parents: 5456
diff changeset
  5840
!
204d1be00e9a add new item if it is modified in the meanwhile
penk
parents: 5456
diff changeset
  5841
204d1be00e9a add new item if it is modified in the meanwhile
penk
parents: 5456
diff changeset
  5842
checkItemForChangesWithNewSetup
204d1be00e9a add new item if it is modified in the meanwhile
penk
parents: 5456
diff changeset
  5843
    self checkItemForChanges.
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5844
    self setupCheckModify.
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5845
!
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5846
4977
621cc3cb454d checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents: 4971
diff changeset
  5847
releaseCheckModify
8614
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5848
    checkModifiedBlock notNil ifTrue:[
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5849
        Processor removeTimedBlock:checkModifiedBlock.
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5850
    ].
4977
621cc3cb454d checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents: 4971
diff changeset
  5851
!
621cc3cb454d checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents: 4971
diff changeset
  5852
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5853
setupCheckModify
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5854
8614
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5855
    checkModifiedBlock isNil ifTrue:[
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5856
        checkModifiedBlock := [
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5857
                self 
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5858
                    enqueueMessage:#checkItemForChangesWithNewSetup 
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5859
                    for:self 
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5860
                    arguments:#().
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5861
            ].
6712b6367808 Clean up TextEditor modification checks
Stefan Vogel <sv@exept.de>
parents: 8514
diff changeset
  5862
    ].
5461
acf501391ddd change delay time for check files in text editor
penk
parents: 5459
diff changeset
  5863
    Processor addTimedBlock:checkModifiedBlock afterSeconds:(self class checkModifiedDelayTime).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5864
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  5865
321c1729db5b initial checkin
penk
parents:
diff changeset
  5866
!FileApplicationNoteBook::TextEditor methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5867
7467
7dd3132cf29a show numlines
Claus Gittinger <cg@exept.de>
parents: 7288
diff changeset
  5868
additionalInfo
7dd3132cf29a show numlines
Claus Gittinger <cg@exept.de>
parents: 7288
diff changeset
  5869
    ^ '[',editView numberOfLines printString , ' lines]'.
7dd3132cf29a show numlines
Claus Gittinger <cg@exept.de>
parents: 7288
diff changeset
  5870
7dd3132cf29a show numlines
Claus Gittinger <cg@exept.de>
parents: 7288
diff changeset
  5871
    "Created: / 24-10-2006 / 12:27:07 / cg"
7dd3132cf29a show numlines
Claus Gittinger <cg@exept.de>
parents: 7288
diff changeset
  5872
!
7dd3132cf29a show numlines
Claus Gittinger <cg@exept.de>
parents: 7288
diff changeset
  5873
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5874
hasMD5
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5875
    ^ ( MD5Stream notNil and:[MD5Stream isLoaded])
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5876
!
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  5877
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5878
isModified
5456
91c198c1c3e9 add new item if it is modified
penk
parents: 5447
diff changeset
  5879
    self checkItemForChanges.
5317
8f813402542f item modified
penk
parents: 5315
diff changeset
  5880
    ^ self modifiedChannel value 
8f813402542f item modified
penk
parents: 5315
diff changeset
  5881
        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
  5882
!
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
  5883
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
  5884
isTextEditor
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
  5885
c7c4e3044e50 on doubleclick after search the file is opened and searchPatternStrin is selected
penk
parents: 4111
diff changeset
  5886
    ^ true
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5887
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  5888
321c1729db5b initial checkin
penk
parents:
diff changeset
  5889
!FileApplicationNoteBook::TextEditor methodsFor:'startup & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5890
321c1729db5b initial checkin
penk
parents:
diff changeset
  5891
closeRequest
6626
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  5892
    "asks for permission before closing"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5893
321c1729db5b initial checkin
penk
parents:
diff changeset
  5894
    (self doClose) ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  5895
        ^ super closeRequest.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5896
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5897
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5898
10754
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5899
getEditorClass
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5900
    UserPreferences current useCodeView2InTools ifTrue:[
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5901
        ^ Tools::CodeView2 ? CodeView
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5902
    ].
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5903
    ^ CodeView
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5904
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5905
    "Created: / 06-10-2011 / 11:21:43 / cg"
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5906
!
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5907
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5908
postBuildTextEditor:aWidget
10754
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5909
    editView := aWidget scrolledView.
10955
Claus Gittinger <cg@exept.de>
parents: 10922
diff changeset
  5910
    "/ I do not want any non-smalltalk code to be syntaxhighlighted!!
10754
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5911
    editView isCodeView2 ifTrue:[
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5912
        editView languageHolder value:nil.
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5913
        editView services:#().
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5914
    ].
5430
e500bd438cc7 save as changed
penk
parents: 5429
diff changeset
  5915
    editView saveAction:[ self doSaveAs ].
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5916
    editView cursorLineHolder addDependent:self.
5430
e500bd438cc7 save as changed
penk
parents: 5429
diff changeset
  5917
5417
c4caf51053e2 add save as for TextEditor
penk
parents: 5415
diff changeset
  5918
    aWidget modifiedChannel:self viewModifiedChannel.
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5919
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5506
diff changeset
  5920
    editView externalEncoding:self fileEncoding.
5609
9ea9d7e7ef95 characterEncoding stuff
Claus Gittinger <cg@exept.de>
parents: 5586
diff changeset
  5921
    "/ editView characterEncoding:'unicode'. - thats the default anyway
9946
Claus Gittinger <cg@exept.de>
parents: 9885
diff changeset
  5922
10754
20b2f75fe420 can now use CodeView2
Claus Gittinger <cg@exept.de>
parents: 10706
diff changeset
  5923
    "Modified: / 06-10-2011 / 11:43:40 / cg"
10955
Claus Gittinger <cg@exept.de>
parents: 10922
diff changeset
  5924
    "Modified (comment): / 03-12-2011 / 10:27:47 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5925
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5926
321c1729db5b initial checkin
penk
parents:
diff changeset
  5927
postOpenWith:aBuilder
321c1729db5b initial checkin
penk
parents:
diff changeset
  5928
5120
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5929
"/    self item isNil ifTrue:[
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5930
"/        self item:(DirectoryContentsBrowser itemClass fileName:(Filename homeDirectory construct:'.bashrc')).
e4c15c9d82ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5109
diff changeset
  5931
"/    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5932
    self setUpTextView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5933
    self changeInformation.
9949
d1161d3fbd19 tags view handling inside a panel
Claus Gittinger <cg@exept.de>
parents: 9947
diff changeset
  5934
    self tagsBrowserVisibilityChanged.
6626
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  5935
    super postOpenWith:aBuilder
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5936
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5937
321c1729db5b initial checkin
penk
parents:
diff changeset
  5938
release
321c1729db5b initial checkin
penk
parents:
diff changeset
  5939
    "release my resources
321c1729db5b initial checkin
penk
parents:
diff changeset
  5940
    "                    
4977
621cc3cb454d checkModify have to reset the mofication time for the file after file change in TextEditor
penk
parents: 4971
diff changeset
  5941
    self releaseCheckModify.
4969
61bfe248d137 file modification handling refactored
penk
parents: 4968
diff changeset
  5942
    checkModifiedBlock := nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5943
    super release.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5944
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5945
321c1729db5b initial checkin
penk
parents:
diff changeset
  5946
setUpTextView
4945
f68e794d2d30 valid parenthesisSpec.
Claus Gittinger <cg@exept.de>
parents: 4923
diff changeset
  5947
    "change the parenthesis-spec of the editor to include $< .. $> if the
f68e794d2d30 valid parenthesisSpec.
Claus Gittinger <cg@exept.de>
parents: 4923
diff changeset
  5948
     shown document is an html- or xml document"
f68e794d2d30 valid parenthesisSpec.
Claus Gittinger <cg@exept.de>
parents: 4923
diff changeset
  5949
7787
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5950
    |item mimeType parenthesis commentStrings parentesisSpec col|
4945
f68e794d2d30 valid parenthesisSpec.
Claus Gittinger <cg@exept.de>
parents: 4923
diff changeset
  5951
5550
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5952
    editView notNil ifTrue:[
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5953
        item := self item.
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5954
        item notNil ifTrue:[
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5955
            item hasMimeType ifTrue:[
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5956
                mimeType := item mimeType.
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5957
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5958
                (mimeType isHtml or:[mimeType isXml]) ifTrue:[
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5959
                    parenthesis := editView parenthesisSpecification copy.
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5960
                    ((parenthesis at:#open) includes:$<) ifFalse:[
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5961
                        col := ((parenthesis at:#open) asOrderedCollection).
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5962
                        col add:$<.
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5963
                        parenthesis at:#open put:col.
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5964
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5965
                        col := ((parenthesis at:#close) asOrderedCollection).
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5966
                        col add:$>.
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5967
                        parenthesis at:#close put:col.
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5968
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5969
                        editView parenthesisSpecification:parenthesis
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  5970
                    ].
5548
7449b01c95b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5540
diff changeset
  5971
                ].
5574
d4a872f4b8b7 set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents: 5567
diff changeset
  5972
d4a872f4b8b7 set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents: 5567
diff changeset
  5973
                commentStrings := MIMETypes 
6477
bbc1872ec339 comment strings
Claus Gittinger <cg@exept.de>
parents: 6470
diff changeset
  5974
                                    commentStringsForMimeType:mimeType 
bbc1872ec339 comment strings
Claus Gittinger <cg@exept.de>
parents: 6470
diff changeset
  5975
                                    suffix:(self fileName asFilename suffix) 
5574
d4a872f4b8b7 set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents: 5567
diff changeset
  5976
                                    ifUnknown:[
d4a872f4b8b7 set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents: 5567
diff changeset
  5977
                                        "/ st:
d4a872f4b8b7 set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents: 5567
diff changeset
  5978
                                        #('"/' ('"' '"'))
d4a872f4b8b7 set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents: 5567
diff changeset
  5979
                                    ]. 
6477
bbc1872ec339 comment strings
Claus Gittinger <cg@exept.de>
parents: 6470
diff changeset
  5980
5574
d4a872f4b8b7 set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents: 5567
diff changeset
  5981
                commentStrings notNil ifTrue:[
d4a872f4b8b7 set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents: 5567
diff changeset
  5982
                    editView perform:#commentStrings: with:commentStrings ifNotUnderstood:nil
d4a872f4b8b7 set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents: 5567
diff changeset
  5983
                ].
d4a872f4b8b7 set comment strings for fileType
Claus Gittinger <cg@exept.de>
parents: 5567
diff changeset
  5984
7787
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5985
                parentesisSpec := MIMETypes 
8176
64c5b7c41f3d fix spelling of MIMETypes>>#parenthesis* methods
Stefan Vogel <sv@exept.de>
parents: 8087
diff changeset
  5986
                                    parenthesisSpecForMimeType:mimeType 
7787
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5987
                                    suffix:(self fileName asFilename suffix) 
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5988
                                    ifUnknown:[
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5989
                                        |spec|
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5990
                                        spec := IdentityDictionary new.       
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5991
                                        spec at:#open        put:#( $( $[ ${) .
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5992
                                        spec at:#close       put:#( $) $] $}).
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5993
                                        spec
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5994
                                    ]. 
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5995
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5996
                parentesisSpec notNil ifTrue:[
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5997
                    editView perform:#parenthesisSpecification: with:parentesisSpec ifNotUnderstood:nil
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5998
                ].
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  5999
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  6000
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4375
diff changeset
  6001
            ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6002
        ].
5550
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  6003
        editView externalEncoding:self fileEncoding.
9e8440512c02 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5548
diff changeset
  6004
    ]
7787
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  6005
244eed4800de parentesis spec
Claus Gittinger <cg@exept.de>
parents: 7769
diff changeset
  6006
    "Modified: / 10-04-2007 / 15:24:22 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6007
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  6008
9785
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6009
!FileApplicationNoteBook::XMLViewApplication class methodsFor:'defaults'!
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6010
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6011
tabStringFor:aApplicationType
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6012
    "the formatString shown in a tab (language translated)"
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6013
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6014
    ^ 'XML View for %1'
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6015
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6016
    "Modified: / 17-02-2011 / 13:28:22 / cg"
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6017
! !
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6018
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6019
!FileApplicationNoteBook::XMLViewApplication class methodsFor:'help specs'!
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6020
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6021
helpSpec
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6022
    "This resource specification was automatically generated
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6023
     by the UIHelpTool of ST/X."
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6024
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6025
    "Do not manually edit this!! If it is corrupted,
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6026
     the UIHelpTool may not be able to read the specification."
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6027
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6028
    "
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6029
     UIHelpTool openOnClass:FileApplicationNoteBook::HtmlViewApplication    
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6030
    "
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6031
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6032
    <resource: #help>
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6033
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6034
    ^ super helpSpec addPairsFrom:#(
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6035
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6036
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6037
)
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6038
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6039
    "Modified: / 17-02-2011 / 13:28:28 / cg"
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6040
! !
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6041
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6042
!FileApplicationNoteBook::XMLViewApplication class methodsFor:'interface specs'!
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6043
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6044
windowSpec
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6045
    "This resource specification was automatically generated
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6046
     by the UIPainter of ST/X."
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6047
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6048
    "Do not manually edit this!! If it is corrupted,
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6049
     the UIPainter may not be able to read the specification."
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6050
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6051
    "
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6052
     UIPainter new openOnClass:FileApplicationNoteBook::XMLViewApplication andSelector:#windowSpec
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6053
     FileApplicationNoteBook::XMLViewApplication new openInterface:#windowSpec
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6054
     FileApplicationNoteBook::XMLViewApplication open
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6055
    "
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6056
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6057
    <resource: #canvas>
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6058
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6059
    ^ 
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6060
     #(FullSpec
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6061
        name: windowSpec
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6062
        window: 
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6063
       (WindowSpec
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6064
          label: 'NoteBookApplication::HtmlView'
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6065
          name: 'NoteBookApplication::HtmlView'
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6066
          min: (Point 10 10)
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6067
          bounds: (Rectangle 0 0 676 492)
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6068
          menu: mainMenu
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6069
        )
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6070
        component: 
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6071
       (SpecCollection
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6072
          collection: (
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6073
           (MenuPanelSpec
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6074
              name: 'MenuXml'
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6075
              layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6076
              level: 0
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6077
              visibilityChannel: isEmbeddedApplication
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6078
              menu: menu
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6079
              textDefault: true
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6080
            )
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6081
           (SubCanvasSpec
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6082
              name: 'XMLCanvas'
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6083
              layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 0 1)
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6084
              level: 0
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6085
              hasHorizontalScrollBar: false
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6086
              hasVerticalScrollBar: false
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6087
              majorKey: #'XML::XMLInspector'
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6088
              createNewApplication: true
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6089
              createNewBuilder: false
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6090
              postBuildCallback: postBuildXMLCanvas:
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6091
            )
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6092
           )
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6093
         
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6094
        )
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6095
      )
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6096
! !
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6097
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6098
!FileApplicationNoteBook::XMLViewApplication class methodsFor:'menu specs'!
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6099
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6100
menu
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6101
    "This resource specification was automatically generated
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6102
     by the MenuEditor of ST/X."
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6103
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6104
    "Do not manually edit this!! If it is corrupted,
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6105
     the MenuEditor may not be able to read the specification."
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6106
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6107
    "
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6108
     MenuEditor new openOnClass:FileApplicationNoteBook::XMLViewApplication andSelector:#menu
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6109
     (Menu new fromLiteralArrayEncoding:(FileApplicationNoteBook::XMLViewApplication menu)) startUp
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6110
    "
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6111
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6112
    <resource: #menu>
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6113
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6114
    ^ 
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6115
     #(Menu
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6116
        (
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6117
         (MenuItem
9786
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6118
            activeHelpKey: reloadFile
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6119
            isVisible: reloadButtonVisible
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6120
            enabled: enableReload
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6121
            label: 'Reload'
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6122
            itemValue: reload
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6123
            nameKey: Reload
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6124
            translateLabel: true
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6125
            isButton: true
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6126
            labelImage: (ResourceRetriever ToolbarIconLibrary reloadTextFromFileIcon)
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6127
          )
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6128
         (MenuItem
9785
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6129
            activeHelpKey: closeTabButton
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6130
            label: 'Close'
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6131
            itemValue: doClose
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6132
            translateLabel: true
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6133
            isButton: true
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6134
            startGroup: right
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6135
            hideMenuOnActivated: false
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6136
            labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon)
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6137
          )
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6138
         )
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6139
        nil
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6140
        nil
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6141
      )
9786
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6142
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6143
    "Modified: / 17-02-2011 / 17:30:26 / cg"
9785
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6144
! !
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6145
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6146
!FileApplicationNoteBook::XMLViewApplication class methodsFor:'queries'!
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6147
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6148
canOpenItem:anItem
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6149
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6150
    ^ (anItem hasMimeType and:[anItem mimeType isXml])
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6151
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6152
    "Modified: / 17-02-2011 / 13:34:08 / cg"
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6153
!
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6154
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6155
wantNewApplicationAnyway
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6156
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6157
    ^ false
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6158
! !
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6159
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6160
!FileApplicationNoteBook::XMLViewApplication methodsFor:'accessing'!
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6161
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6162
item:anItem 
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6163
    |retVal|
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6164
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6165
    self labelHolder value:anItem fileName asString.
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6166
    retVal := super item:anItem.
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6167
    xmlTreeApp notNil ifTrue:[
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6168
        self updateXMLTree
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6169
    ].
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6170
    ^ retVal
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6171
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6172
    "Modified: / 17-02-2011 / 13:38:53 / cg"
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6173
!
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6174
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6175
updateXMLTree
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6176
    |inStream dom|
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6177
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6178
    self withWaitCursorDo:[
9786
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6179
        XML::XMLSignal handle:[:ex |
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6180
            Dialog 
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6181
                information:
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6182
                    (resources 
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6183
                        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
  6184
                        with:inStream lineNumber 
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6185
                        with:ex description).
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6186
            Error raise.
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6187
        ] do:[
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6188
            inStream := LineNumberReadStream on:(self fileName readStream).
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6189
            [
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6190
                dom := XML::XMLParser 
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6191
                        processDocumentStream:inStream
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6192
                        beforeScanDo:[:parser | parser validate:false. ].
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6193
                xmlTreeApp model:dom.
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6194
            ] ensure:[
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6195
                inStream close
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6196
            ]
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6197
        ].
9785
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6198
    ].
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6199
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6200
    "Created: / 17-02-2011 / 13:39:07 / cg"
9786
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6201
    "Modified: / 17-02-2011 / 17:39:15 / cg"
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6202
! !
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6203
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6204
!FileApplicationNoteBook::XMLViewApplication methodsFor:'actions'!
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6205
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6206
reload
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6207
    self updateXMLTree.
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6208
be0b10d85572 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 9785
diff changeset
  6209
    "Created: / 17-02-2011 / 17:46:36 / cg"
9785
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6210
! !
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6211
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6212
!FileApplicationNoteBook::XMLViewApplication methodsFor:'aspects'!
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6213
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6214
labelHolder
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6215
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6216
    labelHolder isNil ifTrue:[
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6217
        labelHolder := '' asValue.
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6218
    ].
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6219
    ^ labelHolder.
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6220
! !
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6221
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6222
!FileApplicationNoteBook::XMLViewApplication methodsFor:'initialization & release'!
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6223
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6224
postBuildXMLCanvas:aWidget
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6225
    xmlTreeApp := aWidget client.
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6226
    item notNil ifTrue:[self updateXMLTree].
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6227
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6228
    "Modified: / 17-02-2011 / 13:39:18 / cg"
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6229
! !
eebe4073813f changed: #applicationList
Claus Gittinger <cg@exept.de>
parents: 9611
diff changeset
  6230
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6231
!FileApplicationNoteBook::XViewApplication class methodsFor:'defaults'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6232
321c1729db5b initial checkin
penk
parents:
diff changeset
  6233
maxNumberOfVNCRestarts
321c1729db5b initial checkin
penk
parents:
diff changeset
  6234
321c1729db5b initial checkin
penk
parents:
diff changeset
  6235
    ^ 10
321c1729db5b initial checkin
penk
parents:
diff changeset
  6236
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6237
321c1729db5b initial checkin
penk
parents:
diff changeset
  6238
mimeTypeUnixApplicationMapping
321c1729db5b initial checkin
penk
parents:
diff changeset
  6239
321c1729db5b initial checkin
penk
parents:
diff changeset
  6240
" here insert the application and mime type pairs to open by XviewApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
  6241
"
321c1729db5b initial checkin
penk
parents:
diff changeset
  6242
321c1729db5b initial checkin
penk
parents:
diff changeset
  6243
    ^
321c1729db5b initial checkin
penk
parents:
diff changeset
  6244
    #(
321c1729db5b initial checkin
penk
parents:
diff changeset
  6245
        #(#'application/postscript'     #gv            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  6246
        #(#'application/pdf'            #acroread      )
321c1729db5b initial checkin
penk
parents:
diff changeset
  6247
    )
321c1729db5b initial checkin
penk
parents:
diff changeset
  6248
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6249
321c1729db5b initial checkin
penk
parents:
diff changeset
  6250
tabStringFor:aApplicationType
7687
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  6251
    "the formatString shown in a tab (language translated)"
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  6252
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  6253
    ^ 'VNC for %1'
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  6254
22b90cc3328f code cleanup
Claus Gittinger <cg@exept.de>
parents: 7596
diff changeset
  6255
    "Modified: / 01-03-2007 / 21:43:43 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6256
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6257
4336
b4228ddf2183 change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents: 4293
diff changeset
  6258
unixVNCCommand
b4228ddf2183 change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents: 4293
diff changeset
  6259
b4228ddf2183 change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents: 4293
diff changeset
  6260
    ^ 'Xvnc'
b4228ddf2183 change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents: 4293
diff changeset
  6261
!
b4228ddf2183 change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents: 4293
diff changeset
  6262
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6263
wantNewApplicationAnyway
321c1729db5b initial checkin
penk
parents:
diff changeset
  6264
4500
9f0b8d6ae2be make a new XView for a new item if an XView already open
penk
parents: 4499
diff changeset
  6265
    ^ true
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6266
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  6267
321c1729db5b initial checkin
penk
parents:
diff changeset
  6268
!FileApplicationNoteBook::XViewApplication class methodsFor:'interface specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6269
321c1729db5b initial checkin
penk
parents:
diff changeset
  6270
windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  6271
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  6272
     by the UIPainter of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  6273
321c1729db5b initial checkin
penk
parents:
diff changeset
  6274
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  6275
     the UIPainter may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  6276
321c1729db5b initial checkin
penk
parents:
diff changeset
  6277
    "
4336
b4228ddf2183 change level of buttons bfor notebook applications and remove directory for label of terminal app
penk
parents: 4293
diff changeset
  6278
     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
  6279
     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
  6280
     FileApplicationNoteBook::XViewApplication open
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6281
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  6282
321c1729db5b initial checkin
penk
parents:
diff changeset
  6283
    <resource: #canvas>
321c1729db5b initial checkin
penk
parents:
diff changeset
  6284
321c1729db5b initial checkin
penk
parents:
diff changeset
  6285
    ^ 
321c1729db5b initial checkin
penk
parents:
diff changeset
  6286
     #(#FullSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  6287
        #name: #windowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  6288
        #window: 
321c1729db5b initial checkin
penk
parents:
diff changeset
  6289
       #(#WindowSpec
321c1729db5b initial checkin
penk
parents:
diff changeset
  6290
          #label: 'XView'
321c1729db5b initial checkin
penk
parents:
diff changeset
  6291
          #name: 'XView'
321c1729db5b initial checkin
penk
parents:
diff changeset
  6292
          #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
  6293
          #bounds: #(#Rectangle 16 42 692 534)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6294
          #menu: #mainMenu
321c1729db5b initial checkin
penk
parents:
diff changeset
  6295
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
  6296
        #component: 
321c1729db5b initial checkin
penk
parents:
diff changeset
  6297
       #(#SpecCollection
321c1729db5b initial checkin
penk
parents:
diff changeset
  6298
          #collection: #(
321c1729db5b initial checkin
penk
parents:
diff changeset
  6299
           #(#MenuPanelSpec
4261
8cfc011b2c0c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4201
diff changeset
  6300
              #name: 'MenuVNC'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6301
              #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
  6302
              #level: 0
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6303
              #visibilityChannel: #isEmbeddedApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
  6304
              #menu: #menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  6305
              #textDefault: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  6306
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  6307
           #(#ArbitraryComponentSpec
4261
8cfc011b2c0c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4201
diff changeset
  6308
              #name: 'VNCView'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6309
              #layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0)
321c1729db5b initial checkin
penk
parents:
diff changeset
  6310
              #hasHorizontalScrollBar: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  6311
              #hasVerticalScrollBar: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  6312
              #miniScrollerHorizontal: false
321c1729db5b initial checkin
penk
parents:
diff changeset
  6313
              #miniScrollerVertical: false
321c1729db5b initial checkin
penk
parents:
diff changeset
  6314
              #hasBorder: false
321c1729db5b initial checkin
penk
parents:
diff changeset
  6315
              #component: #VNCFrameBufferView
321c1729db5b initial checkin
penk
parents:
diff changeset
  6316
              #postBuildCallback: #postBuildXView:
321c1729db5b initial checkin
penk
parents:
diff changeset
  6317
            )
321c1729db5b initial checkin
penk
parents:
diff changeset
  6318
           )
321c1729db5b initial checkin
penk
parents:
diff changeset
  6319
         
321c1729db5b initial checkin
penk
parents:
diff changeset
  6320
        )
321c1729db5b initial checkin
penk
parents:
diff changeset
  6321
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
  6322
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  6323
321c1729db5b initial checkin
penk
parents:
diff changeset
  6324
!FileApplicationNoteBook::XViewApplication class methodsFor:'menu specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6325
321c1729db5b initial checkin
penk
parents:
diff changeset
  6326
menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  6327
    "This resource specification was automatically generated
321c1729db5b initial checkin
penk
parents:
diff changeset
  6328
     by the MenuEditor of ST/X."
321c1729db5b initial checkin
penk
parents:
diff changeset
  6329
321c1729db5b initial checkin
penk
parents:
diff changeset
  6330
    "Do not manually edit this!! If it is corrupted,
321c1729db5b initial checkin
penk
parents:
diff changeset
  6331
     the MenuEditor may not be able to read the specification."
321c1729db5b initial checkin
penk
parents:
diff changeset
  6332
321c1729db5b initial checkin
penk
parents:
diff changeset
  6333
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  6334
     MenuEditor new openOnClass:NoteBookApplication::ImageViewApplication andSelector:#menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  6335
     (Menu new fromLiteralArrayEncoding:(NoteBookApplication::ImageViewApplication menu)) startUp
321c1729db5b initial checkin
penk
parents:
diff changeset
  6336
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  6337
321c1729db5b initial checkin
penk
parents:
diff changeset
  6338
    <resource: #menu>
321c1729db5b initial checkin
penk
parents:
diff changeset
  6339
321c1729db5b initial checkin
penk
parents:
diff changeset
  6340
    ^ 
321c1729db5b initial checkin
penk
parents:
diff changeset
  6341
     #(#Menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  6342
        #(
321c1729db5b initial checkin
penk
parents:
diff changeset
  6343
         #(#MenuItem
6100
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  6344
            #activeHelpKey: #closeTabButton
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6345
            #label: 'Close'
321c1729db5b initial checkin
penk
parents:
diff changeset
  6346
            #translateLabel: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  6347
            #isButton: true
321c1729db5b initial checkin
penk
parents:
diff changeset
  6348
            #hideMenuOnActivated: false
321c1729db5b initial checkin
penk
parents:
diff changeset
  6349
            #startGroup: #right
321c1729db5b initial checkin
penk
parents:
diff changeset
  6350
            #value: #doClose
6093
cab3a82eaa34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6091
diff changeset
  6351
            #labelImage: #(#ResourceRetriever #ToolbarIconLibrary #removeTabIcon)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6352
          )
321c1729db5b initial checkin
penk
parents:
diff changeset
  6353
         )
321c1729db5b initial checkin
penk
parents:
diff changeset
  6354
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  6355
        nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  6356
      )
321c1729db5b initial checkin
penk
parents:
diff changeset
  6357
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  6358
321c1729db5b initial checkin
penk
parents:
diff changeset
  6359
!FileApplicationNoteBook::XViewApplication class methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6360
5008
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6361
canOpenItem:anItem
5265
277aaeb1eb45 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5259
diff changeset
  6362
    | keySym|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6363
    
5008
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6364
    keySym := anItem mimeType asSymbol.
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6365
    OperatingSystem isUNIXlike ifFalse:[^ false].
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6366
5265
277aaeb1eb45 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5259
diff changeset
  6367
    (self mimeTypeUnixApplicationMapping contains:[ : el | (el at:1) == keySym ]) ifFalse:[^ false].
5008
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6368
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6369
    (OperatingSystem executeCommand:('which ', self unixVNCCommand)) ifFalse:[
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6370
        Dialog warn:'Cannot start a viewer for ' , anItem fileName baseName.
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6371
        ^ false.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6372
    ].
5008
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6373
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6374
    VNCFrameBufferView notNil ifFalse:[
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6375
        Dialog warn:'VNC support classes are missing (package not loaded?)'.
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6376
        ^ false.
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6377
    ].
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6378
    ^ true
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6379
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  6380
321c1729db5b initial checkin
penk
parents:
diff changeset
  6381
!FileApplicationNoteBook::XViewApplication methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6382
321c1729db5b initial checkin
penk
parents:
diff changeset
  6383
xView
321c1729db5b initial checkin
penk
parents:
diff changeset
  6384
    "return the value of the instance variable 'imageView' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  6385
321c1729db5b initial checkin
penk
parents:
diff changeset
  6386
    ^ xView
321c1729db5b initial checkin
penk
parents:
diff changeset
  6387
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6388
321c1729db5b initial checkin
penk
parents:
diff changeset
  6389
xView:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  6390
    "set the value of the instance variable 'imageView' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  6391
321c1729db5b initial checkin
penk
parents:
diff changeset
  6392
    xView := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6393
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  6394
321c1729db5b initial checkin
penk
parents:
diff changeset
  6395
!FileApplicationNoteBook::XViewApplication methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6396
321c1729db5b initial checkin
penk
parents:
diff changeset
  6397
changeInformation 
321c1729db5b initial checkin
penk
parents:
diff changeset
  6398
321c1729db5b initial checkin
penk
parents:
diff changeset
  6399
    | stream|
321c1729db5b initial checkin
penk
parents:
diff changeset
  6400
321c1729db5b initial checkin
penk
parents:
diff changeset
  6401
    stream := WriteStream on:''.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6402
    stream nextPutAll:'XView on: '.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6403
    stream nextPutAll:self fileName baseName.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6404
    masterApplication isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6405
        self window label:stream contents.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6406
321c1729db5b initial checkin
penk
parents:
diff changeset
  6407
    ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6408
        masterApplication tabStringChangeTo:stream contents for:self.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6409
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6410
    stream close.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6411
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6412
321c1729db5b initial checkin
penk
parents:
diff changeset
  6413
setupXView
321c1729db5b initial checkin
penk
parents:
diff changeset
  6414
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  6415
    |xExt yExt mainView|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6416
321c1729db5b initial checkin
penk
parents:
diff changeset
  6417
    self startVNCserver.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6418
    xExt := self xView width asString.
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  6419
    self masterApplication notNil ifTrue:[
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  6420
        mainView := self builder windowGroup mainView.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  6421
        "/ if the mainView is a FileBrowser take them y extent because size of notebook can be changed
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  6422
        (mainView application class == (Smalltalk at:#FileBrowserV2 ifAbsent:nil)) notNil ifTrue:[
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  6423
            yExt := mainView height asString.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  6424
        ].
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  6425
    ].
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  6426
    yExt isNil ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6427
        yExt := self xView height asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6428
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6429
    ext := xExt, 'x', yExt.    
321c1729db5b initial checkin
penk
parents:
diff changeset
  6430
    self startViewer.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6431
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  6432
321c1729db5b initial checkin
penk
parents:
diff changeset
  6433
!FileApplicationNoteBook::XViewApplication methodsFor:'actions VNC'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6434
321c1729db5b initial checkin
penk
parents:
diff changeset
  6435
setupView
321c1729db5b initial checkin
penk
parents:
diff changeset
  6436
    |  renderer view|
321c1729db5b initial checkin
penk
parents:
diff changeset
  6437
321c1729db5b initial checkin
penk
parents:
diff changeset
  6438
    view := xView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6439
    renderer := VNCRenderer for:vncConnection targetWindow:view device:xView device.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6440
321c1729db5b initial checkin
penk
parents:
diff changeset
  6441
    view renderer:renderer.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6442
    view connection:vncConnection.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6443
321c1729db5b initial checkin
penk
parents:
diff changeset
  6444
    VNCException handle:[:ex|
321c1729db5b initial checkin
penk
parents:
diff changeset
  6445
        self stopViewer.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6446
    ] do:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6447
        vncConnection 
321c1729db5b initial checkin
penk
parents:
diff changeset
  6448
            startMessageHandlerProcessForRenderer:renderer
321c1729db5b initial checkin
penk
parents:
diff changeset
  6449
            errorHandler:[:ex | self stopViewer].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6450
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6451
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6452
321c1729db5b initial checkin
penk
parents:
diff changeset
  6453
startVNCserver
321c1729db5b initial checkin
penk
parents:
diff changeset
  6454
    |cmd blocked connected numberOfVncStarts|
321c1729db5b initial checkin
penk
parents:
diff changeset
  6455
5008
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6456
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6457
    VNCAuthenticationFailure isNil ifTrue:[
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6458
        Dialog warn:'VNC Classes missing (package not laoded ?)'.
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6459
        ^ self.
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6460
    ].
3f24f5a9f740 gzip archiver stuff fixed.
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
  6461
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6462
    connected := false.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6463
    numberOfVncStarts isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6464
        numberOfVncStarts := 1.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6465
    ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6466
        numberOfVncStarts := numberOfVncStarts + 1.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6467
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6468
321c1729db5b initial checkin
penk
parents:
diff changeset
  6469
    vncLock isNil ifTrue:[vncLock := Semaphore forMutualExclusion].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6470
321c1729db5b initial checkin
penk
parents:
diff changeset
  6471
    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
  6472
        cmd := ('/usr/X11R6/bin/', self class unixVNCCommand).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6473
        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
  6474
            cmd := self class unixVNCCommand.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6475
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6476
        vncPortNr isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6477
            vncPortNr := 29
321c1729db5b initial checkin
penk
parents:
diff changeset
  6478
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6479
        cmd := cmd , ' :' , vncPortNr printString , ' nologo -nevershared -localhost -depth 16 -geometry 1024x1024'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6480
321c1729db5b initial checkin
penk
parents:
diff changeset
  6481
        blocked := OperatingSystem blockInterrupts.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6482
321c1729db5b initial checkin
penk
parents:
diff changeset
  6483
        vncServerPID := Processor
321c1729db5b initial checkin
penk
parents:
diff changeset
  6484
                   monitor:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6485
                      vncServerIsTerminated := false.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6486
                      OperatingSystem
321c1729db5b initial checkin
penk
parents:
diff changeset
  6487
                          exec:'/bin/sh'
321c1729db5b initial checkin
penk
parents:
diff changeset
  6488
                          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
  6489
                          environment:nil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6490
                          fileDescriptors:#()
321c1729db5b initial checkin
penk
parents:
diff changeset
  6491
                          fork:true
321c1729db5b initial checkin
penk
parents:
diff changeset
  6492
                          newPgrp:true
321c1729db5b initial checkin
penk
parents:
diff changeset
  6493
                          inDirectory:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6494
                   ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  6495
                   action:[:status |
321c1729db5b initial checkin
penk
parents:
diff changeset
  6496
                      status stillAlive ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6497
                          OperatingSystem closePid:vncServerPID.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6498
                          vncLock critical:[  
321c1729db5b initial checkin
penk
parents:
diff changeset
  6499
                             vncServerPID := nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6500
                             self vncServerTerminated.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6501
                          ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6502
                      ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6503
                  ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6504
321c1729db5b initial checkin
penk
parents:
diff changeset
  6505
        blocked ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6506
            OperatingSystem unblockInterrupts
321c1729db5b initial checkin
penk
parents:
diff changeset
  6507
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6508
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6509
321c1729db5b initial checkin
penk
parents:
diff changeset
  6510
    self waitForTerminationOfServer ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6511
"/        Transcript showCR:'server has terminated really - try with next port'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6512
        (numberOfVncStarts < self class maxNumberOfVNCRestarts) ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6513
            vncPortNr := vncPortNr + 1.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6514
"/            Transcript showCR:'try next port ', vncPortNr asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6515
            self startVNCserver.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6516
        ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6517
            Dialog warn:'have started servers from port '
321c1729db5b initial checkin
penk
parents:
diff changeset
  6518
                      , (vncPortNr - self class maxNumberOfVNCRestarts) asString
321c1729db5b initial checkin
penk
parents:
diff changeset
  6519
                      , ' to '
321c1729db5b initial checkin
penk
parents:
diff changeset
  6520
                      , vncPortNr
321c1729db5b initial checkin
penk
parents:
diff changeset
  6521
                      , ' - cant connect anyway'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6522
"/            Transcript showCR:'have started servers from port ', vncPortNr - self class maxNumberOfVNCRestarts, ' to ', vncPortNr.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6523
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6524
    ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6525
        vncLock critical:[  
321c1729db5b initial checkin
penk
parents:
diff changeset
  6526
            vncServerPID isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6527
                Dialog warn:'Cannot start Xvnc'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6528
            ] ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6529
                VNCAuthenticationFailure handle:[:ex |
321c1729db5b initial checkin
penk
parents:
diff changeset
  6530
                    Dialog warn:'Wrong password'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6531
                ] do:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6532
                    connected := self vncConnect.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6533
                ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6534
                connected ifTrue:[self setupView].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6535
            ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6536
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6537
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6538
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6539
321c1729db5b initial checkin
penk
parents:
diff changeset
  6540
stopVNCServer
5259
b81919da4356 terminateProcess stuff.
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  6541
    |pid|
b81919da4356 terminateProcess stuff.
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  6542
b81919da4356 terminateProcess stuff.
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  6543
    (pid := vncServerPID) notNil ifTrue:[
b81919da4356 terminateProcess stuff.
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  6544
        OperatingSystem terminateProcess:pid.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6545
        Delay waitForSeconds:0.2.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6546
        vncServerPID notNil ifTrue:[
5259
b81919da4356 terminateProcess stuff.
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  6547
            OperatingSystem killProcess:pid.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6548
            vncServerPID := nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6549
        ].
5259
b81919da4356 terminateProcess stuff.
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  6550
        OperatingSystem closePid:pid
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6551
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6552
    self vncServerTerminated.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6553
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6554
321c1729db5b initial checkin
penk
parents:
diff changeset
  6555
vncConnect
321c1729db5b initial checkin
penk
parents:
diff changeset
  6556
    |  tryConnects|
321c1729db5b initial checkin
penk
parents:
diff changeset
  6557
321c1729db5b initial checkin
penk
parents:
diff changeset
  6558
    vncConnection notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6559
        vncConnection close
321c1729db5b initial checkin
penk
parents:
diff changeset
  6560
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6561
321c1729db5b initial checkin
penk
parents:
diff changeset
  6562
    vncConnection := VNCServerConnection new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6563
    tryConnects := 1.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6564
    [tryConnects < 3] whileTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6565
        VNCConnectionFailure handle:[:ex |
321c1729db5b initial checkin
penk
parents:
diff changeset
  6566
            Delay waitForSeconds:0.5.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6567
            tryConnects := tryConnects + 1.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6568
        ] do:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6569
            vncConnection connectTo:'localhost' port:vncPortNr.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6570
            ^ true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6571
        ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6572
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6573
    ^ false
321c1729db5b initial checkin
penk
parents:
diff changeset
  6574
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6575
321c1729db5b initial checkin
penk
parents:
diff changeset
  6576
vncServerTerminated
321c1729db5b initial checkin
penk
parents:
diff changeset
  6577
"/    Transcript showCR:'vnc server has terminated'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6578
"/    'vnc server has terminated' errorPrintCR.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6579
    "/ Dialog information:'vnc server has terminated'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6580
321c1729db5b initial checkin
penk
parents:
diff changeset
  6581
    self stopViewer.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6582
    vncConnection notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6583
        vncConnection close.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6584
        vncConnection := nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  6585
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6586
    vncServerIsTerminated := true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6587
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6588
321c1729db5b initial checkin
penk
parents:
diff changeset
  6589
waitForTerminationOfServer
321c1729db5b initial checkin
penk
parents:
diff changeset
  6590
    | cycles |
321c1729db5b initial checkin
penk
parents:
diff changeset
  6591
321c1729db5b initial checkin
penk
parents:
diff changeset
  6592
    cycles := 1.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6593
    [vncServerIsTerminated] whileFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6594
        (cycles > 3) ifTrue:[^ false].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6595
        cycles := cycles + 1.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6596
        Delay waitForSeconds:0.5.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6597
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6598
    ^ true
321c1729db5b initial checkin
penk
parents:
diff changeset
  6599
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  6600
321c1729db5b initial checkin
penk
parents:
diff changeset
  6601
!FileApplicationNoteBook::XViewApplication methodsFor:'actions viewer'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6602
321c1729db5b initial checkin
penk
parents:
diff changeset
  6603
startViewer
321c1729db5b initial checkin
penk
parents:
diff changeset
  6604
    |cmd keySym applItem |
321c1729db5b initial checkin
penk
parents:
diff changeset
  6605
321c1729db5b initial checkin
penk
parents:
diff changeset
  6606
    keySym := self item mimeType asSymbol.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6607
    applItem := self class mimeTypeUnixApplicationMapping detect:[ : el | (el at:1) == keySym ] ifNone:[nil].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6608
    applItem isNil ifTrue:[ ^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6609
    
321c1729db5b initial checkin
penk
parents:
diff changeset
  6610
    cmd := (applItem at:2) asString, ' -geometry ', ext, ' -display :' , vncPortNr printString , ' ' , self fileName asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6611
    self startViewer:cmd
321c1729db5b initial checkin
penk
parents:
diff changeset
  6612
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6613
321c1729db5b initial checkin
penk
parents:
diff changeset
  6614
startViewer:viewerCommand
321c1729db5b initial checkin
penk
parents:
diff changeset
  6615
    |blocked|
321c1729db5b initial checkin
penk
parents:
diff changeset
  6616
321c1729db5b initial checkin
penk
parents:
diff changeset
  6617
    viewerPID notNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6618
        ^ self
321c1729db5b initial checkin
penk
parents:
diff changeset
  6619
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6620
321c1729db5b initial checkin
penk
parents:
diff changeset
  6621
    blocked := OperatingSystem blockInterrupts.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6622
321c1729db5b initial checkin
penk
parents:
diff changeset
  6623
    viewerPID := Processor
321c1729db5b initial checkin
penk
parents:
diff changeset
  6624
               monitor:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6625
                  OperatingSystem
321c1729db5b initial checkin
penk
parents:
diff changeset
  6626
                      exec:'/bin/sh'
321c1729db5b initial checkin
penk
parents:
diff changeset
  6627
                      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
  6628
                      environment:nil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6629
                      fileDescriptors:#()
321c1729db5b initial checkin
penk
parents:
diff changeset
  6630
                      fork:true
321c1729db5b initial checkin
penk
parents:
diff changeset
  6631
                      newPgrp:true
321c1729db5b initial checkin
penk
parents:
diff changeset
  6632
                      inDirectory:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6633
               ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  6634
               action:[:status |
321c1729db5b initial checkin
penk
parents:
diff changeset
  6635
                  status stillAlive ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6636
                      OperatingSystem closePid:viewerPID.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6637
                      viewerPID := nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6638
                      self viewerTerminated.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6639
                  ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6640
               ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6641
321c1729db5b initial checkin
penk
parents:
diff changeset
  6642
    blocked ifFalse:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6643
        OperatingSystem unblockInterrupts
321c1729db5b initial checkin
penk
parents:
diff changeset
  6644
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6645
321c1729db5b initial checkin
penk
parents:
diff changeset
  6646
    viewerPID isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6647
        Dialog warn:'Cannot start ', viewerCommand.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6648
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6649
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6650
321c1729db5b initial checkin
penk
parents:
diff changeset
  6651
startXterm
321c1729db5b initial checkin
penk
parents:
diff changeset
  6652
    |cmd|
321c1729db5b initial checkin
penk
parents:
diff changeset
  6653
321c1729db5b initial checkin
penk
parents:
diff changeset
  6654
    cmd := 'xterm -geometry 600x800 -display :' , vncPortNr printString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6655
    self startViewer:cmd
321c1729db5b initial checkin
penk
parents:
diff changeset
  6656
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6657
321c1729db5b initial checkin
penk
parents:
diff changeset
  6658
stopViewer
5259
b81919da4356 terminateProcess stuff.
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  6659
    |pid|
b81919da4356 terminateProcess stuff.
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  6660
b81919da4356 terminateProcess stuff.
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  6661
    (pid := viewerPID) notNil ifTrue:[
b81919da4356 terminateProcess stuff.
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  6662
        OperatingSystem terminateProcess:pid.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6663
        Delay waitForSeconds:0.2.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6664
        viewerPID notNil ifTrue:[
5259
b81919da4356 terminateProcess stuff.
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  6665
            OperatingSystem killProcess:pid.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6666
            viewerPID := nil.
5259
b81919da4356 terminateProcess stuff.
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  6667
        ].
b81919da4356 terminateProcess stuff.
Claus Gittinger <cg@exept.de>
parents: 5223
diff changeset
  6668
        OperatingSystem closePid:pid
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6669
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6670
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6671
321c1729db5b initial checkin
penk
parents:
diff changeset
  6672
viewerTerminated
321c1729db5b initial checkin
penk
parents:
diff changeset
  6673
"/    Transcript showCR:'viewer has terminated'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6674
"/    'viewer has terminated' errorPrintCR.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6675
    "/ Dialog information:'viewer has terminated'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6676
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  6677
321c1729db5b initial checkin
penk
parents:
diff changeset
  6678
!FileApplicationNoteBook::XViewApplication methodsFor:'initialization & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6679
321c1729db5b initial checkin
penk
parents:
diff changeset
  6680
postBuildXView:aWidget
321c1729db5b initial checkin
penk
parents:
diff changeset
  6681
321c1729db5b initial checkin
penk
parents:
diff changeset
  6682
    self xView:aWidget scrolledView.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6683
    self xView wantsFocusWithPointerEnter.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6684
    aWidget autoHideScrollBars:true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6685
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6686
321c1729db5b initial checkin
penk
parents:
diff changeset
  6687
postOpenWith:aBuilder 
6626
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  6688
    "only invoked if the application not started from a master"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6689
321c1729db5b initial checkin
penk
parents:
diff changeset
  6690
    |currentDir contents suffix fileName|
321c1729db5b initial checkin
penk
parents:
diff changeset
  6691
321c1729db5b initial checkin
penk
parents:
diff changeset
  6692
    self masterApplication isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6693
        self masterApplication:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6694
        currentDir := Filename homeDirectory.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6695
        contents := currentDir directoryContents.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6696
        fileName := contents 
321c1729db5b initial checkin
penk
parents:
diff changeset
  6697
                    detect:[:file | 
321c1729db5b initial checkin
penk
parents:
diff changeset
  6698
                        suffix := file asFilename suffix asLowercase.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6699
                        suffix = 'pdf'
321c1729db5b initial checkin
penk
parents:
diff changeset
  6700
                    ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  6701
                    ifNone:[nil].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6702
        fileName isNil ifTrue:[
321c1729db5b initial checkin
penk
parents:
diff changeset
  6703
            Dialog warn:'cant find a PDF File in ' , currentDir asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6704
            ^ self
321c1729db5b initial checkin
penk
parents:
diff changeset
  6705
        ].
3982
fc30449d705d *** empty log message ***
penk
parents: 3962
diff changeset
  6706
        self item:(DirectoryContentsBrowser itemClass fileName:(currentDir construct:fileName)).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6707
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6708
    self changeInformation.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6709
    self setupXView.
6626
06553542e9de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6518
diff changeset
  6710
    super postOpenWith:aBuilder
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6711
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6712
321c1729db5b initial checkin
penk
parents:
diff changeset
  6713
release
321c1729db5b initial checkin
penk
parents:
diff changeset
  6714
"/Transcript showCR:'release'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6715
    self stopViewer.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6716
    self stopVNCServer.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6717
    ^ super release
321c1729db5b initial checkin
penk
parents:
diff changeset
  6718
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  6719
321c1729db5b initial checkin
penk
parents:
diff changeset
  6720
!FileApplicationNoteBook class methodsFor:'documentation'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6721
10761
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  6722
version
11590
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  6723
    ^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.268 2012-07-11 15:12:11 stefan Exp $'
10761
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  6724
!
64a7f27deb22 defaultTagsBrowserVisible
Claus Gittinger <cg@exept.de>
parents: 10754
diff changeset
  6725
8912
4ee5a8847d06 category changes
Claus Gittinger <cg@exept.de>
parents: 8783
diff changeset
  6726
version_CVS
11590
dc5935e9387b Fix decoding error handling
Stefan Vogel <sv@exept.de>
parents: 11589
diff changeset
  6727
    ^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.268 2012-07-11 15:12:11 stefan Exp $'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6728
! !