Class ContributionTemplateStore
java.lang.Object
org.eclipse.text.templates.TemplateStoreCore
org.eclipse.jface.text.templates.persistence.TemplateStore
org.eclipse.ui.editors.text.templates.ContributionTemplateStore
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 Summary
ConstructorsConstructorDescriptionContributionTemplateStore(IPreferenceStore store, String key) Creates a new template store.ContributionTemplateStore(ContextTypeRegistry registry, IPreferenceStore store, String key) Creates a new template store with a context type registry. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidHandles anIOExceptionthrown during reloading the preferences due to a preference store update.protected voidLoads the templates contributed via the templates extension point.Methods inherited from class TemplateStore
add, delete, getRegistry, getTemplateData, getTemplateData, internalAdd, load, restoreDefaults, save, startListeningForPreferenceChanges, stopListeningForPreferenceChangesMethods inherited from class TemplateStoreCore
add, delete, findTemplate, findTemplate, findTemplateById, getKey, getTemplates, getTemplates, internalAdd, internalGetTemplates, restoreDefaults, restoreDeleted
-
Constructor Details
-
ContributionTemplateStore
Creates a new template store.- Parameters:
store- the preference store in which to store custom templates underkeykey- the key intostorewhere to store custom templates
-
ContributionTemplateStore
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 notnull.- Parameters:
registry- a context type registry, ornullif all templates should be loadedstore- the preference store in which to store custom templates underkeykey- the key intostorewhere to store custom templates
-
-
Method Details
-
loadContributedTemplates
Loads the templates contributed via the templates extension point.- Overrides:
loadContributedTemplatesin classTemplateStoreCore- Throws:
IOException- if loading fails
-
handleException
Description copied from class:TemplateStoreCoreHandles anIOExceptionthrown during reloading the preferences due to a preference store update. The default is to write to stderr.- Overrides:
handleExceptionin classTemplateStoreCore- Parameters:
x- the exception
-