Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.ui.console')
-rw-r--r--org.eclipse.ui.console/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.ui.console/schema/consolePatternMatchListeners.exsd4
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListenerExtension.java17
3 files changed, 20 insertions, 4 deletions
diff --git a/org.eclipse.ui.console/META-INF/MANIFEST.MF b/org.eclipse.ui.console/META-INF/MANIFEST.MF
index a06b2f40b..a30ed2f0d 100644
--- a/org.eclipse.ui.console/META-INF/MANIFEST.MF
+++ b/org.eclipse.ui.console/META-INF/MANIFEST.MF
@@ -13,5 +13,6 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.workbench.texteditor;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.1.0,4.0.0)",
- org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)"
+ org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.core.variables
Eclipse-LazyStart: true
diff --git a/org.eclipse.ui.console/schema/consolePatternMatchListeners.exsd b/org.eclipse.ui.console/schema/consolePatternMatchListeners.exsd
index 522ad1a80..5cb81e02e 100644
--- a/org.eclipse.ui.console/schema/consolePatternMatchListeners.exsd
+++ b/org.eclipse.ui.console/schema/consolePatternMatchListeners.exsd
@@ -66,7 +66,7 @@
<attribute name="regex" type="string" use="required">
<annotation>
<documentation>
- specifies the regular expression to be matched
+ specifies the regular expression to be matched. Since 3.2, this attribute supports string variable substitution.
</documentation>
</annotation>
</attribute>
@@ -80,7 +80,7 @@
<attribute name="qualifier" type="string">
<annotation>
<documentation>
- a simple regular expression used to identify a line that may contain this pattern match listener&apos;s complete regular expression &lt;code&gt;regex&lt;/code&gt;. When a line is found containing this expression, a search is performed from the beginning of the line for this pattern matcher&apos;s complete &lt;code&gt;regex&lt;/code&gt;. Use of this attribute is optional but can greatly improve performance as lines not containing this expression are disqualified from the search.
+ a simple regular expression used to identify a line that may contain this pattern match listener&apos;s complete regular expression &lt;code&gt;regex&lt;/code&gt;. When a line is found containing this expression, a search is performed from the beginning of the line for this pattern matcher&apos;s complete &lt;code&gt;regex&lt;/code&gt;. Use of this attribute is optional but can greatly improve performance as lines not containing this expression are disqualified from the search. Since 3.2, this attribute supports string variable substitution.
</documentation>
</annotation>
</attribute>
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListenerExtension.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListenerExtension.java
index 9347c0281..1bb1f02df 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListenerExtension.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListenerExtension.java
@@ -19,6 +19,7 @@ import org.eclipse.core.expressions.ExpressionConverter;
import org.eclipse.core.expressions.ExpressionTagNames;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.ui.IPluginContribution;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
@@ -29,6 +30,7 @@ public class PatternMatchListenerExtension implements IPluginContribution {
private IConfigurationElement fConfig;
private Expression fEnablementExpression;
private String fPattern;
+ private String fQualifier;
private int fFlags = -1;
public PatternMatchListenerExtension(IConfigurationElement extension) {
@@ -93,6 +95,11 @@ public class PatternMatchListenerExtension implements IPluginContribution {
public String getPattern() {
if (fPattern == null) {
fPattern = fConfig.getAttributeAsIs("regex"); //$NON-NLS-1$
+ try {
+ fPattern = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(fPattern);
+ } catch (CoreException e) {
+ ConsolePlugin.log(e);
+ }
}
return fPattern;
}
@@ -123,6 +130,14 @@ public class PatternMatchListenerExtension implements IPluginContribution {
}
public String getQuickPattern() {
- return fConfig.getAttribute("qualifier"); //$NON-NLS-1$
+ if (fQualifier == null) {
+ fQualifier = fConfig.getAttribute("qualifier"); //$NON-NLS-1$
+ try {
+ fQualifier = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(fQualifier);
+ } catch (CoreException e) {
+ ConsolePlugin.log(e);
+ }
+ }
+ return fQualifier;
}
}

Back to the top