author | Stefan Vogel <sv@exept.de> |
Fri, 06 Feb 2004 18:56:34 +0100 | |
changeset 5490 | 722da73f31ed |
parent 5358 | b122ec142dba |
child 5547 | 65af7af97085 |
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 |
5295
e3c5a7b20d9d
refactored (added abstract superclass)
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
16 |
instanceVariableNames:'autoDefineWorkspaceVariables autoDefineVariables' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
17 |
classVariableNames:'LastFilterBlockString LastProcessingBlockString' |
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 |
^ |
|
65 |
#(#FullSpec |
|
66 |
#name: #windowSpec |
|
67 |
#window: |
|
68 |
#(#WindowSpec |
|
69 |
#label: 'Workspace' |
|
70 |
#name: 'Workspace' |
|
71 |
#min: #(#Point 10 10) |
|
3845 | 72 |
#bounds: #(#Rectangle 13 23 445 264) |
3154 | 73 |
#menu: #mainMenu |
74 |
) |
|
75 |
#component: |
|
76 |
#(#SpecCollection |
|
77 |
#collection: #( |
|
3193 | 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 |
#canvas: #workspaceHolder |
|
86 |
#canvasInset: 0 |
|
87 |
#canvasFrameLevel: 0 |
|
88 |
#keepCanvasAlive: true |
|
4369 | 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 |
^ |
|
114 |
#(#Menu |
|
115 |
#( |
|
116 |
#(#MenuItem |
|
117 |
#label: 'File' |
|
118 |
#translateLabel: true |
|
119 |
#submenu: |
|
120 |
#(#Menu |
|
121 |
#( |
|
122 |
#(#MenuItem |
|
3651 | 123 |
#label: 'New Workspace' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
124 |
#itemValue: #newWorkspace |
3154 | 125 |
#translateLabel: true |
3651 | 126 |
) |
127 |
#(#MenuItem |
|
128 |
#label: 'New SystemWorkspace' |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
129 |
#itemValue: #newSystemWorkspace |
3651 | 130 |
#translateLabel: true |
3154 | 131 |
) |
132 |
#(#MenuItem |
|
133 |
#label: '-' |
|
134 |
) |
|
135 |
#(#MenuItem |
|
136 |
#label: 'Load File...' |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
137 |
#itemValue: #menuLoad |
3154 | 138 |
#translateLabel: true |
139 |
) |
|
140 |
#(#MenuItem |
|
141 |
#label: '-' |
|
142 |
) |
|
143 |
#(#MenuItem |
|
144 |
#label: 'Save As...' |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
145 |
#itemValue: #menuSaveAs |
3154 | 146 |
#translateLabel: true |
147 |
) |
|
148 |
#(#MenuItem |
|
4474 | 149 |
#enabled: #hasMultipleBuffersHolder |
4267 | 150 |
#label: 'Save all As...' |
151 |
#itemValue: #menuSaveAllAs |
|
152 |
#translateLabel: true |
|
153 |
) |
|
154 |
#(#MenuItem |
|
3154 | 155 |
#label: '-' |
156 |
) |
|
157 |
#(#MenuItem |
|
158 |
#label: 'Exit' |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
159 |
#itemValue: #closeRequest |
3154 | 160 |
#translateLabel: true |
161 |
) |
|
162 |
) |
|
163 |
nil |
|
164 |
nil |
|
165 |
) |
|
166 |
) |
|
167 |
#(#MenuItem |
|
3736 | 168 |
#label: 'Buffers' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
169 |
#nameKey: #Buffer |
3193 | 170 |
#translateLabel: true |
171 |
#submenu: |
|
172 |
#(#Menu |
|
173 |
#( |
|
174 |
#(#MenuItem |
|
3222 | 175 |
#label: 'Add Buffer' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
176 |
#itemValue: #addWorkspace |
3193 | 177 |
#translateLabel: true |
178 |
) |
|
179 |
#(#MenuItem |
|
4098 | 180 |
#enabled: #anyWorkspaceVariableIsDefined |
181 |
#label: 'Add Buffer on Workspace Variables' |
|
182 |
#itemValue: #addWorkspaceVariableInspector |
|
183 |
#translateLabel: true |
|
184 |
) |
|
185 |
#(#MenuItem |
|
4099 | 186 |
#label: 'Add Buffer on Global Variables' |
187 |
#itemValue: #addGlobalVariableInspector |
|
188 |
#translateLabel: true |
|
189 |
) |
|
190 |
#(#MenuItem |
|
3193 | 191 |
#label: 'Rename...' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
192 |
#itemValue: #renameWorkspace |
3193 | 193 |
#translateLabel: true |
194 |
) |
|
195 |
#(#MenuItem |
|
196 |
#label: '-' |
|
197 |
) |
|
198 |
#(#MenuItem |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
199 |
#enabled: #canRemoveWorkspace |
3222 | 200 |
#label: 'Remove Buffer' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
201 |
#itemValue: #removeWorkspace |
3193 | 202 |
#translateLabel: true |
203 |
) |
|
204 |
) |
|
205 |
nil |
|
206 |
nil |
|
207 |
) |
|
208 |
) |
|
209 |
#(#MenuItem |
|
3154 | 210 |
#label: 'Edit' |
211 |
#translateLabel: true |
|
212 |
#submenu: |
|
213 |
#(#Menu |
|
214 |
#( |
|
215 |
#(#MenuItem |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
216 |
#enabled: #hasSelectionInActiveWorkspace |
4591
083328c16498
editMenu: order is cut-copy-paste (as in windows)
Claus Gittinger <cg@exept.de>
parents:
4542
diff
changeset
|
217 |
#label: 'Cut' |
083328c16498
editMenu: order is cut-copy-paste (as in windows)
Claus Gittinger <cg@exept.de>
parents:
4542
diff
changeset
|
218 |
#itemValue: #cutSelection |
3154 | 219 |
#translateLabel: true |
220 |
) |
|
221 |
#(#MenuItem |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
222 |
#enabled: #hasSelectionInActiveWorkspace |
4591
083328c16498
editMenu: order is cut-copy-paste (as in windows)
Claus Gittinger <cg@exept.de>
parents:
4542
diff
changeset
|
223 |
#label: 'Copy' |
083328c16498
editMenu: order is cut-copy-paste (as in windows)
Claus Gittinger <cg@exept.de>
parents:
4542
diff
changeset
|
224 |
#itemValue: #copySelection |
3154 | 225 |
#translateLabel: true |
226 |
) |
|
227 |
#(#MenuItem |
|
228 |
#label: 'Paste' |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
229 |
#itemValue: #paste |
3154 | 230 |
#translateLabel: true |
231 |
) |
|
3752 | 232 |
#(#MenuItem |
4790 | 233 |
#enabled: #hasHistory |
234 |
#label: 'Paste Last' |
|
235 |
#itemValue: #pasteLastDoIt |
|
236 |
#translateLabel: true |
|
237 |
#submenuChannel: #pasteRecentDoItMenu |
|
238 |
) |
|
239 |
#(#MenuItem |
|
240 |
#label: '-' |
|
241 |
) |
|
242 |
#(#MenuItem |
|
243 |
#label: 'Select All' |
|
244 |
#itemValue: #selectAll |
|
245 |
#translateLabel: true |
|
246 |
) |
|
247 |
#(#MenuItem |
|
3752 | 248 |
#label: '-' |
249 |
) |
|
250 |
#(#MenuItem |
|
251 |
#label: 'Filter Text...' |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
252 |
#itemValue: #filterText |
3752 | 253 |
#translateLabel: true |
254 |
) |
|
255 |
#(#MenuItem |
|
256 |
#label: 'Process Text...' |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
257 |
#itemValue: #processText |
3752 | 258 |
#translateLabel: true |
259 |
) |
|
4136 | 260 |
#(#MenuItem |
5261 | 261 |
#label: '-' |
262 |
) |
|
263 |
#(#MenuItem |
|
4829 | 264 |
#label: 'Web Services' |
4480 | 265 |
#translateLabel: true |
266 |
#submenu: |
|
267 |
#(#Menu |
|
268 |
#( |
|
269 |
#(#MenuItem |
|
270 |
#enabled: #hasSelectionInActiveWorkspace |
|
271 |
#label: 'Google Spell' |
|
272 |
#itemValue: #googleSpellingSuggestion |
|
273 |
#translateLabel: true |
|
274 |
) |
|
275 |
#(#MenuItem |
|
276 |
#label: 'Translate' |
|
277 |
#translateLabel: true |
|
278 |
#submenu: |
|
279 |
#(#Menu |
|
280 |
#( |
|
281 |
#(#MenuItem |
|
282 |
#enabled: #hasSelectionInActiveWorkspace |
|
283 |
#label: 'English -> German' |
|
284 |
#itemValue: #babelFishTranslate: |
|
285 |
#translateLabel: true |
|
286 |
#argument: 'en_de' |
|
287 |
) |
|
288 |
#(#MenuItem |
|
289 |
#enabled: #hasSelectionInActiveWorkspace |
|
290 |
#label: 'English -> French' |
|
291 |
#itemValue: #babelFishTranslate: |
|
292 |
#translateLabel: true |
|
293 |
#argument: 'en_fr' |
|
294 |
) |
|
295 |
#(#MenuItem |
|
296 |
#enabled: #hasSelectionInActiveWorkspace |
|
297 |
#label: 'English -> Spanish' |
|
298 |
#itemValue: #babelFishTranslate: |
|
299 |
#translateLabel: true |
|
300 |
#argument: 'en_es' |
|
301 |
) |
|
302 |
#(#MenuItem |
|
303 |
#enabled: #hasSelectionInActiveWorkspace |
|
304 |
#label: 'English -> Portuguese' |
|
305 |
#itemValue: #babelFishTranslate: |
|
306 |
#translateLabel: true |
|
307 |
#argument: 'en_pt' |
|
308 |
) |
|
309 |
#(#MenuItem |
|
310 |
#label: '-' |
|
311 |
) |
|
312 |
#(#MenuItem |
|
313 |
#enabled: #hasSelectionInActiveWorkspace |
|
314 |
#label: 'German -> English' |
|
315 |
#itemValue: #babelFishTranslate: |
|
316 |
#translateLabel: true |
|
317 |
#argument: 'de_en' |
|
318 |
) |
|
319 |
#(#MenuItem |
|
320 |
#enabled: #hasSelectionInActiveWorkspace |
|
321 |
#label: 'French -> English' |
|
322 |
#itemValue: #babelFishTranslate: |
|
323 |
#translateLabel: true |
|
324 |
#argument: 'fr_en' |
|
325 |
) |
|
326 |
#(#MenuItem |
|
327 |
#enabled: #hasSelectionInActiveWorkspace |
|
328 |
#label: 'Spanish -> English' |
|
329 |
#itemValue: #babelFishTranslate: |
|
330 |
#translateLabel: true |
|
331 |
#argument: 'es_en' |
|
332 |
) |
|
333 |
#(#MenuItem |
|
334 |
#enabled: #hasSelectionInActiveWorkspace |
|
335 |
#label: 'Portuguese -> English' |
|
336 |
#itemValue: #babelFishTranslate: |
|
337 |
#translateLabel: true |
|
338 |
#argument: 'pt_en' |
|
339 |
) |
|
340 |
#(#MenuItem |
|
341 |
#enabled: #hasSelectionInActiveWorkspace |
|
342 |
#label: 'Russian -> English' |
|
343 |
#itemValue: #babelFishTranslate: |
|
344 |
#translateLabel: true |
|
345 |
#argument: 'ru_en' |
|
346 |
) |
|
347 |
) |
|
348 |
nil |
|
349 |
nil |
|
350 |
) |
|
351 |
) |
|
352 |
) |
|
353 |
nil |
|
354 |
nil |
|
355 |
) |
|
356 |
) |
|
3154 | 357 |
) |
358 |
nil |
|
359 |
nil |
|
360 |
) |
|
361 |
) |
|
362 |
#(#MenuItem |
|
3722 | 363 |
#label: 'Workspace' |
364 |
#translateLabel: true |
|
365 |
#submenu: |
|
366 |
#(#Menu |
|
367 |
#( |
|
368 |
#(#MenuItem |
|
369 |
#label: 'Add Workspace Variable...' |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
370 |
#itemValue: #addWorkspaceVariable |
3722 | 371 |
#translateLabel: true |
372 |
) |
|
373 |
#(#MenuItem |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
374 |
#enabled: #anyWorkspaceVariableIsDefined |
3722 | 375 |
#label: 'Remove Workspace Variable...' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
376 |
#itemValue: #removeWorkspaceVariable |
3722 | 377 |
#translateLabel: true |
378 |
) |
|
379 |
#(#MenuItem |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
380 |
#enabled: #anyWorkspaceVariableIsDefined |
4267 | 381 |
#label: 'Remove all Workspace Variables...' |
382 |
#itemValue: #removeAllWorkspaceVariables |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
383 |
#translateLabel: true |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
384 |
) |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
385 |
#(#MenuItem |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
386 |
#label: '-' |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
387 |
) |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
388 |
#(#MenuItem |
3812 | 389 |
#enabled: #anyWorkspaceVariableIsDefined |
4267 | 390 |
#label: 'Inspect Workspace Variables' |
391 |
#itemValue: #inspectWorkspaceVariables |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
392 |
#translateLabel: true |
3722 | 393 |
) |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
394 |
#(#MenuItem |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
395 |
#label: '-' |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
396 |
) |
3722 | 397 |
#(#MenuItem |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
398 |
#label: 'Settings' |
3722 | 399 |
#translateLabel: true |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
400 |
#submenu: |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
401 |
#(#Menu |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
402 |
#( |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
403 |
#(#MenuItem |
4474 | 404 |
#label: 'Autodefine as Workspace Variable' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
405 |
#translateLabel: true |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
406 |
#hideMenuOnActivated: false |
4474 | 407 |
#choice: #autoDefineVariables |
408 |
#choiceValue: #workspace |
|
409 |
) |
|
410 |
#(#MenuItem |
|
411 |
#label: 'Autodefine as DoIt Variable' |
|
412 |
#translateLabel: true |
|
413 |
#hideMenuOnActivated: false |
|
414 |
#choice: #autoDefineVariables |
|
415 |
#choiceValue: #doIt |
|
416 |
) |
|
417 |
#(#MenuItem |
|
418 |
#label: 'Autodefine off' |
|
419 |
#translateLabel: true |
|
420 |
#hideMenuOnActivated: false |
|
421 |
#choice: #autoDefineVariables |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
422 |
) |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
423 |
) |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
424 |
nil |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
425 |
nil |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
426 |
) |
3722 | 427 |
) |
428 |
) |
|
429 |
nil |
|
430 |
nil |
|
431 |
) |
|
432 |
) |
|
433 |
#(#MenuItem |
|
3154 | 434 |
#label: 'Smalltalk' |
435 |
#translateLabel: true |
|
436 |
#submenu: |
|
437 |
#(#Menu |
|
438 |
#( |
|
439 |
#(#MenuItem |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
440 |
#enabled: #hasSelectionInActiveWorkspace |
3154 | 441 |
#label: 'DoIt' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
442 |
#itemValue: #doIt |
3154 | 443 |
#translateLabel: true |
444 |
) |
|
445 |
#(#MenuItem |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
446 |
#enabled: #hasSelectionInActiveWorkspace |
3154 | 447 |
#label: 'PrintIt' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
448 |
#itemValue: #printIt |
3154 | 449 |
#translateLabel: true |
450 |
) |
|
451 |
#(#MenuItem |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
452 |
#enabled: #hasSelectionInActiveWorkspace |
3154 | 453 |
#label: 'InspectIt' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
454 |
#itemValue: #inspectIt |
3154 | 455 |
#translateLabel: true |
456 |
) |
|
457 |
#(#MenuItem |
|
458 |
#label: '-' |
|
459 |
) |
|
460 |
#(#MenuItem |
|
4790 | 461 |
#enabled: #hasHistory |
462 |
#label: 'Redo Last' |
|
463 |
#itemValue: #redoLastDoIt |
|
464 |
#translateLabel: true |
|
465 |
#submenuChannel: #redoRecentDoItMenu |
|
466 |
) |
|
467 |
#(#MenuItem |
|
468 |
#label: '-' |
|
469 |
) |
|
470 |
#(#MenuItem |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
471 |
#enabled: #hasSelectionInActiveWorkspace |
3384 | 472 |
#label: 'TimeIt' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
473 |
#itemValue: #timeIt |
3384 | 474 |
#translateLabel: true |
475 |
) |
|
476 |
#(#MenuItem |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
477 |
#enabled: #hasSelectionInActiveWorkspace |
3384 | 478 |
#label: 'SpyOnIt' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
479 |
#itemValue: #spyOnIt |
3384 | 480 |
#translateLabel: true |
481 |
) |
|
482 |
#(#MenuItem |
|
483 |
#label: '-' |
|
484 |
) |
|
485 |
#(#MenuItem |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
486 |
#enabled: #hasSelectionInActiveWorkspace |
3383
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
487 |
#label: 'Browse Class' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
488 |
#itemValue: #browseIt |
3154 | 489 |
#translateLabel: true |
490 |
) |
|
3383
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
491 |
#(#MenuItem |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
492 |
#enabled: #hasSelectionInActiveWorkspace |
3710 | 493 |
#label: 'Browse Implementors of It' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
494 |
#itemValue: #browseImplementorsOfIt |
3383
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
495 |
#translateLabel: true |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
496 |
) |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
497 |
#(#MenuItem |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
498 |
#enabled: #hasSelectionInActiveWorkspace |
3710 | 499 |
#label: 'Browse References to It' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
500 |
#itemValue: #browseReferencesToIt |
3383
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
501 |
#translateLabel: true |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
502 |
) |
4154 | 503 |
#(#MenuItem |
504 |
#label: '-' |
|
505 |
) |
|
506 |
#(#MenuItem |
|
5262 | 507 |
#label: 'FileIn Text' |
5261 | 508 |
#itemValue: #fileInText |
509 |
#translateLabel: true |
|
510 |
) |
|
511 |
#(#MenuItem |
|
512 |
#label: '-' |
|
513 |
) |
|
514 |
#(#MenuItem |
|
4154 | 515 |
#label: 'Add Global Variable...' |
4284 | 516 |
#itemValue: #addGlobalVariable |
517 |
#translateLabel: true |
|
518 |
) |
|
519 |
#(#MenuItem |
|
520 |
#label: 'Remove Global Variable...' |
|
521 |
#itemValue: #removeGlobalVariable |
|
4154 | 522 |
#translateLabel: true |
523 |
) |
|
3154 | 524 |
) |
525 |
nil |
|
526 |
nil |
|
527 |
) |
|
528 |
) |
|
529 |
#(#MenuItem |
|
530 |
#label: 'Help' |
|
531 |
#translateLabel: true |
|
532 |
#startGroup: #right |
|
533 |
#submenu: |
|
534 |
#(#Menu |
|
535 |
#( |
|
536 |
#(#MenuItem |
|
537 |
#label: 'Documentation' |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
538 |
#itemValue: #openDocumentation |
3154 | 539 |
#translateLabel: true |
540 |
) |
|
541 |
#(#MenuItem |
|
542 |
#label: '-' |
|
543 |
) |
|
544 |
#(#MenuItem |
|
3282 | 545 |
#label: 'About this Application...' |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
546 |
#itemValue: #openAboutThisApplication |
3154 | 547 |
#translateLabel: true |
548 |
) |
|
549 |
) |
|
550 |
nil |
|
551 |
nil |
|
552 |
) |
|
553 |
) |
|
554 |
) |
|
555 |
nil |
|
556 |
nil |
|
557 |
) |
|
3193 | 558 |
! |
559 |
||
560 |
tabMenu |
|
561 |
"This resource specification was automatically generated |
|
562 |
by the MenuEditor of ST/X." |
|
563 |
||
564 |
"Do not manually edit this!! If it is corrupted, |
|
565 |
the MenuEditor may not be able to read the specification." |
|
566 |
||
567 |
" |
|
568 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#tabMenu |
|
569 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication tabMenu)) startUp |
|
570 |
" |
|
571 |
||
572 |
<resource: #menu> |
|
573 |
||
574 |
^ |
|
575 |
#(#Menu |
|
576 |
#( |
|
577 |
#(#MenuItem |
|
3222 | 578 |
#label: 'Add Buffer' |
3193 | 579 |
#translateLabel: true |
3651 | 580 |
"/ #triggerOnDown: true |
3193 | 581 |
#value: #addWorkspace |
582 |
) |
|
583 |
#(#MenuItem |
|
584 |
#label: 'Rename...' |
|
585 |
#translateLabel: true |
|
3651 | 586 |
"/ #triggerOnDown: true |
3193 | 587 |
#value: #renameWorkspace: |
588 |
) |
|
589 |
#(#MenuItem |
|
590 |
#label: '-' |
|
591 |
) |
|
592 |
#(#MenuItem |
|
3222 | 593 |
#label: 'Remove Buffer' |
3193 | 594 |
#translateLabel: true |
3651 | 595 |
"/ #triggerOnDown: true |
3193 | 596 |
#value: #removeWorkspace: |
597 |
#enabled: #canRemoveWorkspace: |
|
598 |
) |
|
599 |
) |
|
600 |
nil |
|
601 |
nil |
|
602 |
) |
|
3154 | 603 |
! ! |
604 |
||
3332 | 605 |
!WorkspaceApplication class methodsFor:'special startup'! |
606 |
||
607 |
openSystemWorkspace |
|
5490 | 608 |
|wsApp path needRemove| |
3345 | 609 |
|
610 |
needRemove := true. |
|
3332 | 611 |
|
612 |
wsApp := self new. |
|
613 |
wsApp allButOpen. |
|
3337 | 614 |
wsApp window extent:640@400. |
3332 | 615 |
|
3345 | 616 |
path := (Smalltalk getSystemFileName:'README') ? '../../README'. |
5490 | 617 |
path := path asFilename. |
618 |
path isReadable ifTrue:[ |
|
3345 | 619 |
wsApp addWindow:(HVScrollableView for:Workspace) named:'README' asFirst:false. |
620 |
wsApp loadFile:path. |
|
621 |
wsApp removeWorkspace:1. "/ the original Workspace |
|
4183 | 622 |
wsApp renameWorkspace:1 to:'LICENCE README'. |
3345 | 623 |
needRemove := false. |
624 |
]. |
|
3334 | 625 |
|
3346 | 626 |
"/ path := (Smalltalk getSystemFileName:'doc/online/english/LICENCE_STX.html') ? '../../doc/online/english/LICENCE_STX.html'. |
627 |
"/ path asFilename exists ifTrue:[ |
|
628 |
"/ wsApp addWindow:(licenceView := HVScrollableView for:HTMLDocumentView) named:'License' asFirst:false. |
|
629 |
"/ licenceView homeDocument:'../../doc/online/english/LICENCE_STX.html'. |
|
630 |
"/ licenceView updateLabelFlag:false. |
|
631 |
"/ needRemove ifTrue:[wsApp removeWorkspace:1]. "/ the original Workspace |
|
632 |
"/ needRemove := false. |
|
633 |
"/ ]. |
|
3332 | 634 |
|
4985 | 635 |
path := (Smalltalk getSystemFileName:'GettingStarted.wsp'). |
5490 | 636 |
(path notNil and:[path asFilename isReadable]) ifTrue:[ |
4985 | 637 |
wsApp addWindow:(HVScrollableView for:Workspace) named:'Getting Started' asFirst:false. |
638 |
wsApp loadFile:path. |
|
639 |
needRemove ifTrue:[wsApp removeWorkspace:1]. "/ the original Workspace |
|
640 |
needRemove := false. |
|
641 |
]. |
|
642 |
||
3347 | 643 |
path := (Smalltalk getSystemFileName:'Keyboard.wsp'). |
5490 | 644 |
(path notNil and:[path asFilename isReadable]) ifTrue:[ |
3345 | 645 |
wsApp addWindow:(HVScrollableView for:Workspace) named:'Keyboard' asFirst:false. |
646 |
wsApp loadFile:path. |
|
647 |
needRemove ifTrue:[wsApp removeWorkspace:1]. "/ the original Workspace |
|
648 |
needRemove := false. |
|
649 |
]. |
|
3332 | 650 |
|
4183 | 651 |
path := (Smalltalk getSystemFileName:'Setup.wsp'). |
5490 | 652 |
(path notNil and:[path asFilename isReadable]) ifTrue:[ |
4183 | 653 |
wsApp addWindow:(HVScrollableView for:Workspace) named:'Setup' asFirst:false. |
654 |
wsApp loadFile:path. |
|
655 |
needRemove ifTrue:[wsApp removeWorkspace:1]. "/ the original Workspace |
|
656 |
needRemove := false. |
|
657 |
]. |
|
658 |
||
3347 | 659 |
path := (Smalltalk getSystemFileName:'Hello.wsp'). |
5490 | 660 |
(path notNil and:[path asFilename isReadable]) ifTrue:[ |
3345 | 661 |
wsApp addWindow:(HVScrollableView for:Workspace) named:'Welcome' asFirst:false. |
662 |
wsApp loadFile:path. |
|
663 |
needRemove ifTrue:[wsApp removeWorkspace:1]. "/ the original Workspace |
|
664 |
needRemove := false. |
|
665 |
]. |
|
3332 | 666 |
|
667 |
wsApp openWindow |
|
668 |
||
669 |
" |
|
670 |
self openSystemWorkspace |
|
671 |
" |
|
4542 | 672 |
! |
673 |
||
674 |
openWith:initialText |
|
675 |
"launch a new workspace with some initial contents" |
|
676 |
||
5098 | 677 |
^ self openWith:initialText selected:false |
678 |
||
679 |
" |
|
680 |
WorkspaceApplication openWith:'Transcript showCR:''hello world''' |
|
681 |
" |
|
682 |
! |
|
683 |
||
684 |
openWith:initialText selected:selectedBoolean |
|
685 |
"launch a new workspace with some initial contents" |
|
686 |
||
4542 | 687 |
|workspace| |
688 |
||
689 |
workspace := self new. |
|
690 |
workspace open. |
|
5098 | 691 |
workspace selectedWorkspace contents:initialText selected:selectedBoolean. |
4542 | 692 |
^ workspace |
693 |
||
694 |
" |
|
695 |
WorkspaceApplication openWith:'Transcript showCR:''hello world''' |
|
696 |
" |
|
3332 | 697 |
! ! |
698 |
||
3193 | 699 |
!WorkspaceApplication methodsFor:'aspects'! |
700 |
||
4474 | 701 |
autoDefineVariables |
702 |
autoDefineVariables isNil ifTrue:[ |
|
703 |
autoDefineVariables := ValueHolder new. |
|
704 |
(UserPreferences current autoDefineWorkspaceVariables) ifTrue:[ |
|
705 |
autoDefineVariables value:#workspace |
|
706 |
]. |
|
707 |
autoDefineVariables onChangeSend:#autoDefineVariablesChanged to:self. |
|
708 |
]. |
|
709 |
^ autoDefineVariables. |
|
710 |
! |
|
711 |
||
3667 | 712 |
autoDefineWorkspaceVariables |
713 |
"does not work yet - needs more interaction with parser" |
|
714 |
||
715 |
autoDefineWorkspaceVariables isNil ifTrue:[ |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
716 |
autoDefineWorkspaceVariables := UserPreferences current autoDefineWorkspaceVariables asValue. |
3667 | 717 |
autoDefineWorkspaceVariables onChangeSend:#autoDefineWorkspaceVariablesChanged to:self. |
718 |
]. |
|
719 |
^ autoDefineWorkspaceVariables. |
|
720 |
! |
|
721 |
||
4136 | 722 |
hasHistory |
723 |
^ Workspace doItHistory size > 0. |
|
3193 | 724 |
! ! |
725 |
||
4358 | 726 |
!WorkspaceApplication methodsFor:'aspects-queries'! |
3193 | 727 |
|
3812 | 728 |
anyWorkspaceVariableIsDefined |
729 |
^ Workspace workspaceVariables size > 0 |
|
3154 | 730 |
! ! |
731 |
||
732 |
!WorkspaceApplication methodsFor:'initialization & release'! |
|
733 |
||
734 |
closeRequest |
|
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
735 |
(self askIfAnyModified:'Text was not saved. Close anyway ?' yesButton:'Close') ifFalse:[ |
3154 | 736 |
^ self |
737 |
]. |
|
738 |
||
739 |
^ super closeRequest |
|
740 |
! ! |
|
741 |
||
4359 | 742 |
!WorkspaceApplication methodsFor:'menu-actions'! |
3154 | 743 |
|
4154 | 744 |
addGlobalVariable |
745 |
|name nameKey selection| |
|
746 |
||
747 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
748 |
||
749 |
name := Dialog |
|
750 |
request:'Name of new Global Variable:' |
|
751 |
initialAnswer:(selection asString string) |
|
752 |
okLabel:'Add' |
|
753 |
title:'Enter Variable Name'. |
|
754 |
name size == 0 ifTrue:[ |
|
755 |
^ self |
|
756 |
]. |
|
757 |
nameKey := name asSymbol. |
|
758 |
||
4284 | 759 |
(Smalltalk includesKey:nameKey) ifTrue:[ |
4154 | 760 |
self warn:'Global named ''' , name , ''' already exists.'. |
761 |
^ self. |
|
762 |
]. |
|
763 |
Smalltalk at:nameKey put:nil. |
|
764 |
! |
|
765 |
||
4099 | 766 |
addGlobalVariableInspector |
767 |
|v| |
|
768 |
||
769 |
v := self addInspectorOn:(Smalltalk) basic:false suppressPseudoSlots:true. |
|
770 |
v fieldListLabel:'Name'. |
|
4208 | 771 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value) to:'Globals (Smalltalk)'. |
4099 | 772 |
! |
773 |
||
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
774 |
addInspectorOn:aValue basic:isBasicInspector suppressPseudoSlots:suppressPseudoSlots |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
775 |
|view cls resultString| |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
776 |
|
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
777 |
isBasicInspector ifFalse:[ |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
778 |
cls := aValue inspectorClass. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
779 |
]. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
780 |
cls isNil ifTrue:[ |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
781 |
cls := InspectorView |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
782 |
]. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
783 |
view := cls new. |
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
784 |
view suppressPseudoSlots:suppressPseudoSlots. |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
785 |
view inspect:aValue. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
786 |
"/ v allowFollow:true. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
787 |
aValue isBehavior ifTrue:[ |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
788 |
resultString := aValue name |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
789 |
] ifFalse:[ |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
790 |
resultString := aValue classNameWithArticle |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
791 |
]. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
792 |
self addWindow:view named:('Inspecting: ' , resultString). |
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
793 |
^ view |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
794 |
! |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
795 |
|
3196 | 796 |
addWorkspace |
5295
e3c5a7b20d9d
refactored (added abstract superclass)
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
797 |
self addWindow:(self createWorkspace) named:'Workspace%1' |
3196 | 798 |
! |
799 |
||
3722 | 800 |
addWorkspaceVariable |
801 |
|name selection| |
|
802 |
||
803 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
804 |
||
805 |
name := Dialog |
|
806 |
request:'Name of new Workspace Variable:' |
|
807 |
initialAnswer:(selection asString string) |
|
808 |
okLabel:'Add' |
|
809 |
title:'Enter Variable Name'. |
|
810 |
name size == 0 ifTrue:[ |
|
811 |
^ self |
|
812 |
]. |
|
813 |
Workspace addWorkspaceVariable:name. |
|
814 |
! |
|
815 |
||
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
816 |
addWorkspaceVariableInspector |
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
817 |
|v| |
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
818 |
|
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
819 |
v := self addInspectorOn:(Workspace workspaceVariables) basic:false suppressPseudoSlots:true. |
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
820 |
v dereferenceValueHolders:true. |
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
821 |
v fieldListLabel:'Name'. |
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
822 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value) to:'Variables'. |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
823 |
! |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
824 |
|
3752 | 825 |
askForFilterBlock:message template:template rememberIn:nameOfClassVar |
826 |
|filterBlockString filterBlock dialog textHolder classVarValue| |
|
827 |
||
828 |
classVarValue := self class classVarAt:nameOfClassVar ifAbsent:nil. |
|
829 |
classVarValue isNil ifTrue:[ |
|
830 |
self class classVarAt:nameOfClassVar put:template. |
|
831 |
classVarValue := template. |
|
832 |
]. |
|
833 |
||
834 |
textHolder := ValueHolder new. |
|
835 |
dialog := Dialog |
|
836 |
forRequestText:(resources string:message) |
|
837 |
lines:25 |
|
838 |
columns:70 |
|
839 |
initialAnswer:classVarValue |
|
840 |
model:textHolder. |
|
841 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
842 |
dialog open. |
|
843 |
dialog accepted ifFalse:[^ nil]. |
|
844 |
||
845 |
filterBlockString := textHolder value. |
|
846 |
self class classVarAt:nameOfClassVar put:filterBlockString. |
|
847 |
||
848 |
filterBlock := Parser evaluate:filterBlockString. |
|
849 |
filterBlock isBlock ifFalse:[ |
|
5490 | 850 |
self error:'bad input for filterBlock' mayProceed:true. |
3752 | 851 |
^ nil |
852 |
]. |
|
853 |
||
854 |
^ filterBlock |
|
855 |
! |
|
856 |
||
4474 | 857 |
autoDefineVariablesChanged |
858 |
|autoDefine| |
|
859 |
||
860 |
autoDefine := autoDefineVariables value. |
|
861 |
UserPreferences current autoDefineWorkspaceVariables:(autoDefine == #workspace). |
|
862 |
workspaces do:[:each | |
|
863 |
each autoDefineVariables:autoDefine |
|
864 |
]. |
|
865 |
! |
|
866 |
||
3667 | 867 |
autoDefineWorkspaceVariablesChanged |
868 |
"does not work yet - needs more interaction with parser" |
|
869 |
||
870 |
|doAutoDefine| |
|
871 |
||
872 |
doAutoDefine := autoDefineWorkspaceVariables value. |
|
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
873 |
UserPreferences current autoDefineWorkspaceVariables:doAutoDefine. |
3667 | 874 |
workspaces do:[:each | |
875 |
each autoDefineWorkspaceVariables:doAutoDefine |
|
876 |
]. |
|
877 |
! |
|
878 |
||
3198 | 879 |
basicInspectIt |
880 |
self inspectIt:true |
|
881 |
! |
|
882 |
||
3383
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
883 |
browseImplementorsOfIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
884 |
self selectedWorkspacesTextView browseImplementorsOfIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
885 |
! |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
886 |
|
3154 | 887 |
browseIt |
3198 | 888 |
self selectedWorkspacesTextView browseIt |
3154 | 889 |
! |
890 |
||
3383
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
891 |
browseReferencesToIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
892 |
self selectedWorkspacesTextView browseReferencesToIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
893 |
! |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
894 |
|
4136 | 895 |
clearHistory |
896 |
Workspace clearDoItHistory |
|
897 |
! |
|
898 |
||
3154 | 899 |
doIt |
3198 | 900 |
self selectedWorkspacesTextView doIt |
3154 | 901 |
! |
902 |
||
903 |
inspectIt |
|
3198 | 904 |
self inspectIt:false |
905 |
! |
|
906 |
||
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
907 |
inspectIt:isBasicInspector |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
908 |
|ws| |
3196 | 909 |
|
3198 | 910 |
ws := self selectedWorkspacesTextView. |
3196 | 911 |
ws |
912 |
do:(ws selection) |
|
913 |
withValueDo:[:result | |
|
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
914 |
self addInspectorOn:result basic:isBasicInspector suppressPseudoSlots:false |
3196 | 915 |
] |
916 |
||
917 |
"/ self selectedWorkspace inspectIt |
|
3154 | 918 |
! |
919 |
||
3812 | 920 |
inspectWorkspaceVariables |
921 |
|wsvars| |
|
922 |
||
923 |
wsvars := Workspace workspaceVariables. |
|
924 |
wsvars size == 0 ifTrue:[ |
|
925 |
Dialog information:'No Workspace Variables are defined'. |
|
926 |
^ self |
|
927 |
]. |
|
928 |
wsvars inspect |
|
929 |
! |
|
930 |
||
3332 | 931 |
loadFile:aFileName |
932 |
|file ws lbl| |
|
933 |
||
934 |
file := aFileName asFilename. |
|
5490 | 935 |
ws := self selectedWorkspacesTextView. |
936 |
[ |
|
937 |
ws contents:file contents. |
|
938 |
] on:StreamError do:[:ex| |
|
939 |
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
|
940 |
^ self |
13f6e4eaac91
fix #loadFile: check if file exists
Michael Beyl <mb@exept.de>
parents:
5140
diff
changeset
|
941 |
]. |
3332 | 942 |
ws modified:false. |
943 |
||
944 |
lbl := file withoutSuffix baseName. |
|
945 |
tabList size <= 1 ifTrue:[ |
|
946 |
self window label:lbl. |
|
947 |
] ifFalse:[ |
|
948 |
tabList at:self selectedWorkspaceIndexHolder value put:lbl |
|
949 |
] |
|
950 |
! |
|
951 |
||
3154 | 952 |
menuLoad |
3332 | 953 |
|file| |
3154 | 954 |
|
3193 | 955 |
(self askIfModified:'Text was modified. Load anyway ?' yesButton:'Load') ifFalse:[ ^ self]. |
956 |
||
4602
a961c37bd041
better save file dialog (use new dialog vs. use old dialog)
Claus Gittinger <cg@exept.de>
parents:
4591
diff
changeset
|
957 |
file := Dialog requestFileName:'Load file' default:'file.wsp' pattern:'*.wsp'. |
5490 | 958 |
file size ~~ 0 ifTrue:[ |
3332 | 959 |
self loadFile:file |
3154 | 960 |
] |
961 |
! |
|
962 |
||
3334 | 963 |
newSystemWorkspace |
964 |
self class openSystemWorkspace |
|
965 |
! |
|
966 |
||
3154 | 967 |
openDocumentation |
968 |
"opens the documentation file" |
|
969 |
||
970 |
self openHTMLDocument: 'tools/misc/TOP.html#WORKSPACE' |
|
971 |
! |
|
972 |
||
4267 | 973 |
pasteAndExecute:aString |
974 |
self paste:aString. |
|
4136 | 975 |
self printIt |
976 |
! |
|
977 |
||
3154 | 978 |
printIt |
3198 | 979 |
self selectedWorkspacesTextView printIt |
3193 | 980 |
! |
981 |
||
3752 | 982 |
processText |
983 |
|template filterBlock newList oldList answer nChanged changedLines flags| |
|
984 |
||
985 |
template := |
|
986 |
'"/ general text processor; |
|
987 |
"/ the following block should evaluate to a new line, |
|
988 |
"/ given the original line as argument. |
|
989 |
"/ Beginner warning: Smalltalk know-how is useful here. |
|
990 |
||
991 |
[:line | |
|
992 |
"/ any processing on line. |
|
993 |
"/ Notice, that line might be a Text object (i.e. non-string), |
|
994 |
"/ |
|
995 |
"/ Useful operations on the line are: |
|
996 |
"/ - '' .... '' , concatenation of any prefix/suffix |
|
997 |
"/ - leftPaddedTo:size padding |
|
998 |
"/ - rightPaddedTo:size padding |
|
999 |
"/ - copyTo:(size min:N) |
|
1000 |
"/ - asUppercase |
|
1001 |
"/ - asLowercase |
|
4141 | 1002 |
"/ - withoutSeparators remove whiteSpace |
1003 |
"/ - asCollectionOfWords words |
|
3752 | 1004 |
|
1005 |
"/ makes everything bold |
|
1006 |
"/ |
|
1007 |
"/ line allBold |
|
1008 |
||
4141 | 1009 |
"/ first word only |
1010 |
"/ |
|
1011 |
"/ line withoutSeparators asCollectionOfWords first |
|
1012 |
||
3752 | 1013 |
"/ dummy filter (keeps all lines as-is) |
1014 |
"/ |
|
1015 |
line |
|
1016 |
] |
|
1017 |
'. |
|
1018 |
filterBlock := self askForFilterBlock:'Processing block:' |
|
1019 |
template:template |
|
1020 |
rememberIn:#LastProcessingBlockString. |
|
1021 |
filterBlock isNil ifTrue:[^ self]. |
|
1022 |
||
1023 |
oldList := self selectedWorkspacesTextView list. |
|
1024 |
oldList := oldList collect:[:lineOrNil | lineOrNil ? '']. |
|
4141 | 1025 |
newList := oldList collect:[:line | |newLine| |
1026 |
newLine := line. |
|
1027 |
Error handle:[:ex | |
|
1028 |
] do:[ |
|
1029 |
newLine := filterBlock value:line |
|
1030 |
]. |
|
1031 |
newLine |
|
1032 |
]. |
|
3752 | 1033 |
newList := newList collect:[:line | (line isString and:[line size == 0]) ifTrue:[nil] ifFalse:[line]]. |
1034 |
||
1035 |
flags := (1 to:oldList size) collect:[:i | (oldList at:i) ~= (newList at:i)]. |
|
1036 |
flags := flags select:[:flag | flag]. |
|
1037 |
nChanged := flags size. |
|
1038 |
nChanged == 0 ifTrue:[ |
|
1039 |
self information:'No lines were changed.'. |
|
1040 |
^ self |
|
1041 |
]. |
|
1042 |
||
1043 |
answer := Dialog confirmWithCancel:(resources |
|
1044 |
string:'%1 lines changed. Change text ?' |
|
1045 |
with:nChanged) |
|
1046 |
labels:#( 'Cancel' 'No, Show Changed' 'Yes'). |
|
1047 |
answer isNil ifTrue:[^ self]. |
|
1048 |
answer ifFalse:[ |
|
1049 |
changedLines := (1 to:oldList size) select:[:i | (oldList at:i) ~= (newList at:i)]. |
|
1050 |
changedLines := changedLines collect:[:i | (newList at:i)]. |
|
1051 |
TextBox openOn:(changedLines asStringCollection) title:'Changed lines'. |
|
1052 |
^ self. |
|
1053 |
]. |
|
1054 |
||
1055 |
self selectedWorkspacesTextView list:newList. |
|
1056 |
! |
|
1057 |
||
4136 | 1058 |
redoLastDoIt |
4267 | 1059 |
|s| |
4136 | 1060 |
|
4267 | 1061 |
s := self lastDoItsString. |
1062 |
s notNil ifTrue:[ |
|
1063 |
self pasteAndExecute:s |
|
1064 |
] |
|
4136 | 1065 |
! |
1066 |
||
3722 | 1067 |
removeAllWorkspaceVariables |
1068 |
(Dialog confirm:'Do you really want to remove all Workspace Variables ?') |
|
1069 |
ifTrue:[ |
|
1070 |
Workspace removeAllWorkspaceVariables |
|
1071 |
]. |
|
1072 |
! |
|
1073 |
||
4284 | 1074 |
removeGlobalVariable |
1075 |
|name nameKey selection value| |
|
1076 |
||
1077 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
1078 |
||
1079 |
name := Dialog |
|
1080 |
request:'Remove Global Variable:' |
|
1081 |
initialAnswer:(selection asString string) |
|
1082 |
okLabel:'Remove' |
|
1083 |
title:'Remove Global'. |
|
1084 |
||
1085 |
name size == 0 ifTrue:[^ self]. |
|
1086 |
nameKey := name asSymbolIfInterned. |
|
1087 |
nameKey isNil ifTrue:[^ self]. |
|
1088 |
||
1089 |
(Smalltalk includesKey:nameKey) ifFalse:[ |
|
1090 |
self warn:('No such Global Binding: ''%1''.' bindWith:name). |
|
1091 |
^ self. |
|
1092 |
]. |
|
1093 |
||
1094 |
value := Smalltalk at:nameKey. |
|
1095 |
value notNil ifTrue:[ |
|
1096 |
(self confirm:('Global ''%1'' is currently bound to %2\\Remove Binding ?' bindWith:name with:value) withCRs) |
|
1097 |
ifFalse:[ |
|
1098 |
^ self. |
|
1099 |
]. |
|
1100 |
]. |
|
1101 |
Smalltalk at:nameKey put:nil. |
|
1102 |
Smalltalk removeKey:nameKey |
|
1103 |
! |
|
1104 |
||
3722 | 1105 |
removeWorkspaceVariable |
3812 | 1106 |
|name selection wsvars| |
1107 |
||
1108 |
wsvars := Workspace workspaceVariables. |
|
1109 |
wsvars size == 0 ifTrue:[ |
|
1110 |
Dialog information:'No Workspace Variables are defined'. |
|
1111 |
^ self |
|
1112 |
]. |
|
3722 | 1113 |
|
1114 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
1115 |
||
1116 |
name := Dialog |
|
1117 |
request:'Variable to remove:' |
|
1118 |
initialAnswer:(selection asString string) |
|
1119 |
okLabel:'Remove' |
|
1120 |
title:'Enter Variable Name' |
|
3812 | 1121 |
list:(wsvars keys asOrderedCollection sort). |
3722 | 1122 |
name size == 0 ifTrue:[ |
1123 |
^ self |
|
1124 |
]. |
|
1125 |
Workspace removeWorkspaceVariable:name. |
|
1126 |
! |
|
1127 |
||
3384 | 1128 |
spyOnIt |
1129 |
self selectedWorkspacesTextView spyOnIt |
|
1130 |
! |
|
1131 |
||
1132 |
timeIt |
|
1133 |
self selectedWorkspacesTextView timeIt |
|
3154 | 1134 |
! ! |
1135 |
||
4790 | 1136 |
!WorkspaceApplication methodsFor:'menu-actions-editing'! |
1137 |
||
1138 |
babelFishTranslate:fromToModeString |
|
1139 |
"translate the selected text and paste it after the selection" |
|
1140 |
||
1141 |
self selectedWorkspace babelFishTranslate:fromToModeString |
|
1142 |
! |
|
1143 |
||
5261 | 1144 |
fileInText |
1145 |
self selectedWorkspacesTextView contentsAsString readStream fileIn |
|
1146 |
! |
|
1147 |
||
4790 | 1148 |
filterText |
1149 |
|template filterBlock newList oldList answer nDeleted deletedLines| |
|
1150 |
||
1151 |
template := |
|
1152 |
'"/ general text filter; |
|
1153 |
"/ the following block should evaluate to true for all lines |
|
1154 |
"/ you want to keep - lines for which the block returns false will be removed. |
|
1155 |
"/ Beginner warning: Smalltalk know-how is useful here. |
|
1156 |
||
1157 |
[:line | |
|
1158 |
"/ any condition on line. |
|
1159 |
"/ Notice, that line might be a Text object (i.e. non-string), |
|
1160 |
"/ so you may want to use line string. |
|
1161 |
"/ |
|
1162 |
"/ Useful queries on the line are: |
|
1163 |
"/ - size the length of the line |
|
1164 |
"/ - hasChangeOfEmphasis any bold, italic etc. |
|
1165 |
"/ - startsWith:someString |
|
1166 |
"/ - endsWith:someString |
|
1167 |
||
1168 |
"/ example filter (removes all empty lines) |
|
1169 |
"/ |
|
1170 |
"/ line size > 0 |
|
1171 |
||
1172 |
"/ example filter (removes all lines which do not end with some suffix) |
|
1173 |
"/ |
|
1174 |
"/ (line asLowercase endsWith:''foo'') not |
|
1175 |
||
1176 |
"/ dummy filter (keeps all lines) |
|
1177 |
"/ |
|
1178 |
true |
|
1179 |
] |
|
1180 |
'. |
|
1181 |
||
1182 |
filterBlock := self askForFilterBlock:'Filter block:' |
|
1183 |
template:template |
|
1184 |
rememberIn:#LastFilterBlockString. |
|
1185 |
filterBlock isNil ifTrue:[^ self]. |
|
1186 |
||
1187 |
oldList := self selectedWorkspacesTextView list. |
|
1188 |
oldList := oldList collect:[:lineOrNil | lineOrNil ? '']. |
|
1189 |
newList := oldList select:filterBlock. |
|
1190 |
newList := newList collect:[:line | (line isString and:[line size == 0]) ifTrue:[nil] ifFalse:[line]]. |
|
1191 |
nDeleted := oldList size - newList size. |
|
1192 |
nDeleted == 0 ifTrue:[ |
|
1193 |
self information:'No lines were deleted.'. |
|
1194 |
^ self |
|
1195 |
]. |
|
1196 |
||
1197 |
answer := Dialog confirmWithCancel:(resources |
|
1198 |
string:'%1 lines remain (%2 deleted). Change text ?' |
|
1199 |
with:newList size |
|
1200 |
with:nDeleted) |
|
1201 |
labels:#( 'Cancel' 'No, Show Deleted' 'Yes'). |
|
1202 |
answer isNil ifTrue:[^ self]. |
|
1203 |
answer ifFalse:[ |
|
1204 |
deletedLines := oldList reject:filterBlock. |
|
1205 |
TextBox openOn:(deletedLines asStringCollection) title:'Filtered lines'. |
|
1206 |
^ self. |
|
1207 |
]. |
|
1208 |
||
1209 |
self selectedWorkspacesTextView list:newList. |
|
1210 |
! |
|
1211 |
||
1212 |
googleSpellingSuggestion |
|
1213 |
self selectedWorkspacesTextView googleSpellingSuggestion |
|
1214 |
! |
|
1215 |
||
1216 |
pasteLastDoIt |
|
1217 |
|s| |
|
1218 |
||
1219 |
s := self lastDoItsString. |
|
1220 |
s notNil ifTrue:[ |
|
1221 |
self paste:s |
|
1222 |
] |
|
1223 |
! ! |
|
1224 |
||
4136 | 1225 |
!WorkspaceApplication methodsFor:'menu-dynamic'! |
1226 |
||
4267 | 1227 |
pasteRecentDoItMenu |
1228 |
<resource: #programMenu > |
|
1229 |
||
1230 |
^ self recentDoItsMenuFor:#'paste:' |
|
1231 |
! |
|
1232 |
||
1233 |
recentDoItsMenuFor:aSelector |
|
4136 | 1234 |
<resource: #programMenu > |
1235 |
||
1236 |
^ [ |
|
1237 |
|doIts m classHistory currentClass| |
|
1238 |
||
1239 |
doIts := Workspace doItHistory. |
|
1240 |
doIts size > 0 ifTrue:[ |
|
1241 |
m := Menu new. |
|
1242 |
doIts do:[:doItEntry | |
|
1243 |
|lines label item| |
|
1244 |
||
1245 |
label := doItEntry withoutLeadingSeparators asStringCollection first. |
|
1246 |
(label size > 20) ifTrue:[ |
|
1247 |
label := (label contractTo:20) |
|
1248 |
] ifFalse:[ |
|
1249 |
(lines size > 1) ifTrue:[ |
|
1250 |
label := label , '...' |
|
1251 |
]. |
|
1252 |
]. |
|
1253 |
label := '''' , label , ''''. |
|
1254 |
||
1255 |
item := MenuItem label:label. |
|
1256 |
m addItem:item. |
|
4267 | 1257 |
item value:aSelector. |
4136 | 1258 |
item argument:doItEntry. |
1259 |
]. |
|
1260 |
m addItem: (MenuItem new label:'-'). |
|
1261 |
m addItem: (MenuItem new |
|
5358 | 1262 |
label: (resources string:'Clear History'); |
4136 | 1263 |
value: #clearHistory; |
1264 |
activeHelpKey: #historyEmptyMenu; |
|
1265 |
translateLabel:true). |
|
1266 |
]. |
|
1267 |
m |
|
1268 |
]. |
|
4267 | 1269 |
! |
1270 |
||
1271 |
redoRecentDoItMenu |
|
1272 |
<resource: #programMenu > |
|
1273 |
||
1274 |
^ self recentDoItsMenuFor:#'pasteAndExecute:' |
|
4136 | 1275 |
! ! |
1276 |
||
3154 | 1277 |
!WorkspaceApplication methodsFor:'private'! |
1278 |
||
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1279 |
askIfAnyModified:question yesButton:yesButtonText |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1280 |
(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
|
1281 |
|
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1282 |
(Dialog |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1283 |
confirm:(resources string:question) withCRs |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1284 |
yesLabel:(resources at:yesButtonText) |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1285 |
noLabel:(resources at:'Cancel')) |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1286 |
ifTrue:[ |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1287 |
"/ reset modified flag so question is asked only once |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1288 |
(workspaces select:[:aView | (self isModifiedWorkspace:aView)]) |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1289 |
do:[:eachModifiedTextView | |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1290 |
eachModifiedTextView modified:false. |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1291 |
]. |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1292 |
^ true |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1293 |
]. |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1294 |
^ false |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1295 |
! |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1296 |
|
5295
e3c5a7b20d9d
refactored (added abstract superclass)
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
1297 |
createWorkspace |
e3c5a7b20d9d
refactored (added abstract superclass)
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
1298 |
^ (HVScrollableView for:Workspace) |
3193 | 1299 |
! |
1300 |
||
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1301 |
isModifiedWorkspace:aView |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1302 |
|view| |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1303 |
|
4267 | 1304 |
view := self workspaceViewOfView:aView. |
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1305 |
|
4313 | 1306 |
(view isNil |
1307 |
or:[view modified not |
|
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1308 |
or:[view contentsWasSaved |
4313 | 1309 |
or:[view contents withoutSeparators isEmpty]]]) ifTrue:[ |
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1310 |
^ false |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1311 |
]. |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1312 |
^ true |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1313 |
! |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1314 |
|
4267 | 1315 |
lastDoItsString |
1316 |
|history| |
|
3198 | 1317 |
|
4267 | 1318 |
history := Workspace doItHistory. |
1319 |
history size > 0 ifFalse:[ |
|
1320 |
self selectedWorkspacesTextView flash. |
|
1321 |
^ nil |
|
3198 | 1322 |
]. |
4267 | 1323 |
^ history first |
3154 | 1324 |
! ! |
1325 |
||
1326 |
!WorkspaceApplication class methodsFor:'documentation'! |
|
1327 |
||
1328 |
version |
|
5490 | 1329 |
^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.71 2004-02-06 17:56:34 stefan Exp $' |
3154 | 1330 |
! ! |