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