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