Class ContextTypeRegistry

java.lang.Object
org.eclipse.text.templates.ContextTypeRegistry
Direct Known Subclasses:
ContextTypeRegistry

public class ContextTypeRegistry extends Object
A registry for context types. Editor implementors will usually instantiate a registry and configure the context types available in their editor.

In order to pick up templates contributed using the org.eclipse.ui.editors.templates extension point, use a ContributionContextTypeRegistry.

Since:
3.7
  • Constructor Details

    • ContextTypeRegistry

      public ContextTypeRegistry()
  • Method Details

    • addContextType

      public void addContextType(TemplateContextType contextType)
      Adds a context type to the registry. If there already is a context type with the same ID registered, it is replaced.
      Parameters:
      contextType - the context type to add
    • getContextType

      public TemplateContextType getContextType(String id)
      Returns the context type if the id is valid, null otherwise.
      Parameters:
      id - the id of the context type to retrieve
      Returns:
      the context type if name is valid, null otherwise
    • contextTypes

      public Iterator<TemplateContextType> contextTypes()
      Returns an iterator over all registered context types.
      Returns:
      an iterator over all registered context types