From: Tuukka Lehtonen Date: Mon, 30 Dec 2019 13:54:22 +0000 (+0200) Subject: Fixed Simantics Console activation and formatted message output X-Git-Tag: v1.43.0~136^2~12 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F54%2F3754%2F1;p=simantics%2Fplatform.git Fixed Simantics Console activation and formatted message output Also fixed an NPE from org.simantics.platform.ui.internal.Activator.stop gitlab #437 Change-Id: I83e5d08d49ee0f97ac6c81987054ffa01b916516 --- diff --git a/bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/SimanticsConsole.java b/bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/SimanticsConsole.java index c7aa2e185..366096857 100644 --- a/bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/SimanticsConsole.java +++ b/bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/SimanticsConsole.java @@ -114,6 +114,7 @@ public class SimanticsConsole extends MessageConsole { SimanticsConsole sc = new SimanticsConsole(); ConsolePlugin.getDefault().getConsoleManager().addConsoles(new SimanticsConsole[] {sc}); + sc.activate(); return sc; } diff --git a/bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/internal/Activator.java b/bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/internal/Activator.java index bd910dd27..f7047f1a1 100644 --- a/bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/internal/Activator.java +++ b/bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/internal/Activator.java @@ -10,6 +10,7 @@ * Semantum Oy - initial API and implementation *******************************************************************************/ package org.simantics.platform.ui.internal; + import java.io.PrintWriter; import java.io.StringWriter; @@ -40,7 +41,7 @@ public class Activator extends AbstractUIPlugin { @Override public void stop(BundleContext context) throws Exception { - context = null; + this.context = null; super.stop(context); } diff --git a/bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/internal/ConsoleAppender.java b/bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/internal/ConsoleAppender.java index 8c3bf3705..62f90a529 100644 --- a/bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/internal/ConsoleAppender.java +++ b/bundles/org.simantics.platform.ui/src/org/simantics/platform/ui/internal/ConsoleAppender.java @@ -40,7 +40,7 @@ public class ConsoleAppender extends AppenderBase { b.append('['); b.append(formatter.format(new Date(e.getTimeStamp()))); b.append("]: "); - b.append(e.getMessage()); + b.append(e.getFormattedMessage()); console.write(b.toString()); }