org.eclipse.xtext.ui.editor.templates
Class XtextTemplateStore

java.lang.Object
  extended by org.eclipse.jface.text.templates.persistence.TemplateStore
      extended by org.eclipse.xtext.ui.editor.templates.XtextTemplateStore

public class XtextTemplateStore
extends org.eclipse.jface.text.templates.persistence.TemplateStore

Author:
Sven Efftinge - Initial contribution and API

Constructor Summary
XtextTemplateStore(org.eclipse.jface.text.templates.ContextTypeRegistry registry, org.eclipse.jface.preference.IPreferenceStore store, java.lang.String key, org.eclipse.ui.plugin.AbstractUIPlugin plugin)
           
 
Method Summary
protected  java.net.URL getTemplateFileURL(org.eclipse.ui.plugin.AbstractUIPlugin plugin)
           
protected  void handleException(java.io.IOException x)
          Handles an IOException thrown during reloading the preferences due to a preference store update.
protected  void loadContributedTemplates()
          Hook method to load contributed templates.
 
Methods inherited from class org.eclipse.jface.text.templates.persistence.TemplateStore
add, delete, findTemplate, findTemplate, findTemplateById, getRegistry, getTemplateData, getTemplateData, getTemplates, getTemplates, internalAdd, load, restoreDefaults, restoreDefaults, restoreDeleted, save, startListeningForPreferenceChanges, stopListeningForPreferenceChanges
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XtextTemplateStore

@Inject
public XtextTemplateStore(org.eclipse.jface.text.templates.ContextTypeRegistry registry,
                                 org.eclipse.jface.preference.IPreferenceStore store,
                                 java.lang.String key,
                                 org.eclipse.ui.plugin.AbstractUIPlugin plugin)
Method Detail

getTemplateFileURL

protected java.net.URL getTemplateFileURL(org.eclipse.ui.plugin.AbstractUIPlugin plugin)

loadContributedTemplates

protected void loadContributedTemplates()
                                 throws java.io.IOException
Description copied from class: org.eclipse.jface.text.templates.persistence.TemplateStore
Hook method to load contributed templates. Contributed templates are superseded by customized versions of user added templates stored in the preferences.

The default implementation does nothing.

Overrides:
loadContributedTemplates in class org.eclipse.jface.text.templates.persistence.TemplateStore
Throws:
java.io.IOException - if loading fails

handleException

protected void handleException(java.io.IOException x)
Description copied from class: org.eclipse.jface.text.templates.persistence.TemplateStore
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.jface.text.templates.persistence.TemplateStore
Parameters:
x - the exception