summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-04-13 00:54:54 (EDT)
committer pelder2006-04-13 00:54:54 (EDT)
commit62a3894953f2a40e20956191a2d6d56852dcfd8d (patch)
tree02dfe0205f7d61e52cae30fa002cf94aeb09e02c
parente0bbf137c69a2f46179b40c3c11480c87d8eb24d (diff)
downloadorg.eclipse.jet-62a3894953f2a40e20956191a2d6d56852dcfd8d.zip
org.eclipse.jet-62a3894953f2a40e20956191a2d6d56852dcfd8d.tar.gz
org.eclipse.jet-62a3894953f2a40e20956191a2d6d56852dcfd8d.tar.bz2
[131195] Log JET Transform execution to an Eclipse console
-rw-r--r--plugins/org.eclipse.jet.ui/plugin.xml7
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/Messages.java14
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/messages.properties7
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETConsoleColorProvider.java125
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETTransformMainTab.java77
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/LaunchShortcut.java10
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/Activator.java17
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Context.java16
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferenceInitializer.java6
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferences.java5
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JET2TransformationDelegate.java31
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETProcess.java72
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETStreamMonitor.java50
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETStreamsProxy.java45
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/RuntimeLoggerContextExtender.java19
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/RuntimeTagLogger.java4
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeConditionalRuntimeTag.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeContainerRuntimeTag.java6
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeEmptyRuntimeTag.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeFunctionRuntimeTag.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeIteratingRuntimeTag.java4
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsCopyBinaryFileAction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsCopyTextFileAction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsFileFromWriterAction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsFolderAction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsProjectAction.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/transform/JETLaunchConstants.java52
28 files changed, 508 insertions, 77 deletions
diff --git a/plugins/org.eclipse.jet.ui/plugin.xml b/plugins/org.eclipse.jet.ui/plugin.xml
index eb300d7..056c7fb 100644
--- a/plugins/org.eclipse.jet.ui/plugin.xml
+++ b/plugins/org.eclipse.jet.ui/plugin.xml
@@ -150,5 +150,12 @@
value="org.eclipse.jet.jet2Nature"/>
</page>
</extension>
+ <extension
+ point="org.eclipse.debug.ui.consoleColorProviders">
+ <consoleColorProvider
+ class="org.eclipse.jet.internal.ui.launch.JETConsoleColorProvider"
+ id="org.eclipse.jet.ui.consoleColorProvider"
+ processType="org.eclipse.jet.process"/>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/Messages.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/Messages.java
index da2d8fc..3560121 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/Messages.java
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/Messages.java
@@ -39,18 +39,32 @@ public class Messages extends NLS {
public static String JETTransformMainTab_BrowseButtonLabel;
+ public static String JETTransformMainTab_DebugSeverity;
+
public static String JETTransformMainTab_DescriptionLabel;
+ public static String JETTransformMainTab_DisplayMessage_Gropu;
+
+ public static String JETTransformMainTab_ErrorSeverity;
+
public static String JETTransformMainTab_IdLabel;
+ public static String JETTransformMainTab_InformationSeverity;
+
public static String JETTransformMainTab_NameLabel;
public static String JETTransformMainTab_SelectResourceDialogTitle;
+ public static String JETTransformMainTab_SeverityLabel;
+
+ public static String JETTransformMainTab_TraceSeverity;
+
public static String JETTransformMainTab_TransformGroupLabel;
public static String JETTransformMainTab_TransformInputGroup;
+ public static String JETTransformMainTab_WarningSeverity;
+
public static String LaunchShortcut_DefaultLaunchName;
public static String NewProjectWizard_WindowTitle;
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/messages.properties b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/messages.properties
index 8762169..b6d4110 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/messages.properties
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/messages.properties
@@ -28,10 +28,17 @@ UnloadAction_NotLoaded=Bundle is not loaded "{0}". No action was taken.
JETTransformMainTab_TransformGroupLabel=Transform
JETTransformMainTab_DescriptionLabel=Description:
+JETTransformMainTab_SeverityLabel=&Severity (at or above):
+JETTransformMainTab_ErrorSeverity=error
+JETTransformMainTab_WarningSeverity=warning
+JETTransformMainTab_DebugSeverity=debug
JETTransformMainTab_NameLabel=Name:
JETPreferencePage_Description=JET General options
JETTransformMainTab_IdLabel=ID:
JETTransformMainTab_TransformInputGroup=Transform Input
+JETTransformMainTab_DisplayMessage_Gropu=Display Messages
+JETTransformMainTab_InformationSeverity=information
+JETTransformMainTab_TraceSeverity=trace
JETTransformMainTab_BrowseButtonLabel=Browse...
CompilePreferencePage_Description=JET Compiler options
CompilePreferencePage_EnableProjectSettings=&Enable Project specific settings
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETConsoleColorProvider.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETConsoleColorProvider.java
new file mode 100644
index 0000000..24b7db0
--- /dev/null
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETConsoleColorProvider.java
@@ -0,0 +1,125 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.internal.ui.launch;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.ui.console.ConsoleColorProvider;
+import org.eclipse.debug.ui.console.IConsole;
+import org.eclipse.debug.ui.console.IConsoleColorProvider;
+import org.eclipse.jet.internal.JETPreferences;
+import org.eclipse.jet.internal.launch.JETProcess;
+import org.eclipse.jet.internal.launch.JETStreamsProxy;
+import org.eclipse.jet.ui.Activator;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Colorize the JET execution console
+ *
+ */
+public class JETConsoleColorProvider extends ConsoleColorProvider implements IConsoleColorProvider {
+
+ private Map colors;
+ /**
+ *
+ */
+ public JETConsoleColorProvider() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.console.IConsoleColorProvider#connect(org.eclipse.debug.core.model.IProcess, org.eclipse.debug.ui.console.IConsole)
+ */
+ public void connect(IProcess process, IConsole console) {
+ colors = new HashMap();
+ JETProcess jetProcess = (JETProcess) process;
+ final JETStreamsProxy jetStreamsProxy = (JETStreamsProxy) jetProcess
+ .getStreamsProxy();
+
+ if (jetStreamsProxy != null) {
+ if (jetStreamsProxy.getWarningStreamMonitor() != null) {
+ console.connect(jetStreamsProxy.getWarningStreamMonitor(),
+ JETStreamsProxy.JET_WARNING_STREAM);
+ }
+ if (jetStreamsProxy.getTraceStreamMonitor() != null) {
+ console.connect(jetStreamsProxy.getTraceStreamMonitor(),
+ JETStreamsProxy.JET_TRACE_STREAM);
+ }
+ if (jetStreamsProxy.getDebugStreamMonitor() != null) {
+ console.connect(jetStreamsProxy.getDebugStreamMonitor(),
+ JETStreamsProxy.JET_DEBUG_STREAM);
+ }
+ }
+ super.connect(process, console);
+ }
+
+ public void disconnect() {
+ for (Iterator i = colors.values().iterator(); i.hasNext();) {
+ Color color = (Color) i.next();
+ color.dispose();
+ }
+ colors.clear();
+ super.disconnect();
+ }
+
+ private Color getPrefColor(String prefKey) {
+ Color color = (Color) colors.get(prefKey);
+ if(color == null) {
+ final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ final RGB rgb = PreferenceConverter.getColor(store, prefKey);
+ color = new Color(Display.getCurrent(), rgb);
+ colors.put(prefKey, color);
+ }
+ return color;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.console.IConsoleColorProvider#getColor(java.lang.String)
+ */
+ public Color getColor(String streamIdentifer) {
+ if (streamIdentifer.equals(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM)) {
+ return getPrefColor(JETPreferences.CONSOLE_INFO_COLOR);
+ }
+ if (streamIdentifer.equals(IDebugUIConstants.ID_STANDARD_ERROR_STREAM)) {
+ return getPrefColor(JETPreferences.CONSOLE_ERROR_COLOR);
+ }
+ if (streamIdentifer.equals(JETStreamsProxy.JET_DEBUG_STREAM)) {
+ return getPrefColor(JETPreferences.CONSOLE_DEBUG_COLOR);
+ }
+ if (streamIdentifer.equals(JETStreamsProxy.JET_TRACE_STREAM)) {
+ return getPrefColor(JETPreferences.CONSOLE_TRACE_COLOR);
+ }
+ if (streamIdentifer.equals(JETStreamsProxy.JET_WARNING_STREAM)) {
+ return getPrefColor(JETPreferences.CONSOLE_WARNING_COLOR);
+ }
+ return super.getColor(streamIdentifer);
+ }
+
+ public boolean isReadOnly() {
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETTransformMainTab.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETTransformMainTab.java
index dbad366..7a23722 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETTransformMainTab.java
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETTransformMainTab.java
@@ -27,9 +27,10 @@ import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.internal.launch.JET2TransformationDelegate;
+import org.eclipse.jet.internal.runtime.RuntimeLoggerContextExtender;
import org.eclipse.jet.internal.ui.l10n.Messages;
import org.eclipse.jet.transform.IJETBundleDescriptor;
+import org.eclipse.jet.transform.JETLaunchConstants;
import org.eclipse.jet.ui.Activator;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -70,6 +71,8 @@ public class JETTransformMainTab extends AbstractLaunchConfigurationTab {
private Combo transformCombo;
private Text transformName;
private Text transformDescription;
+ private Combo logLevelCombo;
+ private String[] logLevels;
private class Listener extends SelectionAdapter implements ModifyListener
@@ -116,11 +119,33 @@ public class JETTransformMainTab extends AbstractLaunchConfigurationTab {
createInputBlock(composite);
createTransformBlock(composite);
+ createMessagesBlock(composite);
setControl(composite);
Dialog.applyDialogFont(composite);
}
+ private void createMessagesBlock(Composite composite) {
+ Group group = new Group(composite, SWT.NONE);
+ group.setText(Messages.JETTransformMainTab_DisplayMessage_Gropu);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ group.setLayout(layout);
+ group.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ createLogLevelsSection(group);
+ }
+
+ private void createLogLevelsSection(Group parent) {
+ Label label = new Label(parent, SWT.NONE);
+ label.setText(Messages.JETTransformMainTab_SeverityLabel);
+
+ logLevelCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
+ logLevelCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ logLevelCombo.setItems(getLogLevels());
+ logLevelCombo.addSelectionListener(fListener);
+ }
+
/**
* @param composite
*/
@@ -225,7 +250,7 @@ public class JETTransformMainTab extends AbstractLaunchConfigurationTab {
*/
public void initializeFrom(ILaunchConfiguration configuration) {
try {
- final String id = configuration.getAttribute(JET2TransformationDelegate.ID, EMPTY_STRING);
+ final String id = configuration.getAttribute(JETLaunchConstants.ID, EMPTY_STRING);
transformCombo.setText(id);
final IJETBundleDescriptor descriptor = JET2Platform.getJETBundleManager().getDescriptor(id);
if(descriptor != null)
@@ -237,19 +262,53 @@ public class JETTransformMainTab extends AbstractLaunchConfigurationTab {
transformCombo.setText(EMPTY_STRING);
}
try {
- sourceField.setText(configuration.getAttribute(JET2TransformationDelegate.SOURCE, EMPTY_STRING));
+ sourceField.setText(configuration.getAttribute(JETLaunchConstants.SOURCE, EMPTY_STRING));
} catch (CoreException e) {
sourceField.setText(EMPTY_STRING);
}
+
+ int level;
+ try {
+ level = configuration.getAttribute(JETLaunchConstants.LOG_FILTER_LEVEL, RuntimeLoggerContextExtender.INFO_LEVEL);
+ } catch (CoreException e) {
+ level = RuntimeLoggerContextExtender.INFO_LEVEL;
+ }
+ logLevelCombo.setText(getLogLevelText(level));
}
- /* (non-Javadoc)
+ private String[] getLogLevels() {
+ if (logLevels == null) {
+ logLevels = new String[] {
+ Messages.JETTransformMainTab_ErrorSeverity,
+ Messages.JETTransformMainTab_WarningSeverity,
+ Messages.JETTransformMainTab_InformationSeverity,
+ Messages.JETTransformMainTab_TraceSeverity,
+ Messages.JETTransformMainTab_DebugSeverity,
+ };
+ }
+ return logLevels;
+ }
+
+ private int getLogLevelFromIndex(int selectionIndex) {
+ // list is from highest (5) to lowest (1)
+ return getLogLevels().length - selectionIndex;
+ }
+
+ private String getLogLevelText(int logLevel) {
+ // log levels list are from highest (5) to lowest (1)
+ return getLogLevels()[getLogLevels().length - logLevel];
+ }
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- configuration.setAttribute(JET2TransformationDelegate.ID, transformCombo.getText());
+ configuration.setAttribute(JETLaunchConstants.ID, transformCombo.getText());
+
+ configuration.setAttribute(JETLaunchConstants.SOURCE, sourceField.getText());
- configuration.setAttribute(JET2TransformationDelegate.SOURCE, sourceField.getText());
+ configuration.setAttribute(JETLaunchConstants.LOG_FILTER_LEVEL, getLogLevelFromIndex(logLevelCombo.getSelectionIndex()));
}
@@ -272,19 +331,21 @@ public class JETTransformMainTab extends AbstractLaunchConfigurationTab {
}
}
if(resource != null) {
- configuration.setAttribute(JET2TransformationDelegate.SOURCE,
+ configuration.setAttribute(JETLaunchConstants.SOURCE,
resource.getFullPath().makeRelative().toString());
final IProject project = resource.getProject();
final IJETBundleDescriptor descriptor = JET2Platform.getProjectDescription(project.getName());
if(descriptor != null) {
id = descriptor.getId();
- configuration.setAttribute(JET2TransformationDelegate.ID, id);
+ configuration.setAttribute(JETLaunchConstants.ID, id);
}
}
+ configuration.setAttribute(JETLaunchConstants.LOG_FILTER_LEVEL, RuntimeLoggerContextExtender.INFO_LEVEL);
+
configuration.rename(LaunchShortcut.generateLaunchName(id, resource));
}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/LaunchShortcut.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/LaunchShortcut.java
index b191384..8673cc4 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/LaunchShortcut.java
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/LaunchShortcut.java
@@ -27,9 +27,9 @@ import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.ILaunchShortcut;
import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.internal.launch.JET2TransformationDelegate;
import org.eclipse.jet.internal.ui.l10n.Messages;
import org.eclipse.jet.transform.IJETBundleDescriptor;
+import org.eclipse.jet.transform.JETLaunchConstants;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
@@ -70,7 +70,7 @@ public class LaunchShortcut implements ILaunchShortcut {
final ILaunchConfigurationType configurationType = getConfigurationType();
final ILaunchConfiguration[] configs = lm.getLaunchConfigurations(configurationType);
for (int i = 0; i < configs.length; i++) {
- if(resource.getFullPath().toString().equals(configs[i].getAttribute(JET2TransformationDelegate.SOURCE, (String)null))){
+ if(resource.getFullPath().toString().equals(configs[i].getAttribute(JETLaunchConstants.SOURCE, (String)null))){
DebugUITools.launch(configs[i], mode);
return;
}
@@ -84,8 +84,8 @@ public class LaunchShortcut implements ILaunchShortcut {
final ILaunchConfigurationWorkingCopy wConfig = configurationType
.newInstance(null, generateLaunchName(id, resource));
- wConfig.setAttribute(JET2TransformationDelegate.ID, id);
- wConfig.setAttribute(JET2TransformationDelegate.SOURCE, resource.getFullPath().toString());
+ wConfig.setAttribute(JETLaunchConstants.ID, id);
+ wConfig.setAttribute(JETLaunchConstants.SOURCE, resource.getFullPath().toString());
final ILaunchConfiguration config = wConfig.doSave();
DebugUITools.launch(config, mode);
} catch (CoreException e) {
@@ -96,7 +96,7 @@ public class LaunchShortcut implements ILaunchShortcut {
private ILaunchConfigurationType getConfigurationType() {
ILaunchManager lm= DebugPlugin.getDefault().getLaunchManager();
- return lm.getLaunchConfigurationType(JET2TransformationDelegate.CONFIG_ID);
+ return lm.getLaunchConfigurationType(JETLaunchConstants.CONFIG_ID);
}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/Activator.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/Activator.java
index db5f4bb..6dfb616 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/Activator.java
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/Activator.java
@@ -1,7 +1,11 @@
package org.eclipse.jet.ui;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jet.JET2Platform;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
import org.osgi.framework.BundleContext;
/**
@@ -11,6 +15,7 @@ public class Activator extends AbstractUIPlugin {
//The shared instance.
private static Activator plugin;
+ private IPreferenceStore preferenceStore;
/**
* The constructor.
@@ -52,4 +57,16 @@ public class Activator extends AbstractUIPlugin {
return AbstractUIPlugin.imageDescriptorFromPlugin(getDefault()
.getBundle().getSymbolicName(), path);
}
+
+ /**
+ * Return the prefence store shared by ui and core plugins.
+ */
+ public IPreferenceStore getPreferenceStore() {
+ // Create the preference store lazily.
+ if (preferenceStore == null) {
+ preferenceStore = new ScopedPreferenceStore(new InstanceScope(),JET2Platform.PLUGIN_ID);
+
+ }
+ return preferenceStore;
+ }
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Context.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Context.java
index 5f2b596..5a8eb3a 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Context.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Context.java
@@ -30,6 +30,7 @@ import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.jet.internal.l10n.JET2Messages;
import org.eclipse.jet.internal.runtime.JET2TemplateStatus;
+import org.eclipse.jet.internal.runtime.RuntimeLoggerContextExtender;
import org.eclipse.jet.taglib.JET2TagException;
import org.eclipse.jet.taglib.TagFactory;
import org.eclipse.jet.taglib.TagInfo;
@@ -124,6 +125,21 @@ public final class JET2Context
tagInfo,
throwable);
stati.add(status);
+ RuntimeLoggerContextExtender.log(this, message, tagInfo, templatePath, getLevel(severity));
+ }
+
+ private int getLevel(int severity)
+ {
+ switch(severity)
+ {
+ case Diagnostic.ERROR:
+ return RuntimeLoggerContextExtender.ERROR_LEVEL;
+ case Diagnostic.WARNING:
+ return RuntimeLoggerContextExtender.WARNING_LEVEL;
+ case Diagnostic.INFO:
+ return RuntimeLoggerContextExtender.INFO_LEVEL;
+ }
+ return Diagnostic.ERROR;
}
/**
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java
index ba2ea0d..4298595 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java
@@ -335,7 +335,7 @@ public class JET2Platform
rl.addListener(new RuntimeTagLogger()
{
- public void log(String message, TagInfo td, String templatePath)
+ public void log(String message, TagInfo td, String templatePath, int level)
{
int nlPos = message.indexOf(System.getProperty("line.separator")); //$NON-NLS-1$
if(nlPos >= 0) {
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferenceInitializer.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferenceInitializer.java
index ec87a15..2475b8b 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferenceInitializer.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferenceInitializer.java
@@ -56,5 +56,11 @@ public class JETPreferenceInitializer extends AbstractPreferenceInitializer
}
node.putBoolean(JETPreferences.PROJECT_SPECIFIC_SETTINGS, false);
+
+ node.put(JETPreferences.CONSOLE_ERROR_COLOR, "255,0,0"); // Red //$NON-NLS-1$
+ node.put(JETPreferences.CONSOLE_WARNING_COLOR, "255,255,128"); // Yellow //$NON-NLS-1$
+ node.put(JETPreferences.CONSOLE_INFO_COLOR, "0,0,0"); // Black //$NON-NLS-1$
+ node.put(JETPreferences.CONSOLE_TRACE_COLOR, "128,128,128"); // Dark grey //$NON-NLS-1$
+ node.put(JETPreferences.CONSOLE_DEBUG_COLOR, "192,192,192"); // Light grey //$NON-NLS-1$
}
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferences.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferences.java
index f078b60..1acdfbd 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferences.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferences.java
@@ -27,6 +27,11 @@ public class JETPreferences
private static final String NS = JET2Platform.PLUGIN_ID + "."; //$NON-NLS-1$
public static final String PROJECT_SPECIFIC_SETTINGS = NS + "projectPrefs"; //$NON-NLS-1$
public static final String ADDITIONAL_TEMPLATE_JAR_LOCATIONS = NS + "additionalJarLocations"; //$NON-NLS-1$
+ public static final String CONSOLE_ERROR_COLOR = NS + "consoleErrorColor"; //$NON-NLS-1$
+ public static final String CONSOLE_WARNING_COLOR = NS + "consoleWarningColor"; //$NON-NLS-1$
+ public static final String CONSOLE_INFO_COLOR = NS + "consoleInfoColor"; //$NON-NLS-1$
+ public static final String CONSOLE_TRACE_COLOR = NS + "consoleTraceColor"; //$NON-NLS-1$
+ public static final String CONSOLE_DEBUG_COLOR = NS + "consoleDebugColor"; //$NON-NLS-1$
/**
*
*/
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JET2TransformationDelegate.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JET2TransformationDelegate.java
index 94abfe2..cdc1bca 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JET2TransformationDelegate.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JET2TransformationDelegate.java
@@ -23,12 +23,11 @@ import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.internal.InternalJET2Platform;
+import org.eclipse.jet.internal.runtime.RuntimeLoggerContextExtender;
+import org.eclipse.jet.transform.JETLaunchConstants;
/**
@@ -38,11 +37,6 @@ import org.eclipse.jet.internal.InternalJET2Platform;
public class JET2TransformationDelegate implements ILaunchConfigurationDelegate
{
- public static final String CONFIG_ID = JET2Platform.PLUGIN_ID + ".jet2Transformation"; //$NON-NLS-1$
- public static final String SOURCE = JET2Platform.PLUGIN_ID + "." + "source"; //$NON-NLS-1$ //$NON-NLS-2$
-
- public static final String ID = JET2Platform.PLUGIN_ID + "." + "id"; //$NON-NLS-1$//$NON-NLS-2$
-
/**
*
*/
@@ -59,21 +53,16 @@ public class JET2TransformationDelegate implements ILaunchConfigurationDelegate
String id = getId(configuration);
IResource source = getSource(configuration);
-
- // TODO convert source to an appropriate object
-
- final IStatus status = JET2Platform.runTransformOnResource(id, source, monitor);
+ int logFilterLevel = getLogFilterLevel(configuration);
+ final JETProcess process = new JETProcess(launch, id, source, logFilterLevel, monitor);
+ launch.addProcess(process);
- if(!status.isOK())
- {
- InternalJET2Platform.log(status);
- }
-
+ process.run();
}
private IResource getSource(ILaunchConfiguration configuration) throws CoreException
{
- String sourcePath = configuration.getAttribute(SOURCE, (String)null);
+ String sourcePath = configuration.getAttribute(JETLaunchConstants.SOURCE, (String)null);
IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
IResource resource = wsRoot.findMember(sourcePath);
if (resource == null)
@@ -85,7 +74,7 @@ public class JET2TransformationDelegate implements ILaunchConfigurationDelegate
private String getId(ILaunchConfiguration configuration) throws CoreException
{
- String id = configuration.getAttribute(ID, (String)null);
+ String id = configuration.getAttribute(JETLaunchConstants.ID, (String)null);
if (id == null)
{
throw new IllegalArgumentException();
@@ -93,4 +82,8 @@ public class JET2TransformationDelegate implements ILaunchConfigurationDelegate
return id;
}
+ private int getLogFilterLevel(ILaunchConfiguration configuration) throws CoreException
+ {
+ return configuration.getAttribute(JETLaunchConstants.LOG_FILTER_LEVEL, RuntimeLoggerContextExtender.INFO_LEVEL);
+ }
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETProcess.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETProcess.java
index 4bed262..3ee2521 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETProcess.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETProcess.java
@@ -16,11 +16,27 @@
*/
package org.eclipse.jet.internal.launch;
+import java.io.IOException;
+import java.text.DateFormat;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IStreamsProxy;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.jet.CoreJETException;
+import org.eclipse.jet.JET2Context;
+import org.eclipse.jet.JET2Platform;
+import org.eclipse.jet.taglib.workspace.WorkspaceContextExtender;
+import org.eclipse.jet.transform.IJETBundleDescriptor;
/**
* Implement IProcess for JET transforms.
@@ -30,11 +46,28 @@ public class JETProcess extends PlatformObject implements IProcess
private final String label;
private final ILaunch launch;
+ private boolean terminated = false;
+ private final String id;
+ private final IResource resource;
+ private final IProgressMonitor monitor;
+ private final JET2Context context;
+ private JETStreamsProxy streamsProxy;
+ private final Map attributes = new HashMap();
- public JETProcess(String label, ILaunch launch)
+ public JETProcess(ILaunch launch, String id, IResource resource, int logFilterLevel, IProgressMonitor monitor)
{
- this.label = label;
+ this.label = " - " + DateFormat.getDateTimeInstance().format(Calendar.getInstance().getTime()); //$NON-NLS-1$
this.launch = launch;
+ this.id = id;
+ this.resource = resource;
+ this.monitor = monitor;
+
+ context = new JET2Context(null);
+
+ streamsProxy = new JETStreamsProxy(context, logFilterLevel);
+
+ setAttribute(IProcess.ATTR_PROCESS_TYPE, "org.eclipse.jet.process"); //$NON-NLS-1$
+
}
/* (non-Javadoc)
@@ -58,7 +91,7 @@ public class JETProcess extends PlatformObject implements IProcess
*/
public IStreamsProxy getStreamsProxy()
{
- return new JETStreamsProxy();
+ return streamsProxy;
}
/* (non-Javadoc)
@@ -66,6 +99,7 @@ public class JETProcess extends PlatformObject implements IProcess
*/
public void setAttribute(String key, String value)
{
+ attributes.put(key, value);
}
/* (non-Javadoc)
@@ -73,7 +107,7 @@ public class JETProcess extends PlatformObject implements IProcess
*/
public String getAttribute(String key)
{
- return null;
+ return (String)attributes.get(key);
}
/* (non-Javadoc)
@@ -97,7 +131,7 @@ public class JETProcess extends PlatformObject implements IProcess
*/
public boolean isTerminated()
{
- return false;
+ return terminated;
}
/* (non-Javadoc)
@@ -107,4 +141,32 @@ public class JETProcess extends PlatformObject implements IProcess
{
}
+ public void run() {
+ IStatus status;
+ try
+ {
+ final IJETBundleDescriptor descriptor = JET2Platform.getJETBundleManager().getDescriptor(id);
+
+ String loaderId = descriptor.getModelLoaderId();
+ String fileType = descriptor.getModelExtension();
+
+ WorkspaceContextExtender.loadResourceAsSource(context, resource, loaderId, fileType);
+
+ status = JET2Platform.runTransform(id, context, monitor);
+ context.logInfo(status.getMessage());
+ }
+ catch (IOException e)
+ {
+ // didn't work.
+ status = new Status(IStatus.ERROR, id, IStatus.OK, e.getLocalizedMessage(), e);
+ context.logError(e.getLocalizedMessage());
+ }
+ catch (CoreJETException e)
+ {
+ status = BasicDiagnostic.toIStatus(e.getDiagnostic());
+ context.logError(status.getMessage());
+ }
+ terminated = true;
+
+ }
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETStreamMonitor.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETStreamMonitor.java
index e645fa8..a51bb4f 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETStreamMonitor.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETStreamMonitor.java
@@ -22,6 +22,8 @@ import java.util.List;
import org.eclipse.debug.core.IStreamListener;
import org.eclipse.debug.core.model.IStreamMonitor;
+import org.eclipse.jet.JET2Context;
+import org.eclipse.jet.internal.runtime.RuntimeLoggerContextExtender;
import org.eclipse.jet.internal.runtime.RuntimeTagLogger;
import org.eclipse.jet.taglib.TagInfo;
@@ -34,9 +36,12 @@ public class JETStreamMonitor implements IStreamMonitor, RuntimeTagLogger
private final StringBuffer buffer = new StringBuffer();
- public JETStreamMonitor()
+ private int msgLevel;
+
+ public JETStreamMonitor(JET2Context context, int msgLevel)
{
- // do nothing
+ new RuntimeLoggerContextExtender(context).addListener(this);
+ this.msgLevel = msgLevel;
}
/* (non-Javadoc)
@@ -66,8 +71,12 @@ public class JETStreamMonitor implements IStreamMonitor, RuntimeTagLogger
listeners.remove(listener);
}
- public void log(String message, TagInfo td, String templatePath)
+ public void log(String message, TagInfo td, String templatePath, int level)
{
+ if(level != msgLevel)
+ {
+ return;
+ }
String formattedMsg = formatMessage(message, td, templatePath);
for (Iterator i = listeners.iterator(); i.hasNext();)
@@ -86,20 +95,31 @@ public class JETStreamMonitor implements IStreamMonitor, RuntimeTagLogger
private String formatMessage(String message, TagInfo td, String templatePath)
{
StringBuffer msg = new StringBuffer();
- msg.append(templatePath);
- msg.append(':').append(td.getLine()).append(':').append(td.getCol()).append(' ');
- msg.append(message).append(' ');
- msg.append('<').append(td.getTagName());
- final String[] attrNames = td.getAttributeNames();
- for (int i = 0; i < attrNames.length; i++)
+ if(templatePath != null && templatePath.length() > 0)
{
- msg.append(attrNames[i]).append('=');
- final String value = td.getAttribute(attrNames[i]);
- char quote = value.indexOf('"') >= 0 ? '\'' : '"';
- msg.append(quote).append(value).append(quote).append(' ');
+ msg.append(templatePath);
+ if(td != null)
+ {
+ msg.append('(').append(td.getLine()).append(',').append(td.getCol()).append(')');
+ }
+ msg.append(": "); //$NON-NLS-1$
}
- msg.append('>');
-
+ msg.append(message);
+ if(td != null)
+ {
+ msg.append(System.getProperty("line.separator")); //$NON-NLS-1$
+ msg.append(" ").append('<').append(td.getTagName()); //$NON-NLS-1$
+ final String[] attrNames = td.getAttributeNames();
+ for (int i = 0; i < attrNames.length; i++)
+ {
+ msg.append(' ').append(attrNames[i]).append('=');
+ final String value = td.getAttribute(attrNames[i]);
+ char quote = value.indexOf('"') >= 0 ? '\'' : '"';
+ msg.append(quote).append(value).append(quote);
+ }
+ msg.append('>');
+ }
+ msg.append(System.getProperty("line.separator")); //$NON-NLS-1$
String finalMsg = msg.toString();
return finalMsg;
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETStreamsProxy.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETStreamsProxy.java
index 5a6cc85..d1a067c 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETStreamsProxy.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETStreamsProxy.java
@@ -20,6 +20,8 @@ import java.io.IOException;
import org.eclipse.debug.core.model.IStreamMonitor;
import org.eclipse.debug.core.model.IStreamsProxy;
+import org.eclipse.jet.JET2Context;
+import org.eclipse.jet.internal.runtime.RuntimeLoggerContextExtender;
/**
* Implement IStreamsProxy for JET transforms.
@@ -27,20 +29,41 @@ import org.eclipse.debug.core.model.IStreamsProxy;
public class JETStreamsProxy implements IStreamsProxy
{
+ public static String JET_WARNING_STREAM = "org.eclipse.jet.warningStream"; //$NON-NLS-1$
+ public static String JET_TRACE_STREAM = "org.eclipse.jet.traceStream"; //$NON-NLS-1$
+ public static String JET_DEBUG_STREAM = "org.eclipse.jet.debugStream"; //$NON-NLS-1$
+
+ private JETStreamMonitor outputStreamMonitor = null;
+ private JETStreamMonitor errorStreamMonitor = null;
+ private JETStreamMonitor warningStreamMonitor = null;
+ private JETStreamMonitor traceStreamMonitor = null;
+ private JETStreamMonitor debugStreamMonitor = null;
+
/**
+ * @param context
+ * @param levelFilter TODO
*
*/
- public JETStreamsProxy()
+ public JETStreamsProxy(JET2Context context, int levelFilter)
{
super();
+ this.outputStreamMonitor = createLogger(context, RuntimeLoggerContextExtender.INFO_LEVEL, levelFilter);
+ this.errorStreamMonitor = createLogger(context, RuntimeLoggerContextExtender.ERROR_LEVEL, levelFilter);
+ this.warningStreamMonitor = createLogger(context, RuntimeLoggerContextExtender.WARNING_LEVEL, levelFilter);
+ this.traceStreamMonitor = createLogger(context, RuntimeLoggerContextExtender.TRACE_LEVEL, levelFilter);
+ this.debugStreamMonitor = createLogger(context, RuntimeLoggerContextExtender.DEBUG_LEVEL, levelFilter);
}
+ private JETStreamMonitor createLogger(JET2Context context, int level, int minLevel)
+ {
+ return (level >= minLevel) ? new JETStreamMonitor(context, level) : null;
+ }
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStreamsProxy#getErrorStreamMonitor()
*/
public IStreamMonitor getErrorStreamMonitor()
{
- return new JETStreamMonitor();
+ return errorStreamMonitor;
}
/* (non-Javadoc)
@@ -48,7 +71,7 @@ public class JETStreamsProxy implements IStreamsProxy
*/
public IStreamMonitor getOutputStreamMonitor()
{
- return null;
+ return outputStreamMonitor;
}
/* (non-Javadoc)
@@ -56,6 +79,22 @@ public class JETStreamsProxy implements IStreamsProxy
*/
public void write(String input) throws IOException
{
+ outputStreamMonitor.log(input, null, null, RuntimeLoggerContextExtender.INFO_LEVEL);
+ }
+
+ public final JETStreamMonitor getDebugStreamMonitor()
+ {
+ return debugStreamMonitor;
+ }
+
+ public final JETStreamMonitor getTraceStreamMonitor()
+ {
+ return traceStreamMonitor;
+ }
+
+ public final JETStreamMonitor getWarningStreamMonitor()
+ {
+ return warningStreamMonitor;
}
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/RuntimeLoggerContextExtender.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/RuntimeLoggerContextExtender.java
index a3740fe..4a068b7 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/RuntimeLoggerContextExtender.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/RuntimeLoggerContextExtender.java
@@ -33,6 +33,13 @@ import org.eclipse.jet.transform.TransformContextExtender;
public class RuntimeLoggerContextExtender extends AbstractContextExtender
{
+ public static final int ERROR_LEVEL = 5;
+ public static final int WARNING_LEVEL = 4;
+ public static final int INFO_LEVEL = 3;
+ public static final int TRACE_LEVEL = 2;
+ public static final int DEBUG_LEVEL = 1;
+
+
private static final class ContextData
{
private final List listeners = new ArrayList();
@@ -66,7 +73,7 @@ public class RuntimeLoggerContextExtender extends AbstractContextExtender
getData().listeners.remove(logger);
}
- public static void log(JET2Context context, String message, TagInfo td)
+ public static void log(JET2Context context, String message, TagInfo td, int level)
{
if (context.hasContextExtender(RuntimeLoggerContextExtender.class))
{
@@ -76,25 +83,25 @@ public class RuntimeLoggerContextExtender extends AbstractContextExtender
TransformContextExtender tce = new TransformContextExtender(context);
templatePath = tce.getTemplatePath();
}
- rl.log(message, td, templatePath);
+ rl.log(message, td, templatePath, level);
}
}
- public void log(String message, TagInfo td, String templatePath)
+ public void log(String message, TagInfo td, String templatePath, int level)
{
for (Iterator i = getData().listeners.iterator(); i.hasNext();)
{
RuntimeTagLogger logger = (RuntimeTagLogger)i.next();
- logger.log(message, td, templatePath);
+ logger.log(message, td, templatePath, level);
}
}
- public static void log(JET2Context context, String message, TagInfo tagInfo, String templatePath)
+ public static void log(JET2Context context, String message, TagInfo tagInfo, String templatePath, int level)
{
if (context.hasContextExtender(RuntimeLoggerContextExtender.class))
{
RuntimeLoggerContextExtender rl = new RuntimeLoggerContextExtender(context);
- rl.log(message, tagInfo, templatePath);
+ rl.log(message, tagInfo, templatePath, level);
}
}
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/RuntimeTagLogger.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/RuntimeTagLogger.java
index 840d5e6..1ee85e6 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/RuntimeTagLogger.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/RuntimeTagLogger.java
@@ -25,7 +25,7 @@ import org.eclipse.jet.taglib.TagInfo;
*/
public interface RuntimeTagLogger
{
-
- void log(String message, TagInfo td, String templatePath);
+
+ void log(String message, TagInfo td, String templatePath, int level);
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeConditionalRuntimeTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeConditionalRuntimeTag.java
index 68f2558..c6b2f41 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeConditionalRuntimeTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeConditionalRuntimeTag.java
@@ -74,7 +74,7 @@ public class SafeConditionalRuntimeTag extends SafeContainerRuntimeTag
}
}
});
- RuntimeLoggerContextExtender.log(getContext(), (doEvalResult ? JET2Messages.TraceRuntimeTags_ProcessingBody : JET2Messages.TraceRuntimeTags_SkippingBody), getTagInfo());
+ RuntimeLoggerContextExtender.log(getContext(), (doEvalResult ? JET2Messages.TraceRuntimeTags_ProcessingBody : JET2Messages.TraceRuntimeTags_SkippingBody), getTagInfo(), RuntimeLoggerContextExtender.TRACE_LEVEL);
return doEvalResult;
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeContainerRuntimeTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeContainerRuntimeTag.java
index 7272e04..e497873 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeContainerRuntimeTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeContainerRuntimeTag.java
@@ -66,7 +66,7 @@ public class SafeContainerRuntimeTag extends SafeCustomRuntimeTag
untrustedTag.doAction(getTagInfo(), getContext(), getWriter());
}
});
- RuntimeLoggerContextExtender.log(getContext(), JET2Messages.TraceRuntimeTags_ActionCompleted, getTagInfo());
+ RuntimeLoggerContextExtender.log(getContext(), JET2Messages.TraceRuntimeTags_ActionCompleted, getTagInfo(), RuntimeLoggerContextExtender.TRACE_LEVEL);
}
}
@@ -86,7 +86,7 @@ public class SafeContainerRuntimeTag extends SafeCustomRuntimeTag
untrustedTag.doBeforeBody(getTagInfo(), getContext(), getWriter());
}
});
- RuntimeLoggerContextExtender.log(getContext(), JET2Messages.TraceRuntimeTags_BeforeBodyCompleted, getTagInfo());
+ RuntimeLoggerContextExtender.log(getContext(), JET2Messages.TraceRuntimeTags_BeforeBodyCompleted, getTagInfo(), RuntimeLoggerContextExtender.TRACE_LEVEL);
}
return !bodyProcessed;
}
@@ -108,7 +108,7 @@ public class SafeContainerRuntimeTag extends SafeCustomRuntimeTag
MessageFormat.format(
JET2Messages.TraceRuntimeTags_SetBodyContents,
new Object[] {bodyContent.getDocument().get()}),
- getTagInfo());
+ getTagInfo(), RuntimeLoggerContextExtender.TRACE_LEVEL);
untrustedTag.setBodyContent(bodyContent);
}
untrustedTag.doAfterBody(getTagInfo(), getContext(), getWriter());
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeEmptyRuntimeTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeEmptyRuntimeTag.java
index 4c9471e..698e1d5 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeEmptyRuntimeTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeEmptyRuntimeTag.java
@@ -51,7 +51,7 @@ public class SafeEmptyRuntimeTag extends SafeCustomRuntimeTag
}
});
- RuntimeLoggerContextExtender.log(getContext(), JET2Messages.TraceRuntimeTags_ActionCompleted, getTagInfo());
+ RuntimeLoggerContextExtender.log(getContext(), JET2Messages.TraceRuntimeTags_ActionCompleted, getTagInfo(), RuntimeLoggerContextExtender.TRACE_LEVEL);
}
/* (non-Javadoc)
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeFunctionRuntimeTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeFunctionRuntimeTag.java
index 5680089..c221f18 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeFunctionRuntimeTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeFunctionRuntimeTag.java
@@ -84,7 +84,7 @@ public class SafeFunctionRuntimeTag extends SafeCustomRuntimeTag
});
RuntimeLoggerContextExtender.log(getContext(), MessageFormat.format(
JET2Messages.TraceRuntimeTags_FunctionResult,
- new Object []{ functionResult }), getTagInfo());
+ new Object []{ functionResult }), getTagInfo(), RuntimeLoggerContextExtender.TRACE_LEVEL);
getWriter().write(functionResult);
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeIteratingRuntimeTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeIteratingRuntimeTag.java
index 52e3b40..bde3ae5 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeIteratingRuntimeTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeIteratingRuntimeTag.java
@@ -67,7 +67,7 @@ public class SafeIteratingRuntimeTag extends SafeContainerRuntimeTag
loopInitializedOk = true;
}
});
- RuntimeLoggerContextExtender.log(getContext(), JET2Messages.TraceRuntimeTags_LoopInitialized, getTagInfo());
+ RuntimeLoggerContextExtender.log(getContext(), JET2Messages.TraceRuntimeTags_LoopInitialized, getTagInfo(), RuntimeLoggerContextExtender.TRACE_LEVEL);
}
/* (non-Javadoc)
@@ -95,7 +95,7 @@ public class SafeIteratingRuntimeTag extends SafeContainerRuntimeTag
}
}
});
- RuntimeLoggerContextExtender.log(getContext(), okToProcessBodyResult ? JET2Messages.TraceRuntimeTags_ProcessingLoopBody : JET2Messages.TraceRuntimeTags_LoopFinished, getTagInfo());
+ RuntimeLoggerContextExtender.log(getContext(), okToProcessBodyResult ? JET2Messages.TraceRuntimeTags_ProcessingLoopBody : JET2Messages.TraceRuntimeTags_LoopFinished, getTagInfo(), RuntimeLoggerContextExtender.TRACE_LEVEL);
return okToProcessBodyResult;
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsCopyBinaryFileAction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsCopyBinaryFileAction.java
index 855b082..4589d47 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsCopyBinaryFileAction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsCopyBinaryFileAction.java
@@ -89,7 +89,7 @@ public class WsCopyBinaryFileAction extends AbstractWorkspaceAction implements I
final String fileMessage = MessageFormat.format(
JET2Messages.WsCopyBinaryFileAction_WritingFile,
new Object []{ file.getFullPath().toString() });
- RuntimeLoggerContextExtender.log(context, fileMessage, getTagInfo(), getTemplatePath());
+ RuntimeLoggerContextExtender.log(context, fileMessage, getTagInfo(), getTemplatePath(), RuntimeLoggerContextExtender.INFO_LEVEL);
}
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsCopyTextFileAction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsCopyTextFileAction.java
index 2b1cd68..5060587 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsCopyTextFileAction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsCopyTextFileAction.java
@@ -93,7 +93,7 @@ public class WsCopyTextFileAction extends AbstractWorkspaceAction implements IWo
final String fileMessage = MessageFormat.format(
JET2Messages.WsFileFromWriterAction_WritingFile,
new Object []{ file.getFullPath().toString() });
- RuntimeLoggerContextExtender.log(context, fileMessage, getTagInfo(), getTemplatePath());
+ RuntimeLoggerContextExtender.log(context, fileMessage, getTagInfo(), getTemplatePath(), RuntimeLoggerContextExtender.INFO_LEVEL);
}
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsFileFromWriterAction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsFileFromWriterAction.java
index 622ee88..5abd71f 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsFileFromWriterAction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsFileFromWriterAction.java
@@ -96,7 +96,7 @@ public class WsFileFromWriterAction extends AbstractWorkspaceAction implements I
JET2Messages.WsFileFromWriterAction_WritingFile,
new Object []{ file.getFullPath().toString() });
ActionsUtil.writeTextFileFromWriter(file, replace, encoding, derived, writer, monitor);
- RuntimeLoggerContextExtender.log(context, fileMessage, getTagInfo(), getTemplatePath());
+ RuntimeLoggerContextExtender.log(context, fileMessage, getTagInfo(), getTemplatePath(), RuntimeLoggerContextExtender.INFO_LEVEL);
}
public void setEncoding(String encoding)
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsFolderAction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsFolderAction.java
index 76de65d..759f743 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsFolderAction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsFolderAction.java
@@ -76,7 +76,7 @@ public class WsFolderAction extends AbstractWorkspaceAction implements IWorkspac
ActionsUtil.ensureFolderExists(folder, monitor);
RuntimeLoggerContextExtender.log(context, MessageFormat.format(
JET2Messages.WsFolderAction_CreatingFolder,
- new Object []{ folder.getFullPath().toString() }), getTagInfo(), getTemplatePath());
+ new Object []{ folder.getFullPath().toString() }), getTagInfo(), getTemplatePath(), RuntimeLoggerContextExtender.INFO_LEVEL);
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsProjectAction.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsProjectAction.java
index 76afd14..e8907f1 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsProjectAction.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/WsProjectAction.java
@@ -86,7 +86,7 @@ public class WsProjectAction extends AbstractWorkspaceAction implements IWorkspa
ActionsUtil.createProject(project, monitor);
final String createMessage = MessageFormat.format(JET2Messages.WsProjectAction_CreatingProject, new Object []{ project.getName() });
- RuntimeLoggerContextExtender.log(context, createMessage, getTagInfo(), getTemplatePath());
+ RuntimeLoggerContextExtender.log(context, createMessage, getTagInfo(), getTemplatePath(), RuntimeLoggerContextExtender.INFO_LEVEL);
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/transform/JETLaunchConstants.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/transform/JETLaunchConstants.java
new file mode 100644
index 0000000..1abcf49
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/transform/JETLaunchConstants.java
@@ -0,0 +1,52 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.transform;
+
+import org.eclipse.jet.JET2Platform;
+
+/**
+ * Declares constants for the JET Launch configuration and its attributes
+ */
+public class JETLaunchConstants
+{
+
+ /**
+ * The JET Launch configuration ID
+ */
+ public static final String CONFIG_ID = JET2Platform.PLUGIN_ID + ".jet2Transformation"; //$NON-NLS-1$
+ /**
+ * The name of the 'source' attribute in the launch configuration
+ */
+ public static final String SOURCE = JET2Platform.PLUGIN_ID + "." + "source"; //$NON-NLS-1$ //$NON-NLS-2$
+ /**
+ * The name of the 'id' attribute in the launch configuration.
+ */
+ public static final String ID = JET2Platform.PLUGIN_ID + "." + "id"; //$NON-NLS-1$//$NON-NLS-2$
+ /**
+ * The name of the 'logFilterLevel' attribute in the lauch configuration.
+ */
+ public static final String LOG_FILTER_LEVEL = JET2Platform.PLUGIN_ID + "." + "logFilterLevel"; //$NON-NLS-1$//$NON-NLS-2$
+
+ /**
+ *
+ */
+ private JETLaunchConstants()
+ {
+ super();
+ }
+
+}