WorkspaceApplication.st
changeset 9341 aa3c5825ec98
parent 9304 6d9d835a55bf
child 9372 3727c6e226cf
--- a/WorkspaceApplication.st	Wed Jan 20 22:05:44 2010 +0100
+++ b/WorkspaceApplication.st	Thu Jan 21 15:06:04 2010 +0100
@@ -870,7 +870,7 @@
          (MenuItem
             label: 'Execute'
             translateLabel: true
-            isVisible: thisIsASmalltalkWorkspace
+            isVisible: executeMenuVisible 
             submenuChannel: executionMenu
             keepLinkedMenu: true
           )
@@ -1434,7 +1434,7 @@
 setCompilerForSyntax
     |language|
 
-    language := syntaxHolder value.
+    language := self syntaxHolder value.
     self selectedWorkspace 
         compilerClass:(language compilerClass "self compilerClassForSyntaxName:syntax").
 
@@ -1450,7 +1450,7 @@
 
 syntaxHolder
     syntaxHolder isNil ifTrue:[
-        syntaxHolder := SmalltalkLanguage instance asValue.
+        syntaxHolder := self defaultEvaluatorSyntax asValue.
         syntaxHolder onChangeSend:#setCompilerForSyntax to:self
     ].
     ^ syntaxHolder
@@ -1466,6 +1466,10 @@
 
 !WorkspaceApplication methodsFor:'defaults'!
 
+defaultEvaluatorSyntax
+    ^ SmalltalkLanguage instance.
+!
+
 defaultFileNameForLoad
    ^ 'file.wsp'
 
@@ -1496,6 +1500,10 @@
     "Created: / 25-10-2006 / 14:57:25 / cg"
 !
 
+executeMenuVisible 
+    ^ self thisIsASmalltalkWorkspace
+!
+
 thisIsASmalltalkWorkspace
     "can be redefined in a subclass to disable smalltalk-specific menu items
      (expecco uses workspaces as scratchpads)"
@@ -1513,6 +1521,11 @@
     ].
 
     ^ super closeRequest
+!
+
+postBuildWith:aBuilder
+    super postBuildWith:aBuilder.
+    self setCompilerForSyntax
 ! !
 
 !WorkspaceApplication methodsFor:'menu-actions'!
@@ -2361,6 +2374,7 @@
                 label:'Smalltalk' 
                 choice:#syntaxHolder
                 choiceValue:SmalltalkLanguage instance).
+
     allLanguages notEmpty ifTrue:[
         m addItem:(MenuItem separator).
 
@@ -2636,9 +2650,9 @@
 !WorkspaceApplication class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.187 2009-12-04 21:13:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.188 2010-01-21 14:06:04 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.187 2009-12-04 21:13:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.188 2010-01-21 14:06:04 cg Exp $'
 ! !