author | Claus Gittinger <cg@exept.de> |
Fri, 19 Jan 2018 23:42:23 +0100 | |
changeset 17952 | b78dac4d2a4c |
parent 17811 | 215663d4f8a3 |
child 17971 | 0f6d265b9ffb |
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 |
||
16198 | 74 |
isAbstract |
75 |
"Return if this class is an abstract class. |
|
76 |
True is returned here for myself only; false for subclasses. |
|
77 |
Abstract subclasses must redefine this again." |
|
78 |
||
79 |
^ self == AbstractFileApplicationNoteBookComponent. |
|
80 |
! |
|
81 |
||
3892 | 82 |
wantNewApplicationAnyway |
83 |
||
84 |
^ true |
|
85 |
! ! |
|
86 |
||
87 |
!AbstractFileApplicationNoteBookComponent methodsFor:'accessing'! |
|
88 |
||
4529 | 89 |
notify:msg |
90 |
self notifyChannel value:msg |
|
91 |
! |
|
92 |
||
17811 | 93 |
sameFileIndex |
94 |
||
95 |
^ sameFileIndex |
|
96 |
! |
|
97 |
||
98 |
sameFileIndex:something |
|
99 |
||
100 |
sameFileIndex := something. |
|
101 |
! ! |
|
102 |
||
103 |
!AbstractFileApplicationNoteBookComponent methodsFor:'accessing-channels'! |
|
104 |
||
3892 | 105 |
notifyChannel |
106 |
notifyChannel isNil ifTrue:[ |
|
107 |
self masterApplication notNil ifTrue:[ |
|
108 |
notifyChannel := masterApplication notifyChannel. |
|
109 |
] ifFalse:[ |
|
110 |
notifyChannel := ValueHolder with:''. |
|
111 |
]. |
|
112 |
]. |
|
113 |
^ notifyChannel |
|
114 |
! ! |
|
115 |
||
116 |
!AbstractFileApplicationNoteBookComponent methodsFor:'actions'! |
|
117 |
||
5010 | 118 |
changeItem:anItem |
3892 | 119 |
|
5010 | 120 |
^ self item:anItem. |
3892 | 121 |
! |
122 |
||
123 |
doClose |
|
124 |
|master| |
|
125 |
||
126 |
"/ tell the NoteBookApplication to close me |
|
127 |
(master := self masterApplication) notNil ifTrue:[ |
|
128 |
master closeSubCanvas:self. |
|
3933
2e083e6e224f
must send #release manually (to release processes)
Claus Gittinger <cg@exept.de>
parents:
3892
diff
changeset
|
129 |
self release. |
3892 | 130 |
] ifFalse:[ |
131 |
self closeRequest. |
|
132 |
]. |
|
3954 | 133 |
^ true |
3892 | 134 |
! ! |
135 |
||
5120 | 136 |
!AbstractFileApplicationNoteBookComponent methodsFor:'aspects'! |
137 |
||
138 |
cursorColLabelHolder |
|
139 |
^ '' |
|
140 |
! |
|
141 |
||
15822
161ba719c870
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
15588
diff
changeset
|
142 |
cursorLineAndColumnLabelHolder |
161ba719c870
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
15588
diff
changeset
|
143 |
^ '' |
161ba719c870
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
15588
diff
changeset
|
144 |
! |
161ba719c870
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
15588
diff
changeset
|
145 |
|
5120 | 146 |
cursorLineLabelHolder |
147 |
^ '' |
|
148 |
! |
|
149 |
||
5528 | 150 |
fileEncodingHolder |
5586 | 151 |
^ #'iso8859-1' |
5528 | 152 |
! |
153 |
||
5737 | 154 |
lockFileEncodingHolder |
7289 | 155 |
^ nil |
5737 | 156 |
! |
157 |
||
5120 | 158 |
modeLabelHolder |
159 |
^ '' |
|
7105 | 160 |
! |
161 |
||
162 |
modeLabelMenu |
|
163 |
^ nil |
|
164 |
||
165 |
"Created: / 11-09-2006 / 12:32:37 / cg" |
|
5120 | 166 |
! ! |
167 |
||
9358
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
168 |
!AbstractFileApplicationNoteBookComponent methodsFor:'drag & drop support'! |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
169 |
|
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
170 |
doStartDrag:aDropSource in:aView |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
171 |
"common code, used in subclasses" |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
172 |
|
17201 | 173 |
AbstractFileBrowser doStartDrag:aDropSource in:aView |
174 |
"/ same code |
|
175 |
"/ |hdl| |
|
176 |
"/ |
|
177 |
"/ hdl := DragAndDropManager new. |
|
178 |
"/ |
|
179 |
"/ hdl disabledCursor:AbstractFileBrowser disabledCursorIcon. |
|
180 |
"/ hdl enabledCursor:AbstractFileBrowser enabledCursorIcon. |
|
181 |
"/ hdl alienCursor:nil. |
|
182 |
"/ |
|
183 |
"/ hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft |
|
9358
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
184 |
! ! |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
185 |
|
3892 | 186 |
!AbstractFileApplicationNoteBookComponent methodsFor:'queries'! |
187 |
||
7468 | 188 |
additionalInfo |
189 |
^ '' |
|
190 |
||
191 |
"Created: / 24-10-2006 / 12:25:51 / cg" |
|
192 |
! |
|
193 |
||
11225 | 194 |
closeButtonShown |
195 |
^ false. |
|
196 |
||
197 |
"Created: / 27-01-2012 / 15:00:22 / cg" |
|
198 |
! |
|
199 |
||
12492
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
200 |
cvsMenusAreShown |
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
201 |
^ ConfigurableFeatures includesFeature: #CVSSupportEnabled |
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
202 |
! |
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
203 |
|
3892 | 204 |
fileName |
205 |
item notNil ifTrue:[ |
|
206 |
^ item fileName. |
|
207 |
]. |
|
208 |
^ nil |
|
209 |
! |
|
210 |
||
211 |
getDirWithoutFileName:aFileName |
|
212 |
||
213 |
| dir | |
|
214 |
aFileName isNil ifTrue:[ |
|
215 |
^ aFileName. |
|
216 |
]. |
|
217 |
dir := aFileName asFilename. |
|
218 |
dir isDirectory ifFalse:[ |
|
219 |
dir := dir directory. |
|
220 |
]. |
|
221 |
^ dir. |
|
222 |
! |
|
223 |
||
14800
993062566d3f
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
12492
diff
changeset
|
224 |
getTabIcon |
993062566d3f
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
12492
diff
changeset
|
225 |
"the item shown in a tab" |
993062566d3f
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
12492
diff
changeset
|
226 |
|
993062566d3f
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
12492
diff
changeset
|
227 |
^ nil |
993062566d3f
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
12492
diff
changeset
|
228 |
! |
993062566d3f
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
12492
diff
changeset
|
229 |
|
3892 | 230 |
getTabString |
7689 | 231 |
"get the tab string from the application" |
3892 | 232 |
|
15974 | 233 |
|formatString valueString stream| |
234 |
||
235 |
stream := CharacterWriteStream on:''. |
|
3892 | 236 |
|
15974 | 237 |
valueString := self getTabValueString. |
238 |
valueString isNil ifTrue:[ |
|
239 |
valueString := resources string:'<unnamed>' |
|
240 |
]. |
|
241 |
formatString := self class tabStringFor:type. |
|
242 |
formatString isNil ifTrue:[ |
|
243 |
"/ default: take the class name |
|
244 |
formatString := self className. |
|
245 |
]. |
|
246 |
stream nextPutAll:(resources string:formatString with:valueString). |
|
8387 | 247 |
|
15974 | 248 |
^ stream contents. |
7689 | 249 |
|
250 |
"Modified: / 01-03-2007 / 21:45:02 / cg" |
|
3892 | 251 |
! |
252 |
||
253 |
getTabStringEnd |
|
15588
558245ed3e2d
class: AbstractFileApplicationNoteBookComponent
Stefan Vogel <sv@exept.de>
parents:
14800
diff
changeset
|
254 |
" get the tab string from the application list on the class side " |
3892 | 255 |
|
5460 | 256 |
| stream| |
3892 | 257 |
|
258 |
self item notNil ifTrue:[ |
|
15588
558245ed3e2d
class: AbstractFileApplicationNoteBookComponent
Stefan Vogel <sv@exept.de>
parents:
14800
diff
changeset
|
259 |
stream := CharacterWriteStream new. |
5460 | 260 |
self type = #directoryDescription ifTrue:[ |
261 |
stream nextPutAll:self fileName directory baseName. |
|
262 |
stream space. |
|
263 |
stream nextPut:$[. |
|
264 |
stream nextPutAll:self fileName baseName. |
|
265 |
stream nextPut:$]. |
|
266 |
] ifFalse:[ |
|
267 |
stream nextPutAll:self fileName baseName. |
|
268 |
stream space. |
|
269 |
self sameFileIndex notNil ifTrue:[ |
|
270 |
stream nextPutAll:self sameFileIndex asString. |
|
271 |
]. |
|
3892 | 272 |
]. |
5460 | 273 |
^ stream contents. |
3892 | 274 |
]. |
275 |
^ nil |
|
276 |
! |
|
277 |
||
7689 | 278 |
getTabValueString |
279 |
"the item shown in a tab (not language translated)" |
|
280 |
||
15974 | 281 |
|stream fn baseName| |
282 |
||
7689 | 283 |
self item isNil ifTrue:[^ nil]. |
284 |
||
15974 | 285 |
stream := CharacterWriteStream on:''. |
7689 | 286 |
|
15974 | 287 |
fn := self fileName. |
288 |
baseName := fn baseName. |
|
289 |
self type = #directoryDescription ifTrue:[ |
|
290 |
stream nextPutAll:(fn directory baseName). |
|
291 |
stream space. |
|
292 |
stream nextPut:$[. |
|
293 |
stream nextPutAll:baseName. |
|
294 |
stream nextPut:$]. |
|
295 |
] ifFalse:[ |
|
296 |
stream nextPutAll:baseName. |
|
297 |
stream space. |
|
298 |
self sameFileIndex notNil ifTrue:[ |
|
299 |
stream nextPutAll:self sameFileIndex asString. |
|
300 |
]. |
|
301 |
]. |
|
302 |
||
303 |
^ stream contents |
|
7689 | 304 |
|
305 |
"Created: / 01-03-2007 / 21:40:03 / cg" |
|
306 |
! |
|
307 |
||
3892 | 308 |
isEmbeddedApplication |
309 |
||
310 |
^ self masterApplication notNil |
|
311 |
! |
|
312 |
||
313 |
isModified |
|
314 |
||
315 |
^ false |
|
316 |
! |
|
317 |
||
4147 | 318 |
isTextEditor |
319 |
||
320 |
^ false |
|
321 |
! |
|
322 |
||
3892 | 323 |
item |
324 |
||
325 |
^ item |
|
326 |
! |
|
327 |
||
5010 | 328 |
item:anItem |
3892 | 329 |
|
5010 | 330 |
item := anItem. |
3892 | 331 |
^ true |
332 |
! |
|
333 |
||
334 |
presentation |
|
335 |
||
336 |
^ nil |
|
337 |
! |
|
338 |
||
339 |
type |
|
340 |
||
341 |
^ type |
|
342 |
! |
|
343 |
||
344 |
type:aType |
|
345 |
||
346 |
type := aType |
|
347 |
! |
|
348 |
||
349 |
wantChangeAnyWay |
|
350 |
||
351 |
^ (self type == #directoryDescription) |
|
352 |
! ! |
|
353 |
||
5604 | 354 |
!AbstractFileApplicationNoteBookComponent methodsFor:'resources'! |
355 |
||
356 |
resources |
|
357 |
masterApplication notNil ifTrue:[ |
|
358 |
^ masterApplication resources |
|
359 |
]. |
|
360 |
^ super resources |
|
361 |
! ! |
|
362 |
||
3892 | 363 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'documentation'! |
364 |
||
365 |
version |
|
15822
161ba719c870
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
15588
diff
changeset
|
366 |
^ '$Header$' |
9358
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
367 |
! |
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
368 |
|
cb6f7757c128
support drag&drop from the find-file resultlist
Claus Gittinger <cg@exept.de>
parents:
8683
diff
changeset
|
369 |
version_CVS |
15822
161ba719c870
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
15588
diff
changeset
|
370 |
^ '$Header$' |
3892 | 371 |
! ! |
12492
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
372 |