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