author | Claus Gittinger <cg@exept.de> |
Thu, 16 Mar 2006 09:21:22 +0100 | |
changeset 6699 | d8eaa3937354 |
parent 6636 | 0df4d1386e30 |
child 6752 | a05ea7328388 |
permissions | -rw-r--r-- |
5140 | 1 |
" |
2 |
COPYRIGHT (c) 2001 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 |
||
3154 | 13 |
"{ Package: 'stx:libtool' }" |
14 |
||
5303 | 15 |
MultiViewToolApplication subclass:#WorkspaceApplication |
5852 | 16 |
instanceVariableNames:'autoDefineVariables syntaxHolder' |
6425 | 17 |
classVariableNames:'LastFilterBlockString LastProcessingBlockString LastTeaWaitTime' |
3222 | 18 |
poolDictionaries:'' |
19 |
category:'Interface-Smalltalk' |
|
3154 | 20 |
! |
21 |
||
3191 | 22 |
!WorkspaceApplication class methodsFor:'documentation'! |
23 |
||
5140 | 24 |
copyright |
25 |
" |
|
26 |
COPYRIGHT (c) 2001 by eXept Software AG |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
3191 | 38 |
documentation |
39 |
" |
|
40 |
A simple wrapper around a WorkSpace-View, adding a pullDown menu. |
|
41 |
||
42 |
[author:] |
|
43 |
Claus Gittinger |
|
44 |
" |
|
45 |
! ! |
|
3154 | 46 |
|
47 |
!WorkspaceApplication class methodsFor:'interface specs'! |
|
48 |
||
49 |
windowSpec |
|
50 |
"This resource specification was automatically generated |
|
51 |
by the UIPainter of ST/X." |
|
52 |
||
53 |
"Do not manually edit this!! If it is corrupted, |
|
54 |
the UIPainter may not be able to read the specification." |
|
55 |
||
56 |
" |
|
57 |
UIPainter new openOnClass:WorkspaceApplication andSelector:#windowSpec |
|
58 |
WorkspaceApplication new openInterface:#windowSpec |
|
59 |
WorkspaceApplication open |
|
60 |
" |
|
61 |
||
62 |
<resource: #canvas> |
|
63 |
||
64 |
^ |
|
6457 | 65 |
#(FullSpec |
66 |
name: windowSpec |
|
67 |
window: |
|
68 |
(WindowSpec |
|
69 |
label: 'Workspace' |
|
70 |
name: 'Workspace' |
|
71 |
min: (Point 10 10) |
|
72 |
bounds: (Rectangle 0 0 432 241) |
|
73 |
menu: mainMenu |
|
3154 | 74 |
) |
6457 | 75 |
component: |
76 |
(SpecCollection |
|
77 |
collection: ( |
|
78 |
(NoteBookViewSpec |
|
79 |
name: 'NoteBook1' |
|
80 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
81 |
model: selectedWorkspaceIndexHolder |
|
82 |
menu: tabList |
|
83 |
useIndex: true |
|
84 |
accessTabMenuAction: tabMenuAt: |
|
85 |
destroyTabAction: destroyTab: |
|
86 |
canvas: workspaceHolder |
|
87 |
canvasInset: 0 |
|
88 |
keepCanvasAlive: true |
|
89 |
tabLevel: 1 |
|
3193 | 90 |
) |
3154 | 91 |
) |
92 |
||
93 |
) |
|
94 |
) |
|
95 |
! ! |
|
96 |
||
97 |
!WorkspaceApplication class methodsFor:'menu specs'! |
|
98 |
||
99 |
mainMenu |
|
100 |
"This resource specification was automatically generated |
|
101 |
by the MenuEditor of ST/X." |
|
102 |
||
103 |
"Do not manually edit this!! If it is corrupted, |
|
104 |
the MenuEditor may not be able to read the specification." |
|
105 |
||
106 |
" |
|
107 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#mainMenu |
|
108 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication mainMenu)) startUp |
|
109 |
" |
|
110 |
||
111 |
<resource: #menu> |
|
112 |
||
113 |
^ |
|
5852 | 114 |
#(Menu |
115 |
( |
|
116 |
(MenuItem |
|
117 |
label: 'File' |
|
118 |
translateLabel: true |
|
119 |
submenu: |
|
120 |
(Menu |
|
121 |
( |
|
122 |
(MenuItem |
|
123 |
label: 'New Workspace' |
|
124 |
itemValue: newWorkspace |
|
125 |
translateLabel: true |
|
3651 | 126 |
) |
5852 | 127 |
(MenuItem |
128 |
label: 'New SystemWorkspace' |
|
129 |
itemValue: newSystemWorkspace |
|
130 |
translateLabel: true |
|
3154 | 131 |
) |
5852 | 132 |
(MenuItem |
133 |
label: '-' |
|
3154 | 134 |
) |
5852 | 135 |
(MenuItem |
136 |
label: 'Load File...' |
|
137 |
itemValue: menuLoad |
|
138 |
translateLabel: true |
|
3154 | 139 |
) |
5852 | 140 |
(MenuItem |
141 |
label: '-' |
|
3154 | 142 |
) |
5852 | 143 |
(MenuItem |
144 |
label: 'Save As...' |
|
145 |
itemValue: menuSaveAs |
|
146 |
translateLabel: true |
|
3154 | 147 |
) |
5852 | 148 |
(MenuItem |
149 |
enabled: hasMultipleBuffersHolder |
|
150 |
label: 'Save all As...' |
|
151 |
itemValue: menuSaveAllAs |
|
152 |
translateLabel: true |
|
4267 | 153 |
) |
5852 | 154 |
(MenuItem |
155 |
label: '-' |
|
3154 | 156 |
) |
5852 | 157 |
(MenuItem |
158 |
label: 'Exit' |
|
159 |
itemValue: closeRequest |
|
160 |
translateLabel: true |
|
3154 | 161 |
) |
162 |
) |
|
163 |
nil |
|
164 |
nil |
|
165 |
) |
|
166 |
) |
|
5852 | 167 |
(MenuItem |
168 |
label: 'Buffers' |
|
169 |
nameKey: Buffer |
|
170 |
translateLabel: true |
|
171 |
submenu: |
|
172 |
(Menu |
|
173 |
( |
|
174 |
(MenuItem |
|
175 |
label: 'Add Buffer' |
|
176 |
itemValue: addWorkspace |
|
177 |
translateLabel: true |
|
3193 | 178 |
) |
5852 | 179 |
(MenuItem |
180 |
enabled: anyWorkspaceVariableIsDefined |
|
181 |
label: 'Add Buffer on Workspace Variables' |
|
182 |
itemValue: addWorkspaceVariableInspector |
|
183 |
translateLabel: true |
|
4098 | 184 |
) |
5852 | 185 |
(MenuItem |
186 |
label: 'Add Buffer on Global Variables' |
|
187 |
itemValue: addGlobalVariableInspector |
|
188 |
translateLabel: true |
|
4099 | 189 |
) |
5852 | 190 |
(MenuItem |
6508 | 191 |
label: 'Add Buffer on Class Variables' |
192 |
itemValue: addClassVariableInspector |
|
193 |
translateLabel: true |
|
194 |
) |
|
6699 | 195 |
(MenuItem |
196 |
label: '-' |
|
197 |
) |
|
198 |
(MenuItem |
|
199 |
label: 'Add Evaluation Buffer' |
|
200 |
itemValue: addEvaluationWorkspace |
|
201 |
translateLabel: true |
|
202 |
) |
|
6508 | 203 |
(MenuItem |
6422 | 204 |
label: '-' |
6421 | 205 |
) |
206 |
(MenuItem |
|
5852 | 207 |
label: 'Rename...' |
208 |
itemValue: renameWorkspace |
|
209 |
translateLabel: true |
|
3193 | 210 |
) |
5852 | 211 |
(MenuItem |
212 |
label: '-' |
|
3193 | 213 |
) |
5852 | 214 |
(MenuItem |
215 |
enabled: canRemoveWorkspace |
|
216 |
label: 'Remove Buffer' |
|
217 |
itemValue: removeWorkspace |
|
218 |
translateLabel: true |
|
3193 | 219 |
) |
220 |
) |
|
221 |
nil |
|
222 |
nil |
|
223 |
) |
|
224 |
) |
|
5852 | 225 |
(MenuItem |
226 |
label: 'Edit' |
|
227 |
translateLabel: true |
|
228 |
submenu: |
|
229 |
(Menu |
|
230 |
( |
|
231 |
(MenuItem |
|
232 |
enabled: hasSelectionInActiveWorkspace |
|
233 |
label: 'Cut' |
|
234 |
itemValue: cutSelection |
|
235 |
translateLabel: true |
|
3154 | 236 |
) |
5852 | 237 |
(MenuItem |
238 |
enabled: hasSelectionInActiveWorkspace |
|
239 |
label: 'Copy' |
|
240 |
itemValue: copySelection |
|
241 |
translateLabel: true |
|
3154 | 242 |
) |
5852 | 243 |
(MenuItem |
244 |
label: 'Paste' |
|
245 |
itemValue: paste |
|
246 |
translateLabel: true |
|
3154 | 247 |
) |
5852 | 248 |
(MenuItem |
249 |
enabled: hasHistory |
|
250 |
label: 'Paste Last' |
|
251 |
itemValue: pasteLastDoIt |
|
252 |
translateLabel: true |
|
253 |
submenuChannel: pasteRecentDoItMenu |
|
254 |
keepLinkedMenu: true |
|
4790 | 255 |
) |
5852 | 256 |
(MenuItem |
257 |
label: '-' |
|
258 |
) |
|
259 |
(MenuItem |
|
260 |
label: 'Select All' |
|
261 |
itemValue: selectAll |
|
262 |
translateLabel: true |
|
4790 | 263 |
) |
5852 | 264 |
(MenuItem |
265 |
label: '-' |
|
3752 | 266 |
) |
5852 | 267 |
(MenuItem |
268 |
label: 'Filter Text...' |
|
269 |
itemValue: filterText |
|
270 |
translateLabel: true |
|
3752 | 271 |
) |
5852 | 272 |
(MenuItem |
273 |
label: 'Process Text...' |
|
274 |
itemValue: processText |
|
275 |
translateLabel: true |
|
3752 | 276 |
) |
5852 | 277 |
(MenuItem |
278 |
label: '-' |
|
5261 | 279 |
) |
5852 | 280 |
(MenuItem |
6422 | 281 |
label: 'Services' |
5852 | 282 |
translateLabel: true |
283 |
submenu: |
|
284 |
(Menu |
|
285 |
( |
|
286 |
(MenuItem |
|
287 |
enabled: hasSelectionInActiveWorkspace |
|
288 |
label: 'Google Spell' |
|
289 |
itemValue: googleSpellingSuggestion |
|
290 |
translateLabel: true |
|
4480 | 291 |
) |
5852 | 292 |
(MenuItem |
293 |
label: 'Translate' |
|
294 |
translateLabel: true |
|
295 |
submenu: |
|
296 |
(Menu |
|
297 |
( |
|
298 |
(MenuItem |
|
299 |
enabled: hasSelectionInActiveWorkspace |
|
300 |
label: 'English -> German' |
|
301 |
itemValue: babelFishTranslate: |
|
302 |
translateLabel: true |
|
303 |
argument: 'en_de' |
|
4480 | 304 |
) |
5852 | 305 |
(MenuItem |
306 |
enabled: hasSelectionInActiveWorkspace |
|
307 |
label: 'English -> French' |
|
308 |
itemValue: babelFishTranslate: |
|
309 |
translateLabel: true |
|
310 |
argument: 'en_fr' |
|
4480 | 311 |
) |
5852 | 312 |
(MenuItem |
313 |
enabled: hasSelectionInActiveWorkspace |
|
314 |
label: 'English -> Spanish' |
|
315 |
itemValue: babelFishTranslate: |
|
316 |
translateLabel: true |
|
317 |
argument: 'en_es' |
|
4480 | 318 |
) |
5852 | 319 |
(MenuItem |
320 |
enabled: hasSelectionInActiveWorkspace |
|
321 |
label: 'English -> Portuguese' |
|
322 |
itemValue: babelFishTranslate: |
|
323 |
translateLabel: true |
|
324 |
argument: 'en_pt' |
|
4480 | 325 |
) |
5852 | 326 |
(MenuItem |
327 |
label: '-' |
|
4480 | 328 |
) |
5852 | 329 |
(MenuItem |
330 |
enabled: hasSelectionInActiveWorkspace |
|
331 |
label: 'German -> English' |
|
332 |
itemValue: babelFishTranslate: |
|
333 |
translateLabel: true |
|
334 |
argument: 'de_en' |
|
4480 | 335 |
) |
5852 | 336 |
(MenuItem |
337 |
enabled: hasSelectionInActiveWorkspace |
|
338 |
label: 'French -> English' |
|
339 |
itemValue: babelFishTranslate: |
|
340 |
translateLabel: true |
|
341 |
argument: 'fr_en' |
|
4480 | 342 |
) |
5852 | 343 |
(MenuItem |
344 |
enabled: hasSelectionInActiveWorkspace |
|
345 |
label: 'Spanish -> English' |
|
346 |
itemValue: babelFishTranslate: |
|
347 |
translateLabel: true |
|
348 |
argument: 'es_en' |
|
4480 | 349 |
) |
5852 | 350 |
(MenuItem |
351 |
enabled: hasSelectionInActiveWorkspace |
|
352 |
label: 'Portuguese -> English' |
|
353 |
itemValue: babelFishTranslate: |
|
354 |
translateLabel: true |
|
355 |
argument: 'pt_en' |
|
4480 | 356 |
) |
5852 | 357 |
(MenuItem |
358 |
enabled: hasSelectionInActiveWorkspace |
|
359 |
label: 'Russian -> English' |
|
360 |
itemValue: babelFishTranslate: |
|
361 |
translateLabel: true |
|
362 |
argument: 'ru_en' |
|
4480 | 363 |
) |
364 |
) |
|
365 |
nil |
|
366 |
nil |
|
367 |
) |
|
368 |
) |
|
6422 | 369 |
(MenuItem |
370 |
label: '-' |
|
371 |
) |
|
372 |
(MenuItem |
|
6425 | 373 |
label: 'Tea Timer' |
6422 | 374 |
itemValue: addTeaTimer |
375 |
translateLabel: true |
|
376 |
) |
|
4480 | 377 |
) |
378 |
nil |
|
379 |
nil |
|
380 |
) |
|
381 |
) |
|
3154 | 382 |
) |
383 |
nil |
|
384 |
nil |
|
385 |
) |
|
386 |
) |
|
5852 | 387 |
(MenuItem |
388 |
label: 'Workspace' |
|
389 |
translateLabel: true |
|
390 |
submenu: |
|
391 |
(Menu |
|
392 |
( |
|
393 |
(MenuItem |
|
394 |
label: 'Add Workspace Variable...' |
|
395 |
itemValue: addWorkspaceVariable |
|
396 |
translateLabel: true |
|
397 |
) |
|
398 |
(MenuItem |
|
399 |
enabled: anyWorkspaceVariableIsDefined |
|
400 |
label: 'Remove Workspace Variable...' |
|
401 |
itemValue: removeWorkspaceVariable |
|
402 |
translateLabel: true |
|
3722 | 403 |
) |
5852 | 404 |
(MenuItem |
405 |
enabled: anyWorkspaceVariableIsDefined |
|
406 |
label: 'Remove all Workspace Variables...' |
|
407 |
itemValue: removeAllWorkspaceVariables |
|
408 |
translateLabel: true |
|
409 |
) |
|
410 |
(MenuItem |
|
411 |
label: '-' |
|
3722 | 412 |
) |
5852 | 413 |
(MenuItem |
414 |
enabled: anyWorkspaceVariableIsDefined |
|
415 |
label: 'Inspect Workspace Variables' |
|
416 |
itemValue: inspectWorkspaceVariables |
|
417 |
translateLabel: true |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
418 |
) |
5852 | 419 |
(MenuItem |
420 |
label: '-' |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
421 |
) |
5852 | 422 |
(MenuItem |
423 |
label: 'Settings' |
|
424 |
translateLabel: true |
|
425 |
submenu: |
|
426 |
(Menu |
|
427 |
( |
|
428 |
(MenuItem |
|
429 |
label: 'Autodefine as Workspace Variable' |
|
430 |
translateLabel: true |
|
431 |
hideMenuOnActivated: false |
|
432 |
choice: autoDefineVariables |
|
433 |
choiceValue: workspace |
|
434 |
) |
|
435 |
(MenuItem |
|
436 |
label: 'Autodefine as DoIt Variable' |
|
437 |
translateLabel: true |
|
438 |
hideMenuOnActivated: false |
|
439 |
choice: autoDefineVariables |
|
440 |
choiceValue: doIt |
|
441 |
) |
|
442 |
(MenuItem |
|
443 |
label: 'Autodefine off' |
|
444 |
translateLabel: true |
|
445 |
hideMenuOnActivated: false |
|
446 |
choice: autoDefineVariables |
|
4474 | 447 |
) |
5852 | 448 |
(MenuItem |
449 |
label: '-' |
|
4474 | 450 |
) |
5852 | 451 |
(MenuItem |
452 |
label: 'Syntax' |
|
453 |
translateLabel: true |
|
454 |
submenu: |
|
455 |
(Menu |
|
456 |
( |
|
457 |
(MenuItem |
|
458 |
label: 'Smalltalk' |
|
459 |
translateLabel: true |
|
460 |
choice: syntaxHolder |
|
5983 | 461 |
choiceValue: Smalltalk |
5852 | 462 |
) |
463 |
(MenuItem |
|
464 |
label: 'JavaScript' |
|
465 |
translateLabel: true |
|
466 |
choice: syntaxHolder |
|
5983 | 467 |
choiceValue: JavaScript |
5852 | 468 |
) |
469 |
) |
|
470 |
nil |
|
471 |
nil |
|
472 |
) |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
473 |
) |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
474 |
) |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
475 |
nil |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
476 |
nil |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
477 |
) |
3722 | 478 |
) |
479 |
) |
|
480 |
nil |
|
481 |
nil |
|
482 |
) |
|
483 |
) |
|
5852 | 484 |
(MenuItem |
485 |
label: 'Smalltalk' |
|
486 |
translateLabel: true |
|
487 |
submenu: |
|
488 |
(Menu |
|
489 |
( |
|
490 |
(MenuItem |
|
491 |
enabled: hasSelectionInActiveWorkspace |
|
492 |
label: 'DoIt' |
|
493 |
itemValue: doIt |
|
494 |
translateLabel: true |
|
3154 | 495 |
) |
5852 | 496 |
(MenuItem |
497 |
enabled: hasSelectionInActiveWorkspace |
|
498 |
label: 'PrintIt' |
|
499 |
itemValue: printIt |
|
500 |
translateLabel: true |
|
3154 | 501 |
) |
5852 | 502 |
(MenuItem |
503 |
enabled: hasSelectionInActiveWorkspace |
|
504 |
label: 'InspectIt' |
|
505 |
itemValue: inspectIt |
|
506 |
translateLabel: true |
|
3154 | 507 |
) |
5852 | 508 |
(MenuItem |
509 |
label: '-' |
|
3154 | 510 |
) |
5852 | 511 |
(MenuItem |
512 |
enabled: hasHistory |
|
513 |
label: 'Redo Last' |
|
514 |
itemValue: redoLastDoIt |
|
515 |
translateLabel: true |
|
516 |
submenuChannel: redoRecentDoItMenu |
|
517 |
keepLinkedMenu: true |
|
4790 | 518 |
) |
5852 | 519 |
(MenuItem |
520 |
label: '-' |
|
4790 | 521 |
) |
5852 | 522 |
(MenuItem |
523 |
enabled: hasSelectionInActiveWorkspace |
|
524 |
label: 'TimeIt' |
|
525 |
itemValue: timeIt |
|
526 |
translateLabel: true |
|
3384 | 527 |
) |
5852 | 528 |
(MenuItem |
529 |
enabled: hasSelectionInActiveWorkspace |
|
530 |
label: 'SpyOnIt' |
|
531 |
itemValue: spyOnIt |
|
532 |
translateLabel: true |
|
3384 | 533 |
) |
5852 | 534 |
(MenuItem |
535 |
label: '-' |
|
3384 | 536 |
) |
5852 | 537 |
(MenuItem |
538 |
enabled: hasSelectionInActiveWorkspace |
|
539 |
label: 'Browse Class' |
|
540 |
itemValue: browseIt |
|
541 |
translateLabel: true |
|
3154 | 542 |
) |
5852 | 543 |
(MenuItem |
544 |
enabled: hasSelectionInActiveWorkspace |
|
545 |
label: 'Browse Implementors of It' |
|
546 |
itemValue: browseImplementorsOfIt |
|
547 |
translateLabel: true |
|
3383
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
548 |
) |
5852 | 549 |
(MenuItem |
550 |
enabled: hasSelectionInActiveWorkspace |
|
551 |
label: 'Browse References to It' |
|
552 |
itemValue: browseReferencesToIt |
|
553 |
translateLabel: true |
|
3383
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
554 |
) |
5852 | 555 |
(MenuItem |
556 |
label: '-' |
|
4154 | 557 |
) |
5852 | 558 |
(MenuItem |
559 |
label: 'FileIn Text' |
|
560 |
itemValue: fileInText |
|
561 |
translateLabel: true |
|
5261 | 562 |
) |
5852 | 563 |
(MenuItem |
564 |
label: '-' |
|
5261 | 565 |
) |
5852 | 566 |
(MenuItem |
567 |
label: 'Add Global Variable...' |
|
568 |
itemValue: addGlobalVariable |
|
569 |
translateLabel: true |
|
4284 | 570 |
) |
5852 | 571 |
(MenuItem |
572 |
label: 'Remove Global Variable...' |
|
573 |
itemValue: removeGlobalVariable |
|
574 |
translateLabel: true |
|
4154 | 575 |
) |
3154 | 576 |
) |
577 |
nil |
|
578 |
nil |
|
579 |
) |
|
580 |
) |
|
5852 | 581 |
(MenuItem |
582 |
label: 'Help' |
|
583 |
translateLabel: true |
|
584 |
startGroup: right |
|
585 |
submenu: |
|
586 |
(Menu |
|
587 |
( |
|
588 |
(MenuItem |
|
589 |
label: 'Documentation' |
|
590 |
itemValue: openDocumentation |
|
591 |
translateLabel: true |
|
3154 | 592 |
) |
5852 | 593 |
(MenuItem |
594 |
label: '-' |
|
3154 | 595 |
) |
5852 | 596 |
(MenuItem |
597 |
label: 'About this Application...' |
|
598 |
itemValue: openAboutThisApplication |
|
599 |
translateLabel: true |
|
3154 | 600 |
) |
601 |
) |
|
602 |
nil |
|
603 |
nil |
|
604 |
) |
|
605 |
) |
|
606 |
) |
|
607 |
nil |
|
608 |
nil |
|
609 |
) |
|
3193 | 610 |
! |
611 |
||
612 |
tabMenu |
|
613 |
"This resource specification was automatically generated |
|
614 |
by the MenuEditor of ST/X." |
|
615 |
||
616 |
"Do not manually edit this!! If it is corrupted, |
|
617 |
the MenuEditor may not be able to read the specification." |
|
618 |
||
619 |
" |
|
620 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#tabMenu |
|
621 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication tabMenu)) startUp |
|
622 |
" |
|
623 |
||
624 |
<resource: #menu> |
|
625 |
||
6229 | 626 |
^ |
3193 | 627 |
#(#Menu |
6322 | 628 |
#( |
629 |
#(#MenuItem |
|
630 |
#label: 'Add Tab' |
|
631 |
#translateLabel: true |
|
632 |
"/ #triggerOnDown: true |
|
633 |
#value: #addWorkspace |
|
634 |
) |
|
635 |
#(#MenuItem |
|
6323 | 636 |
#label: '-' |
637 |
) |
|
638 |
#(#MenuItem |
|
6322 | 639 |
#label: 'Remove Tab' |
640 |
#translateLabel: true |
|
641 |
"/ #triggerOnDown: true |
|
642 |
#value: #removeWorkspace: |
|
643 |
#enabled: #canRemoveWorkspace: |
|
644 |
) |
|
645 |
#(#MenuItem |
|
646 |
#label: '-' |
|
647 |
) |
|
648 |
#(#MenuItem |
|
649 |
#label: 'Rename...' |
|
650 |
#translateLabel: true |
|
651 |
"/ #triggerOnDown: true |
|
652 |
#value: #renameWorkspace: |
|
653 |
) |
|
654 |
) |
|
655 |
nil |
|
656 |
nil |
|
3193 | 657 |
) |
3154 | 658 |
! ! |
659 |
||
3332 | 660 |
!WorkspaceApplication class methodsFor:'special startup'! |
661 |
||
6022 | 662 |
openOnFile:aFilename |
663 |
"launch a new workspace on the contents of some file" |
|
664 |
||
665 |
|ws| |
|
666 |
||
667 |
ws := self openWith:nil. |
|
668 |
ws loadFile:aFilename. |
|
669 |
^ ws |
|
670 |
||
671 |
" |
|
672 |
WorkspaceApplication openOnFile:'Makefile' |
|
673 |
" |
|
674 |
! |
|
675 |
||
3332 | 676 |
openSystemWorkspace |
5681 | 677 |
|wsApp path needRemove font| |
3345 | 678 |
|
679 |
needRemove := true. |
|
3332 | 680 |
|
681 |
wsApp := self new. |
|
682 |
wsApp allButOpen. |
|
3337 | 683 |
wsApp window extent:640@400. |
3332 | 684 |
|
3345 | 685 |
path := (Smalltalk getSystemFileName:'README') ? '../../README'. |
5490 | 686 |
path := path asFilename. |
687 |
path isReadable ifTrue:[ |
|
3345 | 688 |
wsApp addWindow:(HVScrollableView for:Workspace) named:'README' asFirst:false. |
689 |
wsApp loadFile:path. |
|
690 |
wsApp removeWorkspace:1. "/ the original Workspace |
|
4183 | 691 |
wsApp renameWorkspace:1 to:'LICENCE README'. |
3345 | 692 |
needRemove := false. |
693 |
]. |
|
3334 | 694 |
|
3346 | 695 |
"/ path := (Smalltalk getSystemFileName:'doc/online/english/LICENCE_STX.html') ? '../../doc/online/english/LICENCE_STX.html'. |
696 |
"/ path asFilename exists ifTrue:[ |
|
697 |
"/ wsApp addWindow:(licenceView := HVScrollableView for:HTMLDocumentView) named:'License' asFirst:false. |
|
698 |
"/ licenceView homeDocument:'../../doc/online/english/LICENCE_STX.html'. |
|
699 |
"/ licenceView updateLabelFlag:false. |
|
700 |
"/ needRemove ifTrue:[wsApp removeWorkspace:1]. "/ the original Workspace |
|
701 |
"/ needRemove := false. |
|
702 |
"/ ]. |
|
3332 | 703 |
|
5684 | 704 |
wsApp graphicsDevice platformName = 'X11' ifTrue:[ |
705 |
font := Font family:'unifont' face:'medium' style:'roman' size:16 encoding:'iso10646-1'. |
|
706 |
font := font onDevice:wsApp graphicsDevice ifAbsent:nil. |
|
707 |
font isNil ifTrue:[ |
|
708 |
font := Font family:'arial' face:'medium' style:'roman' size:12 encoding:'iso10646-1'. |
|
709 |
font := font onDevice:wsApp graphicsDevice ifAbsent:nil. |
|
710 |
]. |
|
711 |
] ifFalse:[ |
|
5685 | 712 |
font := Font family:'Arial Unicode MS' face:'medium' style:'roman' size:10 encoding:'ms-ansi'. |
5681 | 713 |
font := font onDevice:wsApp graphicsDevice ifAbsent:nil. |
714 |
]. |
|
715 |
||
5649 | 716 |
#( |
6212 | 717 |
('Hello_utf8.wsp' HELLO_UTF_FILE 'Hello' #'utf8' ) |
718 |
('Welcome.wsp' WELCOME_FILE 'Welcome' nil ) |
|
719 |
('Setup.wsp' SETUP_FILE 'Setup' nil ) |
|
720 |
('Keyboard.wsp' KEYBOARD_FILE 'Keyboard' nil ) |
|
721 |
('GettingStarted.wsp' GETTING_STARTED_FILE 'Getting Started' nil ) |
|
6211 | 722 |
) do:[:quadruple | |
723 |
|file resKey title forcedEncoding pane encoding| |
|
724 |
||
725 |
file := quadruple at:1. |
|
726 |
resKey := quadruple at:2. |
|
727 |
file := self classResources string:resKey default:file. |
|
728 |
||
729 |
title := quadruple at:3. |
|
730 |
forcedEncoding := quadruple at:4. |
|
5681 | 731 |
|
5649 | 732 |
path := (Smalltalk getSystemFileName:file). |
5681 | 733 |
|
5649 | 734 |
(path notNil and:[path asFilename isReadable]) ifTrue:[ |
5681 | 735 |
wsApp addWindow:(pane := HVScrollableView for:Workspace) named:title asFirst:false. |
5692 | 736 |
|
737 |
forcedEncoding notNil ifTrue:[ |
|
5694 | 738 |
encoding := forcedEncoding. |
5804 | 739 |
font notNil ifTrue:[ |
740 |
pane font:font. |
|
741 |
] |
|
5692 | 742 |
] ifFalse:[ |
6173
4ba4589e4952
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
6056
diff
changeset
|
743 |
encoding := CharacterEncoder guessEncodingOfFile:path. |
5692 | 744 |
(encoding == #'iso8859-1' or:[encoding == #'ascii']) ifTrue:[ |
745 |
encoding := nil |
|
5681 | 746 |
]. |
747 |
]. |
|
5692 | 748 |
wsApp loadFile:path encoding:encoding label:title. |
5649 | 749 |
needRemove ifTrue:[wsApp removeWorkspace:1]. "/ the original Workspace |
750 |
needRemove := false. |
|
751 |
]. |
|
3345 | 752 |
]. |
5693 | 753 |
wsApp openWindow. |
754 |
wsApp selectedWorkspaceIndexHolder value:2. |
|
3332 | 755 |
|
756 |
" |
|
757 |
self openSystemWorkspace |
|
758 |
" |
|
4542 | 759 |
! |
760 |
||
761 |
openWith:initialText |
|
762 |
"launch a new workspace with some initial contents" |
|
763 |
||
5098 | 764 |
^ self openWith:initialText selected:false |
765 |
||
766 |
" |
|
767 |
WorkspaceApplication openWith:'Transcript showCR:''hello world''' |
|
768 |
" |
|
769 |
! |
|
770 |
||
771 |
openWith:initialText selected:selectedBoolean |
|
772 |
"launch a new workspace with some initial contents" |
|
773 |
||
4542 | 774 |
|workspace| |
775 |
||
776 |
workspace := self new. |
|
777 |
workspace open. |
|
5098 | 778 |
workspace selectedWorkspace contents:initialText selected:selectedBoolean. |
4542 | 779 |
^ workspace |
780 |
||
781 |
" |
|
782 |
WorkspaceApplication openWith:'Transcript showCR:''hello world''' |
|
783 |
" |
|
3332 | 784 |
! ! |
785 |
||
3193 | 786 |
!WorkspaceApplication methodsFor:'aspects'! |
787 |
||
4474 | 788 |
autoDefineVariables |
789 |
autoDefineVariables isNil ifTrue:[ |
|
790 |
autoDefineVariables := ValueHolder new. |
|
791 |
(UserPreferences current autoDefineWorkspaceVariables) ifTrue:[ |
|
5547
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
792 |
autoDefineVariables value:#workspace. |
4474 | 793 |
]. |
794 |
autoDefineVariables onChangeSend:#autoDefineVariablesChanged to:self. |
|
795 |
]. |
|
796 |
^ autoDefineVariables. |
|
797 |
! |
|
798 |
||
4136 | 799 |
hasHistory |
800 |
^ Workspace doItHistory size > 0. |
|
5852 | 801 |
! |
802 |
||
803 |
setCompilerForSyntax |
|
804 |
|syntax| |
|
805 |
||
806 |
syntax := syntaxHolder value. |
|
807 |
self selectedWorkspace compilerClass:(self compilerClassForSyntaxName:syntax). |
|
808 |
! |
|
809 |
||
810 |
syntaxHolder |
|
811 |
syntaxHolder isNil ifTrue:[ |
|
812 |
syntaxHolder := #Smalltalk asValue. |
|
813 |
syntaxHolder onChangeSend:#setCompilerForSyntax to:self |
|
814 |
]. |
|
815 |
^ syntaxHolder |
|
3193 | 816 |
! ! |
817 |
||
4358 | 818 |
!WorkspaceApplication methodsFor:'aspects-queries'! |
3193 | 819 |
|
3812 | 820 |
anyWorkspaceVariableIsDefined |
6267 | 821 |
^ Workspace anyWorkspaceVariableIsDefined |
822 |
||
823 |
"Modified: / 20-04-2005 / 11:57:59 / cg" |
|
3154 | 824 |
! ! |
825 |
||
826 |
!WorkspaceApplication methodsFor:'initialization & release'! |
|
827 |
||
828 |
closeRequest |
|
6636 | 829 |
"asks for permission before closing" |
830 |
||
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
831 |
(self askIfAnyModified:'Text was not saved. Close anyway ?' yesButton:'Close') ifFalse:[ |
3154 | 832 |
^ self |
833 |
]. |
|
834 |
||
835 |
^ super closeRequest |
|
836 |
! ! |
|
837 |
||
4359 | 838 |
!WorkspaceApplication methodsFor:'menu-actions'! |
3154 | 839 |
|
6508 | 840 |
addClassVariableInspector |
841 |
|v| |
|
842 |
||
843 |
v := self addInspectorOn:Smalltalk inspectorClass:ClassVariablesInspectorView suppressPseudoSlots:true. |
|
844 |
||
845 |
v fieldListLabel:'Name'. |
|
846 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value) to:'Class Variables'. |
|
847 |
! |
|
848 |
||
6699 | 849 |
addEvaluationWorkspace |
850 |
self addWindow:(self createEvaluationWorkspace) named:'Eval%1' |
|
851 |
! |
|
852 |
||
4154 | 853 |
addGlobalVariable |
854 |
|name nameKey selection| |
|
855 |
||
856 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
857 |
||
858 |
name := Dialog |
|
859 |
request:'Name of new Global Variable:' |
|
860 |
initialAnswer:(selection asString string) |
|
861 |
okLabel:'Add' |
|
862 |
title:'Enter Variable Name'. |
|
863 |
name size == 0 ifTrue:[ |
|
864 |
^ self |
|
865 |
]. |
|
866 |
nameKey := name asSymbol. |
|
867 |
||
4284 | 868 |
(Smalltalk includesKey:nameKey) ifTrue:[ |
4154 | 869 |
self warn:'Global named ''' , name , ''' already exists.'. |
870 |
^ self. |
|
871 |
]. |
|
872 |
Smalltalk at:nameKey put:nil. |
|
873 |
! |
|
874 |
||
4099 | 875 |
addGlobalVariableInspector |
876 |
|v| |
|
877 |
||
6508 | 878 |
v := self addInspectorOn:Smalltalk inspectorClass:SmalltalkInspectorView suppressPseudoSlots:true. |
879 |
||
4099 | 880 |
v fieldListLabel:'Name'. |
4208 | 881 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value) to:'Globals (Smalltalk)'. |
4099 | 882 |
! |
883 |
||
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
884 |
addInspectorOn:aValue basic:isBasicInspector suppressPseudoSlots:suppressPseudoSlots |
6508 | 885 |
|inspectorClass| |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
886 |
|
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
887 |
isBasicInspector ifFalse:[ |
6508 | 888 |
inspectorClass := aValue inspectorClass. |
889 |
]. |
|
890 |
inspectorClass isNil ifTrue:[ |
|
891 |
inspectorClass := InspectorView |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
892 |
]. |
6508 | 893 |
|
894 |
^ self |
|
895 |
addInspectorOn:aValue |
|
896 |
inspectorClass:inspectorClass |
|
897 |
suppressPseudoSlots:suppressPseudoSlots |
|
898 |
! |
|
899 |
||
900 |
addInspectorOn:aValue inspectorClass:inspectorClass suppressPseudoSlots:suppressPseudoSlots |
|
901 |
|view resultString| |
|
902 |
||
903 |
view := inspectorClass new. |
|
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
904 |
view suppressPseudoSlots:suppressPseudoSlots. |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
905 |
view inspect:aValue. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
906 |
"/ v allowFollow:true. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
907 |
aValue isBehavior ifTrue:[ |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
908 |
resultString := aValue name |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
909 |
] ifFalse:[ |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
910 |
resultString := aValue classNameWithArticle |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
911 |
]. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
912 |
self addWindow:view named:('Inspecting: ' , resultString). |
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
913 |
^ view |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
914 |
! |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
915 |
|
6421 | 916 |
addTeaTimer |
6425 | 917 |
|l dt tEnd answer| |
6421 | 918 |
|
6425 | 919 |
dt := LastTeaWaitTime ? (3*60). |
920 |
answer := Dialog request:'Time (sec):' initialAnswer:dt printString. |
|
921 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
922 |
dt := Number readFrom:answer onError:[^ self]. |
|
923 |
LastTeaWaitTime := dt. |
|
6421 | 924 |
|
925 |
tEnd := AbsoluteTime now addSeconds:dt. |
|
926 |
l := Label new. |
|
927 |
l sizeFixed:true. |
|
928 |
l label:'Waiting ... [',dt printString,' sec]'. |
|
929 |
l viewBackground:Color red. |
|
930 |
self addWindow:l named:'TeaTimer%1'. |
|
931 |
||
932 |
[ |
|
6424 | 933 |
Error handle:[ |
6636 | 934 |
#intentionallyLeftBlank |
6424 | 935 |
] do:[ |
936 |
|remaining| |
|
6421 | 937 |
|
6424 | 938 |
[AbsoluteTime now < tEnd ] whileTrue:[ |
939 |
remaining := tEnd - AbsoluteTime now. |
|
940 |
l label:'Waiting ... [',remaining printString,' sec]'. |
|
941 |
Delay waitForSeconds:1. |
|
942 |
]. |
|
943 |
l label:'TEA is ready !!'. |
|
944 |
l viewBackground:Color green. |
|
945 |
l topView raiseDeiconified. |
|
946 |
] |
|
6421 | 947 |
] fork. |
948 |
! |
|
949 |
||
3196 | 950 |
addWorkspace |
5295
e3c5a7b20d9d
refactored (added abstract superclass)
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
951 |
self addWindow:(self createWorkspace) named:'Workspace%1' |
3196 | 952 |
! |
953 |
||
3722 | 954 |
addWorkspaceVariable |
955 |
|name selection| |
|
956 |
||
957 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
958 |
||
959 |
name := Dialog |
|
960 |
request:'Name of new Workspace Variable:' |
|
961 |
initialAnswer:(selection asString string) |
|
962 |
okLabel:'Add' |
|
963 |
title:'Enter Variable Name'. |
|
964 |
name size == 0 ifTrue:[ |
|
965 |
^ self |
|
966 |
]. |
|
967 |
Workspace addWorkspaceVariable:name. |
|
968 |
! |
|
969 |
||
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
970 |
addWorkspaceVariableInspector |
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
971 |
|v| |
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
972 |
|
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
973 |
v := self addInspectorOn:(Workspace workspaceVariables) basic:false suppressPseudoSlots:true. |
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
974 |
v dereferenceValueHolders:true. |
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
975 |
v fieldListLabel:'Name'. |
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
976 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value) to:'Variables'. |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
977 |
! |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
978 |
|
3752 | 979 |
askForFilterBlock:message template:template rememberIn:nameOfClassVar |
980 |
|filterBlockString filterBlock dialog textHolder classVarValue| |
|
981 |
||
982 |
classVarValue := self class classVarAt:nameOfClassVar ifAbsent:nil. |
|
983 |
classVarValue isNil ifTrue:[ |
|
984 |
self class classVarAt:nameOfClassVar put:template. |
|
985 |
classVarValue := template. |
|
986 |
]. |
|
987 |
||
988 |
textHolder := ValueHolder new. |
|
989 |
dialog := Dialog |
|
990 |
forRequestText:(resources string:message) |
|
991 |
lines:25 |
|
992 |
columns:70 |
|
993 |
initialAnswer:classVarValue |
|
994 |
model:textHolder. |
|
995 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
996 |
dialog open. |
|
997 |
dialog accepted ifFalse:[^ nil]. |
|
998 |
||
999 |
filterBlockString := textHolder value. |
|
1000 |
self class classVarAt:nameOfClassVar put:filterBlockString. |
|
1001 |
||
1002 |
filterBlock := Parser evaluate:filterBlockString. |
|
1003 |
filterBlock isBlock ifFalse:[ |
|
5490 | 1004 |
self error:'bad input for filterBlock' mayProceed:true. |
3752 | 1005 |
^ nil |
1006 |
]. |
|
1007 |
||
1008 |
^ filterBlock |
|
1009 |
! |
|
1010 |
||
4474 | 1011 |
autoDefineVariablesChanged |
1012 |
|autoDefine| |
|
1013 |
||
1014 |
autoDefine := autoDefineVariables value. |
|
1015 |
UserPreferences current autoDefineWorkspaceVariables:(autoDefine == #workspace). |
|
1016 |
workspaces do:[:each | |
|
1017 |
each autoDefineVariables:autoDefine |
|
1018 |
]. |
|
1019 |
! |
|
1020 |
||
3198 | 1021 |
basicInspectIt |
1022 |
self inspectIt:true |
|
1023 |
! |
|
1024 |
||
3383
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
1025 |
browseImplementorsOfIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
1026 |
self selectedWorkspacesTextView browseImplementorsOfIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
1027 |
! |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
1028 |
|
3154 | 1029 |
browseIt |
3198 | 1030 |
self selectedWorkspacesTextView browseIt |
3154 | 1031 |
! |
1032 |
||
3383
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
1033 |
browseReferencesToIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
1034 |
self selectedWorkspacesTextView browseReferencesToIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
1035 |
! |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
1036 |
|
4136 | 1037 |
clearHistory |
1038 |
Workspace clearDoItHistory |
|
1039 |
! |
|
1040 |
||
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6353
diff
changeset
|
1041 |
defaultFileNameForSave |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6353
diff
changeset
|
1042 |
^ self selectedWorkspace defaultFileNameForFileDialog ? super defaultFileNameForSave |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6353
diff
changeset
|
1043 |
! |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6353
diff
changeset
|
1044 |
|
3154 | 1045 |
doIt |
3198 | 1046 |
self selectedWorkspacesTextView doIt |
3154 | 1047 |
! |
1048 |
||
1049 |
inspectIt |
|
3198 | 1050 |
self inspectIt:false |
1051 |
! |
|
1052 |
||
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
1053 |
inspectIt:isBasicInspector |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
1054 |
|ws| |
3196 | 1055 |
|
3198 | 1056 |
ws := self selectedWorkspacesTextView. |
3196 | 1057 |
ws |
1058 |
do:(ws selection) |
|
1059 |
withValueDo:[:result | |
|
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
1060 |
self addInspectorOn:result basic:isBasicInspector suppressPseudoSlots:false |
3196 | 1061 |
] |
1062 |
||
1063 |
"/ self selectedWorkspace inspectIt |
|
3154 | 1064 |
! |
1065 |
||
3812 | 1066 |
inspectWorkspaceVariables |
1067 |
|wsvars| |
|
1068 |
||
1069 |
wsvars := Workspace workspaceVariables. |
|
1070 |
wsvars size == 0 ifTrue:[ |
|
1071 |
Dialog information:'No Workspace Variables are defined'. |
|
1072 |
^ self |
|
1073 |
]. |
|
1074 |
wsvars inspect |
|
1075 |
! |
|
1076 |
||
3332 | 1077 |
loadFile:aFileName |
5649 | 1078 |
self loadFile:aFileName encoding:nil |
1079 |
! |
|
1080 |
||
5692 | 1081 |
loadFile:aFileName encoding:encodingSymbolOrNil |
1082 |
|lbl| |
|
1083 |
||
1084 |
lbl := aFileName asFilename withoutSuffix baseName. |
|
1085 |
self loadFile:aFileName encoding:encodingSymbolOrNil label:lbl. |
|
1086 |
! |
|
1087 |
||
1088 |
loadFile:aFileName encoding:encodingSymbolOrNil label:label |
|
1089 |
|file ws| |
|
3332 | 1090 |
|
1091 |
file := aFileName asFilename. |
|
5490 | 1092 |
ws := self selectedWorkspacesTextView. |
1093 |
[ |
|
5692 | 1094 |
|contents| |
1095 |
||
1096 |
contents := file contents. |
|
1097 |
encodingSymbolOrNil notNil ifTrue:[ |
|
1098 |
contents := contents encodeFrom:encodingSymbolOrNil into:#'unicode'. |
|
5742 | 1099 |
ws externalEncoding:encodingSymbolOrNil. |
5692 | 1100 |
]. |
1101 |
ws contents:contents. |
|
5752
1377fd220c4c
remember loaded file (for save as)
Claus Gittinger <cg@exept.de>
parents:
5742
diff
changeset
|
1102 |
ws defaultFileNameForFileDialog:file pathName. |
5490 | 1103 |
] on:StreamError do:[:ex| |
1104 |
Dialog warn:(resources string:'Cannot open %1: %2' with:file asString with:ex description). |
|
5196
13f6e4eaac91
fix #loadFile: check if file exists
Michael Beyl <mb@exept.de>
parents:
5140
diff
changeset
|
1105 |
^ self |
13f6e4eaac91
fix #loadFile: check if file exists
Michael Beyl <mb@exept.de>
parents:
5140
diff
changeset
|
1106 |
]. |
3332 | 1107 |
ws modified:false. |
1108 |
||
1109 |
tabList size <= 1 ifTrue:[ |
|
5692 | 1110 |
self window label:label. |
3332 | 1111 |
] ifFalse:[ |
5692 | 1112 |
tabList at:self selectedWorkspaceIndexHolder value put:label |
3332 | 1113 |
] |
1114 |
! |
|
1115 |
||
3154 | 1116 |
menuLoad |
3332 | 1117 |
|file| |
3154 | 1118 |
|
3193 | 1119 |
(self askIfModified:'Text was modified. Load anyway ?' yesButton:'Load') ifFalse:[ ^ self]. |
1120 |
||
5846 | 1121 |
file := Dialog requestFileName:(resources string:'Load file') default:'file.wsp' pattern:'*.wsp'. |
5490 | 1122 |
file size ~~ 0 ifTrue:[ |
3332 | 1123 |
self loadFile:file |
3154 | 1124 |
] |
1125 |
! |
|
1126 |
||
3334 | 1127 |
newSystemWorkspace |
1128 |
self class openSystemWorkspace |
|
1129 |
! |
|
1130 |
||
3154 | 1131 |
openDocumentation |
1132 |
"opens the documentation file" |
|
1133 |
||
1134 |
self openHTMLDocument: 'tools/misc/TOP.html#WORKSPACE' |
|
1135 |
! |
|
1136 |
||
4267 | 1137 |
pasteAndExecute:aString |
1138 |
self paste:aString. |
|
4136 | 1139 |
self printIt |
1140 |
! |
|
1141 |
||
3154 | 1142 |
printIt |
3198 | 1143 |
self selectedWorkspacesTextView printIt |
3193 | 1144 |
! |
1145 |
||
3752 | 1146 |
processText |
1147 |
|template filterBlock newList oldList answer nChanged changedLines flags| |
|
1148 |
||
1149 |
template := |
|
1150 |
'"/ general text processor; |
|
1151 |
"/ the following block should evaluate to a new line, |
|
1152 |
"/ given the original line as argument. |
|
1153 |
"/ Beginner warning: Smalltalk know-how is useful here. |
|
1154 |
||
1155 |
[:line | |
|
1156 |
"/ any processing on line. |
|
1157 |
"/ Notice, that line might be a Text object (i.e. non-string), |
|
1158 |
"/ |
|
1159 |
"/ Useful operations on the line are: |
|
1160 |
"/ - '' .... '' , concatenation of any prefix/suffix |
|
1161 |
"/ - leftPaddedTo:size padding |
|
1162 |
"/ - rightPaddedTo:size padding |
|
1163 |
"/ - copyTo:(size min:N) |
|
1164 |
"/ - asUppercase |
|
1165 |
"/ - asLowercase |
|
4141 | 1166 |
"/ - withoutSeparators remove whiteSpace |
1167 |
"/ - asCollectionOfWords words |
|
3752 | 1168 |
|
1169 |
"/ makes everything bold |
|
1170 |
"/ |
|
1171 |
"/ line allBold |
|
1172 |
||
4141 | 1173 |
"/ first word only |
1174 |
"/ |
|
1175 |
"/ line withoutSeparators asCollectionOfWords first |
|
1176 |
||
3752 | 1177 |
"/ dummy filter (keeps all lines as-is) |
1178 |
"/ |
|
1179 |
line |
|
1180 |
] |
|
1181 |
'. |
|
1182 |
filterBlock := self askForFilterBlock:'Processing block:' |
|
1183 |
template:template |
|
1184 |
rememberIn:#LastProcessingBlockString. |
|
1185 |
filterBlock isNil ifTrue:[^ self]. |
|
1186 |
||
1187 |
oldList := self selectedWorkspacesTextView list. |
|
1188 |
oldList := oldList collect:[:lineOrNil | lineOrNil ? '']. |
|
4141 | 1189 |
newList := oldList collect:[:line | |newLine| |
1190 |
newLine := line. |
|
1191 |
Error handle:[:ex | |
|
1192 |
] do:[ |
|
1193 |
newLine := filterBlock value:line |
|
1194 |
]. |
|
1195 |
newLine |
|
1196 |
]. |
|
3752 | 1197 |
newList := newList collect:[:line | (line isString and:[line size == 0]) ifTrue:[nil] ifFalse:[line]]. |
1198 |
||
1199 |
flags := (1 to:oldList size) collect:[:i | (oldList at:i) ~= (newList at:i)]. |
|
1200 |
flags := flags select:[:flag | flag]. |
|
1201 |
nChanged := flags size. |
|
1202 |
nChanged == 0 ifTrue:[ |
|
1203 |
self information:'No lines were changed.'. |
|
1204 |
^ self |
|
1205 |
]. |
|
1206 |
||
1207 |
answer := Dialog confirmWithCancel:(resources |
|
1208 |
string:'%1 lines changed. Change text ?' |
|
1209 |
with:nChanged) |
|
1210 |
labels:#( 'Cancel' 'No, Show Changed' 'Yes'). |
|
1211 |
answer isNil ifTrue:[^ self]. |
|
1212 |
answer ifFalse:[ |
|
1213 |
changedLines := (1 to:oldList size) select:[:i | (oldList at:i) ~= (newList at:i)]. |
|
1214 |
changedLines := changedLines collect:[:i | (newList at:i)]. |
|
1215 |
TextBox openOn:(changedLines asStringCollection) title:'Changed lines'. |
|
1216 |
^ self. |
|
1217 |
]. |
|
1218 |
||
1219 |
self selectedWorkspacesTextView list:newList. |
|
1220 |
! |
|
1221 |
||
4136 | 1222 |
redoLastDoIt |
4267 | 1223 |
|s| |
4136 | 1224 |
|
4267 | 1225 |
s := self lastDoItsString. |
1226 |
s notNil ifTrue:[ |
|
1227 |
self pasteAndExecute:s |
|
1228 |
] |
|
4136 | 1229 |
! |
1230 |
||
3722 | 1231 |
removeAllWorkspaceVariables |
5846 | 1232 |
(Dialog confirm:(resources string:'Do you really want to remove all Workspace Variables ?')) |
3722 | 1233 |
ifTrue:[ |
1234 |
Workspace removeAllWorkspaceVariables |
|
1235 |
]. |
|
1236 |
! |
|
1237 |
||
4284 | 1238 |
removeGlobalVariable |
1239 |
|name nameKey selection value| |
|
1240 |
||
1241 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
1242 |
||
1243 |
name := Dialog |
|
1244 |
request:'Remove Global Variable:' |
|
1245 |
initialAnswer:(selection asString string) |
|
1246 |
okLabel:'Remove' |
|
1247 |
title:'Remove Global'. |
|
1248 |
||
1249 |
name size == 0 ifTrue:[^ self]. |
|
1250 |
nameKey := name asSymbolIfInterned. |
|
1251 |
nameKey isNil ifTrue:[^ self]. |
|
1252 |
||
1253 |
(Smalltalk includesKey:nameKey) ifFalse:[ |
|
1254 |
self warn:('No such Global Binding: ''%1''.' bindWith:name). |
|
1255 |
^ self. |
|
1256 |
]. |
|
1257 |
||
1258 |
value := Smalltalk at:nameKey. |
|
1259 |
value notNil ifTrue:[ |
|
1260 |
(self confirm:('Global ''%1'' is currently bound to %2\\Remove Binding ?' bindWith:name with:value) withCRs) |
|
1261 |
ifFalse:[ |
|
1262 |
^ self. |
|
1263 |
]. |
|
1264 |
]. |
|
1265 |
Smalltalk at:nameKey put:nil. |
|
1266 |
Smalltalk removeKey:nameKey |
|
1267 |
! |
|
1268 |
||
3722 | 1269 |
removeWorkspaceVariable |
6266 | 1270 |
|name selection wsVarNames| |
3812 | 1271 |
|
6266 | 1272 |
wsVarNames := Workspace workspaceVariableNames. |
1273 |
wsVarNames isEmpty ifTrue:[ |
|
3812 | 1274 |
Dialog information:'No Workspace Variables are defined'. |
1275 |
^ self |
|
1276 |
]. |
|
3722 | 1277 |
|
1278 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
1279 |
||
1280 |
name := Dialog |
|
1281 |
request:'Variable to remove:' |
|
1282 |
initialAnswer:(selection asString string) |
|
1283 |
okLabel:'Remove' |
|
1284 |
title:'Enter Variable Name' |
|
6266 | 1285 |
list:(wsVarNames asOrderedCollection sort). |
1286 |
name isEmptyOrNil ifTrue:[ |
|
3722 | 1287 |
^ self |
1288 |
]. |
|
1289 |
Workspace removeWorkspaceVariable:name. |
|
6266 | 1290 |
|
1291 |
"Modified: / 20-04-2005 / 11:56:28 / cg" |
|
3722 | 1292 |
! |
1293 |
||
3384 | 1294 |
spyOnIt |
1295 |
self selectedWorkspacesTextView spyOnIt |
|
1296 |
! |
|
1297 |
||
1298 |
timeIt |
|
1299 |
self selectedWorkspacesTextView timeIt |
|
3154 | 1300 |
! ! |
1301 |
||
4790 | 1302 |
!WorkspaceApplication methodsFor:'menu-actions-editing'! |
1303 |
||
1304 |
babelFishTranslate:fromToModeString |
|
1305 |
"translate the selected text and paste it after the selection" |
|
1306 |
||
1307 |
self selectedWorkspace babelFishTranslate:fromToModeString |
|
1308 |
! |
|
1309 |
||
5261 | 1310 |
fileInText |
1311 |
self selectedWorkspacesTextView contentsAsString readStream fileIn |
|
1312 |
! |
|
1313 |
||
4790 | 1314 |
filterText |
1315 |
|template filterBlock newList oldList answer nDeleted deletedLines| |
|
1316 |
||
1317 |
template := |
|
1318 |
'"/ general text filter; |
|
1319 |
"/ the following block should evaluate to true for all lines |
|
1320 |
"/ you want to keep - lines for which the block returns false will be removed. |
|
1321 |
"/ Beginner warning: Smalltalk know-how is useful here. |
|
1322 |
||
1323 |
[:line | |
|
1324 |
"/ any condition on line. |
|
1325 |
"/ Notice, that line might be a Text object (i.e. non-string), |
|
1326 |
"/ so you may want to use line string. |
|
1327 |
"/ |
|
1328 |
"/ Useful queries on the line are: |
|
1329 |
"/ - size the length of the line |
|
1330 |
"/ - hasChangeOfEmphasis any bold, italic etc. |
|
1331 |
"/ - startsWith:someString |
|
1332 |
"/ - endsWith:someString |
|
1333 |
||
1334 |
"/ example filter (removes all empty lines) |
|
1335 |
"/ |
|
1336 |
"/ line size > 0 |
|
1337 |
||
1338 |
"/ example filter (removes all lines which do not end with some suffix) |
|
1339 |
"/ |
|
1340 |
"/ (line asLowercase endsWith:''foo'') not |
|
1341 |
||
1342 |
"/ dummy filter (keeps all lines) |
|
1343 |
"/ |
|
1344 |
true |
|
1345 |
] |
|
1346 |
'. |
|
1347 |
||
1348 |
filterBlock := self askForFilterBlock:'Filter block:' |
|
1349 |
template:template |
|
1350 |
rememberIn:#LastFilterBlockString. |
|
1351 |
filterBlock isNil ifTrue:[^ self]. |
|
1352 |
||
1353 |
oldList := self selectedWorkspacesTextView list. |
|
1354 |
oldList := oldList collect:[:lineOrNil | lineOrNil ? '']. |
|
1355 |
newList := oldList select:filterBlock. |
|
1356 |
newList := newList collect:[:line | (line isString and:[line size == 0]) ifTrue:[nil] ifFalse:[line]]. |
|
1357 |
nDeleted := oldList size - newList size. |
|
1358 |
nDeleted == 0 ifTrue:[ |
|
1359 |
self information:'No lines were deleted.'. |
|
1360 |
^ self |
|
1361 |
]. |
|
1362 |
||
1363 |
answer := Dialog confirmWithCancel:(resources |
|
1364 |
string:'%1 lines remain (%2 deleted). Change text ?' |
|
1365 |
with:newList size |
|
1366 |
with:nDeleted) |
|
1367 |
labels:#( 'Cancel' 'No, Show Deleted' 'Yes'). |
|
1368 |
answer isNil ifTrue:[^ self]. |
|
1369 |
answer ifFalse:[ |
|
1370 |
deletedLines := oldList reject:filterBlock. |
|
1371 |
TextBox openOn:(deletedLines asStringCollection) title:'Filtered lines'. |
|
1372 |
^ self. |
|
1373 |
]. |
|
1374 |
||
1375 |
self selectedWorkspacesTextView list:newList. |
|
1376 |
! |
|
1377 |
||
1378 |
googleSpellingSuggestion |
|
1379 |
self selectedWorkspacesTextView googleSpellingSuggestion |
|
1380 |
! |
|
1381 |
||
1382 |
pasteLastDoIt |
|
1383 |
|s| |
|
1384 |
||
1385 |
s := self lastDoItsString. |
|
1386 |
s notNil ifTrue:[ |
|
1387 |
self paste:s |
|
1388 |
] |
|
1389 |
! ! |
|
1390 |
||
4136 | 1391 |
!WorkspaceApplication methodsFor:'menu-dynamic'! |
1392 |
||
4267 | 1393 |
pasteRecentDoItMenu |
1394 |
<resource: #programMenu > |
|
1395 |
||
1396 |
^ self recentDoItsMenuFor:#'paste:' |
|
1397 |
! |
|
1398 |
||
1399 |
recentDoItsMenuFor:aSelector |
|
4136 | 1400 |
<resource: #programMenu > |
1401 |
||
1402 |
^ [ |
|
1403 |
|doIts m classHistory currentClass| |
|
1404 |
||
1405 |
doIts := Workspace doItHistory. |
|
1406 |
doIts size > 0 ifTrue:[ |
|
1407 |
m := Menu new. |
|
1408 |
doIts do:[:doItEntry | |
|
1409 |
|lines label item| |
|
1410 |
||
1411 |
label := doItEntry withoutLeadingSeparators asStringCollection first. |
|
1412 |
(label size > 20) ifTrue:[ |
|
1413 |
label := (label contractTo:20) |
|
1414 |
] ifFalse:[ |
|
1415 |
(lines size > 1) ifTrue:[ |
|
1416 |
label := label , '...' |
|
1417 |
]. |
|
1418 |
]. |
|
1419 |
label := '''' , label , ''''. |
|
1420 |
||
1421 |
item := MenuItem label:label. |
|
1422 |
m addItem:item. |
|
4267 | 1423 |
item value:aSelector. |
4136 | 1424 |
item argument:doItEntry. |
1425 |
]. |
|
1426 |
m addItem: (MenuItem new label:'-'). |
|
1427 |
m addItem: (MenuItem new |
|
5358 | 1428 |
label: (resources string:'Clear History'); |
4136 | 1429 |
value: #clearHistory; |
1430 |
activeHelpKey: #historyEmptyMenu; |
|
1431 |
translateLabel:true). |
|
1432 |
]. |
|
1433 |
m |
|
1434 |
]. |
|
4267 | 1435 |
! |
1436 |
||
1437 |
redoRecentDoItMenu |
|
1438 |
<resource: #programMenu > |
|
1439 |
||
1440 |
^ self recentDoItsMenuFor:#'pasteAndExecute:' |
|
4136 | 1441 |
! ! |
1442 |
||
3154 | 1443 |
!WorkspaceApplication methodsFor:'private'! |
1444 |
||
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1445 |
askIfAnyModified:question yesButton:yesButtonText |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1446 |
(workspaces contains:[:aView | self isModifiedWorkspace:aView]) ifFalse:[^ true]. |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1447 |
|
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1448 |
(Dialog |
6353 | 1449 |
confirm:(resources stringWithCRs:question) |
6636 | 1450 |
yesLabel:(resources string:yesButtonText) |
1451 |
noLabel:(resources string:'Cancel')) |
|
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1452 |
ifTrue:[ |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1453 |
"/ reset modified flag so question is asked only once |
6045 | 1454 |
workspaces |
1455 |
select:[:aView | (self isModifiedWorkspace:aView)] |
|
1456 |
thenDo:[:eachModifiedTextView | |
|
1457 |
eachModifiedTextView modified:false. |
|
1458 |
]. |
|
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1459 |
^ true |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1460 |
]. |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1461 |
^ false |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1462 |
! |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1463 |
|
5852 | 1464 |
compilerClassForSyntaxName:syntax |
1465 |
syntax == #Smalltalk ifTrue:[ |
|
1466 |
^ Compiler |
|
1467 |
]. |
|
1468 |
syntax == #JavaScript ifTrue:[ |
|
1469 |
^ JavaScriptCompiler |
|
1470 |
]. |
|
1471 |
^ Compiler |
|
1472 |
! |
|
1473 |
||
6699 | 1474 |
createEvaluationWorkspace |
1475 |
|ws l box resultView environmentView panel workspaceVariables| |
|
1476 |
||
1477 |
workspaceVariables := Workspace workspaceVariables. |
|
1478 |
||
1479 |
panel := VariableVerticalPanel new. |
|
1480 |
||
1481 |
box := View new. |
|
1482 |
l := Label new. |
|
1483 |
l label:'Eval:'. |
|
1484 |
l layout:((0.0@0.0 corner:1.0@0.0) asLayout bottomOffset:22). |
|
1485 |
l adjust:#left. |
|
1486 |
box add:l. |
|
1487 |
||
1488 |
ws := HVScrollableView for:Workspace. |
|
1489 |
ws autoDefineVariables:#workspace. |
|
1490 |
ws layout:((0.0@0.0 corner:1.0@1.0) asLayout topOffset:22). |
|
1491 |
box add:ws. |
|
1492 |
panel add:box. |
|
1493 |
||
1494 |
box := View new. |
|
1495 |
box add:(Label new label:'Value:'; adjust:#left; layout:((0.0@0.0 corner:1.0@0.0) asLayout bottomOffset:22)). |
|
1496 |
resultView := HVScrollableView for:TextCollector. |
|
1497 |
box add:(resultView layout:((0@0 corner:1.0@1.0) asLayout topOffset:22); yourself). |
|
1498 |
||
1499 |
panel add:box. |
|
1500 |
||
1501 |
box := View new. |
|
1502 |
box add:(Label new label:'Environment:'; adjust:#left; layout:((0.0@0.0 corner:1.0@0.0) asLayout bottomOffset:22)). |
|
1503 |
environmentView := DictionaryInspectorView new. |
|
1504 |
environmentView suppressPseudoSlots:true. |
|
1505 |
environmentView inspect:workspaceVariables. |
|
1506 |
environmentView dereferenceValueHolders:true. |
|
1507 |
environmentView fieldListLabel:'Variable'. |
|
1508 |
box add:(environmentView layout:((0@0 corner:1.0@1.0) asLayout topOffset:22); yourself). |
|
1509 |
||
1510 |
panel add:box. |
|
1511 |
||
1512 |
"/ self renameWorkspace:(self selectedWorkspaceIndexHolder value) to:'Eval'. |
|
1513 |
||
1514 |
ws doItAction:[:theCode | |
|
1515 |
|result| |
|
1516 |
||
1517 |
result := ws executeDoIt:theCode. |
|
1518 |
resultView showCR:(result storeString). |
|
1519 |
9 to:2 by:-1 do:[:h| |
|
1520 |
(workspaceVariables includesKey:('$%1' bindWith:h-1)) ifTrue:[ |
|
1521 |
workspaceVariables |
|
1522 |
at:('$%1' bindWith:h) |
|
1523 |
put:(workspaceVariables at:('$%1' bindWith:h-1)). |
|
1524 |
]. |
|
1525 |
]. |
|
1526 |
(workspaceVariables includesKey:'$') ifTrue:[ |
|
1527 |
workspaceVariables at:'$1' put:(workspaceVariables at:'$'). |
|
1528 |
]. |
|
1529 |
workspaceVariables at:'$' put:result. |
|
1530 |
environmentView doUpdate. |
|
1531 |
result. |
|
1532 |
]. |
|
1533 |
||
1534 |
^ panel |
|
1535 |
! |
|
1536 |
||
5295
e3c5a7b20d9d
refactored (added abstract superclass)
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
1537 |
createWorkspace |
5547
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
1538 |
|ws| |
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
1539 |
|
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
1540 |
ws := (HVScrollableView for:Workspace). |
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
1541 |
ws autoDefineVariables:autoDefineVariables. |
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
1542 |
^ ws |
3193 | 1543 |
! |
1544 |
||
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1545 |
isModifiedWorkspace:aView |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1546 |
|view| |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1547 |
|
4267 | 1548 |
view := self workspaceViewOfView:aView. |
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1549 |
|
4313 | 1550 |
(view isNil |
1551 |
or:[view modified not |
|
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1552 |
or:[view contentsWasSaved |
4313 | 1553 |
or:[view contents withoutSeparators isEmpty]]]) ifTrue:[ |
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1554 |
^ false |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1555 |
]. |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1556 |
^ true |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1557 |
! |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1558 |
|
4267 | 1559 |
lastDoItsString |
1560 |
|history| |
|
3198 | 1561 |
|
4267 | 1562 |
history := Workspace doItHistory. |
1563 |
history size > 0 ifFalse:[ |
|
1564 |
self selectedWorkspacesTextView flash. |
|
1565 |
^ nil |
|
3198 | 1566 |
]. |
4267 | 1567 |
^ history first |
5852 | 1568 |
! |
1569 |
||
1570 |
syntaxNameForCompilerClass:aClass |
|
1571 |
aClass == Compiler ifTrue:[ |
|
1572 |
^ #Smalltalk |
|
1573 |
]. |
|
1574 |
aClass == JavaScriptCompiler ifTrue:[ |
|
1575 |
^ #JavaScript |
|
1576 |
]. |
|
1577 |
^ #Smalltalk |
|
1578 |
! |
|
1579 |
||
1580 |
workspaceSelectionChanged |
|
5855 | 1581 |
|compilerClass selectedWorkspace| |
5852 | 1582 |
|
1583 |
super workspaceSelectionChanged. |
|
5855 | 1584 |
selectedWorkspace := self selectedWorkspace. |
6421 | 1585 |
|
1586 |
compilerClass := (selectedWorkspace or:[(selectedWorkspace isKindOf:Workspace) not]) |
|
1587 |
ifTrue:[Compiler] |
|
1588 |
ifFalse:[selectedWorkspace compilerClass]. |
|
5852 | 1589 |
self syntaxHolder setValue:(self syntaxNameForCompilerClass:compilerClass). |
3154 | 1590 |
! ! |
1591 |
||
1592 |
!WorkspaceApplication class methodsFor:'documentation'! |
|
1593 |
||
1594 |
version |
|
6699 | 1595 |
^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.112 2006-03-16 08:21:22 cg Exp $' |
3154 | 1596 |
! ! |