]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/scl/SCLScripts.java
Added SCL Script Output console view.
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / scl / SCLScripts.java
index 350a819fd94b9af2755c2fa28c36a33fef0ccc79..3cd006fce736d3282e1e94e2fae2a93e692f2f61 100644 (file)
@@ -39,7 +39,7 @@ public class SCLScripts {
 
        private static final Logger LOGGER = LoggerFactory.getLogger(SCLScripts.class);
 
-       private static final String SCL_CONSOLE_ID = "org.simantics.scl.ui.console";
+       private static final String SCL_SCRIPT_CONSOLE_ID = "org.simantics.scl.ui.scriptConsole";
 
        /**
         * @param processor database handle
@@ -78,16 +78,16 @@ public class SCLScripts {
 
        public static Pair<CommandSession, SCLReportingHandler> getSCLConsoleCommandSession(boolean createIfNecessary) {
                IWorkbenchPart part;
+               SCLReportingHandler handler = SCLReportingHandler.DEFAULT_WITHOUT_ECHO;
                try {
                        part = createIfNecessary
-                                       ? WorkbenchUtils.showView(SCL_CONSOLE_ID, IWorkbenchPage.VIEW_VISIBLE)
-                                       : WorkbenchUtils.findView(SCL_CONSOLE_ID);
+                                       ? WorkbenchUtils.showView(SCL_SCRIPT_CONSOLE_ID, IWorkbenchPage.VIEW_VISIBLE)
+                                       : WorkbenchUtils.findView(SCL_SCRIPT_CONSOLE_ID);
                        if (part != null)
-                               return Pair.make(part.getAdapter(CommandSession.class), part.getAdapter(SCLReportingHandler.class));
+                               return Pair.make(new CommandSession(SCLOsgi.MODULE_REPOSITORY, handler), part.getAdapter(SCLReportingHandler.class));
                } catch (PartInitException e) {
                        LOGGER.error("Failed to open SCL Console view. Using new CommandSession, reporting to stdout via Logger.", e);
                }
-               SCLReportingHandler handler = SCLReportingHandler.DEFAULT_WITHOUT_ECHO;
                return Pair.make(new CommandSession(SCLOsgi.MODULE_REPOSITORY, handler), SCLReportingHandler.DEFAULT);
        }