Class ContributionTemplateStore

java.lang.Object
org.eclipse.text.templates.TemplateStoreCore
org.eclipse.jface.text.templates.persistence.TemplateStore
org.eclipse.ui.editors.text.templates.ContributionTemplateStore

public class ContributionTemplateStore extends TemplateStore
Manages templates. Handles reading default templates contributed via XML and user-defined (or overridden) templates stored in the preferences.

Clients may instantiate but not subclass this class.

Since:
3.0
Restriction:
This class is not intended to be subclassed by clients.
  • Constructor Details

    • ContributionTemplateStore

      public ContributionTemplateStore(IPreferenceStore store, String key)
      Creates a new template store.
      Parameters:
      store - the preference store in which to store custom templates under key
      key - the key into store where to store custom templates
    • ContributionTemplateStore

      public ContributionTemplateStore(ContextTypeRegistry registry, IPreferenceStore store, String key)
      Creates a new template store with a context type registry. Only templates that specify a context type contained in the registry will be loaded by this store if the registry is not null.
      Parameters:
      registry - a context type registry, or null if all templates should be loaded
      store - the preference store in which to store custom templates under key
      key - the key into store where to store custom templates
  • Method Details

    • loadContributedTemplates

      protected void loadContributedTemplates() throws IOException
      Loads the templates contributed via the templates extension point.
      Overrides:
      loadContributedTemplates in class org.eclipse.text.templates.TemplateStoreCore
      Throws:
      IOException - if loading fails
    • handleException

      protected void handleException(IOException x)
      Description copied from class: org.eclipse.text.templates.TemplateStoreCore
      Handles an IOException thrown during reloading the preferences due to a preference store update. The default is to write to stderr.
      Overrides:
      handleException in class org.eclipse.text.templates.TemplateStoreCore
      Parameters:
      x - the exception