author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 12 Jun 2013 16:47:06 +0100 | |
branch | jv |
changeset 13170 | c9b815af5777 |
parent 12807 | ba8c5416aa28 |
parent 12887 | 07582d422bd1 |
child 13173 | e9da2324940d |
permissions | -rw-r--r-- |
5140 | 1 |
" |
2 |
COPYRIGHT (c) 2001 by eXept Software AG |
|
12308 | 3 |
All Rights Reserved |
5140 | 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 |
" |
|
3154 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
5303 | 14 |
MultiViewToolApplication subclass:#WorkspaceApplication |
9300
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
15 |
instanceVariableNames:'autoDefineVariables syntaxHolder poolsConsideredInDoIts |
9695 | 16 |
smalltalkMenuEnabledHolder clipBoardWatcherProcess |
9735 | 17 |
fetchClipboardLines cursorLineHolder cursorColHolder |
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
18 |
modeLabelHolder toolBarView canChangeLanguageHolder' |
8315 | 19 |
classVariableNames:'LastFilterBlockString LastProcessingBlockString LastTeaWaitTime |
10169 | 20 |
DefaultToolBarVisible ClipBoardFetchingInstance LastLanguage |
21 |
MyWorkspaceOpened' |
|
8315 | 22 |
poolDictionaries:'' |
23 |
category:'Interface-Smalltalk' |
|
3154 | 24 |
! |
25 |
||
3191 | 26 |
!WorkspaceApplication class methodsFor:'documentation'! |
27 |
||
5140 | 28 |
copyright |
29 |
" |
|
30 |
COPYRIGHT (c) 2001 by eXept Software AG |
|
12308 | 31 |
All Rights Reserved |
5140 | 32 |
|
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
40 |
! |
|
41 |
||
3191 | 42 |
documentation |
43 |
" |
|
44 |
A simple wrapper around a WorkSpace-View, adding a pullDown menu. |
|
45 |
||
46 |
[author:] |
|
12308 | 47 |
Claus Gittinger |
3191 | 48 |
" |
49 |
! ! |
|
3154 | 50 |
|
7825 | 51 |
!WorkspaceApplication class methodsFor:'defaults'! |
52 |
||
8499 | 53 |
defaultEditToolbarVisible |
54 |
^ UserPreferences current editToolbarVisibleInWorkspace |
|
55 |
||
56 |
"Created: / 14-07-2007 / 16:42:50 / cg" |
|
57 |
! |
|
58 |
||
7825 | 59 |
defaultInfoVisible |
60 |
^ UserPreferences current infoVisibleInWorkspace |
|
61 |
||
62 |
"Created: / 14-07-2007 / 16:43:21 / cg" |
|
63 |
! |
|
64 |
||
10169 | 65 |
defaultMyWorkspaceDotWspFile |
10568 | 66 |
|stxFolder f | |
67 |
||
68 |
stxFolder := Filename homeDirectory / '.smalltalk'. |
|
69 |
f := stxFolder / 'MyWorkspace.wsp'. |
|
10169 | 70 |
f exists ifFalse:[ |
10568 | 71 |
stxFolder makeDirectory. |
72 |
||
10169 | 73 |
f writingFileDo:[:s| |
74 |
'MyWorkspace.wsp' asFilename exists ifTrue:[ |
|
75 |
s nextPutAll:('MyWorkspace.wsp' asFilename contentsAsString) |
|
76 |
] ifFalse:[ |
|
77 |
s nextPutLine: '"This is your personal workspace..."'. |
|
78 |
s nextPutLine: '"Edit and save as ', f pathName , '"'. |
|
10568 | 79 |
|
80 |
'MyWorkspaceSample.wsp' asFilename exists ifTrue:[ |
|
81 |
s nextPutAll:('MyWorkspaceSample.wsp' asFilename contentsAsString) |
|
82 |
] |
|
12393 | 83 |
]. |
84 |
s syncData. |
|
85 |
]. |
|
10169 | 86 |
]. |
87 |
^f |
|
88 |
||
89 |
"Created: / 21-06-2011 / 08:45:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10317 | 90 |
"Modified: / 14-07-2011 / 13:08:30 / Administrator" |
10568 | 91 |
"Modified: / 10-08-2011 / 21:40:31 / cg" |
10169 | 92 |
! |
93 |
||
7825 | 94 |
defaultToolbarVisible |
95 |
^ UserPreferences current toolbarVisibleInWorkspace |
|
96 |
||
97 |
"Created: / 14-07-2007 / 16:42:50 / cg" |
|
8486 | 98 |
! |
99 |
||
100 |
webServiceLinkName |
|
101 |
^ '/workspace' |
|
7825 | 102 |
! ! |
103 |
||
8708 | 104 |
!WorkspaceApplication class methodsFor:'help specs'! |
105 |
||
106 |
flyByHelpSpec |
|
107 |
<resource: #help> |
|
108 |
||
10220 | 109 |
^ super flyByHelpSpec addPairsFrom:#( |
8708 | 110 |
|
12479 | 111 |
#editCopy |
112 |
'Copy the selected text to the clipboard' |
|
113 |
||
114 |
#editCut |
|
115 |
'Cut the selected text to the clipboard' |
|
116 |
||
117 |
#editDelete |
|
118 |
'Delete the selected text' |
|
119 |
||
10169 | 120 |
#addTerminal |
10277 | 121 |
'Add a tab with an embedded console-terminal' |
122 |
||
123 |
#addTerminalWindows |
|
10169 | 124 |
'Add a tab with an embedded console-terminal (windows users: ignore the no-echo bug, please)' |
125 |
||
9695 | 126 |
#columnLabel |
127 |
'The text-cursor''s column number' |
|
128 |
||
129 |
#lineLabel |
|
130 |
'The text-cursor''s line number. Double-Click to change' |
|
131 |
||
132 |
#modeLabel |
|
133 |
'The editing mode (Insert vs. Overwrite). Right-Click to change' |
|
134 |
||
8708 | 135 |
#editRedo |
8709 | 136 |
'Redo' |
8708 | 137 |
|
138 |
#doIndent |
|
139 |
'Indent (Shift Right)' |
|
140 |
||
141 |
#doUndent |
|
142 |
'Undent (Shift Left)' |
|
143 |
||
9676 | 144 |
#languageSelection |
145 |
'Syntax selection. Right-Click for Menu' |
|
146 |
||
10169 | 147 |
#menuSave |
148 |
'Save the page''s contents in the original file' |
|
149 |
||
150 |
#menuSaveAs |
|
151 |
'Ask for a file and save the page''s contents there' |
|
8708 | 152 |
) |
9676 | 153 |
|
10277 | 154 |
"Modified: / 08-07-2011 / 08:29:51 / cg" |
8708 | 155 |
! ! |
156 |
||
7931 | 157 |
!WorkspaceApplication class methodsFor:'interface specs'! |
158 |
||
159 |
manageSnipletsDialogSpec |
|
160 |
"This resource specification was automatically generated |
|
161 |
by the UIPainter of ST/X." |
|
162 |
||
163 |
"Do not manually edit this!! If it is corrupted, |
|
164 |
the UIPainter may not be able to read the specification." |
|
165 |
||
166 |
" |
|
167 |
UIPainter new openOnClass:WorkspaceApplication andSelector:#manageSnipletsDialogSpec |
|
168 |
WorkspaceApplication new openInterface:#manageSnipletsDialogSpec |
|
169 |
" |
|
170 |
||
171 |
<resource: #canvas> |
|
172 |
||
12308 | 173 |
^ |
7931 | 174 |
#(FullSpec |
12308 | 175 |
name: manageSnipletsDialogSpec |
176 |
window: |
|
7931 | 177 |
(WindowSpec |
12308 | 178 |
label: 'Manage Sniplets' |
179 |
name: 'Manage Sniplets' |
|
180 |
min: (Point 10 10) |
|
181 |
bounds: (Rectangle 0 0 379 590) |
|
182 |
) |
|
183 |
component: |
|
7931 | 184 |
(SpecCollection |
12308 | 185 |
collection: ( |
186 |
(LabelSpec |
|
187 |
label: 'Sniplet:' |
|
188 |
name: 'Label1' |
|
189 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
190 |
translateLabel: true |
|
191 |
adjust: left |
|
192 |
) |
|
193 |
(VariableVerticalPanelSpec |
|
194 |
name: 'VariableVerticalPanel1' |
|
195 |
layout: (LayoutFrame 0 0 30 0 0 1 -80 1) |
|
196 |
component: |
|
197 |
(SpecCollection |
|
198 |
collection: ( |
|
199 |
(SequenceViewSpec |
|
200 |
name: 'List1' |
|
201 |
model: selectedSniplet |
|
202 |
hasHorizontalScrollBar: true |
|
203 |
hasVerticalScrollBar: true |
|
204 |
useIndex: true |
|
205 |
sequenceList: listOfSniplets |
|
206 |
) |
|
207 |
(TextEditorSpec |
|
208 |
name: 'TextEditor1' |
|
209 |
model: selectedSnipletsText |
|
210 |
hasHorizontalScrollBar: true |
|
211 |
hasVerticalScrollBar: true |
|
212 |
hasKeyboardFocusInitially: false |
|
213 |
viewClassName: '' |
|
214 |
) |
|
215 |
) |
|
216 |
||
217 |
) |
|
218 |
handles: (Any 0.5 1.0) |
|
219 |
) |
|
220 |
(HorizontalPanelViewSpec |
|
221 |
name: 'ButtonPanel' |
|
222 |
layout: (LayoutFrame 0 0 -70 1 0 1 -40 1) |
|
223 |
horizontalLayout: center |
|
224 |
verticalLayout: center |
|
225 |
horizontalSpace: 3 |
|
226 |
verticalSpace: 3 |
|
227 |
component: |
|
228 |
(SpecCollection |
|
229 |
collection: ( |
|
230 |
(ActionButtonSpec |
|
231 |
label: 'Save Changes' |
|
232 |
name: 'Button4' |
|
233 |
translateLabel: true |
|
234 |
model: saveSelectedSniplet |
|
235 |
enableChannel: saveEnabled |
|
236 |
extent: (Point 125 22) |
|
237 |
) |
|
238 |
(ActionButtonSpec |
|
239 |
label: 'Remove' |
|
240 |
name: 'Button2' |
|
241 |
translateLabel: true |
|
242 |
model: removeSelectedSniplet |
|
243 |
enableChannel: removeEnabled |
|
244 |
extent: (Point 125 22) |
|
245 |
) |
|
246 |
(ActionButtonSpec |
|
247 |
label: 'Paste' |
|
248 |
name: 'Button3' |
|
249 |
translateLabel: true |
|
250 |
model: pasteSelectedSniplet |
|
251 |
enableChannel: pasteEnabled |
|
252 |
extent: (Point 125 22) |
|
253 |
) |
|
254 |
) |
|
255 |
||
256 |
) |
|
257 |
) |
|
258 |
(DividerSpec |
|
259 |
name: 'Separator1' |
|
260 |
layout: (LayoutFrame 0 0.0 557 0 0 1.0 561 0) |
|
261 |
) |
|
262 |
(HorizontalPanelViewSpec |
|
263 |
name: 'CloseButtonPanel' |
|
264 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
265 |
horizontalLayout: fitSpace |
|
266 |
verticalLayout: center |
|
267 |
horizontalSpace: 3 |
|
268 |
verticalSpace: 3 |
|
269 |
reverseOrderIfOKAtLeft: true |
|
270 |
component: |
|
271 |
(SpecCollection |
|
272 |
collection: ( |
|
273 |
(ActionButtonSpec |
|
274 |
label: 'Close' |
|
275 |
name: 'Button1' |
|
276 |
translateLabel: true |
|
277 |
model: cancel |
|
278 |
extent: (Point 373 22) |
|
279 |
) |
|
280 |
) |
|
281 |
||
282 |
) |
|
283 |
) |
|
284 |
) |
|
285 |
||
286 |
) |
|
7931 | 287 |
) |
9381 | 288 |
! |
289 |
||
10169 | 290 |
toolBarSpec |
291 |
"This resource specification was automatically generated |
|
292 |
by the UIPainter of ST/X." |
|
293 |
||
294 |
"Do not manually edit this!! If it is corrupted, |
|
295 |
the UIPainter may not be able to read the specification." |
|
296 |
||
297 |
" |
|
298 |
UIPainter new openOnClass:WorkspaceApplication andSelector:#toolBarSpec |
|
299 |
WorkspaceApplication new openInterface:#toolBarSpec |
|
300 |
" |
|
301 |
||
302 |
<resource: #canvas> |
|
303 |
||
12308 | 304 |
^ |
10169 | 305 |
#(FullSpec |
12308 | 306 |
name: toolBarSpec |
307 |
window: |
|
10169 | 308 |
(WindowSpec |
12308 | 309 |
label: 'Toolbar' |
310 |
name: 'Toolbar' |
|
311 |
min: (Point 10 10) |
|
312 |
bounds: (Rectangle 0 0 728 48) |
|
313 |
) |
|
314 |
component: |
|
10169 | 315 |
(SpecCollection |
12308 | 316 |
collection: ( |
317 |
(MenuPanelSpec |
|
318 |
name: 'ToolBarMenu' |
|
319 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
320 |
level: 0 |
|
321 |
visibilityChannel: toolBarVisibleHolder |
|
322 |
menu: toolBarMenu |
|
323 |
textDefault: true |
|
324 |
) |
|
325 |
) |
|
326 |
||
327 |
) |
|
10169 | 328 |
) |
329 |
! |
|
330 |
||
9381 | 331 |
windowSpec |
332 |
"This resource specification was automatically generated |
|
333 |
by the UIPainter of ST/X." |
|
334 |
||
335 |
"Do not manually edit this!! If it is corrupted, |
|
336 |
the UIPainter may not be able to read the specification." |
|
337 |
||
338 |
" |
|
339 |
UIPainter new openOnClass:WorkspaceApplication andSelector:#windowSpec |
|
340 |
WorkspaceApplication new openInterface:#windowSpec |
|
341 |
WorkspaceApplication open |
|
342 |
" |
|
343 |
||
344 |
<resource: #canvas> |
|
345 |
||
12308 | 346 |
^ |
9381 | 347 |
#(FullSpec |
12308 | 348 |
name: windowSpec |
349 |
window: |
|
9381 | 350 |
(WindowSpec |
12308 | 351 |
label: 'Workspace' |
352 |
name: 'Workspace' |
|
353 |
min: (Point 10 10) |
|
354 |
bounds: (Rectangle 0 0 640 480) |
|
355 |
menu: mainMenu |
|
356 |
) |
|
357 |
component: |
|
9381 | 358 |
(SpecCollection |
12308 | 359 |
collection: ( |
360 |
(ViewSpec |
|
361 |
name: 'ToolBar' |
|
362 |
layout: (LayoutFrame 0 0 0 0 0 1 32 0) |
|
363 |
visibilityChannel: toolBarVisibleHolder |
|
364 |
component: |
|
365 |
(SpecCollection |
|
366 |
collection: ( |
|
367 |
(ActionButtonSpec |
|
368 |
label: 'hideToolBarIcon' |
|
369 |
name: 'HideToolBarButton' |
|
370 |
layout: (LayoutFrame 0 0 0 0 13 0 0 1) |
|
371 |
activeHelpKey: hideToolBar |
|
372 |
hasCharacterOrientedLabel: false |
|
373 |
translateLabel: true |
|
374 |
model: hideToolbar |
|
375 |
postBuildCallback: hideToolBarButtonCreated: |
|
376 |
) |
|
377 |
(NonScrollableArbitraryComponentSpec |
|
378 |
name: 'ToolBarView' |
|
379 |
layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0) |
|
380 |
level: 1 |
|
381 |
visibilityChannel: toolBarVisibleHolder |
|
382 |
component: toolBarView |
|
383 |
) |
|
384 |
) |
|
385 |
||
386 |
) |
|
387 |
) |
|
388 |
(ViewSpec |
|
389 |
name: 'EditToolBar' |
|
390 |
layout: (LayoutFrame 0 0 32 0 0 1 64 0) |
|
391 |
visibilityChannel: editToolBarVisibleHolder |
|
392 |
component: |
|
393 |
(SpecCollection |
|
394 |
collection: ( |
|
395 |
(ActionButtonSpec |
|
396 |
label: 'hideToolBarIcon' |
|
397 |
name: 'HideEditToolBarButton' |
|
398 |
layout: (LayoutFrame 0 0 0 0 13 0 0 1) |
|
399 |
activeHelpKey: hideEditToolBar |
|
400 |
hasCharacterOrientedLabel: false |
|
401 |
translateLabel: true |
|
402 |
model: hideEditToolbar |
|
403 |
postBuildCallback: hideToolBarButtonCreated: |
|
404 |
) |
|
405 |
(MenuPanelSpec |
|
406 |
name: 'EditToolBar1' |
|
407 |
layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0) |
|
408 |
visibilityChannel: editToolBarVisibleHolder |
|
409 |
menu: editToolBarMenu |
|
410 |
textDefault: true |
|
411 |
) |
|
412 |
) |
|
413 |
||
414 |
) |
|
415 |
) |
|
416 |
(NoteBookViewSpec |
|
417 |
name: 'NoteBook' |
|
418 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -26 1.0) |
|
419 |
model: selectedWorkspaceIndexHolder |
|
420 |
menu: tabList |
|
421 |
useIndex: true |
|
422 |
accessTabMenuAction: tabMenuAt: |
|
423 |
destroyTabAction: destroyTab: |
|
424 |
canvas: workspaceHolder |
|
425 |
canvasInset: 0 |
|
426 |
keepCanvasAlive: true |
|
427 |
tabLevel: 1 |
|
428 |
) |
|
429 |
(UISubSpecification |
|
430 |
name: 'infoBarSubSpec' |
|
431 |
layout: (LayoutFrame 0 0.0 -26 1 0 1.0 0 1.0) |
|
432 |
visibilityChannel: infoVisibleHolder |
|
433 |
majorKey: WorkspaceApplication |
|
434 |
minorKey: windowSpecForInfoBar |
|
12340
8332590c5a41
class: WorkspaceApplication
Claus Gittinger <cg@exept.de>
parents:
12032
diff
changeset
|
435 |
keepSpaceForOSXResizeHandleH: true |
12308 | 436 |
) |
437 |
) |
|
438 |
||
439 |
) |
|
9381 | 440 |
) |
441 |
! |
|
442 |
||
443 |
windowSpecForInfoBar |
|
444 |
"This resource specification was automatically generated |
|
445 |
by the UIPainter of ST/X." |
|
446 |
||
447 |
"Do not manually edit this!! If it is corrupted, |
|
448 |
the UIPainter may not be able to read the specification." |
|
449 |
||
450 |
" |
|
451 |
UIPainter new openOnClass:WorkspaceApplication andSelector:#windowSpecForInfoBar |
|
452 |
WorkspaceApplication new openInterface:#windowSpecForInfoBar |
|
453 |
" |
|
454 |
||
455 |
<resource: #canvas> |
|
456 |
||
12308 | 457 |
^ |
9381 | 458 |
#(FullSpec |
12308 | 459 |
name: windowSpecForInfoBar |
460 |
window: |
|
9381 | 461 |
(WindowSpec |
12308 | 462 |
label: 'Info Bar' |
463 |
name: 'Info Bar' |
|
464 |
min: (Point 400 320) |
|
465 |
max: (Point 1152 900) |
|
466 |
bounds: (Rectangle 0 0 500 30) |
|
467 |
) |
|
468 |
component: |
|
9381 | 469 |
(SpecCollection |
12308 | 470 |
collection: ( |
471 |
(ViewSpec |
|
472 |
name: 'infoView' |
|
473 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
474 |
component: |
|
475 |
(SpecCollection |
|
476 |
collection: ( |
|
477 |
(LabelSpec |
|
478 |
name: 'infoLabel' |
|
479 |
layout: (LayoutFrame 0 0.0 0 0.0 -162 1.0 0 1.0) |
|
480 |
level: -1 |
|
481 |
labelChannel: infoLabelHolder |
|
482 |
resizeForLabel: false |
|
483 |
adjust: left |
|
484 |
) |
|
485 |
(LabelSpec |
|
486 |
name: 'LanguageLabel' |
|
487 |
layout: (LayoutFrame -160 1.0 0 0.0 -60 1.0 0 1.0) |
|
488 |
activeHelpKey: languageSelection |
|
489 |
level: -1 |
|
490 |
labelChannel: languageInfoLabelHolder |
|
491 |
resizeForLabel: false |
|
492 |
adjust: left |
|
493 |
menu: languageInfoLabelMenu |
|
494 |
) |
|
495 |
(LabelSpec |
|
496 |
name: 'ModeLabel' |
|
497 |
layout: (LayoutFrame -60 1 0 0.0 -50 1 0 1.0) |
|
498 |
activeHelpKey: modeLabel |
|
499 |
level: -1 |
|
500 |
translateLabel: true |
|
501 |
labelChannel: modeLabelHolder |
|
502 |
postBuildCallback: postBuildEditModeInfoLabel: |
|
503 |
) |
|
504 |
(LabelSpec |
|
505 |
name: 'CursorLineLabel' |
|
506 |
layout: (LayoutFrame -50 1 0 0.0 -20 1 0 1.0) |
|
507 |
activeHelpKey: lineLabel |
|
508 |
level: -1 |
|
509 |
translateLabel: true |
|
510 |
labelChannel: cursorLineLabelHolder |
|
511 |
adjust: right |
|
512 |
) |
|
513 |
(LabelSpec |
|
514 |
name: 'CursorColLabel' |
|
515 |
layout: (LayoutFrame -20 1 0 0.0 0 1.0 0 1.0) |
|
516 |
activeHelpKey: columnLabel |
|
517 |
level: -1 |
|
518 |
translateLabel: true |
|
519 |
labelChannel: cursorColLabelHolder |
|
520 |
adjust: right |
|
521 |
) |
|
522 |
) |
|
523 |
||
524 |
) |
|
525 |
) |
|
526 |
) |
|
527 |
||
528 |
) |
|
9381 | 529 |
) |
7931 | 530 |
! ! |
531 |
||
3154 | 532 |
!WorkspaceApplication class methodsFor:'menu specs'! |
533 |
||
10169 | 534 |
bufferAddMenuSlice |
535 |
"This resource specification was automatically generated |
|
536 |
by the MenuEditor of ST/X." |
|
537 |
||
538 |
"Do not manually edit this!! If it is corrupted, |
|
539 |
the MenuEditor may not be able to read the specification." |
|
540 |
||
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
541 |
|
10169 | 542 |
" |
543 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#bufferAddMenuSlice |
|
544 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication bufferAddMenuSlice)) startUp |
|
545 |
" |
|
546 |
||
547 |
<resource: #menu> |
|
548 |
||
12308 | 549 |
^ |
10169 | 550 |
#(Menu |
12308 | 551 |
( |
552 |
(MenuItem |
|
553 |
label: 'Terminal' |
|
554 |
itemValue: addTerminal |
|
555 |
translateLabel: true |
|
556 |
) |
|
557 |
(MenuItem |
|
558 |
label: 'Web Browser' |
|
559 |
itemValue: addWebBrowser |
|
560 |
translateLabel: true |
|
561 |
isVisible: isWebBrowserAvailable |
|
562 |
) |
|
563 |
(MenuItem |
|
564 |
enabled: isSQLWorkspaceAvailable |
|
565 |
label: 'SQL Workspace' |
|
566 |
itemValue: addSQLWorkspace |
|
567 |
translateLabel: true |
|
568 |
) |
|
569 |
(MenuItem |
|
570 |
label: 'Tea Timer' |
|
571 |
itemValue: addTeaTimer |
|
572 |
translateLabel: true |
|
573 |
) |
|
574 |
(MenuItem |
|
12032
37dea732aec1
changed: #bufferAddMenuSlice
Claus Gittinger <cg@exept.de>
parents:
12028
diff
changeset
|
575 |
label: 'Stopwatch' |
12308 | 576 |
itemValue: addStopWatch |
577 |
translateLabel: true |
|
578 |
) |
|
579 |
) |
|
580 |
nil |
|
581 |
nil |
|
10169 | 582 |
) |
583 |
! |
|
584 |
||
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
585 |
bufferMenu |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
586 |
"This resource specification was automatically generated |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
587 |
by the MenuEditor of ST/X." |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
588 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
589 |
"Do not manually edit this!! If it is corrupted, |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
590 |
the MenuEditor may not be able to read the specification." |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
591 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
592 |
" |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
593 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#bufferMenu |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
594 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication bufferMenu)) startUp |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
595 |
" |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
596 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
597 |
<resource: #menu> |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
598 |
|
12308 | 599 |
^ |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
600 |
#(Menu |
12308 | 601 |
( |
602 |
(MenuItem |
|
603 |
label: 'Add Buffer' |
|
604 |
itemValue: addWorkspace |
|
605 |
translateLabel: true |
|
606 |
shortcutKey: Ctrlt |
|
607 |
) |
|
608 |
(MenuItem |
|
609 |
label: '-' |
|
610 |
isVisible: thisIsASmalltalkWorkspace |
|
611 |
) |
|
612 |
(MenuItem |
|
613 |
label: 'Add Buffer on MyWorkspace' |
|
614 |
itemValue: addMyWorkspace |
|
615 |
translateLabel: true |
|
616 |
isVisible: thisIsASmalltalkWorkspace |
|
617 |
) |
|
618 |
(MenuItem |
|
619 |
enabled: anyWorkspaceVariableIsDefined |
|
620 |
label: 'Add Buffer on Workspace Variables' |
|
621 |
itemValue: addWorkspaceVariableInspector |
|
622 |
translateLabel: true |
|
623 |
isVisible: thisIsASmalltalkWorkspace |
|
624 |
) |
|
625 |
(MenuItem |
|
626 |
label: 'Add Buffer on Global Variables' |
|
627 |
itemValue: addGlobalVariableInspector |
|
628 |
translateLabel: true |
|
629 |
isVisible: thisIsASmalltalkWorkspace |
|
630 |
) |
|
631 |
(MenuItem |
|
632 |
label: 'Add Buffer on Namespace...' |
|
633 |
itemValue: addNamespaceInspector |
|
634 |
translateLabel: true |
|
635 |
isVisible: thisIsASmalltalkWorkspace |
|
636 |
) |
|
637 |
(MenuItem |
|
638 |
label: 'Add Buffer on SharedPool...' |
|
639 |
itemValue: addSharedPoolInspector |
|
640 |
translateLabel: true |
|
641 |
isVisible: thisIsASmalltalkWorkspace |
|
642 |
) |
|
643 |
(MenuItem |
|
644 |
label: 'Add Buffer on Class Variables' |
|
645 |
itemValue: addClassVariableInspector |
|
646 |
translateLabel: true |
|
647 |
isVisible: thisIsASmalltalkWorkspace |
|
648 |
) |
|
649 |
(MenuItem |
|
650 |
label: '-' |
|
651 |
isVisible: thisIsASmalltalkWorkspace |
|
652 |
) |
|
653 |
(MenuItem |
|
654 |
label: 'Add Evaluation Buffer' |
|
655 |
itemValue: addEvaluationWorkspace |
|
656 |
translateLabel: true |
|
657 |
isVisible: thisIsASmalltalkWorkspace |
|
658 |
) |
|
659 |
(MenuItem |
|
660 |
label: '-' |
|
661 |
) |
|
662 |
(MenuItem |
|
663 |
label: 'Menu Slice' |
|
664 |
translateLabel: true |
|
665 |
submenuChannel: bufferAddMenuSlice |
|
666 |
isMenuSlice: true |
|
667 |
) |
|
668 |
(MenuItem |
|
669 |
label: '-' |
|
670 |
) |
|
671 |
(MenuItem |
|
672 |
label: 'Rename...' |
|
673 |
itemValue: renameWorkspace |
|
674 |
translateLabel: true |
|
675 |
) |
|
676 |
(MenuItem |
|
677 |
label: '-' |
|
678 |
) |
|
679 |
(MenuItem |
|
680 |
enabled: canRemoveWorkspace |
|
681 |
label: 'Remove Buffer' |
|
682 |
itemValue: removeWorkspace |
|
683 |
translateLabel: true |
|
684 |
) |
|
685 |
) |
|
686 |
nil |
|
687 |
nil |
|
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
688 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
689 |
! |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
690 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
691 |
editMenu |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
692 |
"This resource specification was automatically generated |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
693 |
by the MenuEditor of ST/X." |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
694 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
695 |
"Do not manually edit this!! If it is corrupted, |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
696 |
the MenuEditor may not be able to read the specification." |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
697 |
|
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
698 |
|
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
699 |
" |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
700 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#editMenu |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
701 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication editMenu)) startUp |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
702 |
" |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
703 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
704 |
<resource: #menu> |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
705 |
|
12308 | 706 |
^ |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
707 |
#(Menu |
12308 | 708 |
( |
709 |
(MenuItem |
|
710 |
enabled: hasSelectionInActiveWorkspace |
|
711 |
label: 'Cut' |
|
712 |
itemValue: cutSelection |
|
713 |
translateLabel: true |
|
714 |
) |
|
715 |
(MenuItem |
|
716 |
enabled: hasSelectionInActiveWorkspace |
|
717 |
label: 'Copy' |
|
718 |
itemValue: copySelection |
|
719 |
translateLabel: true |
|
720 |
) |
|
721 |
(MenuItem |
|
722 |
label: 'Paste' |
|
723 |
itemValue: paste |
|
724 |
translateLabel: true |
|
725 |
) |
|
726 |
(MenuItem |
|
727 |
enabled: hasHistory |
|
728 |
label: 'Paste Last' |
|
729 |
itemValue: pasteLastDoIt |
|
730 |
translateLabel: true |
|
731 |
isVisible: thisIsASmalltalkWorkspace |
|
732 |
submenuChannel: pasteRecentDoItMenu |
|
733 |
) |
|
734 |
(MenuItem |
|
735 |
label: '-' |
|
736 |
) |
|
737 |
(MenuItem |
|
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
738 |
enabled: hasSelectionInActiveWorkspace |
12308 | 739 |
label: 'Copy as Sniplet...' |
740 |
itemValue: addSelectionToSniplets |
|
741 |
translateLabel: true |
|
742 |
) |
|
743 |
(MenuItem |
|
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
744 |
enabled: selectedWorkspaceIsTextView |
12308 | 745 |
label: 'Paste Sniplet...' |
746 |
itemValue: pasteSniplet |
|
747 |
translateLabel: true |
|
748 |
) |
|
749 |
(MenuItem |
|
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
750 |
enabled: selectedWorkspaceIsTextView |
12308 | 751 |
label: 'Manage Sniplets...' |
752 |
itemValue: manageSniplets |
|
753 |
translateLabel: true |
|
754 |
) |
|
755 |
(MenuItem |
|
756 |
label: '-' |
|
757 |
) |
|
758 |
(MenuItem |
|
759 |
label: 'Select All' |
|
760 |
itemValue: selectAll |
|
761 |
translateLabel: true |
|
762 |
) |
|
763 |
(MenuItem |
|
764 |
label: '-' |
|
765 |
isVisible: thisIsASmalltalkWorkspace |
|
766 |
) |
|
767 |
(MenuItem |
|
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
768 |
enabled: selectedWorkspaceIsTextView |
12308 | 769 |
label: 'Filter Text...' |
770 |
itemValue: filterText |
|
771 |
translateLabel: true |
|
772 |
isVisible: thisIsASmalltalkWorkspace |
|
773 |
) |
|
774 |
(MenuItem |
|
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
775 |
enabled: selectedWorkspaceIsTextView |
12308 | 776 |
label: 'Process Text...' |
777 |
itemValue: processText |
|
778 |
translateLabel: true |
|
779 |
isVisible: thisIsASmalltalkWorkspace |
|
780 |
) |
|
781 |
(MenuItem |
|
11496 | 782 |
label: 'Compare Text Against...' |
783 |
itemValue: compareTextAgainst |
|
784 |
translateLabel: true |
|
785 |
) |
|
786 |
(MenuItem |
|
12308 | 787 |
label: '-' |
788 |
) |
|
789 |
(MenuItem |
|
790 |
label: 'Services' |
|
791 |
translateLabel: true |
|
792 |
submenu: |
|
793 |
(Menu |
|
794 |
( |
|
795 |
(MenuItem |
|
796 |
label: 'Autofetch Selection' |
|
797 |
itemValue: autoFetchSelection: |
|
798 |
translateLabel: true |
|
11627 | 799 |
hideMenuOnActivated: false |
12308 | 800 |
indication: autoFetchSelection |
801 |
) |
|
802 |
(MenuItem |
|
11627 | 803 |
enabled: autoFetchSelection |
804 |
label: 'Insert as Line (Append CR)' |
|
12308 | 805 |
translateLabel: true |
11627 | 806 |
hideMenuOnActivated: false |
12308 | 807 |
indication: autoFetchSelectionLines |
808 |
) |
|
809 |
(MenuItem |
|
810 |
label: '-' |
|
811 |
isVisible: thisIsASmalltalkWorkspace |
|
812 |
) |
|
813 |
(MenuItem |
|
814 |
enabled: hasSelectionInActiveWorkspace |
|
815 |
label: 'Google Spell' |
|
816 |
itemValue: googleSpellingSuggestion |
|
817 |
translateLabel: true |
|
818 |
isVisible: thisIsASmalltalkWorkspace |
|
819 |
) |
|
820 |
(MenuItem |
|
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
821 |
enabled: hasSelectionInActiveWorkspace |
12308 | 822 |
label: 'Translate (babelFish)' |
823 |
translateLabel: true |
|
824 |
isVisible: thisIsASmalltalkWorkspace |
|
825 |
submenu: |
|
826 |
(Menu |
|
827 |
( |
|
828 |
(MenuItem |
|
829 |
enabled: hasSelectionInActiveWorkspace |
|
830 |
label: 'English -> German' |
|
831 |
itemValue: babelFishTranslate: |
|
832 |
translateLabel: true |
|
833 |
argument: 'en_de' |
|
834 |
) |
|
835 |
(MenuItem |
|
836 |
enabled: hasSelectionInActiveWorkspace |
|
837 |
label: 'English -> French' |
|
838 |
itemValue: babelFishTranslate: |
|
839 |
translateLabel: true |
|
840 |
argument: 'en_fr' |
|
841 |
) |
|
842 |
(MenuItem |
|
843 |
enabled: hasSelectionInActiveWorkspace |
|
844 |
label: 'English -> Spanish' |
|
845 |
itemValue: babelFishTranslate: |
|
846 |
translateLabel: true |
|
847 |
argument: 'en_es' |
|
848 |
) |
|
849 |
(MenuItem |
|
850 |
enabled: hasSelectionInActiveWorkspace |
|
851 |
label: 'English -> Portuguese' |
|
852 |
itemValue: babelFishTranslate: |
|
853 |
translateLabel: true |
|
854 |
argument: 'en_pt' |
|
855 |
) |
|
856 |
(MenuItem |
|
857 |
label: '-' |
|
858 |
) |
|
859 |
(MenuItem |
|
860 |
enabled: hasSelectionInActiveWorkspace |
|
861 |
label: 'German -> English' |
|
862 |
itemValue: babelFishTranslate: |
|
863 |
translateLabel: true |
|
864 |
argument: 'de_en' |
|
865 |
) |
|
866 |
(MenuItem |
|
867 |
enabled: hasSelectionInActiveWorkspace |
|
868 |
label: 'French -> English' |
|
869 |
itemValue: babelFishTranslate: |
|
870 |
translateLabel: true |
|
871 |
argument: 'fr_en' |
|
872 |
) |
|
873 |
(MenuItem |
|
874 |
enabled: hasSelectionInActiveWorkspace |
|
875 |
label: 'Spanish -> English' |
|
876 |
itemValue: babelFishTranslate: |
|
877 |
translateLabel: true |
|
878 |
argument: 'es_en' |
|
879 |
) |
|
880 |
(MenuItem |
|
881 |
enabled: hasSelectionInActiveWorkspace |
|
882 |
label: 'Portuguese -> English' |
|
883 |
itemValue: babelFishTranslate: |
|
884 |
translateLabel: true |
|
885 |
argument: 'pt_en' |
|
886 |
) |
|
887 |
(MenuItem |
|
888 |
enabled: hasSelectionInActiveWorkspace |
|
889 |
label: 'Russian -> English' |
|
890 |
itemValue: babelFishTranslate: |
|
891 |
translateLabel: true |
|
892 |
argument: 'ru_en' |
|
893 |
) |
|
894 |
) |
|
895 |
nil |
|
896 |
nil |
|
897 |
) |
|
898 |
) |
|
899 |
) |
|
900 |
nil |
|
901 |
nil |
|
902 |
) |
|
903 |
) |
|
904 |
) |
|
905 |
nil |
|
906 |
nil |
|
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
907 |
) |
11496 | 908 |
|
11627 | 909 |
"Modified: / 20-07-2012 / 10:30:57 / cg" |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
910 |
! |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
911 |
|
9695 | 912 |
editModeInfoLabelMenu |
913 |
"This resource specification was automatically generated |
|
914 |
by the MenuEditor of ST/X." |
|
915 |
||
916 |
"Do not manually edit this!! If it is corrupted, |
|
917 |
the MenuEditor may not be able to read the specification." |
|
918 |
||
919 |
" |
|
920 |
MenuEditor new openOnClass:Tools::NewSystemBrowser andSelector:#editModeInfoLabelMenu |
|
921 |
(Menu new fromLiteralArrayEncoding:(Tools::NewSystemBrowser editModeInfoLabelMenu)) startUp |
|
922 |
" |
|
923 |
||
924 |
<resource: #menu> |
|
925 |
||
12308 | 926 |
^ |
9695 | 927 |
#(Menu |
12308 | 928 |
( |
929 |
(MenuItem |
|
930 |
label: 'Insert' |
|
931 |
itemValue: editModeInsert |
|
932 |
translateLabel: true |
|
933 |
) |
|
934 |
(MenuItem |
|
935 |
label: 'Overwrite' |
|
936 |
itemValue: editModeOverwrite |
|
937 |
translateLabel: true |
|
938 |
) |
|
939 |
(MenuItem |
|
940 |
label: 'Insert Selecting' |
|
941 |
itemValue: editModeInsertAndSelect |
|
942 |
translateLabel: true |
|
943 |
) |
|
944 |
) |
|
945 |
nil |
|
946 |
nil |
|
9695 | 947 |
) |
948 |
||
949 |
"Created: / 22-01-2011 / 11:50:05 / cg" |
|
950 |
! |
|
951 |
||
8499 | 952 |
editToolBarMenu |
953 |
"This resource specification was automatically generated |
|
954 |
by the MenuEditor of ST/X." |
|
955 |
||
956 |
"Do not manually edit this!! If it is corrupted, |
|
957 |
the MenuEditor may not be able to read the specification." |
|
958 |
||
959 |
" |
|
960 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#editToolBarMenu |
|
961 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication editToolBarMenu)) startUp |
|
962 |
" |
|
963 |
||
964 |
<resource: #menu> |
|
965 |
||
12308 | 966 |
^ |
8499 | 967 |
#(Menu |
12308 | 968 |
( |
969 |
(MenuItem |
|
970 |
activeHelpKey: editCut |
|
971 |
label: 'Cut' |
|
972 |
itemValue: cutSelection |
|
973 |
translateLabel: true |
|
974 |
labelImage: (ResourceRetriever ToolbarIconLibrary cut16x16Icon) |
|
975 |
isButton: true |
|
976 |
) |
|
977 |
(MenuItem |
|
978 |
activeHelpKey: editCopy |
|
979 |
label: 'Copy' |
|
980 |
itemValue: copySelection |
|
981 |
translateLabel: true |
|
982 |
labelImage: (ResourceRetriever ToolbarIconLibrary copy16x16Icon) |
|
983 |
isButton: true |
|
984 |
) |
|
985 |
(MenuItem |
|
986 |
activeHelpKey: editPaste |
|
987 |
label: 'Paste' |
|
988 |
itemValue: paste |
|
989 |
translateLabel: true |
|
990 |
labelImage: (ResourceRetriever ToolbarIconLibrary paste16x16Icon) |
|
991 |
isButton: true |
|
992 |
) |
|
993 |
(MenuItem |
|
994 |
label: '-' |
|
995 |
) |
|
996 |
(MenuItem |
|
997 |
activeHelpKey: editUndo |
|
998 |
label: 'Undo' |
|
999 |
itemValue: undo |
|
1000 |
translateLabel: true |
|
1001 |
labelImage: (ResourceRetriever ToolbarIconLibrary undo16x16Icon) |
|
1002 |
isButton: true |
|
1003 |
) |
|
1004 |
(MenuItem |
|
1005 |
activeHelpKey: editRedo |
|
1006 |
label: 'Redo' |
|
1007 |
itemValue: redo |
|
1008 |
translateLabel: true |
|
1009 |
labelImage: (ResourceRetriever ToolbarIconLibrary redo16x16Icon) |
|
1010 |
isButton: true |
|
1011 |
) |
|
1012 |
(MenuItem |
|
1013 |
label: '-' |
|
1014 |
) |
|
1015 |
(MenuItem |
|
1016 |
activeHelpKey: editSearch |
|
1017 |
label: 'Search' |
|
1018 |
itemValue: search |
|
1019 |
translateLabel: true |
|
1020 |
labelImage: (ResourceRetriever ToolbarIconLibrary search16x16Icon) |
|
1021 |
isButton: true |
|
1022 |
) |
|
1023 |
(MenuItem |
|
1024 |
label: '-' |
|
1025 |
) |
|
1026 |
(MenuItem |
|
1027 |
activeHelpKey: doUndent |
|
1028 |
label: 'Undent' |
|
1029 |
itemValue: undent |
|
1030 |
translateLabel: true |
|
1031 |
isButton: true |
|
1032 |
labelImage: (ResourceRetriever ToolbarIconLibrary undent16x16Icon) |
|
1033 |
) |
|
1034 |
(MenuItem |
|
1035 |
activeHelpKey: doIndent |
|
1036 |
label: 'Indent' |
|
1037 |
itemValue: indent |
|
1038 |
translateLabel: true |
|
1039 |
isButton: true |
|
1040 |
labelImage: (ResourceRetriever ToolbarIconLibrary indent16x16Icon) |
|
1041 |
) |
|
1042 |
) |
|
1043 |
nil |
|
1044 |
nil |
|
8499 | 1045 |
) |
1046 |
! |
|
1047 |
||
8342 | 1048 |
executionMenu |
1049 |
"This resource specification was automatically generated |
|
1050 |
by the MenuEditor of ST/X." |
|
1051 |
||
1052 |
"Do not manually edit this!! If it is corrupted, |
|
1053 |
the MenuEditor may not be able to read the specification." |
|
1054 |
||
11483
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
1055 |
|
8342 | 1056 |
" |
8492 | 1057 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#executionMenu |
1058 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication executionMenu)) startUp |
|
8342 | 1059 |
" |
1060 |
||
1061 |
<resource: #menu> |
|
1062 |
||
12308 | 1063 |
^ |
8342 | 1064 |
#(Menu |
12308 | 1065 |
( |
1066 |
(MenuItem |
|
1067 |
enabled: hasHistory |
|
1068 |
label: 'Redo Last' |
|
1069 |
itemValue: redoLastDoIt |
|
1070 |
submenuChannel: redoRecentDoItMenu |
|
1071 |
) |
|
1072 |
(MenuItem |
|
1073 |
label: '-' |
|
1074 |
) |
|
1075 |
(MenuItem |
|
1076 |
enabled: hasSelectionInActiveWorkspace |
|
1077 |
label: 'DoIt' |
|
1078 |
itemValue: doIt |
|
1079 |
) |
|
1080 |
(MenuItem |
|
1081 |
enabled: hasSelectionInActiveWorkspace |
|
1082 |
label: 'PrintIt' |
|
1083 |
itemValue: printIt |
|
1084 |
) |
|
1085 |
(MenuItem |
|
1086 |
enabled: hasSelectionInActiveWorkspace |
|
1087 |
label: 'InspectIt' |
|
1088 |
itemValue: inspectIt |
|
1089 |
) |
|
1090 |
(MenuItem |
|
1091 |
label: '-' |
|
1092 |
) |
|
1093 |
(MenuItem |
|
1094 |
enabled: hasSelectionInActiveWorkspace |
|
1095 |
label: 'TimeIt' |
|
1096 |
itemValue: timeIt |
|
1097 |
) |
|
1098 |
(MenuItem |
|
1099 |
enabled: hasSelectionInActiveWorkspace |
|
1100 |
label: 'SpyOnIt (Transcript)' |
|
1101 |
itemValue: spyOnIt |
|
1102 |
) |
|
1103 |
(MenuItem |
|
1104 |
enabled: hasSelectionInActiveWorkspace |
|
1105 |
label: 'ProfileIt (Visual)' |
|
1106 |
itemValue: profileIt |
|
1107 |
) |
|
1108 |
(MenuItem |
|
1109 |
label: '-' |
|
1110 |
) |
|
1111 |
(MenuItem |
|
1112 |
enabled: hasSelectionInActiveWorkspace |
|
1113 |
label: 'Browse Class' |
|
1114 |
itemValue: browseIt |
|
1115 |
) |
|
1116 |
(MenuItem |
|
1117 |
enabled: hasSelectionInActiveWorkspace |
|
1118 |
label: 'Browse Implementors of It' |
|
1119 |
itemValue: browseImplementorsOfIt |
|
1120 |
) |
|
1121 |
(MenuItem |
|
1122 |
enabled: hasSelectionInActiveWorkspace |
|
1123 |
label: 'Browse References to It' |
|
1124 |
itemValue: browseReferencesToIt |
|
1125 |
) |
|
1126 |
) |
|
1127 |
nil |
|
1128 |
nil |
|
8342 | 1129 |
) |
1130 |
! |
|
1131 |
||
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1132 |
fileMenu |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1133 |
"This resource specification was automatically generated |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1134 |
by the MenuEditor of ST/X." |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1135 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1136 |
"Do not manually edit this!! If it is corrupted, |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1137 |
the MenuEditor may not be able to read the specification." |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1138 |
|
12244 | 1139 |
|
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1140 |
" |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1141 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#fileMenu |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1142 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication fileMenu)) startUp |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1143 |
" |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1144 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1145 |
<resource: #menu> |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1146 |
|
12308 | 1147 |
^ |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1148 |
#(Menu |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1149 |
( |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1150 |
(MenuItem |
12435
1f1faf35be04
Merged bc21844a6b32 and a8bd7df67b9a (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1151 |
label: 'Connect...' |
1f1faf35be04
Merged bc21844a6b32 and a8bd7df67b9a (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1152 |
itemValue: menuSQLConnect |
1f1faf35be04
Merged bc21844a6b32 and a8bd7df67b9a (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1153 |
translateLabel: true |
1f1faf35be04
Merged bc21844a6b32 and a8bd7df67b9a (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1154 |
isVisible: isSQLWorkspaceSelected |
1f1faf35be04
Merged bc21844a6b32 and a8bd7df67b9a (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1155 |
) |
1f1faf35be04
Merged bc21844a6b32 and a8bd7df67b9a (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1156 |
(MenuItem |
1f1faf35be04
Merged bc21844a6b32 and a8bd7df67b9a (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1157 |
label: '-' |
1f1faf35be04
Merged bc21844a6b32 and a8bd7df67b9a (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1158 |
isVisible: isSQLWorkspaceSelected |
1f1faf35be04
Merged bc21844a6b32 and a8bd7df67b9a (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1159 |
) |
1f1faf35be04
Merged bc21844a6b32 and a8bd7df67b9a (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1160 |
(MenuItem |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1161 |
label: 'New Workspace' |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1162 |
itemValue: newWorkspace |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1163 |
translateLabel: true |
10169 | 1164 |
shortcutKey: Ctrln |
1165 |
) |
|
1166 |
(MenuItem |
|
1167 |
label: 'New Tab' |
|
1168 |
itemValue: addWorkspace |
|
1169 |
translateLabel: true |
|
1170 |
isVisible: false |
|
1171 |
shortcutKey: Ctrlt |
|
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1172 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1173 |
(MenuItem |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1174 |
label: 'New SystemWorkspace' |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1175 |
itemValue: newSystemWorkspace |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1176 |
translateLabel: true |
7866 | 1177 |
isVisible: thisIsASmalltalkWorkspace |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1178 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1179 |
(MenuItem |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1180 |
label: 'New EvaluationWorkspace' |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1181 |
itemValue: newEvaluationWorkspace |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1182 |
translateLabel: true |
7866 | 1183 |
isVisible: thisIsASmalltalkWorkspace |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1184 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1185 |
(MenuItem |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1186 |
label: '-' |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1187 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1188 |
(MenuItem |
12435
1f1faf35be04
Merged bc21844a6b32 and a8bd7df67b9a (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1189 |
label: 'Open File...' |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1190 |
itemValue: menuLoad |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1191 |
translateLabel: true |
10169 | 1192 |
shortcutKey: Ctrlo |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1193 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1194 |
(MenuItem |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1195 |
label: '-' |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1196 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1197 |
(MenuItem |
10169 | 1198 |
label: 'Save' |
1199 |
itemValue: menuSave |
|
1200 |
translateLabel: true |
|
1201 |
shortcutKey: Ctrls |
|
1202 |
) |
|
1203 |
(MenuItem |
|
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1204 |
label: 'Save As...' |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1205 |
itemValue: menuSaveAs |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1206 |
translateLabel: true |
10169 | 1207 |
shortcutKey: SaveAs |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1208 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1209 |
(MenuItem |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1210 |
enabled: hasMultipleBuffersHolder |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1211 |
label: 'Save all As...' |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1212 |
itemValue: menuSaveAllAs |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1213 |
translateLabel: true |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1214 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1215 |
(MenuItem |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1216 |
label: '-' |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1217 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1218 |
(MenuItem |
8529
8d2391313df2
disable print item, if there is nothing to print
Claus Gittinger <cg@exept.de>
parents:
8508
diff
changeset
|
1219 |
enabled: hasTextInActiveWorkspace |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1220 |
label: 'Print...' |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1221 |
itemValue: menuPrint |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1222 |
translateLabel: true |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1223 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1224 |
(MenuItem |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1225 |
label: '-' |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1226 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1227 |
(MenuItem |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1228 |
label: 'Exit' |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1229 |
itemValue: closeRequest |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1230 |
translateLabel: true |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1231 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1232 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1233 |
nil |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1234 |
nil |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1235 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1236 |
! |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1237 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1238 |
helpMenu |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1239 |
"This resource specification was automatically generated |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1240 |
by the MenuEditor of ST/X." |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1241 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1242 |
"Do not manually edit this!! If it is corrupted, |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1243 |
the MenuEditor may not be able to read the specification." |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1244 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1245 |
" |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1246 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#helpMenu |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1247 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication helpMenu)) startUp |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1248 |
" |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1249 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1250 |
<resource: #menu> |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1251 |
|
12308 | 1252 |
^ |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1253 |
#(Menu |
12308 | 1254 |
( |
1255 |
(MenuItem |
|
1256 |
label: 'Documentation' |
|
1257 |
itemValue: openDocumentation |
|
1258 |
translateLabel: true |
|
1259 |
) |
|
1260 |
(MenuItem |
|
1261 |
label: 'Documentation on Smalltalk/X' |
|
1262 |
itemValue: openSTXDocumentation |
|
1263 |
translateLabel: true |
|
1264 |
) |
|
1265 |
(MenuItem |
|
1266 |
label: '-' |
|
1267 |
) |
|
1268 |
(MenuItem |
|
1269 |
label: 'About this Application...' |
|
1270 |
itemValue: openAboutThisApplication |
|
1271 |
translateLabel: true |
|
1272 |
) |
|
1273 |
) |
|
1274 |
nil |
|
1275 |
nil |
|
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1276 |
) |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1277 |
! |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1278 |
|
9676 | 1279 |
languageInfoLabelMenu |
1280 |
"This resource specification was automatically generated |
|
1281 |
by the MenuEditor of ST/X." |
|
1282 |
||
1283 |
"Do not manually edit this!! If it is corrupted, |
|
1284 |
the MenuEditor may not be able to read the specification." |
|
1285 |
||
1286 |
" |
|
1287 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#workspaceMenu |
|
1288 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication workspaceMenu)) startUp |
|
1289 |
" |
|
1290 |
||
1291 |
<resource: #menu> |
|
1292 |
||
12308 | 1293 |
^ |
9676 | 1294 |
#(Menu |
12308 | 1295 |
( |
9676 | 1296 |
"/ (MenuItem |
1297 |
"/ label: 'Smalltalk' |
|
1298 |
"/ translateLabel: true |
|
1299 |
"/ choice: syntaxHolder |
|
1300 |
"/ choiceValue: Smalltalk |
|
1301 |
"/ ) |
|
1302 |
"/ (MenuItem |
|
1303 |
"/ label: 'JavaScript' |
|
1304 |
"/ translateLabel: true |
|
1305 |
"/ choice: syntaxHolder |
|
1306 |
"/ choiceValue: JavaScript |
|
1307 |
"/ ) |
|
12308 | 1308 |
(MenuItem |
1309 |
label: 'Language List Slice' |
|
1310 |
translateLabel: true |
|
1311 |
submenuChannel: languageListMenuSlice |
|
1312 |
isMenuSlice: true |
|
1313 |
) |
|
1314 |
) |
|
1315 |
nil |
|
1316 |
nil |
|
1317 |
) |
|
9676 | 1318 |
|
1319 |
"Created: / 24-12-2010 / 02:03:59 / cg" |
|
1320 |
! |
|
1321 |
||
3154 | 1322 |
mainMenu |
1323 |
"This resource specification was automatically generated |
|
1324 |
by the MenuEditor of ST/X." |
|
1325 |
||
1326 |
"Do not manually edit this!! If it is corrupted, |
|
1327 |
the MenuEditor may not be able to read the specification." |
|
1328 |
||
1329 |
" |
|
1330 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#mainMenu |
|
1331 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication mainMenu)) startUp |
|
1332 |
" |
|
1333 |
||
1334 |
<resource: #menu> |
|
1335 |
||
12308 | 1336 |
^ |
5852 | 1337 |
#(Menu |
12308 | 1338 |
( |
1339 |
(MenuItem |
|
1340 |
label: 'File' |
|
1341 |
translateLabel: true |
|
1342 |
submenuChannel: fileMenu |
|
1343 |
keepLinkedMenu: true |
|
1344 |
) |
|
1345 |
(MenuItem |
|
1346 |
label: 'Buffers' |
|
1347 |
translateLabel: true |
|
1348 |
submenuChannel: bufferMenu |
|
1349 |
keepLinkedMenu: true |
|
1350 |
) |
|
1351 |
(MenuItem |
|
1352 |
label: 'Edit' |
|
1353 |
translateLabel: true |
|
1354 |
submenuChannel: editMenu |
|
1355 |
keepLinkedMenu: true |
|
1356 |
) |
|
1357 |
(MenuItem |
|
1358 |
label: 'View' |
|
1359 |
translateLabel: true |
|
1360 |
submenuChannel: viewMenu |
|
1361 |
keepLinkedMenu: true |
|
1362 |
) |
|
1363 |
(MenuItem |
|
1364 |
label: 'Bookmarks' |
|
1365 |
translateLabel: true |
|
1366 |
submenuChannel: bookmarkMenu |
|
1367 |
) |
|
1368 |
(MenuItem |
|
1369 |
label: 'Execute' |
|
1370 |
translateLabel: true |
|
1371 |
isVisible: executeMenuVisible |
|
1372 |
submenuChannel: executionMenu |
|
1373 |
keepLinkedMenu: true |
|
1374 |
) |
|
1375 |
(MenuItem |
|
1376 |
label: 'Workspace' |
|
1377 |
translateLabel: true |
|
1378 |
isVisible: thisIsASmalltalkWorkspace |
|
1379 |
submenuChannel: workspaceMenu |
|
1380 |
keepLinkedMenu: true |
|
1381 |
) |
|
1382 |
(MenuItem |
|
1383 |
enabled: smalltalkMenuEnabledHolder |
|
1384 |
label: 'Smalltalk' |
|
1385 |
translateLabel: true |
|
1386 |
isVisible: thisIsASmalltalkWorkspace |
|
1387 |
submenuChannel: smalltalkMenu |
|
1388 |
keepLinkedMenu: true |
|
1389 |
) |
|
1390 |
(MenuItem |
|
1391 |
label: 'MENU_Help' |
|
1392 |
translateLabel: true |
|
1393 |
submenuChannel: helpMenu |
|
1394 |
keepLinkedMenu: true |
|
1395 |
) |
|
1396 |
) |
|
1397 |
nil |
|
1398 |
nil |
|
3154 | 1399 |
) |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1400 |
! |
7831 | 1401 |
|
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1402 |
smalltalkMenu |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1403 |
"This resource specification was automatically generated |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1404 |
by the MenuEditor of ST/X." |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1405 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1406 |
"Do not manually edit this!! If it is corrupted, |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1407 |
the MenuEditor may not be able to read the specification." |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1408 |
|
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
1409 |
|
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1410 |
" |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1411 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#smalltalkMenu |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1412 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication smalltalkMenu)) startUp |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1413 |
" |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1414 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1415 |
<resource: #menu> |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1416 |
|
12308 | 1417 |
^ |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1418 |
#(Menu |
12308 | 1419 |
( |
1420 |
(MenuItem |
|
1421 |
enabled: hasSelectionInActiveWorkspace |
|
1422 |
label: 'FileIn Text' |
|
1423 |
itemValue: fileInText |
|
1424 |
translateLabel: true |
|
1425 |
) |
|
1426 |
(MenuItem |
|
1427 |
enabled: hasSelectionInActiveWorkspace |
|
1428 |
label: 'ChangeList on Text' |
|
1429 |
itemValue: changesBrowserOnText |
|
1430 |
translateLabel: true |
|
1431 |
) |
|
1432 |
(MenuItem |
|
1433 |
label: '-' |
|
1434 |
) |
|
1435 |
(MenuItem |
|
1436 |
enabled: selectedWorkspaceIsTextView |
|
1437 |
label: 'Add Global Variable...' |
|
1438 |
itemValue: addGlobalVariable |
|
1439 |
translateLabel: true |
|
1440 |
) |
|
1441 |
(MenuItem |
|
1442 |
enabled: selectedWorkspaceIsTextView |
|
1443 |
label: 'Remove Global Variable...' |
|
1444 |
itemValue: removeGlobalVariable |
|
1445 |
translateLabel: true |
|
1446 |
) |
|
1447 |
(MenuItem |
|
1448 |
label: '-' |
|
1449 |
) |
|
1450 |
(MenuItem |
|
1451 |
enabled: selectedWorkspaceIsTextView |
|
1452 |
label: 'Add SharedPool...' |
|
1453 |
itemValue: addSharedPool |
|
1454 |
translateLabel: true |
|
1455 |
) |
|
1456 |
(MenuItem |
|
1457 |
enabled: selectedWorkspaceIsTextView |
|
1458 |
label: 'Remove SharedPool...' |
|
1459 |
itemValue: removeSharedPool |
|
1460 |
translateLabel: true |
|
1461 |
) |
|
1462 |
) |
|
1463 |
nil |
|
1464 |
nil |
|
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1465 |
) |
7658 | 1466 |
! |
1467 |
||
1468 |
toolBarMenu |
|
1469 |
"This resource specification was automatically generated |
|
1470 |
by the MenuEditor of ST/X." |
|
1471 |
||
1472 |
"Do not manually edit this!! If it is corrupted, |
|
1473 |
the MenuEditor may not be able to read the specification." |
|
1474 |
||
1475 |
" |
|
1476 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#toolBarMenu |
|
1477 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication toolBarMenu)) startUp |
|
1478 |
" |
|
1479 |
||
1480 |
<resource: #menu> |
|
1481 |
||
12308 | 1482 |
^ |
7658 | 1483 |
#(Menu |
12308 | 1484 |
( |
1485 |
(MenuItem |
|
1486 |
label: '' |
|
1487 |
) |
|
1488 |
(MenuItem |
|
1489 |
label: 'Add Buffer' |
|
1490 |
itemValue: addWorkspace |
|
1491 |
translateLabel: true |
|
1492 |
isButton: true |
|
1493 |
labelImage: (ResourceRetriever ToolbarIconLibrary addBufferIcon) |
|
1494 |
) |
|
1495 |
(MenuItem |
|
1496 |
label: '-' |
|
1497 |
) |
|
1498 |
(MenuItem |
|
1499 |
activeHelpKey: menuSaveOrSaveAs |
|
1500 |
label: 'Save Text' |
|
1501 |
itemValue: menuSave |
|
1502 |
translateLabel: true |
|
1503 |
isButton: true |
|
1504 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveToFileIcon) |
|
1505 |
) |
|
1506 |
(MenuItem |
|
1507 |
label: '-' |
|
1508 |
isVisible: doItMenuButtonVisibile |
|
1509 |
) |
|
1510 |
(MenuItem |
|
1511 |
activeHelpKey: #'help_doIt' |
|
1512 |
label: 'DoIt' |
|
1513 |
itemValue: doIt |
|
1514 |
translateLabel: true |
|
1515 |
isButton: true |
|
1516 |
isVisible: doItMenuButtonVisibile |
|
1517 |
labelImage: (ResourceRetriever ToolbarIconLibrary doItIcon) |
|
1518 |
) |
|
1519 |
(MenuItem |
|
1520 |
activeHelpKey: #'help_printIt' |
|
1521 |
label: 'PrintIt' |
|
1522 |
itemValue: printIt |
|
1523 |
translateLabel: true |
|
1524 |
isButton: true |
|
1525 |
isVisible: printItMenuButtonVisibile |
|
1526 |
labelImage: (ResourceRetriever ToolbarIconLibrary printItIcon) |
|
1527 |
) |
|
1528 |
(MenuItem |
|
1529 |
activeHelpKey: #'help_inspectIt' |
|
1530 |
label: 'InspectIt' |
|
1531 |
itemValue: inspectIt |
|
1532 |
translateLabel: true |
|
1533 |
isButton: true |
|
1534 |
isVisible: inspectItMenuButtonVisibile |
|
1535 |
labelImage: (ResourceRetriever ToolbarIconLibrary inspectItIcon) |
|
1536 |
) |
|
1537 |
(MenuItem |
|
1538 |
activeHelpKey: #'help_browseIt' |
|
1539 |
label: 'BrowseIt' |
|
1540 |
itemValue: browseIt |
|
1541 |
translateLabel: true |
|
1542 |
isButton: true |
|
1543 |
isVisible: browseItMenuButtonVisibile |
|
1544 |
labelImage: (ResourceRetriever ToolbarIconLibrary browseItIcon) |
|
1545 |
) |
|
1546 |
(MenuItem |
|
1547 |
activeHelpKey: addTerminal |
|
1548 |
label: 'Web Browser' |
|
1549 |
itemValue: addWebBrowser |
|
1550 |
translateLabel: true |
|
1551 |
isButton: true |
|
1552 |
startGroup: right |
|
1553 |
isVisible: isWebBrowserAvailable |
|
1554 |
labelImage: (ResourceRetriever ToolbarIconLibrary webKit22x22) |
|
1555 |
) |
|
1556 |
(MenuItem |
|
1557 |
activeHelpKey: addTerminal |
|
1558 |
label: 'Terminal' |
|
1559 |
itemValue: addTerminal |
|
1560 |
translateLabel: true |
|
1561 |
isButton: true |
|
1562 |
startGroup: right |
|
1563 |
labelImage: (ResourceRetriever ToolbarIconLibrary shellTerminalIcon) |
|
1564 |
) |
|
1565 |
) |
|
1566 |
nil |
|
1567 |
nil |
|
7658 | 1568 |
) |
10169 | 1569 |
|
11612 | 1570 |
"Modified: / 19-07-2012 / 12:04:47 / cg" |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1571 |
! |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1572 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1573 |
workspaceMenu |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1574 |
"This resource specification was automatically generated |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1575 |
by the MenuEditor of ST/X." |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1576 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1577 |
"Do not manually edit this!! If it is corrupted, |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1578 |
the MenuEditor may not be able to read the specification." |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1579 |
|
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
1580 |
|
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1581 |
" |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1582 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#workspaceMenu |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1583 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication workspaceMenu)) startUp |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1584 |
" |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1585 |
|
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1586 |
<resource: #menu> |
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1587 |
|
12308 | 1588 |
^ |
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1589 |
#(Menu |
12308 | 1590 |
( |
1591 |
(MenuItem |
|
1592 |
enabled: selectedWorkspaceIsTextView |
|
1593 |
label: 'Add Workspace Variable...' |
|
1594 |
itemValue: addWorkspaceVariable |
|
1595 |
translateLabel: true |
|
1596 |
) |
|
1597 |
(MenuItem |
|
1598 |
enabled: anyWorkspaceVariableIsDefined |
|
1599 |
label: 'Remove Workspace Variable...' |
|
1600 |
itemValue: removeWorkspaceVariable |
|
1601 |
translateLabel: true |
|
1602 |
) |
|
1603 |
(MenuItem |
|
1604 |
enabled: anyWorkspaceVariableIsDefined |
|
1605 |
label: 'Remove all Workspace Variables...' |
|
1606 |
itemValue: removeAllWorkspaceVariables |
|
1607 |
translateLabel: true |
|
1608 |
) |
|
1609 |
(MenuItem |
|
1610 |
label: '-' |
|
1611 |
) |
|
1612 |
(MenuItem |
|
1613 |
label: 'Language List Slice' |
|
1614 |
translateLabel: true |
|
1615 |
submenuChannel: languageListMenuSlice |
|
1616 |
isMenuSlice: true |
|
1617 |
) |
|
1618 |
(MenuItem |
|
1619 |
label: '-' |
|
1620 |
) |
|
1621 |
(MenuItem |
|
1622 |
enabled: anyWorkspaceVariableIsDefined |
|
1623 |
label: 'Inspect Workspace Variables' |
|
1624 |
itemValue: inspectWorkspaceVariables |
|
1625 |
translateLabel: true |
|
1626 |
) |
|
1627 |
(MenuItem |
|
1628 |
label: '-' |
|
1629 |
) |
|
1630 |
(MenuItem |
|
1631 |
label: 'Autodefine Variables' |
|
1632 |
translateLabel: true |
|
1633 |
submenu: |
|
1634 |
(Menu |
|
1635 |
( |
|
1636 |
(MenuItem |
|
1637 |
label: 'As Workspace Variable' |
|
1638 |
translateLabel: true |
|
1639 |
hideMenuOnActivated: false |
|
1640 |
choice: autoDefineVariables |
|
1641 |
choiceValue: workspace |
|
1642 |
) |
|
1643 |
(MenuItem |
|
1644 |
label: 'As DoIt Variable' |
|
1645 |
translateLabel: true |
|
1646 |
hideMenuOnActivated: false |
|
1647 |
choice: autoDefineVariables |
|
1648 |
choiceValue: doIt |
|
1649 |
) |
|
1650 |
(MenuItem |
|
1651 |
label: '-' |
|
1652 |
) |
|
1653 |
(MenuItem |
|
1654 |
label: 'Do not Autodefine' |
|
1655 |
translateLabel: true |
|
1656 |
hideMenuOnActivated: false |
|
1657 |
choice: autoDefineVariables |
|
1658 |
) |
|
1659 |
) |
|
1660 |
nil |
|
1661 |
nil |
|
1662 |
) |
|
1663 |
) |
|
1664 |
) |
|
1665 |
nil |
|
1666 |
nil |
|
7865
ae5b649724dd
separated submenus into separate specs (for easier customization in subclasses)
Claus Gittinger <cg@exept.de>
parents:
7853
diff
changeset
|
1667 |
) |
11799 | 1668 |
|
1669 |
"Modified: / 12-09-2012 / 12:18:40 / cg" |
|
3154 | 1670 |
! ! |
1671 |
||
10169 | 1672 |
!WorkspaceApplication class methodsFor:'private'! |
1673 |
||
1674 |
createWorkspaceView |
|
10394 | 1675 |
^(UserPreferences current useCodeView2In:#Workspace) |
12405
76f9a872362b
Merged 3efd83b86c07 and 1206aff1f11 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1676 |
ifTrue:[Tools::CodeView2 new] |
76f9a872362b
Merged 3efd83b86c07 and 1206aff1f11 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1677 |
ifFalse:[HVScrollableView for:Workspace] |
10394 | 1678 |
|
1679 |
"Modified: / 26-07-2011 / 10:28:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10169 | 1680 |
! ! |
1681 |
||
3332 | 1682 |
!WorkspaceApplication class methodsFor:'special startup'! |
1683 |
||
7403
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1684 |
openEvaluationWorkspace |
11728
eb5cf1a80189
comment/format in: #openEvaluationWorkspace
Stefan Vogel <sv@exept.de>
parents:
11725
diff
changeset
|
1685 |
|wsApp needRemove| |
7403
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1686 |
|
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1687 |
needRemove := true. |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1688 |
|
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1689 |
wsApp := self new. |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1690 |
wsApp allButOpen. |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1691 |
wsApp window extent:400@500. |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1692 |
|
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1693 |
wsApp addEvaluationWorkspace. |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1694 |
wsApp removeWorkspace:1. |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1695 |
wsApp renameWorkspace:1 to:'Evaluator'. |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1696 |
|
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1697 |
wsApp openWindow. |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1698 |
wsApp selectedWorkspaceIndexHolder value:1. |
7849
e3e01db99dd9
open methods return the just created ws
Claus Gittinger <cg@exept.de>
parents:
7848
diff
changeset
|
1699 |
^ wsApp |
7403
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1700 |
|
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1701 |
" |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1702 |
self openEvaluationWorkspace |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1703 |
" |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1704 |
|
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1705 |
"Created: / 13-10-2006 / 12:14:13 / cg" |
7849
e3e01db99dd9
open methods return the just created ws
Claus Gittinger <cg@exept.de>
parents:
7848
diff
changeset
|
1706 |
"Modified: / 25-09-2007 / 21:00:45 / cg" |
7403
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1707 |
! |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
1708 |
|
9085 | 1709 |
openForSinglePageDoing:aBlock |
1710 |
|wsApp needRemove| |
|
1711 |
||
1712 |
needRemove := true. |
|
1713 |
||
1714 |
wsApp := self new. |
|
1715 |
wsApp allButOpen. |
|
1716 |
||
1717 |
(wsApp builder componentAt:'NoteBook') destroyTabAction:nil. |
|
1718 |
||
1719 |
wsApp window height:500. |
|
1720 |
||
1721 |
aBlock value:wsApp. |
|
1722 |
wsApp removeWorkspace:1. "/ the original Workspace |
|
1723 |
"/ wsApp renameWorkspace:1 to:'LICENCE README'. |
|
1724 |
||
1725 |
wsApp openWindow. |
|
1726 |
wsApp selectedWorkspaceIndexHolder value:1. |
|
1727 |
^ wsApp |
|
1728 |
||
1729 |
" |
|
1730 |
self openWithGlobalsInspector |
|
1731 |
" |
|
1732 |
! |
|
1733 |
||
8317 | 1734 |
openMyWorkspace |
10318 | 1735 |
"/ openMyWorkspace_new leads to an error in root /, which we dont understand... |
12699 | 1736 |
self openMyWorkspace_new. |
1737 |
"/ self openMyWorkspace_old. |
|
1738 |
MyWorkspaceOpened := true. |
|
10318 | 1739 |
|
1740 |
" |
|
10562 | 1741 |
WorkspaceApplication openMyWorkspace |
10318 | 1742 |
" |
1743 |
||
1744 |
"Modified: / 21-06-2011 / 08:58:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1745 |
"Modified: / 14-07-2011 / 13:12:04 / Administrator" |
|
10562 | 1746 |
"Modified (comment): / 09-08-2011 / 22:59:13 / cg" |
10318 | 1747 |
! |
1748 |
||
1749 |
openMyWorkspace_new |
|
10730
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1750 |
"open showing tabs for ALL bookmarked workspace files" |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1751 |
|
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1752 |
|workspace| |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1753 |
|
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1754 |
"/ workspace := self openWith: nil. |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1755 |
"/ workspace enqueueDelayedAction:[ |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1756 |
"/ Error handle:[:ex | |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1757 |
"/ "/ no time to debug that stuff now... |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1758 |
"/ Dialog information:'Error in bookmark handling: ',ex description |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1759 |
"/ ] do:[ |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1760 |
"/ BookmarkList forWorkspace myWorkspaces do:[:bookmark| |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1761 |
"/ workspace switchToBookmarkEntry: bookmark |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1762 |
"/ ]. |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1763 |
"/ |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1764 |
"/ |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1765 |
"/ |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1766 |
"/ ]. |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1767 |
"/ workspace selectedWorkspaceIndexHolder value: 1. |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1768 |
"/ ]. |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1769 |
|
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1770 |
workspace := self new. |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1771 |
workspace allButOpen. |
11483
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
1772 |
workspace initialSyntax:SmalltalkLanguage instance. |
10730
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1773 |
|
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1774 |
Error handle:[:ex | |
12308 | 1775 |
ex reject. |
1776 |
"/ no time to debug that stuff now... |
|
1777 |
Dialog information:'Error in bookmark handling: ',ex description |
|
10730
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1778 |
] do:[ |
12308 | 1779 |
BookmarkList forWorkspace myWorkspaces do:[:bookmark| |
1780 |
workspace switchToBookmarkEntry: bookmark |
|
1781 |
]. |
|
10169 | 1782 |
]. |
10730
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1783 |
workspace selectedWorkspaceIndexHolder value: 1. |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1784 |
workspace openWindow. |
10169 | 1785 |
|
1786 |
" |
|
10730
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1787 |
WorkspaceApplication openMyWorkspace |
10169 | 1788 |
" |
1789 |
||
1790 |
"Modified: / 21-06-2011 / 08:58:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10318 | 1791 |
"Created: / 14-07-2011 / 13:11:32 / Administrator" |
11483
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
1792 |
"Modified: / 26-04-2012 / 12:45:50 / cg" |
10169 | 1793 |
! |
1794 |
||
1795 |
openMyWorkspace_old |
|
10730
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1796 |
"open showing the single file: MyWorkspace.wsp" |
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1797 |
|
8317 | 1798 |
self openOnFile:'MyWorkspace.wsp' |
1799 |
||
1800 |
" |
|
1801 |
self openMyWorkspace. |
|
1802 |
" |
|
10169 | 1803 |
|
1804 |
"Created: / 21-06-2011 / 08:51:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10730
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
1805 |
"Modified (comment): / 28-09-2011 / 07:48:07 / cg" |
8317 | 1806 |
! |
1807 |
||
6022 | 1808 |
openOnFile:aFilename |
1809 |
"launch a new workspace on the contents of some file" |
|
1810 |
||
1811 |
|ws| |
|
1812 |
||
1813 |
ws := self openWith:nil. |
|
8369 | 1814 |
|
1815 |
"/ let the ws load the file - instead of the caller. |
|
12308 | 1816 |
"/ so the error dialog is shown in its context, |
8369 | 1817 |
"/ and the caller (Launcher) is not blocked. |
1818 |
ws enqueueDelayedAction:[ws loadFile:aFilename]. |
|
1819 |
"/ ws loadFile:aFilename. |
|
6022 | 1820 |
^ ws |
1821 |
||
1822 |
" |
|
1823 |
WorkspaceApplication openOnFile:'Makefile' |
|
1824 |
" |
|
1825 |
! |
|
1826 |
||
3332 | 1827 |
openSystemWorkspace |
5681 | 1828 |
|wsApp path needRemove font| |
3345 | 1829 |
|
1830 |
needRemove := true. |
|
3332 | 1831 |
|
1832 |
wsApp := self new. |
|
1833 |
wsApp allButOpen. |
|
7686 | 1834 |
|
11480 | 1835 |
(wsApp builder componentAt:'NoteBook') |
12308 | 1836 |
destroyTabAction:[:tabIndex| wsApp removeWorkspace:tabIndex]. |
7686 | 1837 |
|
3337 | 1838 |
wsApp window extent:640@400. |
3332 | 1839 |
|
3345 | 1840 |
path := (Smalltalk getSystemFileName:'README') ? '../../README'. |
5490 | 1841 |
path := path asFilename. |
1842 |
path isReadable ifTrue:[ |
|
12308 | 1843 |
wsApp addWindow:(self createWorkspaceView) named:'README' asFirst:false. |
1844 |
wsApp loadFile:path. |
|
1845 |
wsApp removeWorkspace:1. "/ the original Workspace |
|
1846 |
wsApp renameWorkspace:1 to:'LICENCE README'. |
|
1847 |
needRemove := false. |
|
3345 | 1848 |
]. |
3334 | 1849 |
|
3346 | 1850 |
"/ path := (Smalltalk getSystemFileName:'doc/online/english/LICENCE_STX.html') ? '../../doc/online/english/LICENCE_STX.html'. |
1851 |
"/ path asFilename exists ifTrue:[ |
|
1852 |
"/ wsApp addWindow:(licenceView := HVScrollableView for:HTMLDocumentView) named:'License' asFirst:false. |
|
1853 |
"/ licenceView homeDocument:'../../doc/online/english/LICENCE_STX.html'. |
|
1854 |
"/ licenceView updateLabelFlag:false. |
|
1855 |
"/ needRemove ifTrue:[wsApp removeWorkspace:1]. "/ the original Workspace |
|
1856 |
"/ needRemove := false. |
|
1857 |
"/ ]. |
|
3332 | 1858 |
|
5684 | 1859 |
wsApp graphicsDevice platformName = 'X11' ifTrue:[ |
12308 | 1860 |
font := Font family:'unifont' face:'medium' style:'roman' size:16 encoding:'iso10646-1'. |
1861 |
font := font onDevice:wsApp graphicsDevice ifAbsent:nil. |
|
1862 |
font isNil ifTrue:[ |
|
1863 |
font := Font family:'arial' face:'medium' style:'roman' size:12 encoding:'iso10646-1'. |
|
1864 |
font := font onDevice:wsApp graphicsDevice ifAbsent:nil. |
|
1865 |
]. |
|
5684 | 1866 |
] ifFalse:[ |
12308 | 1867 |
"/ font := Font family:'Arial Unicode MS' face:'medium' style:'roman' size:10 encoding:'ms-ansi'. |
1868 |
font := Font family:'Arial' face:'medium' style:'roman' size:10 encoding:'ms-ansi'. |
|
1869 |
font := font onDevice:wsApp graphicsDevice ifAbsent:nil. |
|
5681 | 1870 |
]. |
1871 |
||
8771
26df78104a59
changed: #openSystemWorkspace
Claus Gittinger <cg@exept.de>
parents:
8763
diff
changeset
|
1872 |
#( "/ file resourceKey title forcedEncoding type |
12308 | 1873 |
('Hello_utf8.wsp' HELLO_UTF_FILE 'Hello' #'utf8' #text) |
1874 |
('Welcome.wsp' WELCOME_FILE 'This Release' nil #text) |
|
8791
5a85029bf765
changed: #openSystemWorkspace
Claus Gittinger <cg@exept.de>
parents:
8790
diff
changeset
|
1875 |
"/ ('Setup.wsp' SETUP_FILE 'Setup' nil #text) |
12308 | 1876 |
('Keyboard.wsp' KEYBOARD_FILE 'Keyboard' nil #text) |
8791
5a85029bf765
changed: #openSystemWorkspace
Claus Gittinger <cg@exept.de>
parents:
8790
diff
changeset
|
1877 |
"/ ('GettingStarted.wsp' GETTING_STARTED_FILE 'Getting Started' nil #text) |
12308 | 1878 |
('../../doc/online/english/GettingStarted.html' GETTING_STARTED_TML_FILE 'Getting Started' nil #html) |
1879 |
('../../doc/books/JoyOfST/IntroToST.html' INTRO_TO_ST_FILE 'Smalltalk Introduction' nil #html) |
|
7612
42b1c57c6cc7
Private.wsp and MyWorkspace.wsp
Claus Gittinger <cg@exept.de>
parents:
7544
diff
changeset
|
1880 |
"/ if these are present, show them. |
12308 | 1881 |
('Private.wsp' PRIVATE_FILE 'Private Workspace' nil #text) |
1882 |
('MyWorkspace.wsp' MYWORKSPACE_FILE 'My Workspace' nil #text) |
|
8771
26df78104a59
changed: #openSystemWorkspace
Claus Gittinger <cg@exept.de>
parents:
8763
diff
changeset
|
1883 |
) do:[:tuple | |
12308 | 1884 |
|file resKey title forcedEncoding type pane encoding htmlView| |
1885 |
||
1886 |
file := tuple at:1. |
|
1887 |
resKey := tuple at:2. |
|
1888 |
file := self classResources string:resKey default:file. |
|
1889 |
||
1890 |
title := tuple at:3. |
|
1891 |
forcedEncoding := tuple at:4. |
|
1892 |
type := tuple at:5. |
|
1893 |
||
1894 |
path := Smalltalk getSystemFileName:file. |
|
1895 |
(path notNil and:[path asFilename isReadable]) ifTrue:[ |
|
1896 |
type == #html ifTrue:[ |
|
1897 |
wsApp addWindow:(htmlView := HVScrollableView for:HTMLDocumentView) named:title asFirst:false. |
|
1898 |
htmlView homeDocument:path. |
|
1899 |
htmlView updateTopViewsTitleFlag:false. |
|
1900 |
] ifFalse:[ |
|
1901 |
wsApp addWindow:(pane := self createWorkspaceView) named:title asFirst:false. |
|
1902 |
forcedEncoding notNil ifTrue:[ |
|
1903 |
encoding := forcedEncoding. |
|
1904 |
font notNil ifTrue:[ |
|
1905 |
pane font:font. |
|
1906 |
] |
|
1907 |
] ifFalse:[ |
|
1908 |
encoding := CharacterEncoder guessEncodingOfFile:path. |
|
1909 |
(encoding == #'iso8859-1' or:[encoding == #'ascii']) ifTrue:[ |
|
1910 |
encoding := nil |
|
1911 |
]. |
|
1912 |
]. |
|
1913 |
wsApp loadFile:path encoding:encoding label:title. |
|
1914 |
]. |
|
1915 |
needRemove ifTrue:[wsApp removeWorkspace:1]. "/ the original Workspace |
|
1916 |
needRemove := false. |
|
1917 |
]. |
|
3345 | 1918 |
]. |
5693 | 1919 |
wsApp openWindow. |
1920 |
wsApp selectedWorkspaceIndexHolder value:2. |
|
7849
e3e01db99dd9
open methods return the just created ws
Claus Gittinger <cg@exept.de>
parents:
7848
diff
changeset
|
1921 |
^ wsApp |
3332 | 1922 |
|
1923 |
" |
|
7850 | 1924 |
|ws b| |
1925 |
ws := self openSystemWorkspace. |
|
7853 | 1926 |
ws addMyWorkspace. |
1927 |
ws selectedWorkspaceIndexHolder value:(ws workspaces size). |
|
1928 |
ws selectedWorkspace contents:'Tools::NewSystemBrowser open'; selectAll. |
|
12308 | 1929 |
ws selectedWorkspace |
1930 |
add:(b := Button label:'DoIt' action:[ws doIt. b destroy]) |
|
3332 | 1931 |
" |
7853 | 1932 |
" |
1933 |
|ws b| |
|
1934 |
ws := self new. |
|
12308 | 1935 |
ws open. |
7853 | 1936 |
ws selectedWorkspace contents:'Tools::NewSystemBrowser open'; selectAll. |
1937 |
" |
|
7612
42b1c57c6cc7
Private.wsp and MyWorkspace.wsp
Claus Gittinger <cg@exept.de>
parents:
7544
diff
changeset
|
1938 |
|
10169 | 1939 |
"Modified: / 14-02-2010 / 23:02:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1940 |
"Modified: / 05-07-2011 / 15:34:40 / cg" |
|
4542 | 1941 |
! |
1942 |
||
1943 |
openWith:initialText |
|
1944 |
"launch a new workspace with some initial contents" |
|
1945 |
||
5098 | 1946 |
^ self openWith:initialText selected:false |
1947 |
||
1948 |
" |
|
1949 |
WorkspaceApplication openWith:'Transcript showCR:''hello world''' |
|
1950 |
" |
|
1951 |
! |
|
1952 |
||
1953 |
openWith:initialText selected:selectedBoolean |
|
1954 |
"launch a new workspace with some initial contents" |
|
1955 |
||
4542 | 1956 |
|workspace| |
1957 |
||
1958 |
workspace := self new. |
|
1959 |
workspace open. |
|
5098 | 1960 |
workspace selectedWorkspace contents:initialText selected:selectedBoolean. |
4542 | 1961 |
^ workspace |
1962 |
||
1963 |
" |
|
1964 |
WorkspaceApplication openWith:'Transcript showCR:''hello world''' |
|
1965 |
" |
|
9085 | 1966 |
! |
1967 |
||
12807
ba8c5416aa28
Merged d550d7de8e2d and 99a40df6afb8 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1968 |
|
ba8c5416aa28
Merged d550d7de8e2d and 99a40df6afb8 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1969 |
|
9085 | 1970 |
openWithGlobalsInspector |
1971 |
"open a workspaceApp with a single initial pane, showing global variables. |
|
1972 |
Same as Smalltalk inspect, but looks nicer..." |
|
1973 |
||
1974 |
^ self openForSinglePageDoing:[:wsApp | wsApp addNamespaceInspectorFor:Smalltalk] |
|
1975 |
||
1976 |
" |
|
1977 |
self openWithGlobalsInspector |
|
1978 |
" |
|
1979 |
! |
|
1980 |
||
1981 |
openWithWorkspaceVariableInspector |
|
1982 |
"open a workspaceApp with a single initial pane, showing workspace variables. |
|
1983 |
Same as Workspace workspaceVariables inspect, but looks nicer..." |
|
1984 |
||
1985 |
^ self openForSinglePageDoing:[:wsApp | wsApp addWorkspaceVariableInspector] |
|
1986 |
||
1987 |
" |
|
1988 |
self openWithWorkspaceVariableInspector |
|
1989 |
" |
|
3332 | 1990 |
! ! |
1991 |
||
10169 | 1992 |
!WorkspaceApplication class methodsFor:'startup'! |
1993 |
||
1994 |
open |
|
1995 |
"/ the very first open opens a MyWorkspace |
|
1996 |
||
1997 |
(MyWorkspaceOpened == true) ifTrue:[ |
|
1998 |
super open |
|
1999 |
] ifFalse:[ |
|
2000 |
self openMyWorkspace |
|
2001 |
]. |
|
2002 |
||
2003 |
" |
|
2004 |
MyWorkspaceOpened := nil. |
|
2005 |
WorkspaceApplication open. |
|
2006 |
" |
|
2007 |
||
2008 |
"Created: / 21-06-2011 / 09:03:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2009 |
"Modified (comment): / 05-07-2011 / 15:23:53 / cg" |
|
2010 |
! ! |
|
2011 |
||
3193 | 2012 |
!WorkspaceApplication methodsFor:'aspects'! |
2013 |
||
4474 | 2014 |
autoDefineVariables |
2015 |
autoDefineVariables isNil ifTrue:[ |
|
12308 | 2016 |
autoDefineVariables := ValueHolder new. |
2017 |
(UserPreferences current autoDefineWorkspaceVariables) ifTrue:[ |
|
2018 |
autoDefineVariables value:#workspace. |
|
2019 |
] ifFalse:[ |
|
2020 |
autoDefineVariables value:#doIt. |
|
2021 |
]. |
|
2022 |
autoDefineVariables onChangeSend:#autoDefineVariablesChanged to:self. |
|
4474 | 2023 |
]. |
2024 |
^ autoDefineVariables. |
|
2025 |
! |
|
2026 |
||
10169 | 2027 |
bookmarks |
2028 |
|ws app| |
|
2029 |
||
2030 |
ws := self selectedWorkspace scrolledView. |
|
2031 |
ws isTextView ifTrue:[ |
|
12308 | 2032 |
^ BookmarkList forWorkspace |
10169 | 2033 |
]. |
11725
0b626c2b4b2d
Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents:
11713
diff
changeset
|
2034 |
(ws isApplicationSubView) ifTrue:[ |
12308 | 2035 |
app := ws application. |
2036 |
(app respondsTo:#bookmarks) ifTrue:[ |
|
2037 |
^ app bookmarks |
|
2038 |
]. |
|
2039 |
(app respondsTo:#bookmarkListHolder) ifTrue:[ |
|
2040 |
^ app bookmarkListHolder value |
|
2041 |
]. |
|
10169 | 2042 |
]. |
2043 |
^ BookmarkList new. |
|
2044 |
||
2045 |
"Created: / 20-06-2011 / 22:23:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2046 |
"Modified: / 21-06-2011 / 08:13:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2047 |
"Modified (format): / 05-07-2011 / 14:21:10 / cg" |
|
2048 |
! |
|
2049 |
||
8226 | 2050 |
browseItMenuButtonVisibile |
2051 |
^ self thisIsASmalltalkWorkspace |
|
2052 |
! |
|
2053 |
||
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2054 |
canChangeLanguageHolder |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2055 |
"return/create the 'canChangeLanguageHolder' value holder (automatically generated)" |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2056 |
|
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2057 |
canChangeLanguageHolder isNil ifTrue:[ |
12308 | 2058 |
canChangeLanguageHolder := ValueHolder with: true. |
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2059 |
]. |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2060 |
^ canChangeLanguageHolder |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2061 |
|
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2062 |
"Modified: / 10-05-2012 / 23:43:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2063 |
! |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2064 |
|
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2065 |
canChangeLanguageHolder:something |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2066 |
"set the 'canChangeLanguageHolder' value holder (automatically generated)" |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2067 |
|
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2068 |
canChangeLanguageHolder := something. |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2069 |
! |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2070 |
|
9695 | 2071 |
cursorColHolder |
2072 |
cursorColHolder isNil ifTrue:[ |
|
12308 | 2073 |
cursorColHolder := IndirectValue for:(1 asValue) |
9695 | 2074 |
]. |
2075 |
^ cursorColHolder |
|
2076 |
||
2077 |
"Created: / 22-01-2011 / 11:36:00 / cg" |
|
2078 |
! |
|
2079 |
||
2080 |
cursorColLabelHolder |
|
12308 | 2081 |
^ BlockValue |
2082 |
with:[:v | v isNil ifTrue:[''] ifFalse:[v printString]] |
|
2083 |
argument:self cursorColHolder. |
|
9695 | 2084 |
|
2085 |
"Created: / 22-01-2011 / 11:36:08 / cg" |
|
2086 |
! |
|
2087 |
||
2088 |
cursorLineHolder |
|
2089 |
cursorLineHolder isNil ifTrue:[ |
|
12308 | 2090 |
cursorLineHolder := IndirectValue for:(1 asValue) |
9695 | 2091 |
]. |
2092 |
^ cursorLineHolder |
|
2093 |
||
2094 |
"Created: / 22-01-2011 / 11:35:22 / cg" |
|
2095 |
! |
|
2096 |
||
2097 |
cursorLineLabelHolder |
|
12308 | 2098 |
^ BlockValue |
2099 |
with:[:v | v isNil ifTrue:[''] ifFalse:[v printString]] |
|
2100 |
argument:self cursorLineHolder. |
|
9695 | 2101 |
|
2102 |
"Modified: / 22-01-2011 / 11:42:56 / cg" |
|
2103 |
! |
|
2104 |
||
8133
8b09d048b345
doIt button only in smalltalks workspace
Claus Gittinger <cg@exept.de>
parents:
8111
diff
changeset
|
2105 |
doItMenuButtonVisibile |
8b09d048b345
doIt button only in smalltalks workspace
Claus Gittinger <cg@exept.de>
parents:
8111
diff
changeset
|
2106 |
^ self thisIsASmalltalkWorkspace |
8b09d048b345
doIt button only in smalltalks workspace
Claus Gittinger <cg@exept.de>
parents:
8111
diff
changeset
|
2107 |
! |
8b09d048b345
doIt button only in smalltalks workspace
Claus Gittinger <cg@exept.de>
parents:
8111
diff
changeset
|
2108 |
|
4136 | 2109 |
hasHistory |
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2110 |
^ Workspace doItHistory notEmptyOrNil. |
5852 | 2111 |
! |
2112 |
||
9381 | 2113 |
hasInfoLabel |
2114 |
^ true |
|
2115 |
! |
|
2116 |
||
8133
8b09d048b345
doIt button only in smalltalks workspace
Claus Gittinger <cg@exept.de>
parents:
8111
diff
changeset
|
2117 |
inspectItMenuButtonVisibile |
8b09d048b345
doIt button only in smalltalks workspace
Claus Gittinger <cg@exept.de>
parents:
8111
diff
changeset
|
2118 |
^ self thisIsASmalltalkWorkspace |
8b09d048b345
doIt button only in smalltalks workspace
Claus Gittinger <cg@exept.de>
parents:
8111
diff
changeset
|
2119 |
! |
8b09d048b345
doIt button only in smalltalks workspace
Claus Gittinger <cg@exept.de>
parents:
8111
diff
changeset
|
2120 |
|
9381 | 2121 |
languageInfoLabelHolder |
2122 |
^ BlockValue |
|
12308 | 2123 |
with:[:syntax | |
2124 |
syntax notNil ifTrue:[ |
|
2125 |
"'Syntax: ',"syntax name |
|
2126 |
] ifFalse:[ |
|
2127 |
'Text' |
|
2128 |
] |
|
2129 |
] |
|
2130 |
argument:self syntaxHolder |
|
11483
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
2131 |
|
11615
f9dfb7daa5e4
corrected switching languages between tabs
Claus Gittinger <cg@exept.de>
parents:
11612
diff
changeset
|
2132 |
"Modified: / 19-07-2012 / 16:53:30 / cg" |
9381 | 2133 |
! |
2134 |
||
9695 | 2135 |
modeLabelHolder |
2136 |
modeLabelHolder isNil ifTrue:[ |
|
12308 | 2137 |
modeLabelHolder := IndirectValue for:('I' asValue) |
9695 | 2138 |
]. |
2139 |
^ modeLabelHolder |
|
2140 |
||
2141 |
"Created: / 22-01-2011 / 11:37:25 / cg" |
|
2142 |
! |
|
2143 |
||
8226 | 2144 |
printItMenuButtonVisibile |
2145 |
^ self thisIsASmalltalkWorkspace |
|
2146 |
! |
|
2147 |
||
12308 | 2148 |
setWindowLabel: label |
10169 | 2149 |
|
2150 |
self setWindowLabel: label language: self syntaxHolder value |
|
2151 |
! |
|
2152 |
||
2153 |
setWindowLabel: label language: language |
|
11624 | 2154 |
|languageName| |
2155 |
||
2156 |
language notNil ifTrue:[ |
|
2157 |
languageName := ' - ', language name. |
|
2158 |
] ifFalse:[ |
|
2159 |
languageName := ''. |
|
2160 |
]. |
|
2161 |
self window label:label, ' - ' , languageName |
|
10169 | 2162 |
! |
2163 |
||
9300
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
2164 |
smalltalkMenuEnabledHolder |
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
2165 |
smalltalkMenuEnabledHolder isNil ifTrue:[ |
12308 | 2166 |
smalltalkMenuEnabledHolder := true asValue. |
9300
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
2167 |
]. |
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
2168 |
^ smalltalkMenuEnabledHolder |
5852 | 2169 |
! |
2170 |
||
2171 |
syntaxHolder |
|
2172 |
syntaxHolder isNil ifTrue:[ |
|
12308 | 2173 |
syntaxHolder := self defaultEvaluatorSyntax asValue. |
2174 |
syntaxHolder onChangeSend:#setCompilerForSyntax to:self |
|
5852 | 2175 |
]. |
2176 |
^ syntaxHolder |
|
10169 | 2177 |
! |
2178 |
||
2179 |
toolBarView |
|
2180 |
||
2181 |
toolBarView isNil ifTrue:[ |
|
12308 | 2182 |
toolBarView := SubCanvas new. |
2183 |
toolBarView level: 0. |
|
2184 |
toolBarView client: self spec: #toolBarSpec builder: builder. |
|
10169 | 2185 |
]. |
2186 |
^toolBarView |
|
2187 |
||
2188 |
"Created: / 10-06-2011 / 22:52:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2189 |
"Modified: / 11-06-2011 / 00:06:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3193 | 2190 |
! ! |
2191 |
||
4358 | 2192 |
!WorkspaceApplication methodsFor:'aspects-queries'! |
3193 | 2193 |
|
3812 | 2194 |
anyWorkspaceVariableIsDefined |
6267 | 2195 |
^ Workspace anyWorkspaceVariableIsDefined |
2196 |
||
2197 |
"Modified: / 20-04-2005 / 11:57:59 / cg" |
|
10169 | 2198 |
! |
2199 |
||
2200 |
canAddBookmark |
|
2201 |
||
2202 |
| ws file | |
|
2203 |
||
2204 |
ws := self selectedWorkspace scrolledView. |
|
2205 |
^ws isTextView ifTrue:[ |
|
12308 | 2206 |
file := ws defaultFileNameForFileDialog. |
2207 |
file notNil. |
|
10169 | 2208 |
] ifFalse:[ |
12308 | 2209 |
true |
10169 | 2210 |
] |
2211 |
||
2212 |
"Created: / 20-06-2011 / 22:43:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2213 |
! |
|
2214 |
||
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2215 |
isSQLWorkspaceAvailable |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2216 |
|
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2217 |
^(Smalltalk at:#'SQL::WorkspacePage') notNil |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2218 |
|
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2219 |
"Created: / 10-05-2012 / 18:49:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2220 |
! |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
2221 |
|
12244 | 2222 |
isSQLWorkspaceSelected |
2223 |
||
2224 |
^self aspectAt:#isSQLWorkspaceSelected ifAbsentPut:[ |
|
12308 | 2225 |
BlockValue |
2226 |
with:[:ignored|self selectedWorkspaceApplication isKindOf: (Smalltalk at:#'SQL::WorkspacePage')] |
|
2227 |
argument: self selectedWorkspaceIndexHolder |
|
12244 | 2228 |
] |
2229 |
||
2230 |
"Created: / 11-05-2012 / 09:41:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2231 |
! |
|
2232 |
||
10169 | 2233 |
isWebBrowserAvailable |
2234 |
||
2235 |
^(Smalltalk at:#WebKitView) notNil |
|
2236 |
||
2237 |
"Created: / 11-06-2011 / 00:30:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2238 |
! |
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2239 |
|
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2240 |
selectedWorkspaceIsTextView |
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2241 |
^ self selectedWorkspacesTextView notNil |
3154 | 2242 |
! ! |
2243 |
||
9632 | 2244 |
!WorkspaceApplication methodsFor:'autofetch selection'! |
2245 |
||
2246 |
autoFetchSelection |
|
2247 |
^ clipBoardWatcherProcess notNil |
|
2248 |
||
2249 |
"Created: / 16-11-2010 / 14:55:39 / cg" |
|
2250 |
! |
|
2251 |
||
2252 |
autoFetchSelection:aBoolean |
|
2253 |
Display platformName = 'WIN32' ifTrue:[ |
|
12308 | 2254 |
aBoolean ifTrue:[ |
2255 |
self startClipboardWatcher |
|
2256 |
] ifFalse:[ |
|
2257 |
self stopClipboardWatcher |
|
2258 |
]. |
|
2259 |
^ self. |
|
9632 | 2260 |
]. |
2261 |
||
2262 |
aBoolean ifTrue:[ |
|
12308 | 2263 |
self window windowGroup addPreEventHook:self. |
2264 |
device addSelectionHandler:self |
|
9632 | 2265 |
] ifFalse:[ |
12308 | 2266 |
self window windowGroup removePreEventHook:self. |
2267 |
device removeSelectionHandler:self |
|
9632 | 2268 |
]. |
2269 |
||
2270 |
"Created: / 16-11-2010 / 14:34:15 / cg" |
|
2271 |
! |
|
2272 |
||
9735 | 2273 |
autoFetchSelectionLines |
2274 |
fetchClipboardLines isNil ifTrue:[ |
|
12308 | 2275 |
fetchClipboardLines := true asValue |
9735 | 2276 |
]. |
2277 |
^ fetchClipboardLines |
|
2278 |
||
2279 |
"Created: / 04-02-2011 / 17:52:34 / cg" |
|
2280 |
! |
|
2281 |
||
9632 | 2282 |
itemFromClipboard |
2283 |
|text| |
|
2284 |
||
2285 |
text := self window getClipboardText. |
|
2286 |
(text notNil and:[text isString]) ifTrue:[ |
|
12308 | 2287 |
self autoFetchSelectionLines value ifTrue:[ |
2288 |
text := text , Character cr |
|
2289 |
]. |
|
2290 |
self paste:text. |
|
9632 | 2291 |
]. |
2292 |
||
2293 |
"Created: / 16-11-2010 / 14:44:26 / cg" |
|
9735 | 2294 |
"Modified: / 04-02-2011 / 17:53:46 / cg" |
9632 | 2295 |
! |
2296 |
||
2297 |
startClipboardWatcher |
|
2298 |
clipBoardWatcherProcess isNil ifTrue:[ |
|
12308 | 2299 |
ClipBoardFetchingInstance notNil ifTrue:[ |
2300 |
ClipBoardFetchingInstance stopClipboardWatcher |
|
2301 |
]. |
|
2302 |
clipBoardWatcherProcess := |
|
2303 |
[ |
|
2304 |
[true] whileTrue:[ |
|
2305 |
self waitForClipBoardToChange. |
|
2306 |
]. |
|
2307 |
] newProcess. |
|
2308 |
||
2309 |
clipBoardWatcherProcess resume. |
|
2310 |
ClipBoardFetchingInstance := self. |
|
9632 | 2311 |
]. |
2312 |
||
2313 |
"Created: / 16-11-2010 / 14:35:55 / cg" |
|
2314 |
! |
|
2315 |
||
2316 |
stopClipboardWatcher |
|
2317 |
|p| |
|
2318 |
||
2319 |
(p := clipBoardWatcherProcess) notNil ifTrue:[ |
|
12308 | 2320 |
ClipBoardFetchingInstance := nil. |
2321 |
clipBoardWatcherProcess := nil. |
|
2322 |
p terminate |
|
9632 | 2323 |
]. |
2324 |
||
2325 |
"Created: / 16-11-2010 / 14:36:12 / cg" |
|
2326 |
! |
|
2327 |
||
2328 |
waitForClipBoardToChange |
|
2329 |
|prev| |
|
2330 |
||
2331 |
prev := self window getClipboardText. |
|
12308 | 2332 |
[ |
2333 |
Delay waitForSeconds:0.2. |
|
2334 |
self window getClipboardText = prev |
|
9632 | 2335 |
] whileTrue. |
2336 |
self itemFromClipboard. |
|
2337 |
||
2338 |
"Created: / 16-11-2010 / 14:44:05 / cg" |
|
2339 |
! ! |
|
2340 |
||
7474
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2341 |
!WorkspaceApplication methodsFor:'defaults'! |
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2342 |
|
9341
aa3c5825ec98
refactored to allow redefinition of defaultSyntax
Claus Gittinger <cg@exept.de>
parents:
9304
diff
changeset
|
2343 |
defaultEvaluatorSyntax |
9653 | 2344 |
LastLanguage notNil ifTrue:[^ LastLanguage]. |
9341
aa3c5825ec98
refactored to allow redefinition of defaultSyntax
Claus Gittinger <cg@exept.de>
parents:
9304
diff
changeset
|
2345 |
^ SmalltalkLanguage instance. |
9653 | 2346 |
|
2347 |
"Modified: / 01-12-2010 / 12:21:41 / cg" |
|
9341
aa3c5825ec98
refactored to allow redefinition of defaultSyntax
Claus Gittinger <cg@exept.de>
parents:
9304
diff
changeset
|
2348 |
! |
aa3c5825ec98
refactored to allow redefinition of defaultSyntax
Claus Gittinger <cg@exept.de>
parents:
9304
diff
changeset
|
2349 |
|
7474
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2350 |
defaultFileNameForLoad |
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2351 |
^ 'file.wsp' |
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2352 |
|
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2353 |
"Created: / 25-10-2006 / 14:56:10 / cg" |
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2354 |
! |
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2355 |
|
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2356 |
defaultFileNameForSave |
8324 | 2357 |
|ws| |
2358 |
||
9695 | 2359 |
ws := self selectedWorkspace scrolledView. |
8324 | 2360 |
ws isTextView ifFalse:[ |
12308 | 2361 |
"/ eval-ws |
2362 |
^ super defaultFileNameForSave |
|
8324 | 2363 |
]. |
2364 |
^ ws defaultFileNameForFileDialog ? super defaultFileNameForSave |
|
9695 | 2365 |
|
2366 |
"Modified: / 22-01-2011 / 12:01:27 / cg" |
|
7474
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2367 |
! |
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2368 |
|
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2369 |
defaultFileNameForSaveAll |
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2370 |
^ 'file.wsp' |
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2371 |
|
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2372 |
"Created: / 25-10-2006 / 14:56:04 / cg" |
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2373 |
! |
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2374 |
|
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2375 |
defaultPatternLoad |
8032 | 2376 |
^ '*.wsp; *.txt; *.rc' |
7474
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2377 |
|
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2378 |
"Created: / 25-10-2006 / 14:57:25 / cg" |
7866 | 2379 |
! |
2380 |
||
12308 | 2381 |
executeMenuVisible |
9341
aa3c5825ec98
refactored to allow redefinition of defaultSyntax
Claus Gittinger <cg@exept.de>
parents:
9304
diff
changeset
|
2382 |
^ self thisIsASmalltalkWorkspace |
aa3c5825ec98
refactored to allow redefinition of defaultSyntax
Claus Gittinger <cg@exept.de>
parents:
9304
diff
changeset
|
2383 |
! |
aa3c5825ec98
refactored to allow redefinition of defaultSyntax
Claus Gittinger <cg@exept.de>
parents:
9304
diff
changeset
|
2384 |
|
7866 | 2385 |
thisIsASmalltalkWorkspace |
9300
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
2386 |
"can be redefined in a subclass to disable smalltalk-specific menu items |
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
2387 |
(expecco uses workspaces as scratchpads)" |
7866 | 2388 |
|
2389 |
^ true |
|
7474
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2390 |
! ! |
f18ef25a1ca6
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
7461
diff
changeset
|
2391 |
|
9372 | 2392 |
!WorkspaceApplication methodsFor:'drag & drop'! |
2393 |
||
2394 |
droppedFile:aFilename in:aComponent |
|
2395 |
"this is a notification from my textView component" |
|
2396 |
||
12308 | 2397 |
self |
2398 |
renameWorkspace:(self selectedWorkspaceIndexHolder value) |
|
2399 |
to:aFilename asFilename baseName |
|
9372 | 2400 |
! ! |
2401 |
||
10169 | 2402 |
!WorkspaceApplication methodsFor:'help'! |
2403 |
||
2404 |
flyByHelpSpec |
|
10220 | 2405 |
"/ dynamically adjust the menuSave item's flyByhelpText |
2406 |
^ self updateHelpSpec:(super flyByHelpSpec) |
|
2407 |
||
2408 |
"Created: / 05-07-2011 / 15:42:25 / cg" |
|
2409 |
! |
|
2410 |
||
2411 |
updateHelpSpec:aSpec |
|
2412 |
|file ws| |
|
10169 | 2413 |
|
2414 |
"/ dynamically adjust the menuSave item's flyByhelpText |
|
2415 |
ws := self selectedWorkspace scrolledView. |
|
2416 |
ws isTextView ifTrue:[ |
|
12308 | 2417 |
file := ws defaultFileNameForFileDialog. |
10169 | 2418 |
]. |
2419 |
||
10220 | 2420 |
aSpec |
12308 | 2421 |
at:#menuSaveOrSaveAs |
2422 |
put:(file isNil ifTrue:[aSpec at:#menuSaveAs] ifFalse:[aSpec at:#menuSave]). |
|
10220 | 2423 |
|
10277 | 2424 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
12308 | 2425 |
aSpec |
2426 |
at:#addTerminal |
|
2427 |
put:(aSpec at:#addTerminalWindows). |
|
10277 | 2428 |
|
2429 |
]. |
|
10220 | 2430 |
^ aSpec |
2431 |
||
2432 |
"Created: / 06-07-2011 / 16:32:13 / cg" |
|
10169 | 2433 |
! ! |
2434 |
||
3154 | 2435 |
!WorkspaceApplication methodsFor:'initialization & release'! |
2436 |
||
2437 |
closeRequest |
|
6636 | 2438 |
"asks for permission before closing" |
2439 |
||
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
2440 |
(self askIfAnyModified:'Text was not saved. Close anyway ?' yesButton:'Close') ifFalse:[ |
12308 | 2441 |
^ self |
3154 | 2442 |
]. |
2443 |
||
2444 |
^ super closeRequest |
|
9341
aa3c5825ec98
refactored to allow redefinition of defaultSyntax
Claus Gittinger <cg@exept.de>
parents:
9304
diff
changeset
|
2445 |
! |
aa3c5825ec98
refactored to allow redefinition of defaultSyntax
Claus Gittinger <cg@exept.de>
parents:
9304
diff
changeset
|
2446 |
|
11483
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
2447 |
initialSyntax: aLanguage |
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
2448 |
self syntaxHolder value: aLanguage. |
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
2449 |
|
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
2450 |
"Created: / 26-04-2012 / 12:26:48 / cg" |
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
2451 |
! |
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
2452 |
|
9695 | 2453 |
postBuildEditModeInfoLabel:aLabel |
2454 |
aLabel menuHolder:self; menuMessage:#editModeInfoLabelMenu. |
|
2455 |
||
2456 |
"Created: / 22-01-2011 / 11:32:57 / cg" |
|
2457 |
! |
|
2458 |
||
9341
aa3c5825ec98
refactored to allow redefinition of defaultSyntax
Claus Gittinger <cg@exept.de>
parents:
9304
diff
changeset
|
2459 |
postBuildWith:aBuilder |
aa3c5825ec98
refactored to allow redefinition of defaultSyntax
Claus Gittinger <cg@exept.de>
parents:
9304
diff
changeset
|
2460 |
super postBuildWith:aBuilder. |
9381 | 2461 |
self setCompilerForSyntax. |
2462 |
||
2463 |
self infoVisibilityChanged. "/ force geometry update |
|
2464 |
self autoDefineVariablesChanged. "/ force workspaceView update |
|
9695 | 2465 |
! |
2466 |
||
2467 |
postOpenWith:aBuilder |
|
2468 |
self windowGroup addPreEventHook:self. |
|
2469 |
super postOpenWith:aBuilder. |
|
2470 |
||
2471 |
"Created: / 22-01-2011 / 12:09:20 / cg" |
|
9746
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
2472 |
"Modified: / 08-02-2011 / 21:33:49 / cg" |
9695 | 2473 |
! |
2474 |
||
2475 |
processEvent:anEvent |
|
2476 |
"filter double click in line-label. |
|
2477 |
Return true, if I have eaten the event" |
|
2478 |
||
2479 |
anEvent isButtonMultiPressEvent ifTrue:[ |
|
12308 | 2480 |
anEvent view name = 'CursorLineLabel' ifTrue:[ |
2481 |
self selectedWorkspace scrolledView gotoLine. |
|
2482 |
^ true |
|
2483 |
]. |
|
9695 | 2484 |
]. |
2485 |
^ false |
|
2486 |
||
2487 |
"Created: / 22-01-2011 / 12:10:01 / cg" |
|
3154 | 2488 |
! ! |
2489 |
||
4359 | 2490 |
!WorkspaceApplication methodsFor:'menu-actions'! |
3154 | 2491 |
|
3752 | 2492 |
askForFilterBlock:message template:template rememberIn:nameOfClassVar |
2493 |
|filterBlockString filterBlock dialog textHolder classVarValue| |
|
2494 |
||
2495 |
classVarValue := self class classVarAt:nameOfClassVar ifAbsent:nil. |
|
2496 |
classVarValue isNil ifTrue:[ |
|
12308 | 2497 |
self class classVarAt:nameOfClassVar put:template. |
2498 |
classVarValue := template. |
|
3752 | 2499 |
]. |
2500 |
||
2501 |
textHolder := ValueHolder new. |
|
12308 | 2502 |
dialog := Dialog |
2503 |
forRequestText:(resources string:message) |
|
2504 |
lines:25 |
|
2505 |
columns:70 |
|
2506 |
initialAnswer:classVarValue |
|
2507 |
model:textHolder. |
|
3752 | 2508 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
2509 |
dialog open. |
|
2510 |
dialog accepted ifFalse:[^ nil]. |
|
2511 |
||
2512 |
filterBlockString := textHolder value. |
|
12308 | 2513 |
self class classVarAt:nameOfClassVar put:filterBlockString. |
3752 | 2514 |
|
2515 |
filterBlock := Parser evaluate:filterBlockString. |
|
2516 |
filterBlock isBlock ifFalse:[ |
|
12308 | 2517 |
self error:'bad input for filterBlock' mayProceed:true. |
2518 |
^ nil |
|
3752 | 2519 |
]. |
2520 |
||
2521 |
^ filterBlock |
|
2522 |
! |
|
2523 |
||
4474 | 2524 |
autoDefineVariablesChanged |
2525 |
|autoDefine| |
|
2526 |
||
2527 |
autoDefine := autoDefineVariables value. |
|
2528 |
UserPreferences current autoDefineWorkspaceVariables:(autoDefine == #workspace). |
|
2529 |
workspaces do:[:each | |
|
2530 |
each autoDefineVariables:autoDefine |
|
2531 |
]. |
|
2532 |
! |
|
2533 |
||
3198 | 2534 |
basicInspectIt |
2535 |
self inspectIt:true |
|
2536 |
! |
|
2537 |
||
3383
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
2538 |
browseImplementorsOfIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
2539 |
self selectedWorkspacesTextView browseImplementorsOfIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
2540 |
! |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
2541 |
|
3154 | 2542 |
browseIt |
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2543 |
|ws| |
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2544 |
|
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2545 |
ws := self selectedWorkspacesTextView. |
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2546 |
ws notNil ifTrue:[ |
12308 | 2547 |
ws browseIt |
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2548 |
] |
3154 | 2549 |
! |
2550 |
||
3383
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
2551 |
browseReferencesToIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
2552 |
self selectedWorkspacesTextView browseReferencesToIt |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
2553 |
! |
fb3b6909bd1a
+ browseReferencesToIt & browserImplementorsOfIt
Claus Gittinger <cg@exept.de>
parents:
3347
diff
changeset
|
2554 |
|
4136 | 2555 |
clearHistory |
2556 |
Workspace clearDoItHistory |
|
2557 |
! |
|
2558 |
||
11496 | 2559 |
compareTextAgainst |
2560 |
|ws otherText thisText| |
|
2561 |
||
2562 |
ws := self selectedWorkspace scrolledView. |
|
2563 |
ws isTextView ifFalse:[ |
|
12308 | 2564 |
^ self |
11496 | 2565 |
]. |
2566 |
||
2567 |
ws hasSelection ifTrue:[ |
|
12308 | 2568 |
thisText := ws selectionAsString. |
11496 | 2569 |
] ifFalse:[ |
12308 | 2570 |
thisText := ws contents asString. |
11496 | 2571 |
]. |
2572 |
||
2573 |
otherText := Dialog requestText:'Paste other text below:'. |
|
2574 |
otherText isEmptyOrNil ifTrue:[^ self ]. |
|
2575 |
||
12308 | 2576 |
DiffTextView |
2577 |
openOn: thisText label: 'Workspace' |
|
2578 |
and: otherText label: 'Other Text' |
|
2579 |
title: 'Comparing Workspace Contents' |
|
11496 | 2580 |
|
2581 |
"Created: / 04-05-2012 / 15:35:32 / cg" |
|
2582 |
! |
|
2583 |
||
3154 | 2584 |
doIt |
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2585 |
|ws| |
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2586 |
|
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2587 |
ws := self selectedWorkspacesTextView. |
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2588 |
ws notNil ifTrue:[ |
12308 | 2589 |
ws doIt |
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2590 |
] |
3154 | 2591 |
! |
2592 |
||
2593 |
inspectIt |
|
3198 | 2594 |
self inspectIt:false |
2595 |
! |
|
2596 |
||
4086
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
2597 |
inspectIt:isBasicInspector |
9f685ed7ad3f
autodefine workspace variables
Claus Gittinger <cg@exept.de>
parents:
4031
diff
changeset
|
2598 |
|ws| |
3196 | 2599 |
|
3198 | 2600 |
ws := self selectedWorkspacesTextView. |
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2601 |
ws isNil ifTrue:[ |
12308 | 2602 |
"there is none - i.e. it is a HTMLDocumentView" |
2603 |
^ self. |
|
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2604 |
]. |
3196 | 2605 |
ws |
12308 | 2606 |
do:(ws selection) |
2607 |
withValueDo:[:result | |
|
2608 |
self addInspectorOn:result basic:isBasicInspector suppressPseudoSlots:false |
|
2609 |
] |
|
3196 | 2610 |
|
2611 |
"/ self selectedWorkspace inspectIt |
|
3154 | 2612 |
! |
2613 |
||
3812 | 2614 |
inspectWorkspaceVariables |
2615 |
|wsvars| |
|
2616 |
||
2617 |
wsvars := Workspace workspaceVariables. |
|
2618 |
wsvars size == 0 ifTrue:[ |
|
12308 | 2619 |
Dialog information:'No Workspace Variables are defined'. |
2620 |
^ self |
|
3812 | 2621 |
]. |
2622 |
wsvars inspect |
|
2623 |
! |
|
2624 |
||
10169 | 2625 |
loadFile:aFileName encoding:encodingSymbolOrNil label:label |
2626 |
||
2627 |
"This small hack allows programmers to have their own |
|
2628 |
MyWorkspace.wsp in their ~/.smalltalk directory" |
|
2629 |
||
2630 |
| f | |
|
2631 |
f := aFileName asFilename. |
|
2632 |
(f exists not and:[f isAbsolute not]) ifTrue:[ |
|
2633 |
f := Filename homeDirectory / '.smalltalk' / f pathName. |
|
2634 |
f exists ifFalse:[ |
|
12308 | 2635 |
(aFileName = 'MyWorkspace.wsp') |
2636 |
ifTrue: |
|
2637 |
[| s| |
|
2638 |
s := f writeStream. |
|
2639 |
[s nextPutAll:'"Edit and save as ', f pathName , '"'] |
|
2640 |
ensure:[s close]] |
|
2641 |
ifFalse: |
|
2642 |
[f := aFileName asFilename] |
|
10169 | 2643 |
]]. |
2644 |
^super loadFile:f pathName encoding:encodingSymbolOrNil label:label |
|
2645 |
||
2646 |
"Created: / 23-12-2009 / 10:13:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2647 |
"Modified: / 11-02-2010 / 10:15:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2648 |
! |
|
2649 |
||
7931 | 2650 |
manageSniplets |
2651 |
|bindings listOfSniplets removeAction pasteAction |
|
2652 |
hasSelectionHolder removeEnabledHolder pasteEnabledHolder |
|
8285 | 2653 |
selectedSnipletHolder selectedSnipletsTextHolder selectedSnipletsName |
8286 | 2654 |
snipletsDictionary saveEnabledHolder saveAction | |
7931 | 2655 |
|
8285 | 2656 |
snipletsDictionary := Workspace sniplets. |
2657 |
snipletsDictionary isEmptyOrNil ifTrue:[ |
|
12308 | 2658 |
Dialog information:(resources string:'No Sniplets to Manage'). |
2659 |
^ self. |
|
7944
3d185d0ca8e9
sharedPool inspection support
Claus Gittinger <cg@exept.de>
parents:
7931
diff
changeset
|
2660 |
]. |
3d185d0ca8e9
sharedPool inspection support
Claus Gittinger <cg@exept.de>
parents:
7931
diff
changeset
|
2661 |
|
12887
07582d422bd1
class: WorkspaceApplication
Claus Gittinger <cg@exept.de>
parents:
12767
diff
changeset
|
2662 |
listOfSniplets := List withAll:(snipletsDictionary keysSorted). |
7931 | 2663 |
selectedSnipletsTextHolder := '' asValue. |
2664 |
||
2665 |
selectedSnipletHolder := nil asValue. |
|
2666 |
selectedSnipletHolder onChangeEvaluate:[ |
|
12308 | 2667 |
(selectedSnipletHolder value) isNil ifTrue:[ |
2668 |
selectedSnipletsName := nil. |
|
2669 |
selectedSnipletsTextHolder value:''. |
|
2670 |
] ifFalse:[ |
|
2671 |
selectedSnipletsName := listOfSniplets at:(selectedSnipletHolder value). |
|
2672 |
selectedSnipletsTextHolder value:(snipletsDictionary at:selectedSnipletsName). |
|
2673 |
]. |
|
7931 | 2674 |
]. |
2675 |
||
2676 |
hasSelectionHolder := BlockValue with:[:m | m value notNil] argument:selectedSnipletHolder. |
|
2677 |
removeEnabledHolder := hasSelectionHolder. |
|
2678 |
pasteEnabledHolder := hasSelectionHolder. |
|
12308 | 2679 |
saveEnabledHolder := BlockValue with:[:m :textHolder| |
2680 |
m value notNil |
|
2681 |
and:[(snipletsDictionary at:(listOfSniplets at:(selectedSnipletHolder value))) ~= textHolder value] |
|
8286 | 2682 |
] argument: selectedSnipletHolder argument: selectedSnipletsTextHolder. |
7931 | 2683 |
|
2684 |
removeAction := [ |
|
12308 | 2685 |
snipletsDictionary removeKey:selectedSnipletsName. |
2686 |
listOfSniplets remove:selectedSnipletsName. |
|
7931 | 2687 |
]. |
2688 |
||
2689 |
pasteAction := [ |
|
12308 | 2690 |
|text| |
2691 |
text := snipletsDictionary at:selectedSnipletsName. |
|
2692 |
self paste:text |
|
7931 | 2693 |
]. |
8286 | 2694 |
saveAction := [ |
12308 | 2695 |
|originalText newText| |
2696 |
originalText := snipletsDictionary at:selectedSnipletsName. |
|
2697 |
newText := selectedSnipletsTextHolder value. |
|
2698 |
originalText ~= newText ifTrue:[ |
|
2699 |
snipletsDictionary at: selectedSnipletsName put: newText. |
|
2700 |
]. |
|
2701 |
saveEnabledHolder recomputeValue. |
|
8286 | 2702 |
]. |
7931 | 2703 |
|
2704 |
bindings := IdentityDictionary new. |
|
2705 |
bindings at:#listOfSniplets put:listOfSniplets. |
|
2706 |
bindings at:#selectedSniplet put:selectedSnipletHolder asValue. |
|
2707 |
bindings at:#selectedSnipletsText put:selectedSnipletsTextHolder. |
|
2708 |
bindings at:#removeSelectedSniplet put:removeAction. |
|
2709 |
bindings at:#pasteSelectedSniplet put:pasteAction. |
|
8286 | 2710 |
bindings at:#saveSelectedSniplet put:saveAction. |
7931 | 2711 |
bindings at:#removeEnabled put:removeEnabledHolder. |
8286 | 2712 |
bindings at:#pasteEnabled put:pasteEnabledHolder. |
2713 |
bindings at:#saveEnabled put:saveEnabledHolder. |
|
7931 | 2714 |
|
2715 |
self openDialogInterface:#manageSnipletsDialogSpec withBindings:bindings |
|
2716 |
! |
|
2717 |
||
12244 | 2718 |
menuSQLConnect |
2719 |
||
2720 |
self selectedWorkspaceApplication menuConnect |
|
2721 |
||
2722 |
"Created: / 11-05-2012 / 10:00:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2723 |
! |
|
2724 |
||
10169 | 2725 |
menuSave |
10786
2499584c6260
changed: #menuSave (support for CodeView2 accept/cancel bar)
vrany
parents:
10730
diff
changeset
|
2726 |
|ws file| |
10169 | 2727 |
|
2728 |
ws := self selectedWorkspace scrolledView. |
|
2729 |
ws isTextView ifFalse:[ |
|
12308 | 2730 |
self shouldImplement:'Functionality not yet implemented'. |
10169 | 2731 |
]. |
2732 |
file := ws defaultFileNameForFileDialog. |
|
12308 | 2733 |
file |
2734 |
ifNil:[ |
|
2735 |
self menuSaveAs. |
|
2736 |
^ self |
|
2737 |
]. |
|
10169 | 2738 |
ws saveAs:file doAppend:false. |
10786
2499584c6260
changed: #menuSave (support for CodeView2 accept/cancel bar)
vrany
parents:
10730
diff
changeset
|
2739 |
ws isCodeView2 ifTrue:[ |
12308 | 2740 |
ws beUnmodified |
10786
2499584c6260
changed: #menuSave (support for CodeView2 accept/cancel bar)
vrany
parents:
10730
diff
changeset
|
2741 |
] |
10169 | 2742 |
|
2743 |
"Created: / 21-06-2011 / 11:42:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2744 |
"Modified (format): / 05-07-2011 / 15:44:27 / cg" |
|
10786
2499584c6260
changed: #menuSave (support for CodeView2 accept/cancel bar)
vrany
parents:
10730
diff
changeset
|
2745 |
"Modified: / 08-10-2011 / 12:51:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10169 | 2746 |
! |
2747 |
||
7403
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
2748 |
newEvaluationWorkspace |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
2749 |
self class openEvaluationWorkspace |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
2750 |
|
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
2751 |
"Created: / 13-10-2006 / 12:19:47 / cg" |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
2752 |
! |
73712386ea82
menu: open/add evaluation workspace
Claus Gittinger <cg@exept.de>
parents:
6865
diff
changeset
|
2753 |
|
3334 | 2754 |
newSystemWorkspace |
2755 |
self class openSystemWorkspace |
|
2756 |
! |
|
2757 |
||
3154 | 2758 |
openDocumentation |
2759 |
"opens the documentation file" |
|
2760 |
||
2761 |
self openHTMLDocument: 'tools/misc/TOP.html#WORKSPACE' |
|
2762 |
! |
|
2763 |
||
4267 | 2764 |
pasteAndExecute:aString |
2765 |
self paste:aString. |
|
4136 | 2766 |
self printIt |
2767 |
! |
|
2768 |
||
7931 | 2769 |
pasteSniplet |
8285 | 2770 |
|allSniplets snipletToPaste snipletsDictionary| |
7931 | 2771 |
|
8285 | 2772 |
snipletsDictionary := Workspace sniplets. |
2773 |
snipletsDictionary isEmptyOrNil ifTrue:[ |
|
12308 | 2774 |
Dialog information:(resources string:'No Sniplets to Paste'). |
2775 |
^ self. |
|
7944
3d185d0ca8e9
sharedPool inspection support
Claus Gittinger <cg@exept.de>
parents:
7931
diff
changeset
|
2776 |
]. |
12887
07582d422bd1
class: WorkspaceApplication
Claus Gittinger <cg@exept.de>
parents:
12767
diff
changeset
|
2777 |
allSniplets := snipletsDictionary keysSorted. |
7931 | 2778 |
|
12308 | 2779 |
snipletToPaste := Dialog |
2780 |
choose:(resources string:'Paste Sniplet:') |
|
2781 |
fromList:allSniplets |
|
2782 |
lines:10. |
|
7931 | 2783 |
snipletToPaste isNil ifTrue:[ |
12308 | 2784 |
^ self |
7931 | 2785 |
]. |
9616 | 2786 |
self paste:(snipletsDictionary at:snipletToPaste) withCRs. |
2787 |
||
2788 |
"Modified: / 29-10-2010 / 10:21:29 / cg" |
|
7931 | 2789 |
! |
2790 |
||
3154 | 2791 |
printIt |
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2792 |
|ws| |
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2793 |
|
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2794 |
ws := self selectedWorkspacesTextView. |
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2795 |
ws notNil ifTrue:[ |
12308 | 2796 |
ws printIt |
11481
d0a2a73ed69d
added: #selectedWorkspaceIsTextView
Stefan Vogel <sv@exept.de>
parents:
11480
diff
changeset
|
2797 |
] |
3193 | 2798 |
! |
2799 |
||
3752 | 2800 |
processText |
2801 |
|template filterBlock newList oldList answer nChanged changedLines flags| |
|
2802 |
||
2803 |
template := |
|
2804 |
'"/ general text processor; |
|
12308 | 2805 |
"/ the following block should evaluate to a new line, |
3752 | 2806 |
"/ given the original line as argument. |
2807 |
"/ Beginner warning: Smalltalk know-how is useful here. |
|
2808 |
||
2809 |
[:line | |
|
2810 |
"/ any processing on line. |
|
2811 |
"/ Notice, that line might be a Text object (i.e. non-string), |
|
12308 | 2812 |
"/ |
3752 | 2813 |
"/ Useful operations on the line are: |
2814 |
"/ - '' .... '' , concatenation of any prefix/suffix |
|
2815 |
"/ - leftPaddedTo:size padding |
|
2816 |
"/ - rightPaddedTo:size padding |
|
12308 | 2817 |
"/ - copyTo:(size min:N) |
2818 |
"/ - asUppercase |
|
3752 | 2819 |
"/ - asLowercase |
4141 | 2820 |
"/ - withoutSeparators remove whiteSpace |
2821 |
"/ - asCollectionOfWords words |
|
3752 | 2822 |
|
2823 |
"/ makes everything bold |
|
2824 |
"/ |
|
2825 |
"/ line allBold |
|
2826 |
||
4141 | 2827 |
"/ first word only |
2828 |
"/ |
|
2829 |
"/ line withoutSeparators asCollectionOfWords first |
|
2830 |
||
3752 | 2831 |
"/ dummy filter (keeps all lines as-is) |
2832 |
"/ |
|
2833 |
line |
|
2834 |
] |
|
2835 |
'. |
|
2836 |
filterBlock := self askForFilterBlock:'Processing block:' |
|
12308 | 2837 |
template:template |
2838 |
rememberIn:#LastProcessingBlockString. |
|
3752 | 2839 |
filterBlock isNil ifTrue:[^ self]. |
2840 |
||
2841 |
oldList := self selectedWorkspacesTextView list. |
|
2842 |
oldList := oldList collect:[:lineOrNil | lineOrNil ? '']. |
|
4141 | 2843 |
newList := oldList collect:[:line | |newLine| |
12308 | 2844 |
newLine := line. |
2845 |
Error handle:[:ex | |
|
2846 |
] do:[ |
|
2847 |
newLine := filterBlock value:line |
|
2848 |
]. |
|
2849 |
newLine |
|
2850 |
]. |
|
3752 | 2851 |
newList := newList collect:[:line | (line isString and:[line size == 0]) ifTrue:[nil] ifFalse:[line]]. |
2852 |
||
2853 |
flags := (1 to:oldList size) collect:[:i | (oldList at:i) ~= (newList at:i)]. |
|
2854 |
flags := flags select:[:flag | flag]. |
|
2855 |
nChanged := flags size. |
|
2856 |
nChanged == 0 ifTrue:[ |
|
12308 | 2857 |
self information:'No lines were changed.'. |
2858 |
^ self |
|
3752 | 2859 |
]. |
2860 |
||
12308 | 2861 |
answer := Dialog confirmWithCancel:(resources |
2862 |
string:'%1 lines changed. Change text ?' |
|
2863 |
with:nChanged) |
|
2864 |
labels:#( 'Cancel' 'No, Show Changed' 'Yes'). |
|
3752 | 2865 |
answer isNil ifTrue:[^ self]. |
2866 |
answer ifFalse:[ |
|
12308 | 2867 |
changedLines := (1 to:oldList size) select:[:i | (oldList at:i) ~= (newList at:i)]. |
2868 |
changedLines := changedLines collect:[:i | (newList at:i)]. |
|
2869 |
TextBox openOn:(changedLines asStringCollection) title:'Changed lines'. |
|
2870 |
^ self. |
|
3752 | 2871 |
]. |
2872 |
||
2873 |
self selectedWorkspacesTextView list:newList. |
|
2874 |
! |
|
2875 |
||
12028 | 2876 |
profileIt |
2877 |
self selectedWorkspacesTextView profileIt |
|
2878 |
! |
|
2879 |
||
4136 | 2880 |
redoLastDoIt |
4267 | 2881 |
|s| |
4136 | 2882 |
|
4267 | 2883 |
s := self lastDoItsString. |
2884 |
s notNil ifTrue:[ |
|
12308 | 2885 |
self pasteAndExecute:s |
4267 | 2886 |
] |
4136 | 2887 |
! |
2888 |
||
3722 | 2889 |
removeAllWorkspaceVariables |
5846 | 2890 |
(Dialog confirm:(resources string:'Do you really want to remove all Workspace Variables ?')) |
3722 | 2891 |
ifTrue:[ |
12308 | 2892 |
Workspace removeAllWorkspaceVariables |
3722 | 2893 |
]. |
2894 |
! |
|
2895 |
||
4284 | 2896 |
removeGlobalVariable |
2897 |
|name nameKey selection value| |
|
2898 |
||
2899 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
2900 |
||
12308 | 2901 |
name := Dialog |
2902 |
request:'Remove Global Variable:' |
|
2903 |
initialAnswer:(selection asString string) |
|
2904 |
okLabel:'Remove' |
|
2905 |
title:'Remove Global'. |
|
4284 | 2906 |
|
2907 |
name size == 0 ifTrue:[^ self]. |
|
2908 |
nameKey := name asSymbolIfInterned. |
|
2909 |
nameKey isNil ifTrue:[^ self]. |
|
2910 |
||
2911 |
(Smalltalk includesKey:nameKey) ifFalse:[ |
|
12308 | 2912 |
self warn:('No such Global Binding: ''%1''.' bindWith:name). |
2913 |
^ self. |
|
4284 | 2914 |
]. |
2915 |
||
2916 |
value := Smalltalk at:nameKey. |
|
2917 |
value notNil ifTrue:[ |
|
12308 | 2918 |
(self confirm:('Global ''%1'' is currently bound to %2\\Remove Binding ?' bindWith:name with:value) withCRs) |
2919 |
ifFalse:[ |
|
2920 |
^ self. |
|
2921 |
]. |
|
4284 | 2922 |
]. |
2923 |
Smalltalk at:nameKey put:nil. |
|
2924 |
Smalltalk removeKey:nameKey |
|
2925 |
! |
|
2926 |
||
7931 | 2927 |
removeSharedPool |
2928 |
|poolToRemove| |
|
2929 |
||
2930 |
poolsConsideredInDoIts isEmptyOrNil ifTrue:[ |
|
12308 | 2931 |
Dialog information:'No pools have been added yet'. |
2932 |
^ self. |
|
7931 | 2933 |
]. |
2934 |
||
12308 | 2935 |
poolToRemove := Dialog |
2936 |
choose:'Pool to Remove (No longer known in doIt-Evaluations):' |
|
2937 |
fromList:(poolsConsideredInDoIts asOrderedCollection sort) |
|
2938 |
lines:10. |
|
7931 | 2939 |
|
2940 |
poolToRemove isNil ifTrue:[ |
|
12308 | 2941 |
^ self |
7931 | 2942 |
]. |
2943 |
poolsConsideredInDoIts remove:poolToRemove. |
|
12308 | 2944 |
workspaces do:[:eachWs | |
2945 |
|ws| |
|
2946 |
ws := self workspaceViewOfView:eachWs. |
|
2947 |
ws notNil ifTrue:[ |
|
2948 |
ws poolsConsideredInDoIts:poolsConsideredInDoIts. |
|
2949 |
]. |
|
7931 | 2950 |
]. |
2951 |
||
2952 |
"Modified: / 24-11-2006 / 12:44:16 / cg" |
|
2953 |
! |
|
2954 |
||
3722 | 2955 |
removeWorkspaceVariable |
6266 | 2956 |
|name selection wsVarNames| |
3812 | 2957 |
|
6266 | 2958 |
wsVarNames := Workspace workspaceVariableNames. |
2959 |
wsVarNames isEmpty ifTrue:[ |
|
12308 | 2960 |
Dialog information:'No Workspace Variables are defined'. |
2961 |
^ self |
|
3812 | 2962 |
]. |
3722 | 2963 |
|
2964 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
2965 |
||
12308 | 2966 |
name := Dialog |
2967 |
request:'Variable to remove:' |
|
2968 |
initialAnswer:(selection asString string) |
|
2969 |
okLabel:'Remove' |
|
2970 |
title:'Enter Variable Name' |
|
2971 |
list:(wsVarNames asOrderedCollection sort). |
|
6266 | 2972 |
name isEmptyOrNil ifTrue:[ |
12308 | 2973 |
^ self |
3722 | 2974 |
]. |
2975 |
Workspace removeWorkspaceVariable:name. |
|
6266 | 2976 |
|
2977 |
"Modified: / 20-04-2005 / 11:56:28 / cg" |
|
3722 | 2978 |
! |
2979 |
||
10169 | 2980 |
renameWorkspace:wsIndex to:newName |
2981 |
|tabList| |
|
2982 |
||
2983 |
tabList := self tabList. |
|
2984 |
tabList notEmpty ifTrue:[ |
|
12308 | 2985 |
tabList at:wsIndex put:newName. |
10169 | 2986 |
]. |
2987 |
wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[ |
|
12308 | 2988 |
self setWindowLabel: newName. |
10169 | 2989 |
]. |
2990 |
! |
|
2991 |
||
9746
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
2992 |
setCompilerForSyntax |
11811
41a4ebfe2da2
changed: #setCompilerForSyntax
Claus Gittinger <cg@exept.de>
parents:
11799
diff
changeset
|
2993 |
|selectedWorkspace ws| |
11654
7ac01328f0ef
changed: #setCompilerForSyntax
Claus Gittinger <cg@exept.de>
parents:
11627
diff
changeset
|
2994 |
|
7ac01328f0ef
changed: #setCompilerForSyntax
Claus Gittinger <cg@exept.de>
parents:
11627
diff
changeset
|
2995 |
(selectedWorkspace := self selectedWorkspace) notNil ifTrue:[ |
12308 | 2996 |
(ws := self workspaceViewOfView:selectedWorkspace) notNil ifTrue:[ |
2997 |
self setCompilerForSyntaxIn:ws. |
|
2998 |
] |
|
11654
7ac01328f0ef
changed: #setCompilerForSyntax
Claus Gittinger <cg@exept.de>
parents:
11627
diff
changeset
|
2999 |
]. |
7ac01328f0ef
changed: #setCompilerForSyntax
Claus Gittinger <cg@exept.de>
parents:
11627
diff
changeset
|
3000 |
|
11811
41a4ebfe2da2
changed: #setCompilerForSyntax
Claus Gittinger <cg@exept.de>
parents:
11799
diff
changeset
|
3001 |
"Modified: / 26-09-2012 / 11:55:59 / cg" |
9746
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
3002 |
! |
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
3003 |
|
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
3004 |
setCompilerForSyntaxIn:aWorkspace |
11826 | 3005 |
|compilerClass language| |
9746
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
3006 |
|
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
3007 |
language := self syntaxHolder value. |
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
3008 |
language isSymbol ifTrue:[ |
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
3009 |
language := ProgrammingLanguage named:language |
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
3010 |
]. |
11612 | 3011 |
language isNil ifTrue:[ |
11826 | 3012 |
compilerClass := nil |
11612 | 3013 |
] ifFalse:[ |
11826 | 3014 |
compilerClass := (language evaluatorClass "self compilerClassForSyntaxName:syntax"). |
11612 | 3015 |
]. |
11826 | 3016 |
[ |
3017 |
"/ could be a non-text view (VT100Terminal) |
|
3018 |
aWorkspace compilerClass:compilerClass. |
|
3019 |
] on:MessageNotUnderstood do:[]. |
|
3020 |
||
11612 | 3021 |
self smalltalkMenuEnabledHolder value:(language notNil and:[language isSmalltalk]). |
9746
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
3022 |
|
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
3023 |
"Created: / 08-02-2011 / 21:32:39 / cg" |
10602 | 3024 |
"Modified: / 17-08-2011 / 08:47:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11826 | 3025 |
"Modified: / 28-09-2012 / 19:55:18 / cg" |
9746
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
3026 |
! |
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
3027 |
|
3384 | 3028 |
spyOnIt |
3029 |
self selectedWorkspacesTextView spyOnIt |
|
3030 |
! |
|
3031 |
||
10169 | 3032 |
switchToBookmarkEntry: bookmark |
11829
2e8997ff4629
changed: #switchToBookmarkEntry:
Claus Gittinger <cg@exept.de>
parents:
11826
diff
changeset
|
3033 |
| ws file app | |
10169 | 3034 |
|
3035 |
ws := self selectedWorkspace scrolledView. |
|
11725
0b626c2b4b2d
Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents:
11713
diff
changeset
|
3036 |
(ws isApplicationSubView) ifTrue:[ |
12308 | 3037 |
((app := ws application) respondsTo:#switchToBookmarkEntry:) ifTrue:[ |
3038 |
app switchToBookmarkEntry: bookmark |
|
3039 |
]. |
|
3040 |
^ self. |
|
10169 | 3041 |
]. |
3042 |
||
3043 |
bookmark isFileBookmark ifTrue:[ |
|
12308 | 3044 |
file := bookmark path asFilename. |
3045 |
(ws isTextView not or:[ws contents notEmpty]) ifTrue:[ |
|
3046 |
self addWindow: (self createWorkspace) named: file withoutSuffix baseName. |
|
3047 |
]. |
|
3048 |
file exists ifFalse:[ |
|
3049 |
Transcript showCR:('Bookmarked workspace file no longer exists: %1' bindWith:file) |
|
3050 |
] ifTrue:[ |
|
3051 |
self loadFile: file. |
|
3052 |
]. |
|
3053 |
^ self. |
|
10169 | 3054 |
]. |
3055 |
||
3056 |
"Created: / 20-06-2011 / 22:45:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3057 |
"Modified: / 21-06-2011 / 08:18:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10730
23c04d952143
much faster startup in openMyWorkspace_new
Claus Gittinger <cg@exept.de>
parents:
10602
diff
changeset
|
3058 |
"Modified: / 28-09-2011 / 07:44:53 / cg" |
10169 | 3059 |
! |
3060 |
||
3384 | 3061 |
timeIt |
3062 |
self selectedWorkspacesTextView timeIt |
|
3154 | 3063 |
! ! |
3064 |
||
8763 | 3065 |
!WorkspaceApplication methodsFor:'menu-actions-adding'! |
3066 |
||
10169 | 3067 |
addBookmark |
3068 |
||
3069 |
self menuAddBookmarkTo: self bookmarks root. |
|
3070 |
||
3071 |
"Created: / 20-06-2011 / 22:34:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3072 |
"Modified: / 21-06-2011 / 08:56:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3073 |
! |
|
3074 |
||
8763 | 3075 |
addClassVariableInspector |
3076 |
|v| |
|
3077 |
||
3078 |
ClassVariablesInspectorView isNil ifTrue:[ |
|
12308 | 3079 |
self error:'Missing class: "ClassVariablesInspectorView"'. |
3080 |
^ self. |
|
8763 | 3081 |
]. |
3082 |
v := self addInspectorOn:Smalltalk inspectorClass:ClassVariablesInspectorView suppressPseudoSlots:true. |
|
3083 |
||
3084 |
v fieldListLabel:'Name'. |
|
3085 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value) to:'Class Variables'. |
|
3086 |
||
3087 |
"Modified: / 22-10-2006 / 11:28:14 / cg" |
|
3088 |
! |
|
3089 |
||
3090 |
addEvaluationWorkspace |
|
3091 |
^ self addWindow:(self createEvaluationWorkspace) named:'Eval%1' |
|
3092 |
||
3093 |
"Modified: / 13-10-2006 / 12:16:35 / cg" |
|
3094 |
! |
|
3095 |
||
3096 |
addGlobalVariable |
|
3097 |
|name nameKey selection| |
|
3098 |
||
3099 |
selection := self selectedWorkspacesTextView selection ? ''. |
|
3100 |
||
12308 | 3101 |
name := Dialog |
3102 |
request:'Name of new Global Variable:' |
|
3103 |
initialAnswer:(selection asString string) |
|
3104 |
okLabel:'Add' |
|
3105 |
title:'Enter Variable Name'. |
|
8763 | 3106 |
name size == 0 ifTrue:[ |
12308 | 3107 |
^ self |
8763 | 3108 |
]. |
3109 |
nameKey := name asSymbol. |
|
3110 |
||
3111 |
(Smalltalk includesKey:nameKey) ifTrue:[ |
|
12308 | 3112 |
self warn:'Global named ''' , name , ''' already exists.'. |
3113 |
^ self. |
|
8763 | 3114 |
]. |
3115 |
Smalltalk at:nameKey put:nil. |
|
3116 |
! |
|
3117 |
||
3118 |
addGlobalVariableInspector |
|
3119 |
^ self addNamespaceInspectorFor:Smalltalk |
|
3120 |
||
3121 |
"Modified: / 29-05-2007 / 19:08:58 / cg" |
|
3122 |
! |
|
3123 |
||
3124 |
addInspectorOn:aValue basic:isBasicInspector suppressPseudoSlots:suppressPseudoSlots |
|
3125 |
|inspectorClass| |
|
3126 |
||
3127 |
isBasicInspector ifFalse:[ |
|
12737 | 3128 |
"/ Inspector2 does not work yet!! |
3129 |
"(Tools::Inspector2 notNil and:[UserPreferences current useInspector2])" false ifTrue:[ |
|
3130 |
inspectorClass := Tools::Inspector2. |
|
3131 |
] ifFalse:[ |
|
3132 |
inspectorClass := aValue inspectorClass. |
|
3133 |
]. |
|
8763 | 3134 |
]. |
3135 |
inspectorClass isNil ifTrue:[ |
|
12308 | 3136 |
inspectorClass := InspectorView |
8763 | 3137 |
]. |
3138 |
||
3139 |
^ self |
|
12308 | 3140 |
addInspectorOn:aValue |
3141 |
inspectorClass:inspectorClass |
|
3142 |
suppressPseudoSlots:suppressPseudoSlots |
|
8763 | 3143 |
! |
3144 |
||
3145 |
addInspectorOn:aValue inspectorClass:inspectorClass suppressPseudoSlots:suppressPseudoSlots |
|
3146 |
|view resultString| |
|
3147 |
||
3148 |
view := inspectorClass new. |
|
3149 |
view suppressPseudoSlots:suppressPseudoSlots. |
|
3150 |
view inspect:aValue. |
|
3151 |
"/ v allowFollow:true. |
|
3152 |
aValue isBehavior ifTrue:[ |
|
12308 | 3153 |
resultString := aValue name |
8763 | 3154 |
] ifFalse:[ |
12308 | 3155 |
resultString := aValue classNameWithArticle |
8763 | 3156 |
]. |
3157 |
self addWindow:view named:('Inspecting: ' , resultString). |
|
3158 |
^ view |
|
3159 |
! |
|
3160 |
||
3161 |
addMyWorkspace |
|
3162 |
|pane f| |
|
3163 |
||
12308 | 3164 |
self |
3165 |
addWindow:self createWorkspaceView"(pane := HVScrollableView for:Workspace)" |
|
3166 |
named:'My Workspace' |
|
3167 |
asFirst:false. |
|
10169 | 3168 |
|
3169 |
f := Filename homeDirectory / 'MyWorkspace.wsp'. |
|
3170 |
f exists ifFalse:[ |
|
12308 | 3171 |
f := Filename homeDirectory / '.smalltalk' / 'MyWorkspace.wsp'. |
3172 |
f exists ifFalse:[ |
|
3173 |
f := 'MyWorkspace.wsp' asFilename |
|
3174 |
] |
|
10169 | 3175 |
]. |
3176 |
f exists ifTrue:[ |
|
12308 | 3177 |
self loadFile:f label:'My Workspace'. |
8763 | 3178 |
] ifFalse:[ |
12308 | 3179 |
pane defaultFileNameForFileDialog: f pathName. |
8763 | 3180 |
]. |
3181 |
||
10169 | 3182 |
"Modified: / 21-06-2010 / 08:40:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3183 |
"Modified: / 05-07-2011 / 15:39:08 / cg" |
|
8763 | 3184 |
! |
3185 |
||
3186 |
addNamespaceInspector |
|
3187 |
|ns| |
|
3188 |
||
3189 |
ns := Dialog requestNameSpace:'Namespace' initialAnswer:nil. |
|
3190 |
ns isEmptyOrNil ifTrue:[^ self]. |
|
3191 |
^ self addNamespaceInspectorFor:(Smalltalk at:ns asSymbol) |
|
3192 |
||
3193 |
"Created: / 29-05-2007 / 19:10:50 / cg" |
|
3194 |
! |
|
3195 |
||
3196 |
addNamespaceInspectorFor:aNameSpaceOrSharedPool |
|
3197 |
|v label| |
|
3198 |
||
3199 |
SmalltalkInspectorView isNil ifTrue:[ |
|
12308 | 3200 |
self error:'Missing class: "SmalltalkInspectorView"'. |
3201 |
^ nil. |
|
8763 | 3202 |
]. |
3203 |
||
12308 | 3204 |
v := self |
3205 |
addInspectorOn:aNameSpaceOrSharedPool |
|
3206 |
inspectorClass:SmalltalkInspectorView |
|
3207 |
suppressPseudoSlots:true. |
|
8763 | 3208 |
|
3209 |
v fieldListLabel:'Name'. |
|
3210 |
aNameSpaceOrSharedPool == Smalltalk ifTrue:[ |
|
12308 | 3211 |
label := 'Smalltalk (Globals)' |
8763 | 3212 |
] ifFalse:[ |
12308 | 3213 |
aNameSpaceOrSharedPool isSharedPool ifTrue:[ |
3214 |
label := aNameSpaceOrSharedPool name,' (SharedPool)' |
|
3215 |
] ifFalse:[ |
|
3216 |
label := aNameSpaceOrSharedPool name,' (Namespace)' |
|
3217 |
]. |
|
8763 | 3218 |
]. |
3219 |
||
12308 | 3220 |
self |
3221 |
renameWorkspace:(self selectedWorkspaceIndexHolder value) |
|
3222 |
to:label. |
|
8763 | 3223 |
^ v |
3224 |
||
3225 |
"Created: / 29-05-2007 / 19:08:45 / cg" |
|
3226 |
! |
|
3227 |
||
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
3228 |
addSQLWorkspace |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
3229 |
|page view | |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
3230 |
|
12244 | 3231 |
page := (Smalltalk at:#'SQL::WorkspacePage') new. |
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
3232 |
view := ApplicationSubView new. |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
3233 |
view client:page spec:#windowSpec. |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
3234 |
self addWindow:view named:'SQL Workspace %1'. |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
3235 |
|
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
3236 |
"Created: / 10-05-2012 / 18:48:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
3237 |
! |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
3238 |
|
8763 | 3239 |
addSelectionToSniplets |
3240 |
|selection snipletsBaseName snipletsName nr snipletsDictionary| |
|
3241 |
||
3242 |
selection := (self selectedWorkspacesTextView selection ? '') asString. |
|
3243 |
selection isEmpty ifTrue:[ |
|
12308 | 3244 |
Dialog information:(resources string:'Nothing Selected'). |
3245 |
^ self |
|
8763 | 3246 |
]. |
3247 |
||
3248 |
snipletsBaseName := Dialog request:(resources string:'Name of Sniplet:'). |
|
3249 |
snipletsBaseName isNil ifTrue:[ |
|
12308 | 3250 |
^ self |
8763 | 3251 |
]. |
3252 |
snipletsBaseName isEmpty ifTrue:[ |
|
12308 | 3253 |
snipletsBaseName := Time now asString. |
8763 | 3254 |
]. |
3255 |
snipletsDictionary := Workspace sniplets. |
|
3256 |
||
3257 |
snipletsName := snipletsBaseName. |
|
3258 |
(snipletsDictionary includesKey:snipletsName) ifTrue:[ |
|
12308 | 3259 |
(Dialog confirm:(resources string:'Replace existing sniplet named "%1" ?' with:snipletsName)) |
3260 |
ifFalse:[ |
|
3261 |
[snipletsDictionary includesKey:snipletsName] whileTrue:[ |
|
3262 |
nr := (nr ? 1) + 1. |
|
3263 |
snipletsName := (snipletsBaseName,'(%1)') bindWith:nr |
|
3264 |
]. |
|
3265 |
] |
|
8763 | 3266 |
]. |
3267 |
snipletsDictionary at:snipletsName put:selection |
|
3268 |
||
3269 |
"Modified: / 24-11-2006 / 12:44:16 / cg" |
|
3270 |
! |
|
3271 |
||
3272 |
addSharedPool |
|
3273 |
|allPools poolToAdd| |
|
3274 |
||
3275 |
allPools := SharedPool allSubclasses collect:[:p | p name]. |
|
3276 |
allPools removeAll:(poolsConsideredInDoIts ? #()). |
|
9671 | 3277 |
allPools sort. |
8763 | 3278 |
|
12308 | 3279 |
poolToAdd := Dialog |
3280 |
choose:'Select a SharedPool to Add (To be known in doIt-Evaluations):' |
|
3281 |
fromList:allPools |
|
3282 |
lines:15. |
|
8763 | 3283 |
poolToAdd isNil ifTrue:[ |
12308 | 3284 |
^ self |
8763 | 3285 |
]. |
3286 |
poolsConsideredInDoIts isNil ifTrue:[ |
|
12308 | 3287 |
poolsConsideredInDoIts := (Set new). |
8763 | 3288 |
]. |
3289 |
poolsConsideredInDoIts add:poolToAdd. |
|
12308 | 3290 |
workspaces do:[:eachWs | |
3291 |
|ws| |
|
3292 |
ws := self workspaceViewOfView:eachWs. |
|
3293 |
ws notNil ifTrue:[ |
|
3294 |
ws poolsConsideredInDoIts:poolsConsideredInDoIts. |
|
3295 |
]. |
|
8763 | 3296 |
]. |
3297 |
||
3298 |
"Modified: / 24-11-2006 / 12:44:16 / cg" |
|
3299 |
! |
|
3300 |
||
3301 |
addSharedPoolInspector |
|
3302 |
|pool| |
|
3303 |
||
3304 |
pool := Dialog requestSharedPool:'SharedPool' title:nil initialAnswer:nil. |
|
3305 |
pool isEmptyOrNil ifTrue:[^ self]. |
|
3306 |
^ self addNamespaceInspectorFor:(Smalltalk at:pool asSymbol) |
|
3307 |
||
3308 |
"Created: / 29-05-2007 / 19:10:50 / cg" |
|
3309 |
! |
|
3310 |
||
3311 |
addStopWatch |
|
3312 |
|v clock| |
|
3313 |
||
3314 |
v := View new. |
|
3315 |
v viewBackground:Color white. |
|
3316 |
clock := ClockView in:v. |
|
3317 |
clock beStopWatch. |
|
3318 |
||
12308 | 3319 |
clock |
3320 |
origin:[ |
|
3321 |
|ext| |
|
3322 |
||
3323 |
ext := (v height) min:(v width). |
|
3324 |
(v extent - ext) // 2 |
|
3325 |
] |
|
3326 |
extent:[ |
|
3327 |
|ext| |
|
3328 |
||
3329 |
ext := (v height) min:(v width). |
|
3330 |
ext @ ext |
|
3331 |
]. |
|
8763 | 3332 |
|
3333 |
self addWindow:v named:'StopWatch%1'. |
|
3334 |
! |
|
3335 |
||
3336 |
addTeaTimer |
|
10169 | 3337 |
"you think that is a useless gimmick ? |
3338 |
I use it in the office and as a wakeup clock timer" |
|
3339 |
||
9569 | 3340 |
|l dt tEnd dur answer confirmed confirmButton| |
8763 | 3341 |
|
3342 |
dt := LastTeaWaitTime ? (3*60). |
|
12308 | 3343 |
answer := Dialog |
3344 |
request:'Delta-Time (seconds), Duration (n s/m/h) or End-Time (hh:mm:ss):' |
|
3345 |
initialAnswer:(TimeDuration seconds:dt) printString. |
|
8763 | 3346 |
answer isEmptyOrNil ifTrue:[^ self]. |
3347 |
||
3348 |
"/ allow 3 formats: |
|
3349 |
"/ hh:mm:ss -> endTime |
|
3350 |
"/ nnn s -> x seconds |
|
3351 |
"/ nnn m -> x minutes |
|
3352 |
"/ nnn h -> x hours |
|
3353 |
"/ nnn -> seconds |
|
3354 |
||
3355 |
tEnd := Time readFromString:answer onError:nil. |
|
3356 |
tEnd isNil ifTrue:[ |
|
12308 | 3357 |
dur := TimeDuration readFromString:answer onError:nil. |
3358 |
dur isNil ifTrue:[ |
|
3359 |
dt := Number readFromString:answer onError:[^ self]. |
|
3360 |
LastTeaWaitTime := dt. |
|
3361 |
tEnd := Timestamp now addSeconds:dt. |
|
3362 |
] ifFalse:[ |
|
3363 |
dt := dur asSeconds. |
|
3364 |
tEnd := Timestamp now + dur. |
|
3365 |
]. |
|
8763 | 3366 |
] ifFalse:[ |
12308 | 3367 |
tEnd < Time now ifTrue:[ |
3368 |
(Dialog confirm:'Tomorrow ?') ifFalse:[^ self]. |
|
3369 |
tEnd := tEnd asTimestamp addDays:1. |
|
3370 |
dt := tEnd - Timestamp now. |
|
3371 |
] ifFalse:[ |
|
3372 |
dt := tEnd - Time now. |
|
3373 |
tEnd := tEnd asTimestamp. |
|
3374 |
]. |
|
8763 | 3375 |
]. |
3376 |
||
3377 |
l := Label new. |
|
3378 |
l sizeFixed:true. |
|
3379 |
l label:'Waiting... [',(TimeDuration seconds:dt) printString,']'. |
|
3380 |
l viewBackground:Color red. |
|
9569 | 3381 |
confirmButton := (Button label:'OK') action:[ confirmed := true. confirmButton beInvisible. ]. |
3382 |
confirmButton beInvisible. |
|
3383 |
l add:confirmButton. |
|
8763 | 3384 |
self addWindow:l named:'TeaTimer%1'. |
3385 |
||
3386 |
[ |
|
12308 | 3387 |
Error handle:[ |
3388 |
self halt. |
|
3389 |
#intentionallyLeftBlank |
|
3390 |
] do:[ |
|
3391 |
|remaining wg| |
|
3392 |
||
3393 |
confirmed := false. |
|
3394 |
[Timestamp now < tEnd ] whileTrue:[ |
|
3395 |
remaining := tEnd - Timestamp now. |
|
3396 |
l label:'Waiting... [',(TimeDuration seconds:remaining) printString,']'. |
|
3397 |
Delay waitForSeconds:1. |
|
3398 |
]. |
|
3399 |
||
3400 |
l label:'TEA is ready !!'. |
|
12735
44e8ea95cd2f
class: WorkspaceApplication
Claus Gittinger <cg@exept.de>
parents:
12699
diff
changeset
|
3401 |
self window topView raiseDeiconified. |
12308 | 3402 |
"/ could have been removed in the meantime.... |
3403 |
(wg := confirmButton windowGroup) notNil ifTrue:[ |
|
3404 |
confirmButton beVisible. |
|
3405 |
wg repairDamage. |
|
3406 |
||
3407 |
[ confirmed ] whileFalse:[ |
|
12735
44e8ea95cd2f
class: WorkspaceApplication
Claus Gittinger <cg@exept.de>
parents:
12699
diff
changeset
|
3408 |
self window topView raiseDeiconified. |
12308 | 3409 |
3 timesRepeat:[ l beep. Delay waitForSeconds:0.4 ]. |
3410 |
Delay waitForSeconds:5. |
|
3411 |
]. |
|
3412 |
||
3413 |
l viewBackground:Color green. |
|
3414 |
]. |
|
3415 |
] |
|
8763 | 3416 |
] fork. |
3417 |
||
9632 | 3418 |
"Modified: / 16-11-2010 / 14:54:05 / cg" |
10169 | 3419 |
"Modified (comment): / 05-07-2011 / 14:30:48 / cg" |
3420 |
! |
|
3421 |
||
3422 |
addTerminal |
|
3423 |
| v termView | |
|
3424 |
||
12767
332530749a77
class: WorkspaceApplication
Claus Gittinger <cg@exept.de>
parents:
12737
diff
changeset
|
3425 |
(false "OperatingSystem isUNIXlike and:[XTermView notNil and:[XTermView isAvailable]]") ifTrue:[ |
10169 | 3426 |
v := termView := XTermView new |
3427 |
] ifFalse:[ |
|
3428 |
v := (HVScrollableView for:VT100TerminalView). |
|
3429 |
termView := v scrolledView. |
|
3430 |
v autoHideScrollBars:false. |
|
3431 |
v horizontalMini:true. |
|
3432 |
"/ the startShell seems to realize the view, which is not allowed. |
|
3433 |
"/ do it later (after adding to myself) |
|
3434 |
"/ termView startShellIn: Filename currentDirectory asString. |
|
3435 |
]. |
|
3436 |
||
3437 |
self addWindow:v named:'Terminal%1'. |
|
3438 |
||
3439 |
termView shellTerminateAction:[ termView cr; nextPutLine:'*** shell terminated ***' allBold; cr.]. |
|
3440 |
termView startShellIn: Filename currentDirectory asString. |
|
3441 |
||
3442 |
"Modified: / 09-12-2010 / 23:22:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3443 |
"Modified: / 05-07-2011 / 14:42:39 / cg" |
|
3444 |
! |
|
3445 |
||
3446 |
addWebBrowser |
|
3447 |
|view browser| |
|
3448 |
||
3449 |
browser := Tools::WebBrowserPage new. |
|
3450 |
browser toolBarVisibleHolder value:false. |
|
3451 |
view := ApplicationSubView new. |
|
3452 |
view client:browser spec:#windowSpec. |
|
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
3453 |
self addWindow:view named:'Web Browser %1'. |
10169 | 3454 |
|
3455 |
"Created: / 10-06-2011 / 23:27:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3456 |
"Modified (format): / 05-07-2011 / 14:30:59 / cg" |
|
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
3457 |
"Modified: / 10-05-2012 / 18:49:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8763 | 3458 |
! |
3459 |
||
3460 |
addWorkspaceVariable |
|
3461 |
|name selectedWorkspacesTextView selection| |
|
3462 |
||
3463 |
selectedWorkspacesTextView := self selectedWorkspacesTextView. |
|
3464 |
selectedWorkspacesTextView notNil ifTrue:[ |
|
12308 | 3465 |
selection := selectedWorkspacesTextView selection. |
8763 | 3466 |
]. |
3467 |
||
12308 | 3468 |
name := Dialog |
3469 |
request:'Name of new Workspace Variable:' |
|
3470 |
initialAnswer:(selection ? '') asString string |
|
3471 |
okLabel:'Add' |
|
3472 |
title:'Enter Variable Name'. |
|
8763 | 3473 |
name size == 0 ifTrue:[ |
12308 | 3474 |
^ self |
8763 | 3475 |
]. |
3476 |
Workspace addWorkspaceVariable:name. |
|
3477 |
||
3478 |
"Modified: / 24-11-2006 / 12:44:16 / cg" |
|
3479 |
! |
|
3480 |
||
3481 |
addWorkspaceVariableInspector |
|
3482 |
|v| |
|
3483 |
||
3484 |
v := self addInspectorOn:(Workspace workspaceVariables) basic:false suppressPseudoSlots:true. |
|
3485 |
v dereferenceValueHolders:true. |
|
3486 |
v fieldListLabel:'Name'. |
|
9085 | 3487 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value) to:'Workspace Variables'. |
10169 | 3488 |
! |
3489 |
||
3490 |
menuAddBookmarkTo: folder |
|
3491 |
||
3492 |
| ws file | |
|
3493 |
||
3494 |
ws := self selectedWorkspace scrolledView. |
|
3495 |
ws isTextView ifTrue:[ |
|
12308 | 3496 |
file := ws defaultFileNameForFileDialog. |
3497 |
file ifNotNil:[folder add: (Bookmark forFile: file)]. |
|
3498 |
folder model save. |
|
10169 | 3499 |
] ifFalse:[ |
12308 | 3500 |
self shouldImplement |
10169 | 3501 |
] |
3502 |
||
3503 |
"Created: / 21-06-2011 / 08:56:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
8763 | 3504 |
! ! |
3505 |
||
4790 | 3506 |
!WorkspaceApplication methodsFor:'menu-actions-editing'! |
3507 |
||
3508 |
babelFishTranslate:fromToModeString |
|
3509 |
"translate the selected text and paste it after the selection" |
|
3510 |
||
9653 | 3511 |
SOAP::BabelFishClient isNil ifTrue:[ |
12308 | 3512 |
Dialog information:'Sorry the SOAP-BabelFish translation-client is not available'. |
3513 |
^ self. |
|
9653 | 3514 |
]. |
4790 | 3515 |
self selectedWorkspace babelFishTranslate:fromToModeString |
9653 | 3516 |
|
3517 |
"Modified: / 01-12-2010 / 12:24:34 / cg" |
|
4790 | 3518 |
! |
3519 |
||
7831 | 3520 |
changesBrowserOnText |
12308 | 3521 |
(UserPreferences current changeSetBrowserClass) |
3522 |
openOn:(ChangeSet fromStream:self selectedWorkspacesTextView contentsAsString readStream) |
|
7831 | 3523 |
|
3524 |
"Created: / 27-08-2007 / 10:57:30 / cg" |
|
3525 |
! |
|
3526 |
||
10169 | 3527 |
editBookmarks |
3528 |
||
3529 |
BookmarkListEditor new |
|
12308 | 3530 |
bookmarkList: self bookmarks; |
3531 |
open. |
|
10169 | 3532 |
|
3533 |
"Created: / 20-06-2011 / 22:34:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3534 |
! |
|
3535 |
||
9695 | 3536 |
editModeInsert |
3537 |
self selectedWorkspace editModeInsert |
|
3538 |
||
3539 |
"Created: / 22-01-2011 / 11:51:12 / cg" |
|
3540 |
! |
|
3541 |
||
3542 |
editModeInsertAndSelect |
|
3543 |
self selectedWorkspace editModeInsertAndSelect |
|
3544 |
||
3545 |
"Created: / 22-01-2011 / 11:52:52 / cg" |
|
3546 |
! |
|
3547 |
||
3548 |
editModeOverwrite |
|
3549 |
self selectedWorkspace editModeOverwrite |
|
3550 |
||
3551 |
"Created: / 22-01-2011 / 11:52:15 / cg" |
|
3552 |
! |
|
3553 |
||
5261 | 3554 |
fileInText |
3555 |
self selectedWorkspacesTextView contentsAsString readStream fileIn |
|
3556 |
! |
|
3557 |
||
4790 | 3558 |
filterText |
11496 | 3559 |
|template filterBlock newList oldList answer nDeleted deletedLines |
3560 |
prevLine nextLine line| |
|
4790 | 3561 |
|
3562 |
template := |
|
3563 |
'"/ general text filter; |
|
3564 |
"/ the following block should evaluate to true for all lines |
|
11496 | 3565 |
"/ you want to KEEP. |
3566 |
"/ Lines for which the block returns false, will be removed. |
|
4790 | 3567 |
"/ Beginner warning: Smalltalk know-how is useful here. |
3568 |
||
11496 | 3569 |
[:line :lineNr :previousLine :nextLine| |
4790 | 3570 |
"/ any condition on line. |
3571 |
"/ Notice, that line might be a Text object (i.e. non-string), |
|
11496 | 3572 |
"/ so you may want to use ''line string''. |
12308 | 3573 |
"/ |
4790 | 3574 |
"/ Useful queries on the line are: |
3575 |
"/ - size the length of the line |
|
3576 |
"/ - hasChangeOfEmphasis any bold, italic etc. |
|
3577 |
"/ - startsWith:someString |
|
3578 |
"/ - endsWith:someString |
|
11496 | 3579 |
"/ - includesString:someString |
12308 | 3580 |
"/ - pattern match: |
11496 | 3581 |
|
3582 |
"/ example filters |
|
3583 |
"/ |
|
3584 |
"/ -------- removes all empty lines --------------- |
|
4790 | 3585 |
"/ |
3586 |
"/ line size > 0 |
|
3587 |
||
11496 | 3588 |
"/ -------- removes all lines which do not end with some suffix ---------- |
4790 | 3589 |
"/ |
3590 |
"/ (line asLowercase endsWith:''foo'') not |
|
3591 |
||
11496 | 3592 |
"/ -------- removes duplicates ---------- |
3593 |
"/ |
|
3594 |
"/ (line = nextLine) not |
|
3595 |
||
4790 | 3596 |
"/ dummy filter (keeps all lines) |
3597 |
"/ |
|
3598 |
true |
|
3599 |
] |
|
3600 |
'. |
|
3601 |
||
11496 | 3602 |
filterBlock := self askForFilterBlock:'Filter block (to remove lines):' |
12308 | 3603 |
template:template |
3604 |
rememberIn:#LastFilterBlockString. |
|
4790 | 3605 |
filterBlock isNil ifTrue:[^ self]. |
3606 |
||
3607 |
oldList := self selectedWorkspacesTextView list. |
|
11496 | 3608 |
newList := StringCollection new. |
3609 |
deletedLines := OrderedCollection new. |
|
3610 |
||
3611 |
oldList notEmptyOrNil ifTrue:[ |
|
12308 | 3612 |
line := nil. |
3613 |
nextLine := oldList at: 1. |
|
3614 |
1 to: oldList size do:[:lineNr | |
|
3615 |
prevLine := line. |
|
3616 |
line := nextLine. |
|
3617 |
nextLine := oldList at: lineNr + 1 ifAbsent: nil. |
|
3618 |
||
3619 |
(filterBlock |
|
3620 |
value:(line ? '') |
|
3621 |
value: lineNr |
|
3622 |
value: (prevLine ? '') |
|
3623 |
value: (nextLine ? '') |
|
3624 |
) ifTrue: [ |
|
3625 |
newList add: line |
|
3626 |
] ifFalse:[ |
|
3627 |
deletedLines add: line. |
|
3628 |
] |
|
3629 |
]. |
|
3630 |
||
3631 |
newList := newList collect:[:line | (line isString and:[line size == 0]) ifTrue:[nil] ifFalse:[line]]. |
|
11496 | 3632 |
]. |
3633 |
||
3634 |
nDeleted := deletedLines size. |
|
4790 | 3635 |
nDeleted == 0 ifTrue:[ |
12308 | 3636 |
self information:'No lines were deleted.'. |
3637 |
^ self |
|
4790 | 3638 |
]. |
3639 |
||
12308 | 3640 |
answer := OptionBox |
3641 |
request:(resources |
|
3642 |
string:'%1 lines remain (%2 deleted). Change text ?' |
|
3643 |
with:newList size |
|
3644 |
with:nDeleted) |
|
3645 |
buttonLabels:#( 'Cancel' 'No, Show Deleted' 'Yes, but Show Deleted' 'Yes') |
|
3646 |
values:#(nil false yesAndShow true) |
|
3647 |
default:true. |
|
4790 | 3648 |
answer isNil ifTrue:[^ self]. |
11496 | 3649 |
(answer ~~ true) ifTrue:[ |
12308 | 3650 |
TextBox openOn:(deletedLines asStringCollection) title:'Filtered lines'. |
3651 |
(answer == false) ifTrue:[ |
|
3652 |
^ self. |
|
3653 |
]. |
|
4790 | 3654 |
]. |
3655 |
||
3656 |
self selectedWorkspacesTextView list:newList. |
|
11496 | 3657 |
|
3658 |
"Modified: / 04-05-2012 / 16:03:32 / cg" |
|
4790 | 3659 |
! |
3660 |
||
3661 |
googleSpellingSuggestion |
|
3662 |
self selectedWorkspacesTextView googleSpellingSuggestion |
|
3663 |
! |
|
3664 |
||
8499 | 3665 |
indent |
9810 | 3666 |
self selectedWorkspacesTextView indentBy4. |
8499 | 3667 |
! |
3668 |
||
4790 | 3669 |
pasteLastDoIt |
3670 |
|s| |
|
3671 |
||
3672 |
s := self lastDoItsString. |
|
3673 |
s notNil ifTrue:[ |
|
12308 | 3674 |
self paste:s |
4790 | 3675 |
] |
8499 | 3676 |
! |
3677 |
||
3678 |
undent |
|
9810 | 3679 |
self selectedWorkspacesTextView undentBy4. |
4790 | 3680 |
! ! |
3681 |
||
4136 | 3682 |
!WorkspaceApplication methodsFor:'menu-dynamic'! |
3683 |
||
10169 | 3684 |
bookmarkMenu |
3685 |
| menu item | |
|
10283 | 3686 |
|
3687 |
menu := self bookmarks asMenuUsingBuilder: (BookmarkMenuBuilder new resources:resources). |
|
10169 | 3688 |
menu hasItems ifTrue:[menu addSeparator]. |
3689 |
||
10283 | 3690 |
item := MenuItem labeled:(resources string:'Add Bookmark'). |
11787 | 3691 |
item itemValue:#addBookmark. |
10169 | 3692 |
item enabled:[self canAddBookmark]. |
3693 |
menu addItem: item. |
|
3694 |
||
3695 |
menu addSeparator. |
|
12308 | 3696 |
|
10283 | 3697 |
item := MenuItem labeled:(resources string:'Edit Bookmarks'). |
11787 | 3698 |
item itemValue:#editBookmarks. |
10169 | 3699 |
menu addItem: item. |
3700 |
^menu |
|
3701 |
||
3702 |
"Created: / 20-06-2011 / 22:21:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3703 |
"Modified: / 21-06-2011 / 08:05:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11787 | 3704 |
"Modified: / 09-09-2012 / 13:25:48 / cg" |
10169 | 3705 |
! |
3706 |
||
9695 | 3707 |
editModeInfoLabelMenu |
3708 |
^ self class editModeInfoLabelMenu |
|
3709 |
||
3710 |
"Created: / 22-01-2011 / 11:50:35 / cg" |
|
3711 |
! |
|
3712 |
||
9300
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
3713 |
languageListMenuSlice |
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
3714 |
|m allLanguages | |
9300
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
3715 |
|
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
3716 |
allLanguages := OrderedCollection new. |
12308 | 3717 |
ProgrammingLanguage allDo:[:eachLanguage | |
3718 |
eachLanguage isSmalltalk ifFalse:[ |
|
3719 |
allLanguages add:eachLanguage |
|
3720 |
] |
|
9300
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
3721 |
]. |
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
3722 |
allLanguages sort:[:a :b | a name < b name]. |
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
3723 |
|
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
3724 |
m := Menu new. |
12308 | 3725 |
m addItem:((MenuItem |
3726 |
label:'Smalltalk' |
|
3727 |
choice:#syntaxHolder |
|
3728 |
choiceValue:SmalltalkLanguage instance) |
|
3729 |
enabled: self canChangeLanguageHolder). |
|
9341
aa3c5825ec98
refactored to allow redefinition of defaultSyntax
Claus Gittinger <cg@exept.de>
parents:
9304
diff
changeset
|
3730 |
|
11235
9a0429235c45
changed: #languageListMenuSlice
Claus Gittinger <cg@exept.de>
parents:
10786
diff
changeset
|
3731 |
"/ allLanguages notEmpty ifTrue:[ |
9a0429235c45
changed: #languageListMenuSlice
Claus Gittinger <cg@exept.de>
parents:
10786
diff
changeset
|
3732 |
"/ m addItem:(MenuItem separator). |
9300
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
3733 |
|
12308 | 3734 |
allLanguages do:[:eachLanguage | |
3735 |
"JV@2012-02-18: Add language only iff it supports |
|
3736 |
evaluation (most of then do, but some may not - |
|
3737 |
such as Java)" |
|
3738 |
(eachLanguage evaluatorClass notNil |
|
3739 |
and:[eachLanguage evaluatorClass canUnderstand: #evaluate:in:receiver:notifying:logged:ifFail:]) |
|
3740 |
ifTrue:[ |
|
3741 |
m addItem:((MenuItem |
|
3742 |
label:(eachLanguage name) |
|
3743 |
choice:#syntaxHolder |
|
3744 |
choiceValue:eachLanguage) |
|
3745 |
enabled: self canChangeLanguageHolder). |
|
3746 |
]. |
|
3747 |
]. |
|
11235
9a0429235c45
changed: #languageListMenuSlice
Claus Gittinger <cg@exept.de>
parents:
10786
diff
changeset
|
3748 |
"/ ]. |
9300
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
3749 |
^ m |
11235
9a0429235c45
changed: #languageListMenuSlice
Claus Gittinger <cg@exept.de>
parents:
10786
diff
changeset
|
3750 |
|
12158 | 3751 |
"Modified: / 04-02-2012 / 11:52:07 / cg" |
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
3752 |
"Modified: / 10-05-2012 / 23:44:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9300
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
3753 |
! |
07364a10a823
syntax to choose from is fetched via ProgramminLanguage list;
Claus Gittinger <cg@exept.de>
parents:
9166
diff
changeset
|
3754 |
|
8350 | 3755 |
makeRecentDoItsMenuFor:aSelector |
3756 |
|doIts m cmdLabelLen| |
|
3757 |
||
3758 |
cmdLabelLen := 40. |
|
3759 |
||
3760 |
doIts := Workspace doItHistory. |
|
3761 |
doIts size > 0 ifTrue:[ |
|
12308 | 3762 |
m := Menu new. |
3763 |
doIts do:[:doItEntry | |
|
3764 |
|lines label item| |
|
3765 |
||
3766 |
lines := doItEntry withoutLeadingSeparators asStringCollection. |
|
3767 |
label := lines first. |
|
3768 |
(label size > cmdLabelLen) ifTrue:[ |
|
3769 |
label := (label contractTo:cmdLabelLen) |
|
3770 |
]. |
|
3771 |
(lines size > 1) ifTrue:[ |
|
3772 |
label := label , ' [...]' |
|
3773 |
]. |
|
3774 |
label := '''' , label , ''''. |
|
3775 |
||
3776 |
item := MenuItem label:label. |
|
3777 |
item itemValue:aSelector argument:doItEntry. |
|
3778 |
m addItem:item. |
|
3779 |
]. |
|
3780 |
m addSeparator. |
|
3781 |
m addItem: (MenuItem new |
|
3782 |
label: (resources string:'Clear History'); |
|
3783 |
itemValue: #clearHistory; |
|
3784 |
activeHelpKey: #historyEmptyMenu; |
|
3785 |
translateLabel:true). |
|
8350 | 3786 |
]. |
3787 |
^ m |
|
11787 | 3788 |
|
3789 |
"Modified: / 09-09-2012 / 13:25:30 / cg" |
|
8350 | 3790 |
! |
3791 |
||
4267 | 3792 |
pasteRecentDoItMenu |
3793 |
<resource: #programMenu > |
|
3794 |
||
3795 |
^ self recentDoItsMenuFor:#'paste:' |
|
3796 |
! |
|
3797 |
||
3798 |
recentDoItsMenuFor:aSelector |
|
4136 | 3799 |
<resource: #programMenu > |
3800 |
||
3801 |
^ [ |
|
12308 | 3802 |
self makeRecentDoItsMenuFor:aSelector |
4136 | 3803 |
]. |
4267 | 3804 |
! |
3805 |
||
3806 |
redoRecentDoItMenu |
|
3807 |
<resource: #programMenu > |
|
3808 |
||
3809 |
^ self recentDoItsMenuFor:#'pasteAndExecute:' |
|
4136 | 3810 |
! ! |
3811 |
||
3154 | 3812 |
!WorkspaceApplication methodsFor:'private'! |
3813 |
||
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
3814 |
askIfAnyModified:question yesButton:yesButtonText |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
3815 |
(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
|
3816 |
|
12308 | 3817 |
(Dialog |
3818 |
confirm:(resources stringWithCRs:question) |
|
3819 |
yesLabel:(resources string:yesButtonText) |
|
3820 |
noLabel:(resources string:'Cancel')) |
|
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
3821 |
ifTrue:[ |
12308 | 3822 |
"/ reset modified flag so question is asked only once |
3823 |
workspaces |
|
3824 |
select:[:aView | (self isModifiedWorkspace:aView)] |
|
3825 |
thenDo:[:eachModifiedTextView | |
|
3826 |
eachModifiedTextView |
|
3827 |
perform:#modified: with:false |
|
3828 |
ifNotUnderstood:[]. |
|
3829 |
]. |
|
3830 |
^ true |
|
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
3831 |
]. |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
3832 |
^ false |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
3833 |
! |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
3834 |
|
5852 | 3835 |
compilerClassForSyntaxName:syntax |
3836 |
syntax == #Smalltalk ifTrue:[ |
|
12308 | 3837 |
^ Compiler |
5852 | 3838 |
]. |
3839 |
syntax == #JavaScript ifTrue:[ |
|
12308 | 3840 |
^ JavaScriptCompiler |
5852 | 3841 |
]. |
3842 |
^ Compiler |
|
3843 |
! |
|
3844 |
||
6699 | 3845 |
createEvaluationWorkspace |
8292 | 3846 |
|ws l b box resultView environmentView panel workspaceVariables timeLabel| |
6699 | 3847 |
|
3848 |
workspaceVariables := Workspace workspaceVariables. |
|
3849 |
||
3850 |
panel := VariableVerticalPanel new. |
|
7541
957ae975e391
handles in the eval-workspace
Claus Gittinger <cg@exept.de>
parents:
7537
diff
changeset
|
3851 |
panel showHandle:true. |
6699 | 3852 |
|
3853 |
box := View new. |
|
3854 |
l := Label new. |
|
8292 | 3855 |
l label:(resources string:'Eval:'). |
6865 | 3856 |
l layout:((0.0@0.0 corner:0.5@0.0) asLayout bottomOffset:22). |
6699 | 3857 |
l adjust:#left. |
3858 |
box add:l. |
|
3859 |
||
3860 |
ws := HVScrollableView for:Workspace. |
|
12308 | 3861 |
ws scrolledView name:#'Workspace'. |
6699 | 3862 |
ws autoDefineVariables:#workspace. |
6865 | 3863 |
ws layout:((0.0@0.0 corner:1.0@1.0) asLayout topOffset:22; bottomOffset:-22). |
6699 | 3864 |
box add:ws. |
6865 | 3865 |
|
3866 |
b := Button new. |
|
3867 |
b label:'DoIt'. |
|
3868 |
b layout:((0.25@1.0 corner:0.5@1.0) asLayout topOffset:-22). |
|
3869 |
b adjust:#left. |
|
3870 |
b action:[ws doIt]. |
|
3871 |
box add:b. |
|
3872 |
||
3873 |
b := Button new. |
|
3874 |
b label:'InspectIt'. |
|
3875 |
b layout:((0.5@1.0 corner:0.75@1.0) asLayout topOffset:-22). |
|
3876 |
b adjust:#left. |
|
3877 |
b action:[ws inspectIt]. |
|
3878 |
box add:b. |
|
3879 |
||
3880 |
b := Button new. |
|
3881 |
b label:'BrowseIt'. |
|
3882 |
b layout:((0.75@1.0 corner:1.0@1.0) asLayout topOffset:-22). |
|
3883 |
b adjust:#left. |
|
3884 |
b action:[ws browseIt]. |
|
3885 |
box add:b. |
|
3886 |
||
6699 | 3887 |
panel add:box. |
3888 |
||
3889 |
box := View new. |
|
8292 | 3890 |
box add:(Label new label:(resources string:'Value:'); adjust:#left; layout:((0.0@0.0 corner:0.5@0.0) asLayout bottomOffset:22)). |
3891 |
box add:(timeLabel := Label new label:''; adjust:#right; layout:((0.5@0.0 corner:1.0@0.0) asLayout bottomOffset:22)). |
|
6699 | 3892 |
resultView := HVScrollableView for:TextCollector. |
3893 |
box add:(resultView layout:((0@0 corner:1.0@1.0) asLayout topOffset:22); yourself). |
|
3894 |
||
3895 |
panel add:box. |
|
3896 |
||
3897 |
box := View new. |
|
8292 | 3898 |
box add:(Label new label:(resources string:'Environment:'); adjust:#left; layout:((0.0@0.0 corner:1.0@0.0) asLayout bottomOffset:22)). |
6699 | 3899 |
environmentView := DictionaryInspectorView new. |
3900 |
environmentView suppressPseudoSlots:true. |
|
3901 |
environmentView inspect:workspaceVariables. |
|
3902 |
environmentView dereferenceValueHolders:true. |
|
3903 |
environmentView fieldListLabel:'Variable'. |
|
3904 |
box add:(environmentView layout:((0@0 corner:1.0@1.0) asLayout topOffset:22); yourself). |
|
3905 |
||
3906 |
panel add:box. |
|
3907 |
||
3908 |
"/ self renameWorkspace:(self selectedWorkspaceIndexHolder value) to:'Eval'. |
|
3909 |
||
3910 |
ws doItAction:[:theCode | |
|
12308 | 3911 |
|t result resultString| |
3912 |
||
3913 |
t := TimeDuration toRun:[ |
|
3914 |
result := ws executeDoIt:theCode. |
|
3915 |
]. |
|
3916 |
timeLabel label:(resources string:'Exec. Time: %1' with:t printString). |
|
3917 |
||
3918 |
resultString := [ |
|
3919 |
result storeString |
|
3920 |
] on:Error do:[ |
|
3921 |
result printString |
|
3922 |
]. |
|
3923 |
||
3924 |
resultView showCR:resultString. |
|
3925 |
9 to:1 by:-1 do:[:h| |
|
3926 |
(workspaceVariables includesKey:('_%1' bindWith:h-1)) ifTrue:[ |
|
3927 |
workspaceVariables |
|
3928 |
at:('_%1' bindWith:h) |
|
3929 |
put:(workspaceVariables at:('_%1' bindWith:h-1)). |
|
3930 |
]. |
|
3931 |
]. |
|
3932 |
workspaceVariables at:'_0' put:(ValueHolder with:result). |
|
3933 |
environmentView doUpdate. |
|
3934 |
result. |
|
6699 | 3935 |
]. |
6865 | 3936 |
panel relativeCorners:#(0.4 0.6 1.0). |
6699 | 3937 |
^ panel |
7541
957ae975e391
handles in the eval-workspace
Claus Gittinger <cg@exept.de>
parents:
7537
diff
changeset
|
3938 |
|
957ae975e391
handles in the eval-workspace
Claus Gittinger <cg@exept.de>
parents:
7537
diff
changeset
|
3939 |
"Modified: / 24-11-2006 / 11:06:33 / cg" |
6699 | 3940 |
! |
3941 |
||
5295
e3c5a7b20d9d
refactored (added abstract superclass)
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
3942 |
createWorkspace |
5547
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
3943 |
|ws| |
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
3944 |
|
10169 | 3945 |
ws := self createWorkspaceView. |
12197
1b0092bafad9
WorkspaceApplication: fixes to reflect autodefine variable settings
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12196
diff
changeset
|
3946 |
ws autoDefineVariables:self autoDefineVariables value. |
7931 | 3947 |
ws poolsConsideredInDoIts:poolsConsideredInDoIts. |
5547
65af7af97085
initial value of #autoDefine was not set correctly
Claus Gittinger <cg@exept.de>
parents:
5490
diff
changeset
|
3948 |
^ ws |
9746
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
3949 |
|
10169 | 3950 |
"Modified (format): / 05-07-2011 / 14:18:52 / cg" |
12197
1b0092bafad9
WorkspaceApplication: fixes to reflect autodefine variable settings
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12196
diff
changeset
|
3951 |
"Modified: / 18-03-2012 / 23:37:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3193 | 3952 |
! |
3953 |
||
10169 | 3954 |
createWorkspaceView |
11615
f9dfb7daa5e4
corrected switching languages between tabs
Claus Gittinger <cg@exept.de>
parents:
11612
diff
changeset
|
3955 |
|ws language| |
10169 | 3956 |
|
3957 |
ws := self class createWorkspaceView. |
|
12280
b2461f96560c
Accept in workspace is same as save file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12278
diff
changeset
|
3958 |
ws acceptAction:[:code | self menuSave ]. |
10169 | 3959 |
(ws respondsTo:#languageHolder:) ifTrue:[ |
12308 | 3960 |
ws languageHolder:self syntaxHolder |
10169 | 3961 |
]. |
11615
f9dfb7daa5e4
corrected switching languages between tabs
Claus Gittinger <cg@exept.de>
parents:
11612
diff
changeset
|
3962 |
(language := self syntaxHolder value) notNil ifTrue:[ |
12308 | 3963 |
ws compilerClass:(language evaluatorClass). |
11615
f9dfb7daa5e4
corrected switching languages between tabs
Claus Gittinger <cg@exept.de>
parents:
11612
diff
changeset
|
3964 |
]. |
10169 | 3965 |
^ ws |
3966 |
||
11615
f9dfb7daa5e4
corrected switching languages between tabs
Claus Gittinger <cg@exept.de>
parents:
11612
diff
changeset
|
3967 |
"Modified: / 19-07-2012 / 16:39:15 / cg" |
12280
b2461f96560c
Accept in workspace is same as save file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12278
diff
changeset
|
3968 |
"Modified: / 21-08-2012 / 17:20:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10169 | 3969 |
! |
3970 |
||
12308 | 3971 |
isModifiedWorkspace:aView |
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
3972 |
|view| |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
3973 |
|
10169 | 3974 |
aView isNil ifTrue:[ |
12308 | 3975 |
^ false |
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
3976 |
]. |
10169 | 3977 |
view := self workspaceViewOfView:aView. |
12308 | 3978 |
(view isNil |
3979 |
or:[ view modified not |
|
3980 |
or:[ view contentsWasSaved |
|
3981 |
or:[ view contents withoutSeparators isEmpty ]]]) |
|
3982 |
ifTrue:[ |
|
3983 |
^ false |
|
10169 | 3984 |
]. |
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
3985 |
^ true |
10169 | 3986 |
|
3987 |
"Modified: / 03-06-2011 / 11:03:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3988 |
"Modified (format): / 05-07-2011 / 15:01:08 / cg" |
|
4031
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
3989 |
! |
4ace4ff5fbbd
look for unsaved text in ANY workspace
Claus Gittinger <cg@exept.de>
parents:
3845
diff
changeset
|
3990 |
|
4267 | 3991 |
lastDoItsString |
3992 |
|history| |
|
3198 | 3993 |
|
4267 | 3994 |
history := Workspace doItHistory. |
3995 |
history size > 0 ifFalse:[ |
|
12308 | 3996 |
self selectedWorkspacesTextView flash. |
3997 |
^ nil |
|
3198 | 3998 |
]. |
4267 | 3999 |
^ history first |
5852 | 4000 |
! |
4001 |
||
12308 | 4002 |
syntaxFromEvaluatorClass:aClass |
4003 |
ProgrammingLanguage allDo:[:lang | |
|
4004 |
lang evaluatorClass = aClass ifTrue:[ |
|
4005 |
^ lang |
|
4006 |
] |
|
5852 | 4007 |
]. |
10169 | 4008 |
|
4009 |
"Unknown language - should not happen :-)" |
|
4010 |
^ nil |
|
4011 |
||
11483
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
4012 |
"Created: / 26-04-2012 / 12:59:32 / cg" |
5852 | 4013 |
! |
4014 |
||
4015 |
workspaceSelectionChanged |
|
9695 | 4016 |
"attach line, col and mode holders to the current workspace window" |
4017 |
||
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
4018 |
|compilerClass selectedWorkspace selectedWorkspaceApp | |
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
4019 |
|
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
4020 |
|
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
4021 |
"JV@2012-05-10: Modified to better support complex application models as tabs" |
5852 | 4022 |
|
4023 |
super workspaceSelectionChanged. |
|
9695 | 4024 |
|
5855 | 4025 |
selectedWorkspace := self selectedWorkspace. |
12244 | 4026 |
selectedWorkspaceApp := self selectedWorkspaceApplication. |
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
4027 |
|
12308 | 4028 |
(selectedWorkspace notNil and:[selectedWorkspace isScrollWrapper]) ifTrue:[ |
9746
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
4029 |
selectedWorkspace := selectedWorkspace scrolledView |
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
4030 |
]. |
d7c05875edc0
initial language setting fixed
Claus Gittinger <cg@exept.de>
parents:
9745
diff
changeset
|
4031 |
|
12308 | 4032 |
compilerClass := selectedWorkspaceApp ? selectedWorkspace |
12405
76f9a872362b
Merged 3efd83b86c07 and 1206aff1f11 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
4033 |
perform: #compilerClass |
76f9a872362b
Merged 3efd83b86c07 and 1206aff1f11 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
4034 |
ifNotUnderstood: [Compiler]. |
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
4035 |
self canChangeLanguageHolder value: |
12405
76f9a872362b
Merged 3efd83b86c07 and 1206aff1f11 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
4036 |
(selectedWorkspaceApp ? selectedWorkspace respondsTo: #compilerClass:). |
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
4037 |
|
12240 | 4038 |
|
4039 |
self syntaxHolder value:(self syntaxFromEvaluatorClass:compilerClass). |
|
9695 | 4040 |
|
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
4041 |
(selectedWorkspace notNil and:[ selectedWorkspace scrolledView isTextView or:[selectedWorkspaceApp notNil] ]) ifTrue:[ |
12405
76f9a872362b
Merged 3efd83b86c07 and 1206aff1f11 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
4042 |
self cursorLineHolder valueHolder:( selectedWorkspaceApp ? selectedWorkspace perform:#cursorLineHolder ifNotUnderstood:nil ). |
76f9a872362b
Merged 3efd83b86c07 and 1206aff1f11 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
4043 |
self cursorColHolder valueHolder:( selectedWorkspaceApp ? selectedWorkspace perform:#cursorColHolder ifNotUnderstood:nil ). |
76f9a872362b
Merged 3efd83b86c07 and 1206aff1f11 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
4044 |
self modeLabelHolder valueHolder:( selectedWorkspaceApp ? selectedWorkspace perform:#modeLabelHolder ifNotUnderstood:nil ). |
9695 | 4045 |
] ifFalse:[ |
4046 |
self cursorLineHolder valueHolder:nil. |
|
4047 |
self cursorColHolder valueHolder:nil. |
|
4048 |
self modeLabelHolder valueHolder:nil. |
|
4049 |
]. |
|
4050 |
||
10169 | 4051 |
"Update toolbar" |
12243
bf110cbcc7d3
- WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12240
diff
changeset
|
4052 |
selectedWorkspaceApp notNil ifTrue:[ |
12405
76f9a872362b
Merged 3efd83b86c07 and 1206aff1f11 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
4053 |
(selectedWorkspaceApp class respondsTo: #toolBarSpec) ifTrue:[ |
10169 | 4054 |
self toolBarView |
12405
76f9a872362b
Merged 3efd83b86c07 and 1206aff1f11 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
4055 |
client: selectedWorkspaceApp spec: #toolBarSpec |
10169 | 4056 |
] ifFalse:[ |
4057 |
self toolBarView |
|
4058 |
client: self spec: #toolBarSpec builder: builder. |
|
4059 |
] |
|
4060 |
] ifFalse:[ |
|
4061 |
self toolBarView |
|
4062 |
client: self spec: #toolBarSpec builder: builder. |
|
4063 |
] |
|
4064 |
||
12308 | 4065 |
|
3154 | 4066 |
! ! |
4067 |
||
7825 | 4068 |
!WorkspaceApplication methodsFor:'user actions'! |
4069 |
||
4070 |
infoVisibilityChanged |
|
4071 |
super infoVisibilityChanged. |
|
4072 |
UserPreferences current infoVisibleInWorkspace:(self infoVisibleHolder value) |
|
4073 |
||
4074 |
"Created: / 14-07-2007 / 16:46:58 / cg" |
|
4075 |
! |
|
4076 |
||
11483
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
4077 |
syntaxChangedByUser |
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
4078 |
"remember as default for next new workspace" |
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
4079 |
LastLanguage := self syntaxHolder value. |
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
4080 |
|
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
4081 |
"Created: / 26-04-2012 / 12:31:04 / cg" |
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
4082 |
! |
5f545a7d153a
fixed language related valueholder handling
Claus Gittinger <cg@exept.de>
parents:
11481
diff
changeset
|
4083 |
|
7825 | 4084 |
toolBarVisibilityChanged |
4085 |
super toolBarVisibilityChanged. |
|
8499 | 4086 |
UserPreferences current toolbarVisibleInWorkspace:(self toolBarVisibleHolder value). |
4087 |
UserPreferences current editToolbarVisibleInWorkspace:(self editToolBarVisibleHolder value). |
|
7825 | 4088 |
|
4089 |
"Created: / 14-07-2007 / 16:45:31 / cg" |
|
4090 |
! ! |
|
4091 |
||
3154 | 4092 |
!WorkspaceApplication class methodsFor:'documentation'! |
4093 |
||
10318 | 4094 |
version |
12887
07582d422bd1
class: WorkspaceApplication
Claus Gittinger <cg@exept.de>
parents:
12767
diff
changeset
|
4095 |
^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.244 2013-06-09 14:32:47 cg Exp $' |
10318 | 4096 |
! |
4097 |
||
9059 | 4098 |
version_CVS |
12887
07582d422bd1
class: WorkspaceApplication
Claus Gittinger <cg@exept.de>
parents:
12767
diff
changeset
|
4099 |
^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.244 2013-06-09 14:32:47 cg Exp $' |
10394 | 4100 |
! |
4101 |
||
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12406
diff
changeset
|
4102 |
version_HG |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12406
diff
changeset
|
4103 |
|
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12406
diff
changeset
|
4104 |
^ '$Changeset: <not expanded> $' |
10394 | 4105 |
! |
4106 |
||
4107 |
version_SVN |
|
12887
07582d422bd1
class: WorkspaceApplication
Claus Gittinger <cg@exept.de>
parents:
12767
diff
changeset
|
4108 |
^ '$Id: WorkspaceApplication.st,v 1.244 2013-06-09 14:32:47 cg Exp $' |
3154 | 4109 |
! ! |
12340
8332590c5a41
class: WorkspaceApplication
Claus Gittinger <cg@exept.de>
parents:
12032
diff
changeset
|
4110 |