Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2018-09-15 08:12:21 +0000
committerAndrey Loskutov2018-09-18 13:51:31 +0000
commit64b7f7b876595adbccd96e2802eb9cc51518b83d (patch)
tree4847eda1bf5f4a70b44351af38d4e3957021f489 /org.eclipse.text/src/org
parent3c80a177e44f9924952496eeb79d87b7ea955a9d (diff)
downloadeclipse.platform.text-64b7f7b876595adbccd96e2802eb9cc51518b83d.tar.gz
eclipse.platform.text-64b7f7b876595adbccd96e2802eb9cc51518b83d.tar.xz
eclipse.platform.text-64b7f7b876595adbccd96e2802eb9cc51518b83d.zip
Bug 539096 - TemplateContext should implement IAdaptableI20180918-2005I20180918-1800
Change-Id: Ia9af00f7380f72d89122cb2ae1e0f542fdb91a6a Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.text/src/org')
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateContext.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateContext.java b/org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateContext.java
index 321ed5eaa..ab7d959ef 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateContext.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateContext.java
@@ -16,6 +16,8 @@ package org.eclipse.jface.text.templates;
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.core.runtime.IAdaptable;
+
import org.eclipse.jface.text.BadLocationException;
/**
@@ -27,7 +29,7 @@ import org.eclipse.jface.text.BadLocationException;
*
* @since 3.0
*/
-public abstract class TemplateContext {
+public abstract class TemplateContext implements IAdaptable {
/** The context type of this context */
private final TemplateContextType fContextType;
@@ -117,5 +119,14 @@ public abstract class TemplateContext {
* in this context, <code>false</code> otherwise
*/
public abstract boolean canEvaluate(Template template);
+
+ /**
+ * Default implementation does nothing, clients can override to provide adapters.
+ * {@inheritDoc}
+ */
+ @Override
+ public <T> T getAdapter(Class<T> adapter) {
+ return null;
+ }
}

Back to the top