author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 29 Aug 2013 12:20:29 +0100 | |
branch | jv |
changeset 13468 | 444ac2aa4fd6 |
parent 12517 | 3a904476a8d2 |
child 15566 | 184cea584be5 |
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 |
||
14 |
ApplicationModel subclass:#AbstractFileApplicationNoteBookComponent |
|
15 |
instanceVariableNames:'sameFileIndex item type notifyChannel' |
|
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'Interface-Tools-File' |
|
19 |
! |
|
20 |
||
5140 | 21 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
5967 | 35 |
! |
36 |
||
37 |
documentation |
|
38 |
" |
|
39 |
[Author:] |
|
40 |
Christian Penk |
|
41 |
" |
|
5140 | 42 |
! ! |
3892 | 43 |
|
12517
3a904476a8d2
Merged 959c0bb8a414 and cf091b9c64a9 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
44 |
|
3892 | 45 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'defaults'! |
46 |
||
47 |
tabStringFor:aApplicationType |
|
7689 | 48 |
"the formatString shown in a tab (language translated)" |
3892 | 49 |
|
50 |
^ nil |
|
7689 | 51 |
|
52 |
"Modified: / 01-03-2007 / 21:43:10 / cg" |
|
53 |
! |
|
54 |
||
55 |
tabStringFor:aApplicationType forContents:shownContents |
|
56 |
||
57 |
^ nil |
|
58 |
||
59 |
"Created: / 01-03-2007 / 21:35:39 / cg" |
|
3892 | 60 |
! ! |
61 |
||
12517
3a904476a8d2
Merged 959c0bb8a414 and cf091b9c64a9 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
62 |
|
3892 | 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 |
||
12517
3a904476a8d2
Merged 959c0bb8a414 and cf091b9c64a9 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
79 |
|
3892 | 80 |
!AbstractFileApplicationNoteBookComponent methodsFor:'accessing'! |
81 |
||
4529 | 82 |
notify:msg |
83 |
self notifyChannel value:msg |
|
84 |
! |
|
85 |
||
3892 | 86 |
notifyChannel |
87 |
notifyChannel isNil ifTrue:[ |
|
88 |
self masterApplication notNil ifTrue:[ |
|
89 |
notifyChannel := masterApplication notifyChannel. |
|
90 |
] ifFalse:[ |
|
91 |
notifyChannel := ValueHolder with:''. |
|
92 |
]. |
|
93 |
]. |
|
94 |
^ notifyChannel |
|
95 |
! |
|
96 |
||
97 |
sameFileIndex |
|
98 |
||
99 |
^ sameFileIndex |
|
100 |
! |
|
101 |
||
102 |
sameFileIndex:something |
|
103 |
||
104 |
sameFileIndex := something. |
|
105 |
! ! |
|
106 |
||
12517
3a904476a8d2
Merged 959c0bb8a414 and cf091b9c64a9 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
107 |
|
3892 | 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 |
||
12517
3a904476a8d2
Merged 959c0bb8a414 and cf091b9c64a9 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
128 |
|
5120 | 129 |
!AbstractFileApplicationNoteBookComponent methodsFor:'aspects'! |
130 |
||
131 |
cursorColLabelHolder |
|
132 |
^ '' |
|
133 |
! |
|
134 |
||
135 |
cursorLineLabelHolder |
|
136 |
^ '' |
|
137 |
! |
|
138 |
||
5528 | 139 |
fileEncodingHolder |
5586 | 140 |
^ #'iso8859-1' |
5528 | 141 |
! |
142 |
||
5737 | 143 |
lockFileEncodingHolder |
7289 | 144 |
^ nil |
5737 | 145 |
! |
146 |
||
5120 | 147 |
modeLabelHolder |
148 |
^ '' |
|
7105 | 149 |
! |
150 |
||
151 |
modeLabelMenu |
|
152 |
^ nil |
|
153 |
||
154 |
"Created: / 11-09-2006 / 12:32:37 / cg" |
|
5120 | 155 |
! ! |
156 |
||
12517
3a904476a8d2
Merged 959c0bb8a414 and cf091b9c64a9 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
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 |
|
12517
3a904476a8d2
Merged 959c0bb8a414 and cf091b9c64a9 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
174 |
|
3892 | 175 |
!AbstractFileApplicationNoteBookComponent methodsFor:'queries'! |
176 |
||
7468 | 177 |
additionalInfo |
178 |
^ '' |
|
179 |
||
180 |
"Created: / 24-10-2006 / 12:25:51 / cg" |
|
181 |
! |
|
182 |
||
11225 | 183 |
closeButtonShown |
184 |
^ false. |
|
185 |
||
186 |
"Created: / 27-01-2012 / 15:00:22 / cg" |
|
187 |
! |
|
188 |
||
12492
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
189 |
cvsMenusAreShown |
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
190 |
^ ConfigurableFeatures includesFeature: #CVSSupportEnabled |
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
191 |
! |
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
192 |
|
3892 | 193 |
fileName |
194 |
item notNil ifTrue:[ |
|
195 |
^ item fileName. |
|
196 |
]. |
|
197 |
^ nil |
|
198 |
! |
|
199 |
||
200 |
getDirWithoutFileName:aFileName |
|
201 |
||
202 |
| dir | |
|
203 |
aFileName isNil ifTrue:[ |
|
204 |
^ aFileName. |
|
205 |
]. |
|
206 |
dir := aFileName asFilename. |
|
207 |
dir isDirectory ifFalse:[ |
|
208 |
dir := dir directory. |
|
209 |
]. |
|
210 |
^ dir. |
|
211 |
! |
|
212 |
||
213 |
getTabString |
|
7689 | 214 |
"get the tab string from the application" |
3892 | 215 |
|
8387 | 216 |
^ (Unicode16String |
217 |
streamContents:[:stream | |
|
218 |
|formatString valueString| |
|
3892 | 219 |
|
8387 | 220 |
valueString := self getTabValueString. |
221 |
valueString isNil ifTrue:[ |
|
222 |
valueString := resources string:'<unnamed>' |
|
223 |
]. |
|
224 |
||
225 |
formatString := self class tabStringFor:type. |
|
226 |
formatString isNil ifTrue:[ |
|
227 |
"/ default: take the class name |
|
228 |
formatString := self className. |
|
229 |
]. |
|
230 |
stream nextPutAll:(resources string:formatString with:valueString). |
|
231 |
]) asSingleByteStringIfPossible |
|
7689 | 232 |
|
233 |
"Modified: / 01-03-2007 / 21:45:02 / cg" |
|
3892 | 234 |
! |
235 |
||
236 |
getTabStringEnd |
|
237 |
||
238 |
" get the tab string from the application list on the class side " |
|
239 |
||
5460 | 240 |
| stream| |
3892 | 241 |
|
242 |
self item notNil ifTrue:[ |
|
243 |
stream := WriteStream on:''. |
|
5460 | 244 |
self type = #directoryDescription ifTrue:[ |
245 |
stream nextPutAll:self fileName directory baseName. |
|
246 |
stream space. |
|
247 |
stream nextPut:$[. |
|
248 |
stream nextPutAll:self fileName baseName. |
|
249 |
stream nextPut:$]. |
|
250 |
] ifFalse:[ |
|
251 |
stream nextPutAll:self fileName baseName. |
|
252 |
stream space. |
|
253 |
self sameFileIndex notNil ifTrue:[ |
|
254 |
stream nextPutAll:self sameFileIndex asString. |
|
255 |
]. |
|
3892 | 256 |
]. |
5460 | 257 |
^ stream contents. |
3892 | 258 |
]. |
259 |
^ nil |
|
260 |
! |
|
261 |
||
7689 | 262 |
getTabValueString |
263 |
"the item shown in a tab (not language translated)" |
|
264 |
||
265 |
self item isNil ifTrue:[^ nil]. |
|
266 |
||
8387 | 267 |
^ (Unicode16String |
268 |
streamContents:[:stream | |
|
269 |
|fn baseName| |
|
7689 | 270 |
|
8387 | 271 |
fn := self fileName. |
272 |
baseName := fn baseName. |
|
273 |
self type = #directoryDescription ifTrue:[ |
|
274 |
stream nextPutAll:(fn directory baseName). |
|
275 |
stream space. |
|
276 |
stream nextPut:$[. |
|
277 |
stream nextPutAll:baseName. |
|
278 |
stream nextPut:$]. |
|
279 |
] ifFalse:[ |
|
280 |
stream nextPutAll:baseName. |
|
281 |
stream space. |
|
282 |
self sameFileIndex notNil ifTrue:[ |
|
283 |
stream nextPutAll:self sameFileIndex asString. |
|
284 |
]. |
|
7689 | 285 |
]. |
8387 | 286 |
]) asSingleByteStringIfPossible. |
7689 | 287 |
|
288 |
"Created: / 01-03-2007 / 21:40:03 / cg" |
|
289 |
! |
|
290 |
||
3892 | 291 |
isEmbeddedApplication |
292 |
||
293 |
^ self masterApplication notNil |
|
294 |
! |
|
295 |
||
296 |
isModified |
|
297 |
||
298 |
^ false |
|
299 |
! |
|
300 |
||
4147 | 301 |
isTextEditor |
302 |
||
303 |
^ false |
|
304 |
! |
|
305 |
||
3892 | 306 |
item |
307 |
||
308 |
^ item |
|
309 |
! |
|
310 |
||
5010 | 311 |
item:anItem |
3892 | 312 |
|
5010 | 313 |
item := anItem. |
3892 | 314 |
^ true |
315 |
! |
|
316 |
||
317 |
presentation |
|
318 |
||
319 |
^ nil |
|
320 |
! |
|
321 |
||
322 |
type |
|
323 |
||
324 |
^ type |
|
325 |
! |
|
326 |
||
327 |
type:aType |
|
328 |
||
329 |
type := aType |
|
330 |
! |
|
331 |
||
332 |
wantChangeAnyWay |
|
333 |
||
334 |
^ (self type == #directoryDescription) |
|
335 |
! ! |
|
336 |
||
12517
3a904476a8d2
Merged 959c0bb8a414 and cf091b9c64a9 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
337 |
|
5604 | 338 |
!AbstractFileApplicationNoteBookComponent methodsFor:'resources'! |
339 |
||
340 |
resources |
|
341 |
masterApplication notNil ifTrue:[ |
|
342 |
^ masterApplication resources |
|
343 |
]. |
|
344 |
^ super resources |
|
345 |
! ! |
|
346 |
||
12517
3a904476a8d2
Merged 959c0bb8a414 and cf091b9c64a9 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
347 |
|
3892 | 348 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'documentation'! |
349 |
||
350 |
version |
|
12492
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
351 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileApplicationNoteBookComponent.st,v 1.24 2013-03-20 19:55:23 cg 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 |
12492
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
355 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileApplicationNoteBookComponent.st,v 1.24 2013-03-20 19:55:23 cg Exp $' |
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
356 |
! |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
357 |
|
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
358 |
version_HG |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
359 |
|
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
360 |
^ '$Changeset: <not expanded> $' |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
361 |
! |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
362 |
|
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
363 |
version_SVN |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
364 |
^ '$Id: AbstractFileApplicationNoteBookComponent.st 7854 2012-01-30 17:49:41Z vranyj1 $' |
3892 | 365 |
! ! |
12492
1c485310f1ca
class: AbstractFileApplicationNoteBookComponent
Claus Gittinger <cg@exept.de>
parents:
11225
diff
changeset
|
366 |