Fixed SCL Console Clear Console active-state when imports are erroneous
[simantics/platform.git] / bundles / org.simantics.scl.ui / src / org / simantics / scl / ui / console / SCLConsoleView.java
index 4c0d829f350580386299bef6ac222bcc1cdbeb71..67de0b2ffe9e02571d75ec114c22416498e51274 100644 (file)
@@ -173,11 +173,6 @@ public class SCLConsoleView extends ViewPart {
         store.setDefault(REFRESH_AUTOMATICALLY, true);
         
         this.console = new SCLConsole(parent, SWT.NONE);
-        
-        setRefreshAutomatically(store.getBoolean(REFRESH_AUTOMATICALLY), false);
-        setCurrentImports(readImportPreferences());
-
-        addScriptDropSupport(console);
 
         IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
         
@@ -253,7 +248,7 @@ public class SCLConsoleView extends ViewPart {
                 manageImports();
             }
         });
-        
+
         // Show action for running SCL tests if in development mode
         if (Platform.inDevelopmentMode()) {
             toolBarManager.add(new Action("Run tests",
@@ -266,6 +261,12 @@ public class SCLConsoleView extends ViewPart {
         }
         
         toolBarManager.update(true);
+
+        setRefreshAutomatically(store.getBoolean(REFRESH_AUTOMATICALLY), false);
+        // Do this after the actions and SCLConsoleListener are
+        // registered because it can cause output to the console.
+        setCurrentImports(readImportPreferences());
+        addScriptDropSupport(console);
     }
 
     private class ScriptRunningDropTarget extends DropTargetAdapter {