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