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