aboutsummaryrefslogtreecommitdiffstats
path: root/tools/eclipse
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-08-06 10:15:56 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-08-06 10:15:56 +0000
commit52dc5338772fa93dc6ad1c4bd0b8245a9db59405 (patch)
tree0f8424b7f7e46a48fac1c2372fe5db8e1cdd1512 /tools/eclipse
parent2ce4c273b77eb68821a4bc4d8def8fe3eb563240 (diff)
downloadChibiOS-52dc5338772fa93dc6ad1c4bd0b8245a9db59405.tar.gz
ChibiOS-52dc5338772fa93dc6ad1c4bd0b8245a9db59405.tar.bz2
ChibiOS-52dc5338772fa93dc6ad1c4bd0b8245a9db59405.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4536 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'tools/eclipse')
-rw-r--r--tools/eclipse/config_wizard/META-INF/MANIFEST.MF2
-rw-r--r--tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/utils/TemplateEngine.java39
2 files changed, 33 insertions, 8 deletions
diff --git a/tools/eclipse/config_wizard/META-INF/MANIFEST.MF b/tools/eclipse/config_wizard/META-INF/MANIFEST.MF
index b1ef0b0ea..fb3d848cd 100644
--- a/tools/eclipse/config_wizard/META-INF/MANIFEST.MF
+++ b/tools/eclipse/config_wizard/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ChibiOS-RT_Configuration_Support
Bundle-SymbolicName: org.chibios.tools.eclipse.config;singleton:=true
-Bundle-Version: 1.0.3
+Bundle-Version: 1.0.4
Bundle-Activator: config_wizard.Activator
Require-Bundle: org.eclipse.core.resources,
org.eclipse.core.runtime,
diff --git a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/utils/TemplateEngine.java b/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/utils/TemplateEngine.java
index 6c2771d9f..892c9c99b 100644
--- a/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/utils/TemplateEngine.java
+++ b/tools/eclipse/config_wizard/src/org/chibios/tools/eclipse/config/utils/TemplateEngine.java
@@ -27,6 +27,9 @@ import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
@@ -55,10 +58,18 @@ import freemarker.template.TemplateNodeModel;
*/
public class TemplateEngine {
- private static final String CONSOLE_NAME = "ChibiOS/RT Configuration Tool";
+ private final static String CONSOLE_NAME = "ChibiOS/RT Configuration Tool";
+
+ private final static Color DEFAULT_MESSAGE = new Color(Display.getDefault(), new RGB(0, 0, 255));
+ private final static Color DEFAULT_OUTPUT = new Color(Display.getDefault(), new RGB(0, 0, 0));
+ private final static Color DEFAULT_WARNING = new Color(Display.getDefault(), new RGB(255, 255, 0));
+ private final static Color DEFAULT_ERROR = new Color(Display.getDefault(), new RGB(255, 0, 0));
private static Settings settings;
+ private static MessageConsoleStream msg;
private static MessageConsoleStream out;
+ private static MessageConsoleStream err;
+ private static MessageConsoleStream warn;
/**
* Runs the templates engine.
@@ -85,7 +96,14 @@ public class TemplateEngine {
MessageConsole console = findConsole(CONSOLE_NAME);
activateConsole(console);
console.clearConsole();
+ msg = console.newMessageStream();
+ msg.setColor(DEFAULT_MESSAGE);
out = console.newMessageStream();
+ out.setColor(DEFAULT_OUTPUT);
+ err = console.newMessageStream();
+ err.setColor(DEFAULT_ERROR);
+ warn = console.newMessageStream();
+ warn.setColor(DEFAULT_WARNING);
/*
* Instantiates the FMPP Settings engine and associates a listener for
@@ -103,29 +121,36 @@ public class TemplateEngine {
java.lang.Throwable error,
java.lang.Object param) {
+ if (error != null) {
+ err.println(": " + error.getMessage());
+ return;
+ }
+
if (pMode == Engine.PMODE_IGNORE)
return;
switch (event) {
case EVENT_BEGIN_PROCESSING_SESSION:
- out.println("Starting session");
+ msg.println("Starting session");
+ msg.println();
break;
case EVENT_END_PROCESSING_SESSION:
- out.println("Finished");
+ msg.println();
+ msg.println("Finished");
break;
case EVENT_BEGIN_FILE_PROCESSING:
- out.println("Processing " + src.getName());
+ out.println("> Processing " + src.getName());
break;
case EVENT_END_FILE_PROCESSING:
break;
case EVENT_IGNORING_DIR:
- out.println("Ignoring directory " + src.getName());
+ out.println("> Ignoring directory " + src.getName());
break;
case EVENT_SOURCE_NOT_MODIFIED:
- out.println("Skipping " + src.getName());
+ out.println("> Skipping " + src.getName());
break;
case EVENT_WARNING:
- out.println("Warning:" + (String) param);
+ warn.println(": " + (String)param);
break;
}
}