author | Claus Gittinger <cg@exept.de> |
Wed, 04 Aug 2004 20:00:18 +0200 | |
changeset 5967 | ff5e8356fcb7 |
parent 5737 | c5a659e2c4c7 |
child 7105 | 215c0573cf42 |
permissions | -rw-r--r-- |
5140 | 1 |
" |
2 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
3892 | 13 |
"{ Package: 'stx:libtool' }" |
14 |
||
15 |
ApplicationModel subclass:#AbstractFileApplicationNoteBookComponent |
|
16 |
instanceVariableNames:'sameFileIndex item type notifyChannel' |
|
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Interface-Tools-File' |
|
20 |
! |
|
21 |
||
5140 | 22 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'documentation'! |
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
5967 | 36 |
! |
37 |
||
38 |
documentation |
|
39 |
" |
|
40 |
[Author:] |
|
41 |
Christian Penk |
|
42 |
" |
|
5140 | 43 |
! ! |
3892 | 44 |
|
45 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'defaults'! |
|
46 |
||
47 |
tabStringFor:aApplicationType |
|
48 |
||
49 |
^ nil |
|
50 |
! ! |
|
51 |
||
52 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'queries'! |
|
53 |
||
5010 | 54 |
canOpenItem:anItem |
3892 | 55 |
|
56 |
" |
|
57 |
example: |
|
5010 | 58 |
^ (anItem suffix == 'cc') |
3892 | 59 |
" |
60 |
^ false |
|
61 |
! |
|
62 |
||
63 |
wantNewApplicationAnyway |
|
64 |
||
65 |
^ true |
|
66 |
! ! |
|
67 |
||
68 |
!AbstractFileApplicationNoteBookComponent methodsFor:'accessing'! |
|
69 |
||
4529 | 70 |
notify:msg |
71 |
self notifyChannel value:msg |
|
72 |
! |
|
73 |
||
3892 | 74 |
notifyChannel |
75 |
notifyChannel isNil ifTrue:[ |
|
76 |
self masterApplication notNil ifTrue:[ |
|
77 |
notifyChannel := masterApplication notifyChannel. |
|
78 |
] ifFalse:[ |
|
79 |
notifyChannel := ValueHolder with:''. |
|
80 |
]. |
|
81 |
]. |
|
82 |
^ notifyChannel |
|
83 |
! |
|
84 |
||
85 |
sameFileIndex |
|
86 |
||
87 |
^ sameFileIndex |
|
88 |
! |
|
89 |
||
90 |
sameFileIndex:something |
|
91 |
||
92 |
sameFileIndex := something. |
|
93 |
! ! |
|
94 |
||
95 |
!AbstractFileApplicationNoteBookComponent methodsFor:'actions'! |
|
96 |
||
5010 | 97 |
changeItem:anItem |
3892 | 98 |
|
5010 | 99 |
^ self item:anItem. |
3892 | 100 |
! |
101 |
||
102 |
doClose |
|
103 |
|master| |
|
104 |
||
105 |
"/ tell the NoteBookApplication to close me |
|
106 |
(master := self masterApplication) notNil ifTrue:[ |
|
107 |
master closeSubCanvas:self. |
|
3933
2e083e6e224f
must send #release manually (to release processes)
Claus Gittinger <cg@exept.de>
parents:
3892
diff
changeset
|
108 |
self release. |
3892 | 109 |
] ifFalse:[ |
110 |
self closeRequest. |
|
111 |
]. |
|
3954 | 112 |
^ true |
3892 | 113 |
! ! |
114 |
||
5120 | 115 |
!AbstractFileApplicationNoteBookComponent methodsFor:'aspects'! |
116 |
||
117 |
cursorColLabelHolder |
|
118 |
^ '' |
|
119 |
! |
|
120 |
||
121 |
cursorLineLabelHolder |
|
122 |
^ '' |
|
123 |
! |
|
124 |
||
5528 | 125 |
fileEncodingHolder |
5586 | 126 |
^ #'iso8859-1' |
5528 | 127 |
! |
128 |
||
5737 | 129 |
lockFileEncodingHolder |
130 |
^ true |
|
131 |
! |
|
132 |
||
5120 | 133 |
modeLabelHolder |
134 |
^ '' |
|
135 |
! ! |
|
136 |
||
3892 | 137 |
!AbstractFileApplicationNoteBookComponent methodsFor:'queries'! |
138 |
||
139 |
fileName |
|
140 |
||
141 |
item notNil ifTrue:[ |
|
142 |
^ item fileName. |
|
143 |
]. |
|
144 |
^ nil |
|
145 |
! |
|
146 |
||
147 |
getDirWithoutFileName:aFileName |
|
148 |
||
149 |
| dir | |
|
150 |
aFileName isNil ifTrue:[ |
|
151 |
^ aFileName. |
|
152 |
]. |
|
153 |
dir := aFileName asFilename. |
|
154 |
dir isDirectory ifFalse:[ |
|
155 |
dir := dir directory. |
|
156 |
]. |
|
157 |
^ dir. |
|
158 |
! |
|
159 |
||
160 |
getTabString |
|
161 |
||
162 |
" get the tab string from the application list on the class side " |
|
163 |
||
164 |
| stream string firstString endString| |
|
165 |
||
166 |
stream := WriteStream on:''. |
|
167 |
firstString := self class tabStringFor:type. |
|
168 |
firstString isNil ifTrue:[ |
|
169 |
"/ default take the class name |
|
170 |
firstString := self className. |
|
171 |
]. |
|
172 |
stream nextPutAll:firstString. |
|
173 |
endString := self getTabStringEnd. |
|
174 |
endString notNil ifTrue:[ |
|
175 |
stream space. |
|
176 |
stream nextPutAll:endString. |
|
177 |
]. |
|
178 |
string := stream contents. |
|
179 |
stream close. |
|
180 |
^ string. |
|
181 |
! |
|
182 |
||
183 |
getTabStringEnd |
|
184 |
||
185 |
" get the tab string from the application list on the class side " |
|
186 |
||
5460 | 187 |
| stream| |
3892 | 188 |
|
189 |
self item notNil ifTrue:[ |
|
190 |
stream := WriteStream on:''. |
|
5460 | 191 |
self type = #directoryDescription ifTrue:[ |
192 |
stream nextPutAll:self fileName directory baseName. |
|
193 |
stream space. |
|
194 |
stream nextPut:$[. |
|
195 |
stream nextPutAll:self fileName baseName. |
|
196 |
stream nextPut:$]. |
|
197 |
] ifFalse:[ |
|
198 |
stream nextPutAll:self fileName baseName. |
|
199 |
stream space. |
|
200 |
self sameFileIndex notNil ifTrue:[ |
|
201 |
stream nextPutAll:self sameFileIndex asString. |
|
202 |
]. |
|
3892 | 203 |
]. |
5460 | 204 |
^ stream contents. |
3892 | 205 |
]. |
206 |
^ nil |
|
207 |
! |
|
208 |
||
209 |
isEmbeddedApplication |
|
210 |
||
211 |
^ self masterApplication notNil |
|
212 |
! |
|
213 |
||
214 |
isModified |
|
215 |
||
216 |
^ false |
|
217 |
! |
|
218 |
||
4147 | 219 |
isTextEditor |
220 |
||
221 |
^ false |
|
222 |
! |
|
223 |
||
3892 | 224 |
item |
225 |
||
226 |
^ item |
|
227 |
! |
|
228 |
||
5010 | 229 |
item:anItem |
3892 | 230 |
|
5010 | 231 |
item := anItem. |
3892 | 232 |
^ true |
233 |
! |
|
234 |
||
235 |
presentation |
|
236 |
||
237 |
^ nil |
|
238 |
! |
|
239 |
||
240 |
type |
|
241 |
||
242 |
^ type |
|
243 |
! |
|
244 |
||
245 |
type:aType |
|
246 |
||
247 |
type := aType |
|
248 |
! |
|
249 |
||
250 |
wantChangeAnyWay |
|
251 |
||
252 |
^ (self type == #directoryDescription) |
|
253 |
! ! |
|
254 |
||
5604 | 255 |
!AbstractFileApplicationNoteBookComponent methodsFor:'resources'! |
256 |
||
257 |
resources |
|
258 |
masterApplication notNil ifTrue:[ |
|
259 |
^ masterApplication resources |
|
260 |
]. |
|
261 |
^ super resources |
|
262 |
! ! |
|
263 |
||
3892 | 264 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'documentation'! |
265 |
||
266 |
version |
|
5967 | 267 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileApplicationNoteBookComponent.st,v 1.15 2004-08-04 18:00:13 cg Exp $' |
3892 | 268 |
! ! |