author | Claus Gittinger <cg@exept.de> |
Tue, 16 Mar 2004 17:31:10 +0100 | |
changeset 5742 | d9fa63dfd978 |
parent 5695 | 710eba8c51c0 |
child 5752 | 1377fd220c4c |
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 |
5547
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
16 |
instanceVariableNames:'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 |
|
5681 | 608 |
|wsApp path needRemove font| |
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 |
|
5684 | 635 |
wsApp graphicsDevice platformName = 'X11' ifTrue:[ |
636 |
font := Font family:'unifont' face:'medium' style:'roman' size:16 encoding:'iso10646-1'. |
|
637 |
font := font onDevice:wsApp graphicsDevice ifAbsent:nil. |
|
638 |
font isNil ifTrue:[ |
|
639 |
font := Font family:'arial' face:'medium' style:'roman' size:12 encoding:'iso10646-1'. |
|
640 |
font := font onDevice:wsApp graphicsDevice ifAbsent:nil. |
|
641 |
]. |
|
642 |
] ifFalse:[ |
|
5685 | 643 |
font := Font family:'Arial Unicode MS' face:'medium' style:'roman' size:10 encoding:'ms-ansi'. |
5681 | 644 |
font := font onDevice:wsApp graphicsDevice ifAbsent:nil. |
645 |
]. |
|
646 |
||
5649 | 647 |
#( |
5693 | 648 |
('Hello_utf8.wsp' 'Hello' #'utf8' ) |
649 |
('Welcome.wsp' 'Welcome' nil ) |
|
5692 | 650 |
('Setup.wsp' 'Setup' nil ) |
5693 | 651 |
('Keyboard.wsp' 'Keyboard' nil ) |
652 |
('GettingStarted.wsp' 'Getting Started' nil ) |
|
5692 | 653 |
) triplesDo:[:file :title :forcedEncoding| |
654 |
|pane encoding| |
|
5681 | 655 |
|
5649 | 656 |
path := (Smalltalk getSystemFileName:file). |
5681 | 657 |
|
5649 | 658 |
(path notNil and:[path asFilename isReadable]) ifTrue:[ |
5681 | 659 |
wsApp addWindow:(pane := HVScrollableView for:Workspace) named:title asFirst:false. |
5692 | 660 |
|
661 |
forcedEncoding notNil ifTrue:[ |
|
5694 | 662 |
encoding := forcedEncoding. |
663 |
pane font:font. |
|
5692 | 664 |
] ifFalse:[ |
665 |
encoding := SourceCodeManagerUtilities guessEncodingOfFile:path. |
|
666 |
(encoding == #'iso8859-1' or:[encoding == #'ascii']) ifTrue:[ |
|
667 |
encoding := nil |
|
5681 | 668 |
]. |
669 |
]. |
|
5692 | 670 |
wsApp loadFile:path encoding:encoding label:title. |
5649 | 671 |
needRemove ifTrue:[wsApp removeWorkspace:1]. "/ the original Workspace |
672 |
needRemove := false. |
|
673 |
]. |
|
3345 | 674 |
]. |
5693 | 675 |
wsApp openWindow. |
676 |
wsApp selectedWorkspaceIndexHolder value:2. |
|
3332 | 677 |
|
678 |
" |
|
679 |
self openSystemWorkspace |
|
680 |
" |
|
4542 | 681 |
! |
682 |
||
683 |
openWith:initialText |
|
684 |
"launch a new workspace with some initial contents" |
|
685 |
||
5098 | 686 |
^ self openWith:initialText selected:false |
687 |
||
688 |
" |
|
689 |
WorkspaceApplication openWith:'Transcript showCR:''hello world''' |
|
690 |
" |
|
691 |
! |
|
692 |
||
693 |
openWith:initialText selected:selectedBoolean |
|
694 |
"launch a new workspace with some initial contents" |
|
695 |
||
4542 | 696 |
|workspace| |
697 |
||
698 |
workspace := self new. |
|
699 |
workspace open. |
|
5098 | 700 |
workspace selectedWorkspace contents:initialText selected:selectedBoolean. |
4542 | 701 |
^ workspace |
702 |
||
703 |
" |
|
704 |
WorkspaceApplication openWith:'Transcript showCR:''hello world''' |
|
705 |
" |
|
3332 | 706 |
! ! |
707 |
||
3193 | 708 |
!WorkspaceApplication methodsFor:'aspects'! |
709 |
||
4474 | 710 |
autoDefineVariables |
711 |
autoDefineVariables isNil ifTrue:[ |
|
712 |
autoDefineVariables := ValueHolder new. |
|
713 |
(UserPreferences current autoDefineWorkspaceVariables) ifTrue:[ |
|
5547
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
714 |
autoDefineVariables value:#workspace. |
4474 | 715 |
]. |
716 |
autoDefineVariables onChangeSend:#autoDefineVariablesChanged to:self. |
|
717 |
]. |
|
718 |
^ autoDefineVariables. |
|
719 |
! |
|
720 |
||
4136 | 721 |
hasHistory |
722 |
^ Workspace doItHistory size > 0. |
|
3193 | 723 |
! ! |
724 |
||
4358 | 725 |
!WorkspaceApplication methodsFor:'aspects-queries'! |
3193 | 726 |
|
3812 | 727 |
anyWorkspaceVariableIsDefined |
728 |
^ Workspace workspaceVariables size > 0 |
|
3154 | 729 |
! ! |
730 |
||
731 |
!WorkspaceApplication methodsFor:'initialization & release'! |
|
732 |
||
733 |
closeRequest |
|
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
734 |
(self askIfAnyModified:'Text was not saved. Close anyway ?' yesButton:'Close') ifFalse:[ |
3154 | 735 |
^ self |
736 |
]. |
|
737 |
||
738 |
^ super closeRequest |
|
739 |
! ! |
|
740 |
||
4359 | 741 |
!WorkspaceApplication methodsFor:'menu-actions'! |
3154 | 742 |
|
4154 | 743 |
addGlobalVariable |
744 |
|name nameKey selection| |
|
745 |
||
746 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
747 |
||
748 |
name := Dialog |
|
749 |
request:'Name of new Global Variable:' |
|
750 |
initialAnswer:(selection asString string) |
|
751 |
okLabel:'Add' |
|
752 |
title:'Enter Variable Name'. |
|
753 |
name size == 0 ifTrue:[ |
|
754 |
^ self |
|
755 |
]. |
|
756 |
nameKey := name asSymbol. |
|
757 |
||
4284 | 758 |
(Smalltalk includesKey:nameKey) ifTrue:[ |
4154 | 759 |
self warn:'Global named ''' , name , ''' already exists.'. |
760 |
^ self. |
|
761 |
]. |
|
762 |
Smalltalk at:nameKey put:nil. |
|
763 |
! |
|
764 |
||
4099 | 765 |
addGlobalVariableInspector |
766 |
|v| |
|
767 |
||
768 |
v := self addInspectorOn:(Smalltalk) basic:false suppressPseudoSlots:true. |
|
769 |
v fieldListLabel:'Name'. |
|
4208 | 770 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value) to:'Globals (Smalltalk)'. |
4099 | 771 |
! |
772 |
||
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
773 |
addInspectorOn:aValue basic:isBasicInspector suppressPseudoSlots:suppressPseudoSlots |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
774 |
|view cls resultString| |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
775 |
|
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
776 |
isBasicInspector ifFalse:[ |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
777 |
cls := aValue inspectorClass. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
778 |
]. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
779 |
cls isNil ifTrue:[ |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
780 |
cls := InspectorView |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
781 |
]. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
782 |
view := cls new. |
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
783 |
view suppressPseudoSlots:suppressPseudoSlots. |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
784 |
view inspect:aValue. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
785 |
"/ v allowFollow:true. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
786 |
aValue isBehavior ifTrue:[ |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
787 |
resultString := aValue name |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
788 |
] ifFalse:[ |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
789 |
resultString := aValue classNameWithArticle |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
790 |
]. |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
791 |
self addWindow:view named:('Inspecting: ' , resultString). |
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
792 |
^ view |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
793 |
! |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
794 |
|
3196 | 795 |
addWorkspace |
5295
e3c5a7b20d9d
refactored (added abstract superclass)
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
796 |
self addWindow:(self createWorkspace) named:'Workspace%1' |
3196 | 797 |
! |
798 |
||
3722 | 799 |
addWorkspaceVariable |
800 |
|name selection| |
|
801 |
||
802 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
803 |
||
804 |
name := Dialog |
|
805 |
request:'Name of new Workspace Variable:' |
|
806 |
initialAnswer:(selection asString string) |
|
807 |
okLabel:'Add' |
|
808 |
title:'Enter Variable Name'. |
|
809 |
name size == 0 ifTrue:[ |
|
810 |
^ self |
|
811 |
]. |
|
812 |
Workspace addWorkspaceVariable:name. |
|
813 |
! |
|
814 |
||
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
815 |
addWorkspaceVariableInspector |
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
816 |
|v| |
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
817 |
|
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
818 |
v := self addInspectorOn:(Workspace workspaceVariables) basic:false suppressPseudoSlots:true. |
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
819 |
v dereferenceValueHolders:true. |
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
820 |
v fieldListLabel:'Name'. |
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
821 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value) to:'Variables'. |
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
822 |
! |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
823 |
|
3752 | 824 |
askForFilterBlock:message template:template rememberIn:nameOfClassVar |
825 |
|filterBlockString filterBlock dialog textHolder classVarValue| |
|
826 |
||
827 |
classVarValue := self class classVarAt:nameOfClassVar ifAbsent:nil. |
|
828 |
classVarValue isNil ifTrue:[ |
|
829 |
self class classVarAt:nameOfClassVar put:template. |
|
830 |
classVarValue := template. |
|
831 |
]. |
|
832 |
||
833 |
textHolder := ValueHolder new. |
|
834 |
dialog := Dialog |
|
835 |
forRequestText:(resources string:message) |
|
836 |
lines:25 |
|
837 |
columns:70 |
|
838 |
initialAnswer:classVarValue |
|
839 |
model:textHolder. |
|
840 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
841 |
dialog open. |
|
842 |
dialog accepted ifFalse:[^ nil]. |
|
843 |
||
844 |
filterBlockString := textHolder value. |
|
845 |
self class classVarAt:nameOfClassVar put:filterBlockString. |
|
846 |
||
847 |
filterBlock := Parser evaluate:filterBlockString. |
|
848 |
filterBlock isBlock ifFalse:[ |
|
5490 | 849 |
self error:'bad input for filterBlock' mayProceed:true. |
3752 | 850 |
^ nil |
851 |
]. |
|
852 |
||
853 |
^ filterBlock |
|
854 |
! |
|
855 |
||
4474 | 856 |
autoDefineVariablesChanged |
857 |
|autoDefine| |
|
858 |
||
859 |
autoDefine := autoDefineVariables value. |
|
860 |
UserPreferences current autoDefineWorkspaceVariables:(autoDefine == #workspace). |
|
861 |
workspaces do:[:each | |
|
862 |
each autoDefineVariables:autoDefine |
|
863 |
]. |
|
864 |
! |
|
865 |
||
3198 | 866 |
basicInspectIt |
867 |
self inspectIt:true |
|
868 |
! |
|
869 |
||
3383
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
870 |
browseImplementorsOfIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
871 |
self selectedWorkspacesTextView browseImplementorsOfIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
872 |
! |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
873 |
|
3154 | 874 |
browseIt |
3198 | 875 |
self selectedWorkspacesTextView browseIt |
3154 | 876 |
! |
877 |
||
3383
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
878 |
browseReferencesToIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
879 |
self selectedWorkspacesTextView browseReferencesToIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
880 |
! |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
881 |
|
4136 | 882 |
clearHistory |
883 |
Workspace clearDoItHistory |
|
884 |
! |
|
885 |
||
3154 | 886 |
doIt |
3198 | 887 |
self selectedWorkspacesTextView doIt |
3154 | 888 |
! |
889 |
||
890 |
inspectIt |
|
3198 | 891 |
self inspectIt:false |
892 |
! |
|
893 |
||
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
894 |
inspectIt:isBasicInspector |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
895 |
|ws| |
3196 | 896 |
|
3198 | 897 |
ws := self selectedWorkspacesTextView. |
3196 | 898 |
ws |
899 |
do:(ws selection) |
|
900 |
withValueDo:[:result | |
|
4096
1c393b3edbcd
Workspace-Variable inspector
Claus Gittinger <cg@exept.de>
parents:
4086
diff
changeset
|
901 |
self addInspectorOn:result basic:isBasicInspector suppressPseudoSlots:false |
3196 | 902 |
] |
903 |
||
904 |
"/ self selectedWorkspace inspectIt |
|
3154 | 905 |
! |
906 |
||
3812 | 907 |
inspectWorkspaceVariables |
908 |
|wsvars| |
|
909 |
||
910 |
wsvars := Workspace workspaceVariables. |
|
911 |
wsvars size == 0 ifTrue:[ |
|
912 |
Dialog information:'No Workspace Variables are defined'. |
|
913 |
^ self |
|
914 |
]. |
|
915 |
wsvars inspect |
|
916 |
! |
|
917 |
||
3332 | 918 |
loadFile:aFileName |
5649 | 919 |
self loadFile:aFileName encoding:nil |
920 |
! |
|
921 |
||
5692 | 922 |
loadFile:aFileName encoding:encodingSymbolOrNil |
923 |
|lbl| |
|
924 |
||
925 |
lbl := aFileName asFilename withoutSuffix baseName. |
|
926 |
self loadFile:aFileName encoding:encodingSymbolOrNil label:lbl. |
|
927 |
! |
|
928 |
||
929 |
loadFile:aFileName encoding:encodingSymbolOrNil label:label |
|
930 |
|file ws| |
|
3332 | 931 |
|
932 |
file := aFileName asFilename. |
|
5490 | 933 |
ws := self selectedWorkspacesTextView. |
934 |
[ |
|
5692 | 935 |
|contents| |
936 |
||
937 |
contents := file contents. |
|
938 |
encodingSymbolOrNil notNil ifTrue:[ |
|
939 |
contents := contents encodeFrom:encodingSymbolOrNil into:#'unicode'. |
|
5742 | 940 |
ws externalEncoding:encodingSymbolOrNil. |
5692 | 941 |
]. |
942 |
ws contents:contents. |
|
5490 | 943 |
] on:StreamError do:[:ex| |
944 |
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
|
945 |
^ self |
13f6e4eaac91
fix #loadFile: check if file exists
Michael Beyl <mb@exept.de>
parents:
5140
diff
changeset
|
946 |
]. |
3332 | 947 |
ws modified:false. |
948 |
||
949 |
tabList size <= 1 ifTrue:[ |
|
5692 | 950 |
self window label:label. |
3332 | 951 |
] ifFalse:[ |
5692 | 952 |
tabList at:self selectedWorkspaceIndexHolder value put:label |
3332 | 953 |
] |
954 |
! |
|
955 |
||
3154 | 956 |
menuLoad |
3332 | 957 |
|file| |
3154 | 958 |
|
3193 | 959 |
(self askIfModified:'Text was modified. Load anyway ?' yesButton:'Load') ifFalse:[ ^ self]. |
960 |
||
4602
a961c37bd041
better save file dialog (use new dialog vs. use old dialog)
Claus Gittinger <cg@exept.de>
parents:
4591
diff
changeset
|
961 |
file := Dialog requestFileName:'Load file' default:'file.wsp' pattern:'*.wsp'. |
5490 | 962 |
file size ~~ 0 ifTrue:[ |
3332 | 963 |
self loadFile:file |
3154 | 964 |
] |
965 |
! |
|
966 |
||
3334 | 967 |
newSystemWorkspace |
968 |
self class openSystemWorkspace |
|
969 |
! |
|
970 |
||
3154 | 971 |
openDocumentation |
972 |
"opens the documentation file" |
|
973 |
||
974 |
self openHTMLDocument: 'tools/misc/TOP.html#WORKSPACE' |
|
975 |
! |
|
976 |
||
4267 | 977 |
pasteAndExecute:aString |
978 |
self paste:aString. |
|
4136 | 979 |
self printIt |
980 |
! |
|
981 |
||
3154 | 982 |
printIt |
3198 | 983 |
self selectedWorkspacesTextView printIt |
3193 | 984 |
! |
985 |
||
3752 | 986 |
processText |
987 |
|template filterBlock newList oldList answer nChanged changedLines flags| |
|
988 |
||
989 |
template := |
|
990 |
'"/ general text processor; |
|
991 |
"/ the following block should evaluate to a new line, |
|
992 |
"/ given the original line as argument. |
|
993 |
"/ Beginner warning: Smalltalk know-how is useful here. |
|
994 |
||
995 |
[:line | |
|
996 |
"/ any processing on line. |
|
997 |
"/ Notice, that line might be a Text object (i.e. non-string), |
|
998 |
"/ |
|
999 |
"/ Useful operations on the line are: |
|
1000 |
"/ - '' .... '' , concatenation of any prefix/suffix |
|
1001 |
"/ - leftPaddedTo:size padding |
|
1002 |
"/ - rightPaddedTo:size padding |
|
1003 |
"/ - copyTo:(size min:N) |
|
1004 |
"/ - asUppercase |
|
1005 |
"/ - asLowercase |
|
4141 | 1006 |
"/ - withoutSeparators remove whiteSpace |
1007 |
"/ - asCollectionOfWords words |
|
3752 | 1008 |
|
1009 |
"/ makes everything bold |
|
1010 |
"/ |
|
1011 |
"/ line allBold |
|
1012 |
||
4141 | 1013 |
"/ first word only |
1014 |
"/ |
|
1015 |
"/ line withoutSeparators asCollectionOfWords first |
|
1016 |
||
3752 | 1017 |
"/ dummy filter (keeps all lines as-is) |
1018 |
"/ |
|
1019 |
line |
|
1020 |
] |
|
1021 |
'. |
|
1022 |
filterBlock := self askForFilterBlock:'Processing block:' |
|
1023 |
template:template |
|
1024 |
rememberIn:#LastProcessingBlockString. |
|
1025 |
filterBlock isNil ifTrue:[^ self]. |
|
1026 |
||
1027 |
oldList := self selectedWorkspacesTextView list. |
|
1028 |
oldList := oldList collect:[:lineOrNil | lineOrNil ? '']. |
|
4141 | 1029 |
newList := oldList collect:[:line | |newLine| |
1030 |
newLine := line. |
|
1031 |
Error handle:[:ex | |
|
1032 |
] do:[ |
|
1033 |
newLine := filterBlock value:line |
|
1034 |
]. |
|
1035 |
newLine |
|
1036 |
]. |
|
3752 | 1037 |
newList := newList collect:[:line | (line isString and:[line size == 0]) ifTrue:[nil] ifFalse:[line]]. |
1038 |
||
1039 |
flags := (1 to:oldList size) collect:[:i | (oldList at:i) ~= (newList at:i)]. |
|
1040 |
flags := flags select:[:flag | flag]. |
|
1041 |
nChanged := flags size. |
|
1042 |
nChanged == 0 ifTrue:[ |
|
1043 |
self information:'No lines were changed.'. |
|
1044 |
^ self |
|
1045 |
]. |
|
1046 |
||
1047 |
answer := Dialog confirmWithCancel:(resources |
|
1048 |
string:'%1 lines changed. Change text ?' |
|
1049 |
with:nChanged) |
|
1050 |
labels:#( 'Cancel' 'No, Show Changed' 'Yes'). |
|
1051 |
answer isNil ifTrue:[^ self]. |
|
1052 |
answer ifFalse:[ |
|
1053 |
changedLines := (1 to:oldList size) select:[:i | (oldList at:i) ~= (newList at:i)]. |
|
1054 |
changedLines := changedLines collect:[:i | (newList at:i)]. |
|
1055 |
TextBox openOn:(changedLines asStringCollection) title:'Changed lines'. |
|
1056 |
^ self. |
|
1057 |
]. |
|
1058 |
||
1059 |
self selectedWorkspacesTextView list:newList. |
|
1060 |
! |
|
1061 |
||
4136 | 1062 |
redoLastDoIt |
4267 | 1063 |
|s| |
4136 | 1064 |
|
4267 | 1065 |
s := self lastDoItsString. |
1066 |
s notNil ifTrue:[ |
|
1067 |
self pasteAndExecute:s |
|
1068 |
] |
|
4136 | 1069 |
! |
1070 |
||
3722 | 1071 |
removeAllWorkspaceVariables |
1072 |
(Dialog confirm:'Do you really want to remove all Workspace Variables ?') |
|
1073 |
ifTrue:[ |
|
1074 |
Workspace removeAllWorkspaceVariables |
|
1075 |
]. |
|
1076 |
! |
|
1077 |
||
4284 | 1078 |
removeGlobalVariable |
1079 |
|name nameKey selection value| |
|
1080 |
||
1081 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
1082 |
||
1083 |
name := Dialog |
|
1084 |
request:'Remove Global Variable:' |
|
1085 |
initialAnswer:(selection asString string) |
|
1086 |
okLabel:'Remove' |
|
1087 |
title:'Remove Global'. |
|
1088 |
||
1089 |
name size == 0 ifTrue:[^ self]. |
|
1090 |
nameKey := name asSymbolIfInterned. |
|
1091 |
nameKey isNil ifTrue:[^ self]. |
|
1092 |
||
1093 |
(Smalltalk includesKey:nameKey) ifFalse:[ |
|
1094 |
self warn:('No such Global Binding: ''%1''.' bindWith:name). |
|
1095 |
^ self. |
|
1096 |
]. |
|
1097 |
||
1098 |
value := Smalltalk at:nameKey. |
|
1099 |
value notNil ifTrue:[ |
|
1100 |
(self confirm:('Global ''%1'' is currently bound to %2\\Remove Binding ?' bindWith:name with:value) withCRs) |
|
1101 |
ifFalse:[ |
|
1102 |
^ self. |
|
1103 |
]. |
|
1104 |
]. |
|
1105 |
Smalltalk at:nameKey put:nil. |
|
1106 |
Smalltalk removeKey:nameKey |
|
1107 |
! |
|
1108 |
||
3722 | 1109 |
removeWorkspaceVariable |
3812 | 1110 |
|name selection wsvars| |
1111 |
||
1112 |
wsvars := Workspace workspaceVariables. |
|
1113 |
wsvars size == 0 ifTrue:[ |
|
1114 |
Dialog information:'No Workspace Variables are defined'. |
|
1115 |
^ self |
|
1116 |
]. |
|
3722 | 1117 |
|
1118 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
1119 |
||
1120 |
name := Dialog |
|
1121 |
request:'Variable to remove:' |
|
1122 |
initialAnswer:(selection asString string) |
|
1123 |
okLabel:'Remove' |
|
1124 |
title:'Enter Variable Name' |
|
3812 | 1125 |
list:(wsvars keys asOrderedCollection sort). |
3722 | 1126 |
name size == 0 ifTrue:[ |
1127 |
^ self |
|
1128 |
]. |
|
1129 |
Workspace removeWorkspaceVariable:name. |
|
1130 |
! |
|
1131 |
||
3384 | 1132 |
spyOnIt |
1133 |
self selectedWorkspacesTextView spyOnIt |
|
1134 |
! |
|
1135 |
||
1136 |
timeIt |
|
1137 |
self selectedWorkspacesTextView timeIt |
|
3154 | 1138 |
! ! |
1139 |
||
4790 | 1140 |
!WorkspaceApplication methodsFor:'menu-actions-editing'! |
1141 |
||
1142 |
babelFishTranslate:fromToModeString |
|
1143 |
"translate the selected text and paste it after the selection" |
|
1144 |
||
1145 |
self selectedWorkspace babelFishTranslate:fromToModeString |
|
1146 |
! |
|
1147 |
||
5261 | 1148 |
fileInText |
1149 |
self selectedWorkspacesTextView contentsAsString readStream fileIn |
|
1150 |
! |
|
1151 |
||
4790 | 1152 |
filterText |
1153 |
|template filterBlock newList oldList answer nDeleted deletedLines| |
|
1154 |
||
1155 |
template := |
|
1156 |
'"/ general text filter; |
|
1157 |
"/ the following block should evaluate to true for all lines |
|
1158 |
"/ you want to keep - lines for which the block returns false will be removed. |
|
1159 |
"/ Beginner warning: Smalltalk know-how is useful here. |
|
1160 |
||
1161 |
[:line | |
|
1162 |
"/ any condition on line. |
|
1163 |
"/ Notice, that line might be a Text object (i.e. non-string), |
|
1164 |
"/ so you may want to use line string. |
|
1165 |
"/ |
|
1166 |
"/ Useful queries on the line are: |
|
1167 |
"/ - size the length of the line |
|
1168 |
"/ - hasChangeOfEmphasis any bold, italic etc. |
|
1169 |
"/ - startsWith:someString |
|
1170 |
"/ - endsWith:someString |
|
1171 |
||
1172 |
"/ example filter (removes all empty lines) |
|
1173 |
"/ |
|
1174 |
"/ line size > 0 |
|
1175 |
||
1176 |
"/ example filter (removes all lines which do not end with some suffix) |
|
1177 |
"/ |
|
1178 |
"/ (line asLowercase endsWith:''foo'') not |
|
1179 |
||
1180 |
"/ dummy filter (keeps all lines) |
|
1181 |
"/ |
|
1182 |
true |
|
1183 |
] |
|
1184 |
'. |
|
1185 |
||
1186 |
filterBlock := self askForFilterBlock:'Filter block:' |
|
1187 |
template:template |
|
1188 |
rememberIn:#LastFilterBlockString. |
|
1189 |
filterBlock isNil ifTrue:[^ self]. |
|
1190 |
||
1191 |
oldList := self selectedWorkspacesTextView list. |
|
1192 |
oldList := oldList collect:[:lineOrNil | lineOrNil ? '']. |
|
1193 |
newList := oldList select:filterBlock. |
|
1194 |
newList := newList collect:[:line | (line isString and:[line size == 0]) ifTrue:[nil] ifFalse:[line]]. |
|
1195 |
nDeleted := oldList size - newList size. |
|
1196 |
nDeleted == 0 ifTrue:[ |
|
1197 |
self information:'No lines were deleted.'. |
|
1198 |
^ self |
|
1199 |
]. |
|
1200 |
||
1201 |
answer := Dialog confirmWithCancel:(resources |
|
1202 |
string:'%1 lines remain (%2 deleted). Change text ?' |
|
1203 |
with:newList size |
|
1204 |
with:nDeleted) |
|
1205 |
labels:#( 'Cancel' 'No, Show Deleted' 'Yes'). |
|
1206 |
answer isNil ifTrue:[^ self]. |
|
1207 |
answer ifFalse:[ |
|
1208 |
deletedLines := oldList reject:filterBlock. |
|
1209 |
TextBox openOn:(deletedLines asStringCollection) title:'Filtered lines'. |
|
1210 |
^ self. |
|
1211 |
]. |
|
1212 |
||
1213 |
self selectedWorkspacesTextView list:newList. |
|
1214 |
! |
|
1215 |
||
1216 |
googleSpellingSuggestion |
|
1217 |
self selectedWorkspacesTextView googleSpellingSuggestion |
|
1218 |
! |
|
1219 |
||
1220 |
pasteLastDoIt |
|
1221 |
|s| |
|
1222 |
||
1223 |
s := self lastDoItsString. |
|
1224 |
s notNil ifTrue:[ |
|
1225 |
self paste:s |
|
1226 |
] |
|
1227 |
! ! |
|
1228 |
||
4136 | 1229 |
!WorkspaceApplication methodsFor:'menu-dynamic'! |
1230 |
||
4267 | 1231 |
pasteRecentDoItMenu |
1232 |
<resource: #programMenu > |
|
1233 |
||
1234 |
^ self recentDoItsMenuFor:#'paste:' |
|
1235 |
! |
|
1236 |
||
1237 |
recentDoItsMenuFor:aSelector |
|
4136 | 1238 |
<resource: #programMenu > |
1239 |
||
1240 |
^ [ |
|
1241 |
|doIts m classHistory currentClass| |
|
1242 |
||
1243 |
doIts := Workspace doItHistory. |
|
1244 |
doIts size > 0 ifTrue:[ |
|
1245 |
m := Menu new. |
|
1246 |
doIts do:[:doItEntry | |
|
1247 |
|lines label item| |
|
1248 |
||
1249 |
label := doItEntry withoutLeadingSeparators asStringCollection first. |
|
1250 |
(label size > 20) ifTrue:[ |
|
1251 |
label := (label contractTo:20) |
|
1252 |
] ifFalse:[ |
|
1253 |
(lines size > 1) ifTrue:[ |
|
1254 |
label := label , '...' |
|
1255 |
]. |
|
1256 |
]. |
|
1257 |
label := '''' , label , ''''. |
|
1258 |
||
1259 |
item := MenuItem label:label. |
|
1260 |
m addItem:item. |
|
4267 | 1261 |
item value:aSelector. |
4136 | 1262 |
item argument:doItEntry. |
1263 |
]. |
|
1264 |
m addItem: (MenuItem new label:'-'). |
|
1265 |
m addItem: (MenuItem new |
|
5358 | 1266 |
label: (resources string:'Clear History'); |
4136 | 1267 |
value: #clearHistory; |
1268 |
activeHelpKey: #historyEmptyMenu; |
|
1269 |
translateLabel:true). |
|
1270 |
]. |
|
1271 |
m |
|
1272 |
]. |
|
4267 | 1273 |
! |
1274 |
||
1275 |
redoRecentDoItMenu |
|
1276 |
<resource: #programMenu > |
|
1277 |
||
1278 |
^ self recentDoItsMenuFor:#'pasteAndExecute:' |
|
4136 | 1279 |
! ! |
1280 |
||
3154 | 1281 |
!WorkspaceApplication methodsFor:'private'! |
1282 |
||
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1283 |
askIfAnyModified:question yesButton:yesButtonText |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1284 |
(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
|
1285 |
|
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1286 |
(Dialog |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1287 |
confirm:(resources string:question) withCRs |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1288 |
yesLabel:(resources at:yesButtonText) |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1289 |
noLabel:(resources at:'Cancel')) |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1290 |
ifTrue:[ |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1291 |
"/ 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
|
1292 |
(workspaces select:[:aView | (self isModifiedWorkspace:aView)]) |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1293 |
do:[:eachModifiedTextView | |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1294 |
eachModifiedTextView modified: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 |
^ true |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1297 |
]. |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1298 |
^ false |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1299 |
! |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1300 |
|
5295
e3c5a7b20d9d
refactored (added abstract superclass)
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
1301 |
createWorkspace |
5547
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
1302 |
|ws| |
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
1303 |
|
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
1304 |
ws := (HVScrollableView for:Workspace). |
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
1305 |
ws autoDefineVariables:autoDefineVariables. |
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
1306 |
^ ws |
3193 | 1307 |
! |
1308 |
||
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1309 |
isModifiedWorkspace:aView |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1310 |
|view| |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1311 |
|
4267 | 1312 |
view := self workspaceViewOfView:aView. |
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1313 |
|
4313 | 1314 |
(view isNil |
1315 |
or:[view modified not |
|
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1316 |
or:[view contentsWasSaved |
4313 | 1317 |
or:[view contents withoutSeparators isEmpty]]]) ifTrue:[ |
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1318 |
^ false |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1319 |
]. |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1320 |
^ true |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1321 |
! |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
1322 |
|
4267 | 1323 |
lastDoItsString |
1324 |
|history| |
|
3198 | 1325 |
|
4267 | 1326 |
history := Workspace doItHistory. |
1327 |
history size > 0 ifFalse:[ |
|
1328 |
self selectedWorkspacesTextView flash. |
|
1329 |
^ nil |
|
3198 | 1330 |
]. |
4267 | 1331 |
^ history first |
3154 | 1332 |
! ! |
1333 |
||
1334 |
!WorkspaceApplication class methodsFor:'documentation'! |
|
1335 |
||
1336 |
version |
|
5742 | 1337 |
^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.82 2004-03-16 16:31:10 cg Exp $' |
3154 | 1338 |
! ! |