author | Stefan Vogel <sv@exept.de> |
Mon, 30 Nov 2015 11:01:06 +0100 | |
changeset 15974 | 8a850b3f2d90 |
parent 15822 | 161ba719c870 |
child 15978 | 2e1c1fcc135d |
child 16198 | 7aca47a2689a |
permissions | -rw-r--r-- |
5140 | 1 |
" |
2 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
3892 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
15588
558245ed3e2d
class: AbstractFileApplicationNoteBookComponent
Stefan Vogel <sv@exept.de>
parents:
14800
diff
changeset
|
14 |
"{ NameSpace: Smalltalk }" |
558245ed3e2d
class: AbstractFileApplicationNoteBookComponent
Stefan Vogel <sv@exept.de>
parents:
14800
diff
changeset
|
15 |
|
3892 | 16 |
ApplicationModel subclass:#AbstractFileApplicationNoteBookComponent |
17 |
instanceVariableNames:'sameFileIndex item type notifyChannel' |
|
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-Tools-File' |
|
21 |
! |
|
22 |
||
5140 | 23 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'documentation'! |
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
5967 | 37 |
! |
38 |
||
39 |
documentation |
|
40 |
" |
|
41 |
[Author:] |
|
42 |
Christian Penk |
|
43 |
" |
|
5140 | 44 |
! ! |
3892 | 45 |
|
46 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'defaults'! |
|
47 |
||
48 |
tabStringFor:aApplicationType |
|
7689 | 49 |
"the formatString shown in a tab (language translated)" |
3892 | 50 |
|
51 |
^ nil |
|
7689 | 52 |
|
53 |
"Modified: / 01-03-2007 / 21:43:10 / cg" |
|
54 |
! |
|
55 |
||
56 |
tabStringFor:aApplicationType forContents:shownContents |
|
57 |
||
58 |
^ nil |
|
59 |
||
60 |
"Created: / 01-03-2007 / 21:35:39 / cg" |
|
3892 | 61 |
! ! |
62 |
||
63 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'queries'! |
|
64 |
||
5010 | 65 |
canOpenItem:anItem |
3892 | 66 |
|
67 |
" |
|
68 |
example: |
|
5010 | 69 |
^ (anItem suffix == 'cc') |
3892 | 70 |
" |
71 |
^ false |
|
72 |
! |
|
73 |
||
74 |
wantNewApplicationAnyway |
|
75 |
||
76 |
^ true |
|
77 |
! ! |
|
78 |
||
79 |
!AbstractFileApplicationNoteBookComponent methodsFor:'accessing'! |
|
80 |
||
4529 | 81 |
notify:msg |
82 |
self notifyChannel value:msg |
|
83 |
! |
|
84 |
||
3892 | 85 |
notifyChannel |
86 |
notifyChannel isNil ifTrue:[ |
|
87 |
self masterApplication notNil ifTrue:[ |
|
88 |
notifyChannel := masterApplication notifyChannel. |
|
89 |
] ifFalse:[ |
|
90 |
notifyChannel := ValueHolder with:''. |
|
91 |
]. |
|
92 |
]. |
|
93 |
^ notifyChannel |
|
94 |
! |
|
95 |
||
96 |
sameFileIndex |
|
97 |
||
98 |
^ sameFileIndex |
|
99 |
! |
|
100 |
||
101 |
sameFileIndex:something |
|
102 |
||
103 |
sameFileIndex := something. |
|
104 |
! ! |
|
105 |
||
106 |
!AbstractFileApplicationNoteBookComponent methodsFor:'actions'! |
|
107 |
||
5010 | 108 |
changeItem:anItem |
3892 | 109 |
|
5010 | 110 |
^ self item:anItem. |
3892 | 111 |
! |
112 |
||
113 |
doClose |
|
114 |
|master| |
|
115 |
||
116 |
"/ tell the NoteBookApplication to close me |
|
117 |
(master := self masterApplication) notNil ifTrue:[ |
|
118 |
master closeSubCanvas:self. |
|
3933
2e083e6e224f
must send #release manually (to release processes)
Claus Gittinger <cg@exept.de>
parents:
3892
diff
changeset
|
119 |
self release. |
3892 | 120 |
] ifFalse:[ |
121 |
self closeRequest. |
|
122 |
]. |
|
3954 | 123 |
^ true |
3892 | 124 |
! ! |
125 |
||
5120 | 126 |
!AbstractFileApplicationNoteBookComponent methodsFor:'aspects'! |
127 |
||
128 |
cursorColLabelHolder |
|
129 |
^ '' |
|
130 |
! |
|
131 |
||
15822
161ba719c870
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
15588
diff
changeset
|
132 |
cursorLineAndColumnLabelHolder |
161ba719c870
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
15588
diff
changeset
|
133 |
^ '' |
161ba719c870
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
15588
diff
changeset
|
134 |
! |
161ba719c870
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
15588
diff
changeset
|
135 |
|
5120 | 136 |
cursorLineLabelHolder |
137 |
^ '' |
|
138 |
! |
|
139 |
||
5528 | 140 |
fileEncodingHolder |
5586 | 141 |
^ #'iso8859-1' |
5528 | 142 |
! |
143 |
||
5737 | 144 |
lockFileEncodingHolder |
7289 | 145 |
^ nil |
5737 | 146 |
! |
147 |
||
5120 | 148 |
modeLabelHolder |
149 |
^ '' |
|
7105 | 150 |
! |
151 |
||
152 |
modeLabelMenu |
|
153 |
^ nil |
|
154 |
||
155 |
"Created: / 11-09-2006 / 12:32:37 / cg" |
|
5120 | 156 |
! ! |
157 |
||
9358
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
158 |
!AbstractFileApplicationNoteBookComponent methodsFor:'drag & drop support'! |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
159 |
|
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
160 |
doStartDrag:aDropSource in:aView |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
161 |
"common code, used in subclasses" |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
162 |
|
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
163 |
|hdl| |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
164 |
|
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
165 |
hdl := DragAndDropManager new. |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
166 |
|
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
167 |
hdl disabledCursor:AbstractFileBrowser disabledCursorImage. |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
168 |
hdl enabledCursor:AbstractFileBrowser enabledCursorImage. |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
169 |
hdl alienCursor:nil. |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
170 |
|
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
171 |
hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
172 |
! ! |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
173 |
|
3892 | 174 |
!AbstractFileApplicationNoteBookComponent methodsFor:'queries'! |
175 |
||
7468 | 176 |
additionalInfo |
177 |
^ '' |
|
178 |
||
179 |
"Created: / 24-10-2006 / 12:25:51 / cg" |
|
180 |
! |
|
181 |
||
11225 | 182 |
closeButtonShown |
183 |
^ false. |
|
184 |
||
185 |
"Created: / 27-01-2012 / 15:00:22 / cg" |
|
186 |
! |
|
187 |
||
12492
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
188 |
cvsMenusAreShown |
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
189 |
^ ConfigurableFeatures includesFeature: #CVSSupportEnabled |
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
190 |
! |
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
191 |
|
3892 | 192 |
fileName |
193 |
item notNil ifTrue:[ |
|
194 |
^ item fileName. |
|
195 |
]. |
|
196 |
^ nil |
|
197 |
! |
|
198 |
||
199 |
getDirWithoutFileName:aFileName |
|
200 |
||
201 |
| dir | |
|
202 |
aFileName isNil ifTrue:[ |
|
203 |
^ aFileName. |
|
204 |
]. |
|
205 |
dir := aFileName asFilename. |
|
206 |
dir isDirectory ifFalse:[ |
|
207 |
dir := dir directory. |
|
208 |
]. |
|
209 |
^ dir. |
|
210 |
! |
|
211 |
||
14800
993062566d3f
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
12492
diff
changeset
|
212 |
getTabIcon |
993062566d3f
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
12492
diff
changeset
|
213 |
"the item shown in a tab" |
993062566d3f
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
12492
diff
changeset
|
214 |
|
993062566d3f
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
12492
diff
changeset
|
215 |
^ nil |
993062566d3f
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
12492
diff
changeset
|
216 |
! |
993062566d3f
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
12492
diff
changeset
|
217 |
|
3892 | 218 |
getTabString |
7689 | 219 |
"get the tab string from the application" |
3892 | 220 |
|
15974 | 221 |
|formatString valueString stream| |
222 |
||
223 |
stream := CharacterWriteStream on:''. |
|
3892 | 224 |
|
15974 | 225 |
valueString := self getTabValueString. |
226 |
valueString isNil ifTrue:[ |
|
227 |
valueString := resources string:'<unnamed>' |
|
228 |
]. |
|
229 |
formatString := self class tabStringFor:type. |
|
230 |
formatString isNil ifTrue:[ |
|
231 |
"/ default: take the class name |
|
232 |
formatString := self className. |
|
233 |
]. |
|
234 |
stream nextPutAll:(resources string:formatString with:valueString). |
|
8387 | 235 |
|
15974 | 236 |
^ stream contents. |
7689 | 237 |
|
238 |
"Modified: / 01-03-2007 / 21:45:02 / cg" |
|
3892 | 239 |
! |
240 |
||
241 |
getTabStringEnd |
|
15588
558245ed3e2d
class: AbstractFileApplicationNoteBookComponent
Stefan Vogel <sv@exept.de>
parents:
14800
diff
changeset
|
242 |
" get the tab string from the application list on the class side " |
3892 | 243 |
|
5460 | 244 |
| stream| |
3892 | 245 |
|
246 |
self item notNil ifTrue:[ |
|
15588
558245ed3e2d
class: AbstractFileApplicationNoteBookComponent
Stefan Vogel <sv@exept.de>
parents:
14800
diff
changeset
|
247 |
stream := CharacterWriteStream new. |
5460 | 248 |
self type = #directoryDescription ifTrue:[ |
249 |
stream nextPutAll:self fileName directory baseName. |
|
250 |
stream space. |
|
251 |
stream nextPut:$[. |
|
252 |
stream nextPutAll:self fileName baseName. |
|
253 |
stream nextPut:$]. |
|
254 |
] ifFalse:[ |
|
255 |
stream nextPutAll:self fileName baseName. |
|
256 |
stream space. |
|
257 |
self sameFileIndex notNil ifTrue:[ |
|
258 |
stream nextPutAll:self sameFileIndex asString. |
|
259 |
]. |
|
3892 | 260 |
]. |
5460 | 261 |
^ stream contents. |
3892 | 262 |
]. |
263 |
^ nil |
|
264 |
! |
|
265 |
||
7689 | 266 |
getTabValueString |
267 |
"the item shown in a tab (not language translated)" |
|
268 |
||
15974 | 269 |
|stream fn baseName| |
270 |
||
7689 | 271 |
self item isNil ifTrue:[^ nil]. |
272 |
||
15974 | 273 |
stream := CharacterWriteStream on:''. |
7689 | 274 |
|
15974 | 275 |
fn := self fileName. |
276 |
baseName := fn baseName. |
|
277 |
self type = #directoryDescription ifTrue:[ |
|
278 |
stream nextPutAll:(fn directory baseName). |
|
279 |
stream space. |
|
280 |
stream nextPut:$[. |
|
281 |
stream nextPutAll:baseName. |
|
282 |
stream nextPut:$]. |
|
283 |
] ifFalse:[ |
|
284 |
stream nextPutAll:baseName. |
|
285 |
stream space. |
|
286 |
self sameFileIndex notNil ifTrue:[ |
|
287 |
stream nextPutAll:self sameFileIndex asString. |
|
288 |
]. |
|
289 |
]. |
|
290 |
||
291 |
^ stream contents |
|
7689 | 292 |
|
293 |
"Created: / 01-03-2007 / 21:40:03 / cg" |
|
294 |
! |
|
295 |
||
3892 | 296 |
isEmbeddedApplication |
297 |
||
298 |
^ self masterApplication notNil |
|
299 |
! |
|
300 |
||
301 |
isModified |
|
302 |
||
303 |
^ false |
|
304 |
! |
|
305 |
||
4147 | 306 |
isTextEditor |
307 |
||
308 |
^ false |
|
309 |
! |
|
310 |
||
3892 | 311 |
item |
312 |
||
313 |
^ item |
|
314 |
! |
|
315 |
||
5010 | 316 |
item:anItem |
3892 | 317 |
|
5010 | 318 |
item := anItem. |
3892 | 319 |
^ true |
320 |
! |
|
321 |
||
322 |
presentation |
|
323 |
||
324 |
^ nil |
|
325 |
! |
|
326 |
||
327 |
type |
|
328 |
||
329 |
^ type |
|
330 |
! |
|
331 |
||
332 |
type:aType |
|
333 |
||
334 |
type := aType |
|
335 |
! |
|
336 |
||
337 |
wantChangeAnyWay |
|
338 |
||
339 |
^ (self type == #directoryDescription) |
|
340 |
! ! |
|
341 |
||
5604 | 342 |
!AbstractFileApplicationNoteBookComponent methodsFor:'resources'! |
343 |
||
344 |
resources |
|
345 |
masterApplication notNil ifTrue:[ |
|
346 |
^ masterApplication resources |
|
347 |
]. |
|
348 |
^ super resources |
|
349 |
! ! |
|
350 |
||
3892 | 351 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'documentation'! |
352 |
||
353 |
version |
|
15822
161ba719c870
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
15588
diff
changeset
|
354 |
^ '$Header$' |
9358
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
355 |
! |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
356 |
|
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
357 |
version_CVS |
15822
161ba719c870
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
15588
diff
changeset
|
358 |
^ '$Header$' |
3892 | 359 |
! ! |
12492
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
360 |