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