Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates')
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java195
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.java42
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.properties14
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateStore.java230
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/package.html113
5 files changed, 0 insertions, 594 deletions
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java
deleted file mode 100644
index 37153c4f6..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.editors.text.templates;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.TemplateVariableResolver;
-
-import org.eclipse.ui.editors.text.EditorsUI;
-
-import org.eclipse.ui.internal.editors.text.EditorsPlugin;
-
-
-/**
- * A registry for context types. Editor implementors will usually instantiate a
- * registry and configure the context types available in their editor.
- * <code>ContextType</code>s can be added either directly using
- * {@link #addContextType(TemplateContextType)} or by instantiating and adding a
- * contributed context type using {@link #addContextType(String)}.
- *
- * @since 3.0
- */
-public class ContributionContextTypeRegistry extends ContextTypeRegistry {
-
- /* extension point string literals */
- private static final String TEMPLATES_EXTENSION_POINT= "org.eclipse.ui.editors.templates"; //$NON-NLS-1$
-
- private static final String CONTEXT_TYPE= "contextType"; //$NON-NLS-1$
- private static final String ID= "id"; //$NON-NLS-1$
- private static final String NAME= "name"; //$NON-NLS-1$
- private static final String CLASS= "class"; //$NON-NLS-1$
-
- private static final String RESOLVER= "resolver"; //$NON-NLS-1$
- private static final String CONTEXT_TYPE_ID= "contextTypeId"; //$NON-NLS-1$
- private static final String DESCRIPTION= "description"; //$NON-NLS-1$
- private static final String TYPE= "type"; //$NON-NLS-1$
-
- /**
- * Tries to create a context type given an id. If there is already a context
- * type registered under the given id, nothing happens. Otherwise,
- * contributions to the <code>org.eclipse.ui.editors.templates</code>
- * extension point are searched for the given identifier and the specified
- * context type instantiated if it is found.
- *
- * @param id the id for the context type as specified in XML
- */
- public void addContextType(String id) {
- Assert.isNotNull(id);
- if (getContextType(id) != null)
- return;
-
- TemplateContextType type= createContextType(id);
- if (type != null)
- addContextType(type);
-
- }
-
- /**
- * Tries to create a context type given an id. Contributions to the
- * <code>org.eclipse.ui.editors.templates</code> extension point are
- * searched for the given identifier and the specified context type
- * instantiated if it is found. Any contributed
- * {@link org.eclipse.jface.text.templates.TemplateVariableResolver}s
- * are also instantiated and added to the context type.
- *
- * @param id the id for the context type as specified in XML
- * @return the instantiated and configured context type, or
- * <code>null</code> if it is not found or cannot be instantiated
- */
- public static TemplateContextType createContextType(String id) {
- Assert.isNotNull(id);
-
- IConfigurationElement[] extensions= getTemplateExtensions();
- TemplateContextType type;
- try {
- type= createContextType(extensions, id);
- if (type != null) {
- TemplateVariableResolver[] resolvers= createResolvers(extensions, id);
- for (int i= 0; i < resolvers.length; i++)
- type.addResolver(resolvers[i]);
- }
- } catch (CoreException e) {
- EditorsPlugin.log(e);
- type= null;
- }
-
- return type;
- }
-
- private static TemplateContextType createContextType(IConfigurationElement[] extensions, String contextTypeId) throws CoreException {
- for (int i= 0; i < extensions.length; i++) {
- // TODO create half-order over contributions
- if (extensions[i].getName().equals(CONTEXT_TYPE)) {
- String id= extensions[i].getAttributeAsIs(ID);
- if (contextTypeId.equals(id))
- return createContextType(extensions[i]);
- }
- }
-
- return null;
- }
-
- /**
- * Instantiates the resolvers contributed to the context type with id
- * <code>contextTypeId</code>. If instantiation of one resolver fails,
- * the exception are logged and operation continues.
- *
- * @param extensions the configuration elements to parse
- * @param contextTypeId the id of the context type for which resolvers are
- * instantiated
- * @return the instantiated resolvers
- */
- private static TemplateVariableResolver[] createResolvers(IConfigurationElement[] extensions, String contextTypeId) {
- List resolvers= new ArrayList();
- for (int i= 0; i < extensions.length; i++) {
- if (extensions[i].getName().equals(RESOLVER)) {
- String declaredId= extensions[i].getAttributeAsIs(CONTEXT_TYPE_ID);
- if (contextTypeId.equals(declaredId)) {
- try {
- TemplateVariableResolver resolver= createResolver(extensions[i]);
- if (resolver != null)
- resolvers.add(resolver);
- } catch (CoreException e) {
- EditorsPlugin.log(e);
- }
- }
- }
- }
-
- return (TemplateVariableResolver[]) resolvers.toArray(new TemplateVariableResolver[resolvers.size()]);
-
- }
-
- private static IConfigurationElement[] getTemplateExtensions() {
- return Platform.getExtensionRegistry().getConfigurationElementsFor(TEMPLATES_EXTENSION_POINT);
- }
-
- private static TemplateContextType createContextType(IConfigurationElement element) throws CoreException {
- String id= element.getAttributeAsIs(ID);
- try {
- TemplateContextType contextType= (TemplateContextType) element.createExecutableExtension(CLASS);
- String name= element.getAttribute(NAME);
- if (name == null)
- name= id;
-
- contextType.setId(id);
- contextType.setName(name);
-
- return contextType;
- } catch (ClassCastException e) {
- throw new CoreException(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IStatus.OK, "extension does not implement " + TemplateContextType.class.getName(), e)); //$NON-NLS-1$
- }
- }
-
- private static TemplateVariableResolver createResolver(IConfigurationElement element) throws CoreException {
- try {
- String type= element.getAttributeAsIs(TYPE);
- if (type != null) {
-
- TemplateVariableResolver resolver= (TemplateVariableResolver) element.createExecutableExtension(CLASS);
- resolver.setType(type);
-
- String desc= element.getAttribute(DESCRIPTION);
- if (desc == null)
- desc= new String();
- resolver.setDescription(desc);
-
- return resolver;
- }
- } catch (ClassCastException e) {
- throw new CoreException(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IStatus.OK, "extension does not implement " + TemplateVariableResolver.class.getName(), e)); //$NON-NLS-1$
- }
-
- return null;
- }
-}
-
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.java
deleted file mode 100644
index 8782b4946..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.editors.text.templates;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Helper class to get NLSed messages.
- *
- * @since 3.0
- */
-class ContributionTemplateMessages {
-
- private static final String BUNDLE_NAME= "org.eclipse.ui.editors.text.templates.ContributionTemplateMessages";//$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME);
-
- private ContributionTemplateMessages() {}
-
- /**
- * Gets a string from the resource bundle.
- *
- * @param key the string used to get the bundle value, must not be <code>null<code>
- * @return the string from the resource bundle
- */
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.properties b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.properties
deleted file mode 100644
index c5b779f5a..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-ContributionTemplateStore.ignore_prefix=Ignoring template
-ContributionTemplateStore.ignore_postfix_no_id= since it has no id.
-ContributionTemplateStore.ignore_postfix_deleted= since it is deleted.
-ContributionTemplateStore.ignore_postfix_validation_failed= since validation failed.
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateStore.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateStore.java
deleted file mode 100644
index c80f22363..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateStore.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.editors.text.templates;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
-
-import org.osgi.framework.Bundle;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateException;
-import org.eclipse.jface.text.templates.persistence.TemplatePersistenceData;
-import org.eclipse.jface.text.templates.persistence.TemplateReaderWriter;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-
-import org.eclipse.ui.internal.editors.text.EditorsPlugin;
-
-
-/**
- * Manages templates. Handles reading default templates contributed via XML and
- * user-defined (or overridden) templates stored in the preferences.
- * <p>
- * Clients may instantiate but not subclass this class.
- * </p>
- *
- * @since 3.0
- */
-public class ContributionTemplateStore extends TemplateStore {
- /* extension point string literals */
- private static final String TEMPLATES_EXTENSION_POINT= "org.eclipse.ui.editors.templates"; //$NON-NLS-1$
-
- private static final String ID= "id"; //$NON-NLS-1$
- private static final String NAME= "name"; //$NON-NLS-1$
-
- private static final String CONTEXT_TYPE_ID= "contextTypeId"; //$NON-NLS-1$
- private static final String DESCRIPTION= "description"; //$NON-NLS-1$
-
- private static final String TEMPLATE= "template"; //$NON-NLS-1$
- private static final String PATTERN= "pattern"; //$NON-NLS-1$
-
- private static final String INCLUDE= "include"; //$NON-NLS-1$
- private static final String FILE= "file"; //$NON-NLS-1$
- private static final String TRANSLATIONS= "translations"; //$NON-NLS-1$
-
- /**
- * Creates a new template store.
- *
- * @param store the preference store in which to store custom templates
- * under <code>key</code>
- * @param key the key into <code>store</code> where to store custom
- * templates
- */
- public ContributionTemplateStore(IPreferenceStore store, String key) {
- super(store, 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 <code>null</code>.
- *
- * @param registry a context type registry, or <code>null</code> if all
- * templates should be loaded
- * @param store the preference store in which to store custom templates
- * under <code>key</code>
- * @param key the key into <code>store</code> where to store custom
- * templates
- */
- public ContributionTemplateStore(ContextTypeRegistry registry, IPreferenceStore store, String key) {
- super(registry, store, key);
- }
-
- /**
- * Loads the templates contributed via the templates extension point.
- *
- * @throws IOException {@inheritDoc}
- */
- protected void loadContributedTemplates() throws IOException {
- IConfigurationElement[] extensions= getTemplateExtensions();
- Collection contributed= readContributedTemplates(extensions);
- for (Iterator it= contributed.iterator(); it.hasNext();) {
- TemplatePersistenceData data= (TemplatePersistenceData) it.next();
- internalAdd(data);
- }
- }
-
- private Collection readContributedTemplates(IConfigurationElement[] extensions) throws IOException {
- Collection templates= new ArrayList();
- for (int i= 0; i < extensions.length; i++) {
- if (extensions[i].getName().equals(TEMPLATE))
- createTemplate(templates, extensions[i]);
- else if (extensions[i].getName().equals(INCLUDE)) {
- readIncludedTemplates(templates, extensions[i]);
- }
- }
-
- return templates;
- }
-
- private void readIncludedTemplates(Collection templates, IConfigurationElement element) throws IOException {
- String file= element.getAttributeAsIs(FILE);
- if (file != null) {
- Bundle plugin = Platform.getBundle(element.getDeclaringExtension().getNamespace());
- URL url= Platform.find(plugin, new Path(file));
- if (url != null) {
- ResourceBundle bundle= null;
- String translations= element.getAttributeAsIs(TRANSLATIONS);
- if (translations != null) {
- URL bundleURL= Platform.find(plugin, new Path(translations));
- if (url != null) {
- bundle= new PropertyResourceBundle(bundleURL.openStream());
- }
- }
-
- InputStream stream= new BufferedInputStream(url.openStream());
- TemplateReaderWriter reader= new TemplateReaderWriter();
- TemplatePersistenceData[] datas= reader.read(stream, bundle);
- for (int i= 0; i < datas.length; i++) {
- TemplatePersistenceData data= datas[i];
- if (data.isCustom()) {
- if (data.getId() == null)
- EditorsPlugin.logErrorMessage(ContributionTemplateMessages.getString("ContributionTemplateStore.ignore_prefix") + data.getTemplate().getName() + " " + ContributionTemplateMessages.getString("ContributionTemplateStore.ignore_postfix_no_id")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- else
- EditorsPlugin.logErrorMessage(ContributionTemplateMessages.getString("ContributionTemplateStore.ignore_prefix") + data.getTemplate().getName() + " " + ContributionTemplateMessages.getString("ContributionTemplateStore.ignore_postfix_deleted")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- } else if (!validateTemplate(data.getTemplate())) {
- if (contextExists(data.getTemplate().getContextTypeId()))
- EditorsPlugin.logErrorMessage(ContributionTemplateMessages.getString("ContributionTemplateStore.ignore_prefix") + data.getTemplate().getName() + " " + ContributionTemplateMessages.getString("ContributionTemplateStore.ignore_postfix_validation_failed")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- } else {
- templates.add(data);
- }
- }
- }
- }
- }
-
- /**
- * Validates a template against the context type registered in the context
- * type registry. Returns always <code>true</code> if no registry is
- * present.
- *
- * @param template the template to validate
- * @return <code>true</code> if validation is successful or no context
- * type registry is specified, <code>false</code> if validation
- * fails
- */
- private boolean validateTemplate(Template template) {
- String contextTypeId= template.getContextTypeId();
- if (contextExists(contextTypeId)) {
- if (getRegistry() != null)
- try {
- getRegistry().getContextType(contextTypeId).validate(template.getPattern());
- } catch (TemplateException e) {
- return false;
- }
- return true;
- } else
- return false;
- }
-
- /**
- * Returns <code>true</code> if a context type id specifies a valid context type
- * or if no context type registry is present.
- *
- * @param contextTypeId the context type id to look for
- * @return <code>true</code> if the context type specified by the id
- * is present in the context type registry, or if no registry is
- * specified
- */
- private boolean contextExists(String contextTypeId) {
- return contextTypeId != null && (getRegistry() == null || getRegistry().getContextType(contextTypeId) != null);
- }
-
- private static IConfigurationElement[] getTemplateExtensions() {
- return Platform.getExtensionRegistry().getConfigurationElementsFor(TEMPLATES_EXTENSION_POINT);
- }
-
- private void createTemplate(Collection map, IConfigurationElement element) {
- String contextTypeId= element.getAttributeAsIs(CONTEXT_TYPE_ID);
- // log failures since extension point id and name are mandatory
- if (contextExists(contextTypeId)) {
- String id= element.getAttributeAsIs(ID);
- if (isValidTemplateId(id)) {
-
- String name= element.getAttribute(NAME);
- if (name != null) {
-
- String desc= element.getAttribute(DESCRIPTION);
- if (desc == null)
- desc= new String();
-
- String pattern= element.getChildren(PATTERN)[0].getValue();
- if (pattern != null) {
-
- Template template= new Template(name, desc, contextTypeId, pattern);
- TemplatePersistenceData data= new TemplatePersistenceData(template, true, id);
- if (validateTemplate(template))
- map.add(data);
- }
- }
- }
- }
- }
-
- private static boolean isValidTemplateId(String id) {
- return id != null && id.trim().length() != 0; // TODO test validity?
- }
-}
-
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/package.html b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/package.html
deleted file mode 100644
index e70145a0f..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/package.html
+++ /dev/null
@@ -1,113 +0,0 @@
-<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta content="text/html; charset=iso-8859-1"
- http-equiv="Content-Type">
- <meta content="IBM" name="Author">
- <meta content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]"
- name="GENERATOR">
- <title>Templates</title>
- <meta content="Template Infrastructure package description"
- name="description">
-</head>
-<body>
-Application programming interfaces for interaction
-with the Eclipse Java User Interface text support.
-<h2>Templates<br>
-</h2>
-<h3>packages</h3>
-<ul>
- <li style="font-weight: bold;"><big><span
- style="font-family: monospace;">org.eclipse.jface.text.templates</span></big></li>
- <li style="font-weight: bold;"><big><span
- style="font-family: monospace;">org.eclipse.ui.workbench.texteditor.templates</span><br>
- <span style="font-family: monospace;"></span></big></li>
- <li><big><span style="font-family: monospace; font-weight: bold;">org.eclipse.ui.editors.templates</span></big><br>
- <span style="font-family: monospace;"></span></li>
-</ul>
-<h3><code></code></h3>
-Templates are shortcuts for frequently used fragments of text such as
-code patterns or complex text entities. They may contain variables
-which are only resolved at the time when the template is inserted
-within a context. Together with linked mode, inserting a template can
-create a on-the-fly edit mask within a text viewer.<br>
-<br>
-Templates are specified as text, variables are defined using the <span
- style="font-family: monospace;">${variable}</span> notation known from
-Ant, for example. The following snippet shows an example template for
-an instance check in Java:<br>
-<pre>if (${name} instanceof ${type}) {<br>&nbsp;&nbsp;&nbsp; ${type} ${new_name} = (${type})${name};<br>&nbsp;&nbsp;&nbsp; ${cursor}<br>}<br></pre>
-In this template, the variables (<span style="font-family: monospace;">name,
-type, ...</span><span style="font-family: sans-serif;">) are resolved
-when inserted into java source and changing one variable instance will
-also change the other. When leaving linked mode, the caret is placed at
-the </span><span style="font-family: monospace;">cursor</span><span
- style="font-family: sans-serif;"> variable.<br>
-<br>
-Template functionality can be added to a custom text editor by offering
-</span><span style="font-family: monospace;">TemplateProposal</span><span
- style="font-family: sans-serif;">s as content assist choices, which is
-simplified by using a </span><span style="font-family: sans-serif;"><span
- style="font-family: sans-serif;">subclass of </span></span><span
- style="font-family: monospace;">TemplateCompletionProcessor</span><span
- style="font-family: sans-serif;">. User template management can be
-offered by including a </span><span style="font-family: monospace;">TemplatePreferencePage</span><span
- style="font-family: sans-serif;"> which uses a </span><span
- style="font-family: monospace;">TemplateStore</span><span
- style="font-family: sans-serif;"> and <span
- style="font-family: monospace;">ContextTypeRegistry</span> as the
-underlying model to store templates. The <span
- style="font-family: monospace;">org.eclipse.ui.editors.templates</span>
-extension point can be used to allow other plug-ins to contribute
-templates to an editor. This is accomplished by using the <span
- style="font-family: monospace;">ContributionTemplateStore</span> and <span
- style="font-family: monospace;">ContributionContextTypeRegistry</span>
-subclasses of the above types.<br>
-<br>
-Template variables are resolved by a <span
- style="font-family: monospace;">TemplateVariableResolver.</span> <span
- style="font-family: monospace;">GlobalTemplateVariables</span> offers
-some default variables such as date, user, and selection, but advanced
-features such as resolving to language constructs can be performed in
-subclasses.<br>
-</span>
-<h4>Classes</h4>
-<ul>
- <li><span style="font-family: monospace;">Template</span><span
- style="font-family: sans-serif;"> a template consists of name, context
-type identifier, and a pattern.</span></li>
- <li><span style="font-family: sans-serif;"><span
- style="font-family: monospace;">TemplateTranslator</span> and <span
- style="font-family: monospace;">TemplateBuffer</span> are used to
-parse the template grammar and don't need to be used usually.</span></li>
- <li><span style="font-family: sans-serif;">A <span
- style="font-family: monospace;">TemplateProposal </span>can be
-offered in content assist, possibly created by a subclass of <span
- style="font-family: monospace;">TemplateCompletionProcessor.</span></span></li>
- <li><span style="font-family: sans-serif;"><span
- style="font-family: monospace;">TemplateStore</span> and <span
- style="font-family: monospace;">ContextTypeRegistry</span> manage a
-set of templates within a plug-in and offer ways to store them in the
-preferences or externally in XML streams via a <span
- style="font-family: monospace;">TemplateReaderWriter</span>.<br>
- </span></li>
- <li><span style="font-family: sans-serif;"><span
- style="font-family: monospace;">ContributionTemplateStore</span> and <span
- style="font-family: monospace;">ContributionContextTypeRegistry</span>
-add awareness for the </span><span style="font-family: sans-serif;"><span
- style="font-family: sans-serif;"> <span
- style="font-family: monospace;">org.eclipse.ui.editors.templates</span>
-extension point.</span></span></li>
- <li style="font-family: monospace;"><span
- style="font-family: sans-serif;"><span style="font-family: sans-serif;"><span
- style="font-family: monospace;">TemplatePreferencePage</span> allows
-the user to access the templates within a <span
- style="font-family: monospace;">TemplateStore</span>.</span></span></li>
-</ul>
-<ul>
-</ul>
-<h4>Example</h4>
-<pre><span style="font-family: sans-serif;">See the Template Editor Example in the <span
- style="font-weight: bold;">org.eclipse.ui.examples.javaeditor</span> project.<br></span></pre>
-</body>
-</html>

Back to the top