author | Claus Gittinger <cg@exept.de> |
Fri, 11 Sep 1998 20:07:52 +0200 | |
changeset 3832 | 3cb925b0c2e9 |
parent 3827 | d3dd75b5ced3 |
child 3835 | 9646484382ac |
permissions | -rw-r--r-- |
3347 | 1 |
" |
2 |
COPYRIGHT (c) 1998 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 |
" |
|
12 |
||
13 |
||
14 |
IdentityDictionary subclass:#UserPreferences |
|
15 |
instanceVariableNames:'' |
|
16 |
classVariableNames:'CurrentPreferences' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'System-Support' |
|
19 |
! |
|
20 |
||
21 |
!UserPreferences class methodsFor:'documentation'! |
|
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1998 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 |
" |
|
35 |
||
36 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
3353 | 40 |
Not yet finished. |
41 |
||
3359 | 42 |
This will eventually keep track of ALL user preferences. |
43 |
(which are currently spread over the system). |
|
44 |
For now, only a few preferences are found here - but this |
|
45 |
will change over time. |
|
3347 | 46 |
" |
47 |
! ! |
|
48 |
||
49 |
!UserPreferences class methodsFor:'accessing'! |
|
50 |
||
51 |
current |
|
52 |
CurrentPreferences isNil ifTrue:[ |
|
53 |
CurrentPreferences := self new |
|
54 |
]. |
|
55 |
^ CurrentPreferences. |
|
56 |
||
57 |
"Created: / 31.3.1998 / 13:43:03 / cg" |
|
3364 | 58 |
! |
59 |
||
60 |
reset |
|
61 |
"resets the CurrentPreferences to its default values" |
|
62 |
||
63 |
CurrentPreferences := nil |
|
64 |
! |
|
65 |
||
66 |
syntaxColors |
|
67 |
"returns the syntax colors for the settings in the launcher" |
|
68 |
||
69 |
^#( |
|
70 |
'Argument Identifier Color' |
|
71 |
'Boolean Constant Color' |
|
72 |
'Bracket Color' |
|
73 |
'Constant Color' |
|
74 |
'Comment Color' |
|
75 |
'Global Identifier Color' |
|
76 |
'Here Color' |
|
77 |
'Identifier Color' |
|
3377 | 78 |
'InstVar Identifier Color' |
3364 | 79 |
'Local Identifier Color' |
80 |
'Method Selector Color' |
|
81 |
'Selector Color' |
|
82 |
'Self Color' |
|
83 |
'String Color' |
|
84 |
'Super Color' |
|
85 |
'Symbol Color' |
|
86 |
'This Context Color' |
|
87 |
'Unknown Identifier Color' |
|
3377 | 88 |
) |
3364 | 89 |
|
3377 | 90 |
"Modified: / 16.4.1998 / 18:32:23 / cg" |
3347 | 91 |
! ! |
92 |
||
3360 | 93 |
!UserPreferences methodsFor:'accessing - prefs'! |
3358 | 94 |
|
3347 | 95 |
syntaxColoring |
3360 | 96 |
"return the flag which controls syntax coloring (in the browsers)" |
97 |
||
3827
d3dd75b5ced3
syntax coloring is on by default;
Claus Gittinger <cg@exept.de>
parents:
3409
diff
changeset
|
98 |
^ self at:#syntaxColoring ifAbsentPut:true |
3347 | 99 |
|
100 |
" |
|
101 |
UserPreferences current syntaxColoring |
|
102 |
" |
|
103 |
||
3827
d3dd75b5ced3
syntax coloring is on by default;
Claus Gittinger <cg@exept.de>
parents:
3409
diff
changeset
|
104 |
"Modified: / 11.9.1998 / 00:09:59 / cg" |
3347 | 105 |
! |
106 |
||
107 |
syntaxColoring:aBoolean |
|
3360 | 108 |
"turn on/off syntaxColoring (in the browsers)." |
109 |
||
3347 | 110 |
^ self at:#syntaxColoring put:aBoolean |
111 |
||
3357 | 112 |
" |
113 |
UserPreferences current syntaxColoring:true |
|
114 |
UserPreferences current syntaxColoring:false |
|
115 |
" |
|
116 |
||
3347 | 117 |
"Created: / 31.3.1998 / 13:44:00 / cg" |
3360 | 118 |
"Modified: / 1.4.1998 / 13:23:03 / cg" |
3409 | 119 |
! |
120 |
||
121 |
useNewInspector |
|
122 |
"using new or old inspector" |
|
123 |
||
124 |
^ self at:#useNewInspector ifAbsentPut:false |
|
125 |
! |
|
126 |
||
127 |
useNewInspector:aBoolean |
|
128 |
"using new or old inspector" |
|
129 |
||
130 |
^ self at:#useNewInspector put:aBoolean |
|
131 |
||
132 |
" |
|
133 |
UserPreferences current useNewInspector |
|
134 |
" |
|
3360 | 135 |
! ! |
136 |
||
137 |
!UserPreferences methodsFor:'accessing - syntaxColoring prefs'! |
|
138 |
||
139 |
argumentIdentifierColor |
|
140 |
"the color used for argument identifiers; |
|
141 |
If syntaxColoring is turned on." |
|
142 |
||
143 |
^ self at:#argumentIdentifierColor ifAbsentPut:[self identifierColor] |
|
144 |
||
145 |
"Created: / 31.3.1998 / 15:08:20 / cg" |
|
146 |
"Modified: / 1.4.1998 / 13:19:58 / cg" |
|
147 |
! |
|
148 |
||
149 |
argumentIdentifierEmphasis |
|
150 |
"the emphasis used for argument identifiers; |
|
151 |
If syntaxColoring is turned on." |
|
152 |
||
153 |
^ self at:#argumentIdentifierEmphasis ifAbsentPut:[self identifierEmphasis] |
|
154 |
||
155 |
"Created: / 31.3.1998 / 15:16:40 / cg" |
|
156 |
"Modified: / 1.4.1998 / 13:19:55 / cg" |
|
157 |
! |
|
158 |
||
159 |
booleanConstantColor |
|
160 |
"the color used for boolean constants; |
|
161 |
If syntaxColoring is turned on." |
|
162 |
||
163 |
^ self at:#booleanConstantColor ifAbsentPut:[self constantColor] |
|
164 |
||
165 |
"Created: / 31.3.1998 / 18:12:06 / cg" |
|
166 |
"Modified: / 1.4.1998 / 13:20:07 / cg" |
|
167 |
! |
|
168 |
||
169 |
booleanConstantEmphasis |
|
170 |
"the emphasis used for boolean constants; |
|
171 |
If syntaxColoring is turned on." |
|
172 |
||
173 |
^ self at:#booleanConstantEmphasis ifAbsentPut:[self constantEmphasis] |
|
174 |
||
175 |
"Created: / 31.3.1998 / 18:12:46 / cg" |
|
176 |
"Modified: / 1.4.1998 / 13:26:01 / cg" |
|
177 |
! |
|
178 |
||
3361 | 179 |
bracketColor |
180 |
"the color used for brackets; |
|
181 |
If syntaxColoring is turned on." |
|
182 |
||
183 |
^ self at:#bracketColor ifAbsentPut:[Color black] |
|
184 |
||
185 |
" |
|
186 |
self current at:#bracketColor put:Color red. |
|
187 |
self current at:#bracketEmphasis put:#bold |
|
188 |
" |
|
189 |
||
190 |
"Created: / 31.3.1998 / 19:11:38 / cg" |
|
191 |
"Modified: / 1.4.1998 / 13:22:33 / cg" |
|
192 |
! |
|
193 |
||
194 |
bracketEmphasis |
|
195 |
"the emphasis used for brackets; |
|
196 |
If syntaxColoring is turned on." |
|
197 |
||
198 |
^ self at:#bracketEmphasis ifAbsentPut:#normal |
|
199 |
||
200 |
" |
|
201 |
self current at:#bracketEmphasis put:#bold |
|
202 |
" |
|
203 |
||
204 |
"Created: / 31.3.1998 / 19:11:38 / cg" |
|
205 |
"Modified: / 1.4.1998 / 13:22:33 / cg" |
|
206 |
! |
|
207 |
||
3360 | 208 |
commentColor |
209 |
"the color used for comments; |
|
210 |
If syntaxColoring is turned on." |
|
211 |
||
3832 | 212 |
^ self at:#commentColor |
213 |
ifAbsentPut:[ "/ Color red:0 green:67 blue:0 |
|
214 |
Color blue lightened |
|
215 |
"/ Color blue darkened |
|
216 |
] |
|
3360 | 217 |
|
218 |
"Created: / 31.3.1998 / 15:10:23 / cg" |
|
3832 | 219 |
"Modified: / 11.9.1998 / 19:24:04 / cg" |
3360 | 220 |
! |
221 |
||
222 |
commentEmphasis |
|
223 |
"the emphasis used for comments; |
|
224 |
If syntaxColoring is turned on." |
|
225 |
||
226 |
^ self at:#commentEmphasis ifAbsentPut:#italic |
|
227 |
||
228 |
"Created: / 31.3.1998 / 15:09:59 / cg" |
|
229 |
"Modified: / 1.4.1998 / 13:25:53 / cg" |
|
230 |
! |
|
231 |
||
232 |
constantColor |
|
233 |
"the color used for constants; |
|
234 |
If syntaxColoring is turned on." |
|
235 |
||
236 |
^ self at:#constantColor ifAbsentPut:[Color red darkened darkened] |
|
237 |
||
238 |
"Created: / 31.3.1998 / 18:13:15 / cg" |
|
239 |
"Modified: / 1.4.1998 / 13:20:37 / cg" |
|
240 |
! |
|
241 |
||
242 |
constantEmphasis |
|
243 |
"the emphasis used for constants; |
|
244 |
If syntaxColoring is turned on." |
|
245 |
||
246 |
^ self at:#constantEmphasis ifAbsentPut:[self identifierEmphasis] |
|
247 |
||
248 |
"Created: / 31.3.1998 / 18:13:23 / cg" |
|
249 |
"Modified: / 1.4.1998 / 13:25:43 / cg" |
|
250 |
! |
|
251 |
||
252 |
globalIdentifierColor |
|
253 |
"the color used for global identifiers; |
|
254 |
If syntaxColoring is turned on." |
|
255 |
||
256 |
^ self at:#globalIdentifierColor ifAbsentPut:[self identifierColor] |
|
257 |
||
258 |
"Created: / 31.3.1998 / 15:18:49 / cg" |
|
259 |
"Modified: / 1.4.1998 / 13:20:47 / cg" |
|
260 |
! |
|
261 |
||
262 |
globalIdentifierEmphasis |
|
263 |
"the emphasis used for global variable identifiers; |
|
264 |
If syntaxColoring is turned on." |
|
265 |
||
266 |
^ self at:#globalIdentifierEmphasis ifAbsentPut:[self identifierEmphasis] |
|
267 |
||
268 |
"Created: / 31.3.1998 / 15:18:29 / cg" |
|
269 |
"Modified: / 1.4.1998 / 13:25:31 / cg" |
|
270 |
! |
|
271 |
||
272 |
hereColor |
|
273 |
"the color used for the here pseudoVariable; |
|
274 |
If syntaxColoring is turned on." |
|
275 |
||
276 |
^ self at:#hereColor ifAbsentPut:[self identifierColor] |
|
277 |
||
278 |
"Created: / 31.3.1998 / 17:38:09 / cg" |
|
279 |
"Modified: / 1.4.1998 / 13:20:57 / cg" |
|
280 |
! |
|
281 |
||
282 |
hereEmphasis |
|
283 |
"the emphasis used for the hre special variable; |
|
284 |
If syntaxColoring is turned on." |
|
285 |
||
286 |
^ self at:#hereEmphasis ifAbsentPut:[self identifierEmphasis] |
|
287 |
||
288 |
"Created: / 31.3.1998 / 17:35:13 / cg" |
|
289 |
"Modified: / 1.4.1998 / 13:25:17 / cg" |
|
290 |
! |
|
291 |
||
292 |
identifierColor |
|
293 |
"the color used for other identifiers; |
|
294 |
If syntaxColoring is turned on." |
|
295 |
||
296 |
^ self at:#identifierColor ifAbsentPut:[Color black "green darkened darkened"] |
|
297 |
||
3362 | 298 |
" |
299 |
UserPreferences current at:#identifierColor put:Color green darkened darkened. |
|
300 |
UserPreferences current at:#identifierColor put:Color black. |
|
301 |
" |
|
302 |
||
3360 | 303 |
"Created: / 31.3.1998 / 17:35:55 / cg" |
3362 | 304 |
"Modified: / 2.4.1998 / 10:39:42 / cg" |
3360 | 305 |
! |
306 |
||
307 |
identifierEmphasis |
|
308 |
"the emphasis used for other identifiers; |
|
309 |
If syntaxColoring is turned on." |
|
310 |
||
311 |
^ self at:#identifierEmphasis ifAbsentPut:#normal |
|
312 |
||
313 |
"Created: / 31.3.1998 / 15:09:41 / cg" |
|
314 |
"Modified: / 1.4.1998 / 13:25:06 / cg" |
|
315 |
! |
|
316 |
||
3378 | 317 |
instVarIdentifierColor |
3377 | 318 |
"the color used for instance variable identifiers; |
319 |
If syntaxColoring is turned on." |
|
320 |
||
3378 | 321 |
^ self at:#instVarIdentifierColor ifAbsentPut:[self identifierColor] |
3377 | 322 |
|
323 |
" |
|
3378 | 324 |
UserPreferences current at:#instVarIdentifierColor put:Color green darkened. |
325 |
UserPreferences current at:#instVarIdentifierColor put:Color black. |
|
326 |
UserPreferences current instVarIdentifierColor |
|
3377 | 327 |
" |
328 |
||
329 |
"Created: / 16.4.1998 / 18:31:29 / cg" |
|
3378 | 330 |
"Modified: / 16.4.1998 / 18:57:06 / cg" |
3377 | 331 |
! |
332 |
||
3378 | 333 |
instVarIdentifierEmphasis |
3377 | 334 |
"the emphais used for instance variable identifiers; |
335 |
If syntaxColoring is turned on." |
|
336 |
||
3378 | 337 |
^ self at:#instVarIdentifierEmphasis ifAbsentPut:[self identifierEmphasis] |
3377 | 338 |
|
339 |
"Modified: / 1.4.1998 / 13:24:42 / cg" |
|
3378 | 340 |
"Created: / 16.4.1998 / 18:40:05 / cg" |
3377 | 341 |
! |
342 |
||
3360 | 343 |
localIdentifierColor |
344 |
"the color used for local variable identifiers; |
|
345 |
If syntaxColoring is turned on." |
|
346 |
||
347 |
^ self at:#localIdentifierColor ifAbsentPut:[self identifierColor] |
|
348 |
||
3362 | 349 |
" |
350 |
UserPreferences current at:#localIdentifierColor put:Color green darkened. |
|
351 |
UserPreferences current at:#localIdentifierColor put:Color black. |
|
352 |
" |
|
353 |
||
3360 | 354 |
"Created: / 31.3.1998 / 15:18:07 / cg" |
3362 | 355 |
"Modified: / 2.4.1998 / 10:40:05 / cg" |
3360 | 356 |
! |
357 |
||
358 |
localIdentifierEmphasis |
|
359 |
"the emphais used for local variable identifiers; |
|
360 |
If syntaxColoring is turned on." |
|
361 |
||
362 |
^ self at:#localIdentifierEmphasis ifAbsentPut:[self identifierEmphasis] |
|
363 |
||
364 |
"Created: / 31.3.1998 / 15:16:56 / cg" |
|
365 |
"Modified: / 1.4.1998 / 13:24:42 / cg" |
|
366 |
! |
|
367 |
||
368 |
methodSelectorColor |
|
369 |
"the color used for a methods selector pattern; |
|
370 |
If syntaxColoring is turned on." |
|
371 |
||
372 |
^ self at:#methodSelectorColor ifAbsentPut:[Color black] |
|
373 |
||
374 |
"Created: / 31.3.1998 / 15:11:24 / cg" |
|
375 |
"Modified: / 1.4.1998 / 13:24:26 / cg" |
|
376 |
! |
|
377 |
||
378 |
methodSelectorEmphasis |
|
379 |
"the emphasis used for a methods selector pattern; |
|
380 |
If syntaxColoring is turned on." |
|
381 |
||
382 |
^ self at:#methodSelectorEmphasis ifAbsentPut:#bold |
|
383 |
||
384 |
"Created: / 31.3.1998 / 15:11:16 / cg" |
|
385 |
"Modified: / 1.4.1998 / 13:24:20 / cg" |
|
386 |
! |
|
387 |
||
388 |
selectorColor |
|
389 |
"the color used for message selectors; |
|
390 |
If syntaxColoring is turned on." |
|
391 |
||
392 |
^ self at:#selectorColor ifAbsentPut:[Color black] |
|
393 |
||
394 |
"Created: / 31.3.1998 / 15:19:19 / cg" |
|
395 |
"Modified: / 1.4.1998 / 13:24:04 / cg" |
|
396 |
! |
|
397 |
||
398 |
selectorEmphasis |
|
399 |
"the emphasis used for message selectors; |
|
400 |
If syntaxColoring is turned on." |
|
401 |
||
402 |
^ self at:#selectorEmphasis ifAbsentPut:#bold |
|
403 |
||
404 |
"Created: / 31.3.1998 / 15:19:09 / cg" |
|
405 |
"Modified: / 1.4.1998 / 13:23:59 / cg" |
|
406 |
! |
|
407 |
||
408 |
selfColor |
|
409 |
"the color used for the self pseudoVariable; |
|
410 |
If syntaxColoring is turned on." |
|
411 |
||
412 |
^ self at:#selfColor ifAbsentPut:[self identifierColor] |
|
413 |
||
414 |
"Created: / 31.3.1998 / 17:35:45 / cg" |
|
415 |
"Modified: / 1.4.1998 / 13:21:07 / cg" |
|
416 |
! |
|
417 |
||
418 |
selfEmphasis |
|
419 |
"the emphasis used for the self pseudoVariable; |
|
420 |
If syntaxColoring is turned on." |
|
421 |
||
422 |
^ self at:#selfEmphasis ifAbsentPut:[self identifierEmphasis] |
|
423 |
||
424 |
"Created: / 31.3.1998 / 17:34:57 / cg" |
|
425 |
"Modified: / 1.4.1998 / 13:21:51 / cg" |
|
426 |
! |
|
427 |
||
428 |
stringColor |
|
429 |
"the color used for string constants; |
|
430 |
If syntaxColoring is turned on." |
|
431 |
||
432 |
^ self at:#stringColor ifAbsentPut:[self constantColor] |
|
433 |
||
434 |
"Created: / 31.3.1998 / 15:19:50 / cg" |
|
435 |
"Modified: / 1.4.1998 / 13:22:06 / cg" |
|
436 |
! |
|
437 |
||
438 |
stringEmphasis |
|
439 |
"the emphasis used for string constants; |
|
440 |
If syntaxColoring is turned on." |
|
441 |
||
442 |
^ self at:#stringEmphasis ifAbsentPut:[self constantEmphasis] |
|
443 |
||
444 |
"Created: / 31.3.1998 / 15:19:09 / cg" |
|
445 |
"Modified: / 1.4.1998 / 13:22:00 / cg" |
|
446 |
! |
|
447 |
||
448 |
superColor |
|
449 |
"the color used for the super pseudoVariable; |
|
450 |
If syntaxColoring is turned on." |
|
451 |
||
452 |
^ self at:#superColor ifAbsentPut:[self identifierColor] |
|
453 |
||
454 |
"Created: / 31.3.1998 / 17:37:56 / cg" |
|
455 |
"Modified: / 1.4.1998 / 13:21:15 / cg" |
|
456 |
! |
|
457 |
||
458 |
superEmphasis |
|
459 |
"the emphasis used for the super pseudoVariable; |
|
460 |
If syntaxColoring is turned on." |
|
461 |
||
462 |
^ self at:#superEmphasis ifAbsentPut:[self identifierEmphasis] |
|
463 |
||
464 |
"Created: / 31.3.1998 / 17:35:08 / cg" |
|
465 |
"Modified: / 1.4.1998 / 13:21:41 / cg" |
|
466 |
! |
|
467 |
||
468 |
symbolColor |
|
469 |
"the color used for symbol constants; |
|
470 |
If syntaxColoring is turned on." |
|
471 |
||
472 |
^ self at:#symbolColor ifAbsentPut:[self constantColor] |
|
473 |
||
474 |
"Created: / 1.4.1998 / 12:57:35 / cg" |
|
475 |
"Modified: / 1.4.1998 / 13:22:16 / cg" |
|
476 |
! |
|
477 |
||
478 |
symbolEmphasis |
|
479 |
"the emphasis used for symbol constants; |
|
480 |
If syntaxColoring is turned on." |
|
481 |
||
482 |
^ self at:#symbolEmphasis ifAbsentPut:[self constantEmphasis] |
|
483 |
||
484 |
"Created: / 1.4.1998 / 12:57:43 / cg" |
|
485 |
"Modified: / 1.4.1998 / 13:23:43 / cg" |
|
3352 | 486 |
! |
487 |
||
488 |
thisContextColor |
|
3360 | 489 |
"the color used for the thisContext pseudoVariable; |
490 |
If syntaxColoring is turned on." |
|
491 |
||
3355 | 492 |
^ self at:#thisContextColor ifAbsentPut:[self identifierColor] |
3352 | 493 |
|
494 |
"Created: / 31.3.1998 / 17:37:49 / cg" |
|
3360 | 495 |
"Modified: / 1.4.1998 / 13:21:24 / cg" |
3352 | 496 |
! |
497 |
||
498 |
thisContextEmphasis |
|
3360 | 499 |
"the emphasis used for the thisContext pseudoVariable; |
500 |
If syntaxColoring is turned on." |
|
501 |
||
3355 | 502 |
^ self at:#thisContextEmphasis ifAbsentPut:[self identifierEmphasis] |
3352 | 503 |
|
504 |
"Created: / 31.3.1998 / 17:35:27 / cg" |
|
3360 | 505 |
"Modified: / 1.4.1998 / 13:21:30 / cg" |
3354 | 506 |
! |
507 |
||
508 |
unknownIdentifierColor |
|
3360 | 509 |
"the color used for unknown identifiers; |
510 |
If syntaxColoring is turned on." |
|
511 |
||
3355 | 512 |
^ self at:#unknownIdentifierColor ifAbsentPut:[Color red darkened] |
3354 | 513 |
|
3361 | 514 |
" |
515 |
self current at:#unknownIdentifierColor put:Color red. |
|
516 |
self current at:#unknownIdentifierEmphasis put:#bold |
|
517 |
" |
|
518 |
||
3354 | 519 |
"Created: / 31.3.1998 / 19:11:38 / cg" |
3360 | 520 |
"Modified: / 1.4.1998 / 13:22:33 / cg" |
3354 | 521 |
! |
522 |
||
523 |
unknownIdentifierEmphasis |
|
3360 | 524 |
"the emphasis used for unknown identifiers; |
525 |
If syntaxColoring is turned on." |
|
526 |
||
3355 | 527 |
^ self at:#unknownIdentifierEmphasis ifAbsentPut:[self identifierEmphasis] |
3354 | 528 |
|
529 |
"Created: / 31.3.1998 / 19:11:55 / cg" |
|
3360 | 530 |
"Modified: / 1.4.1998 / 13:22:45 / cg" |
3347 | 531 |
! ! |
532 |
||
533 |
!UserPreferences class methodsFor:'documentation'! |
|
534 |
||
535 |
version |
|
3832 | 536 |
^ '$Header: /cvs/stx/stx/libbasic/UserPreferences.st,v 1.19 1998-09-11 18:07:52 cg Exp $' |
3347 | 537 |
! ! |