Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jface.text/src/org/eclipse/jface/text/templates/ContextTypeRegistry.java')
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/ContextTypeRegistry.java37
1 files changed, 10 insertions, 27 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/ContextTypeRegistry.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/ContextTypeRegistry.java
index cb8b9f68e..74cf8ef7d 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/ContextTypeRegistry.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/ContextTypeRegistry.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 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
@@ -11,8 +11,6 @@
package org.eclipse.jface.text.templates;
import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
/**
* A registry for context types. Editor implementors will usually instantiate a
@@ -23,38 +21,23 @@ import java.util.Map;
* </p>
*
* @since 3.0
+ * @deprecated See {@link ContextTypeRegistry} from org.eclipse.text
*/
-public class ContextTypeRegistry {
+@Deprecated
+public class ContextTypeRegistry extends org.eclipse.text.templates.ContextTypeRegistry {
- /** all known context types */
- private final Map<String, TemplateContextType> fContextTypes= new LinkedHashMap<>();
-
- /**
- * Adds a context type to the registry. If there already is a context type
- * with the same ID registered, it is replaced.
- *
- * @param contextType the context type to add
- */
+ @Override
public void addContextType(TemplateContextType contextType) {
- fContextTypes.put(contextType.getId(), contextType);
+ super.addContextType(contextType);
}
- /**
- * Returns the context type if the id is valid, <code>null</code> otherwise.
- *
- * @param id the id of the context type to retrieve
- * @return the context type if <code>name</code> is valid, <code>null</code> otherwise
- */
+ @Override
public TemplateContextType getContextType(String id) {
- return fContextTypes.get(id);
+ return super.getContextType(id);
}
- /**
- * Returns an iterator over all registered context types.
- *
- * @return an iterator over all registered context types
- */
+ @Override
public Iterator<TemplateContextType> contextTypes() {
- return fContextTypes.values().iterator();
+ return super.contextTypes();
}
}

Back to the top