author | penk |
Wed, 28 Jan 2004 14:13:02 +0100 | |
changeset 5460 | 305f441da48a |
parent 5140 | 36c7da05d814 |
child 5528 | 54e3fbee2822 |
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 |
" |
|
36 |
! ! |
|
3892 | 37 |
|
38 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'defaults'! |
|
39 |
||
40 |
tabStringFor:aApplicationType |
|
41 |
||
42 |
^ nil |
|
43 |
! ! |
|
44 |
||
45 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'queries'! |
|
46 |
||
5010 | 47 |
canOpenItem:anItem |
3892 | 48 |
|
49 |
" |
|
50 |
example: |
|
5010 | 51 |
^ (anItem suffix == 'cc') |
3892 | 52 |
" |
53 |
^ false |
|
54 |
! |
|
55 |
||
56 |
wantNewApplicationAnyway |
|
57 |
||
58 |
^ true |
|
59 |
! ! |
|
60 |
||
61 |
!AbstractFileApplicationNoteBookComponent methodsFor:'accessing'! |
|
62 |
||
4529 | 63 |
notify:msg |
64 |
self notifyChannel value:msg |
|
65 |
! |
|
66 |
||
3892 | 67 |
notifyChannel |
68 |
notifyChannel isNil ifTrue:[ |
|
69 |
self masterApplication notNil ifTrue:[ |
|
70 |
notifyChannel := masterApplication notifyChannel. |
|
71 |
] ifFalse:[ |
|
72 |
notifyChannel := ValueHolder with:''. |
|
73 |
]. |
|
74 |
]. |
|
75 |
^ notifyChannel |
|
76 |
! |
|
77 |
||
78 |
sameFileIndex |
|
79 |
||
80 |
^ sameFileIndex |
|
81 |
! |
|
82 |
||
83 |
sameFileIndex:something |
|
84 |
||
85 |
sameFileIndex := something. |
|
86 |
! ! |
|
87 |
||
88 |
!AbstractFileApplicationNoteBookComponent methodsFor:'actions'! |
|
89 |
||
5010 | 90 |
changeItem:anItem |
3892 | 91 |
|
5010 | 92 |
^ self item:anItem. |
3892 | 93 |
! |
94 |
||
95 |
doClose |
|
96 |
|master| |
|
97 |
||
98 |
"/ tell the NoteBookApplication to close me |
|
99 |
(master := self masterApplication) notNil ifTrue:[ |
|
100 |
master closeSubCanvas:self. |
|
3933
2e083e6e224f
must send #release manually (to release processes)
Claus Gittinger <cg@exept.de>
parents:
3892
diff
changeset
|
101 |
self release. |
3892 | 102 |
] ifFalse:[ |
103 |
self closeRequest. |
|
104 |
]. |
|
3954 | 105 |
^ true |
3892 | 106 |
! ! |
107 |
||
5120 | 108 |
!AbstractFileApplicationNoteBookComponent methodsFor:'aspects'! |
109 |
||
110 |
cursorColLabelHolder |
|
111 |
^ '' |
|
112 |
! |
|
113 |
||
114 |
cursorLineLabelHolder |
|
115 |
^ '' |
|
116 |
! |
|
117 |
||
118 |
modeLabelHolder |
|
119 |
^ '' |
|
120 |
! ! |
|
121 |
||
3892 | 122 |
!AbstractFileApplicationNoteBookComponent methodsFor:'queries'! |
123 |
||
124 |
fileName |
|
125 |
||
126 |
item notNil ifTrue:[ |
|
127 |
^ item fileName. |
|
128 |
]. |
|
129 |
^ nil |
|
130 |
! |
|
131 |
||
132 |
getDirWithoutFileName:aFileName |
|
133 |
||
134 |
| dir | |
|
135 |
aFileName isNil ifTrue:[ |
|
136 |
^ aFileName. |
|
137 |
]. |
|
138 |
dir := aFileName asFilename. |
|
139 |
dir isDirectory ifFalse:[ |
|
140 |
dir := dir directory. |
|
141 |
]. |
|
142 |
^ dir. |
|
143 |
! |
|
144 |
||
145 |
getTabString |
|
146 |
||
147 |
" get the tab string from the application list on the class side " |
|
148 |
||
149 |
| stream string firstString endString| |
|
150 |
||
151 |
stream := WriteStream on:''. |
|
152 |
firstString := self class tabStringFor:type. |
|
153 |
firstString isNil ifTrue:[ |
|
154 |
"/ default take the class name |
|
155 |
firstString := self className. |
|
156 |
]. |
|
157 |
stream nextPutAll:firstString. |
|
158 |
endString := self getTabStringEnd. |
|
159 |
endString notNil ifTrue:[ |
|
160 |
stream space. |
|
161 |
stream nextPutAll:endString. |
|
162 |
]. |
|
163 |
string := stream contents. |
|
164 |
stream close. |
|
165 |
^ string. |
|
166 |
! |
|
167 |
||
168 |
getTabStringEnd |
|
169 |
||
170 |
" get the tab string from the application list on the class side " |
|
171 |
||
5460 | 172 |
| stream| |
3892 | 173 |
|
174 |
self item notNil ifTrue:[ |
|
175 |
stream := WriteStream on:''. |
|
5460 | 176 |
self type = #directoryDescription ifTrue:[ |
177 |
stream nextPutAll:self fileName directory baseName. |
|
178 |
stream space. |
|
179 |
stream nextPut:$[. |
|
180 |
stream nextPutAll:self fileName baseName. |
|
181 |
stream nextPut:$]. |
|
182 |
] ifFalse:[ |
|
183 |
stream nextPutAll:self fileName baseName. |
|
184 |
stream space. |
|
185 |
self sameFileIndex notNil ifTrue:[ |
|
186 |
stream nextPutAll:self sameFileIndex asString. |
|
187 |
]. |
|
3892 | 188 |
]. |
5460 | 189 |
^ stream contents. |
3892 | 190 |
]. |
191 |
^ nil |
|
192 |
! |
|
193 |
||
194 |
isEmbeddedApplication |
|
195 |
||
196 |
^ self masterApplication notNil |
|
197 |
! |
|
198 |
||
199 |
isModified |
|
200 |
||
201 |
^ false |
|
202 |
! |
|
203 |
||
4147 | 204 |
isTextEditor |
205 |
||
206 |
^ false |
|
207 |
! |
|
208 |
||
3892 | 209 |
item |
210 |
||
211 |
^ item |
|
212 |
! |
|
213 |
||
5010 | 214 |
item:anItem |
3892 | 215 |
|
5010 | 216 |
item := anItem. |
3892 | 217 |
^ true |
218 |
! |
|
219 |
||
220 |
presentation |
|
221 |
||
222 |
^ nil |
|
223 |
! |
|
224 |
||
225 |
type |
|
226 |
||
227 |
^ type |
|
228 |
! |
|
229 |
||
230 |
type:aType |
|
231 |
||
232 |
type := aType |
|
233 |
! |
|
234 |
||
235 |
wantChangeAnyWay |
|
236 |
||
237 |
^ (self type == #directoryDescription) |
|
238 |
! ! |
|
239 |
||
240 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'documentation'! |
|
241 |
||
242 |
version |
|
5460 | 243 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileApplicationNoteBookComponent.st,v 1.10 2004-01-28 13:13:02 penk Exp $' |
3892 | 244 |
! ! |