From 0f2d6b33db9eabe0c1b142f6d0197a5d1446c3b1 Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Mon, 30 Dec 2019 15:54:22 +0200 Subject: [PATCH] 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 --- .../src/org/simantics/platform/ui/SimanticsConsole.java | 1 + .../src/org/simantics/platform/ui/internal/Activator.java | 3 ++- .../org/simantics/platform/ui/internal/ConsoleAppender.java | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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()); } -- 2.47.1