Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorteicher2004-06-24 07:45:15 +0000
committerteicher2004-06-24 07:45:15 +0000
commit48215b960afbd0a3bee749891f5611ad06ec3e48 (patch)
treef6da47c633f7b12fa450b51bb5cf7e14fa8c481c /org.eclipse.text/src/org/eclipse/jface/text/templates/package.html
parentfdbda57decace04b003eac8c2615cf3fa9fcd58c (diff)
downloadeclipse.platform.text-48215b960afbd0a3bee749891f5611ad06ec3e48.tar.gz
eclipse.platform.text-48215b960afbd0a3bee749891f5611ad06ec3e48.tar.xz
eclipse.platform.text-48215b960afbd0a3bee749891f5611ad06ec3e48.zip
3.0 javadoc pass
Diffstat (limited to 'org.eclipse.text/src/org/eclipse/jface/text/templates/package.html')
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/package.html106
1 files changed, 35 insertions, 71 deletions
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/templates/package.html b/org.eclipse.text/src/org/eclipse/jface/text/templates/package.html
index e70145a0f..471a4e3c6 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/templates/package.html
+++ b/org.eclipse.text/src/org/eclipse/jface/text/templates/package.html
@@ -4,8 +4,6 @@
<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">
@@ -13,101 +11,67 @@
<body>
Application programming interfaces for interaction
with the Eclipse Java User Interface text support.
-<h2>Templates<br>
-</h2>
-<h3>packages</h3>
+<h2>Templates</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>
+ <li><tt><big><strong>org.eclipse.jface.text.templates</strong></big></tt></li>
+ <li><tt><big><strong>org.eclipse.ui.workbench.texteditor.templates</strong></big></tt></li>
+ <li><tt><big><strong>org.eclipse.ui.editors.templates</strong></big></tt></li>
</ul>
-<h3><code></code></h3>
+<h3>Introduction</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
+Templates are specified as text, variables are defined using the <tt>${variable}</tt>
+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
+<pre>if (${name} instanceof ${type}) {
+&nbsp;&nbsp;&nbsp; ${type} ${new_name} = (${type})${name};
+&nbsp;&nbsp;&nbsp; ${cursor}
+}
+</pre>
+In this template, the variables (<tt>name,type, ...</tt>) 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>
+the <tt>cursor</tt> 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>
+<tt>TemplateProposal</tt>s as content assist choices, which is
+simplified by using a subclass of <tt>TemplateCompletionProcessor</tt>. User template management can be
+offered by including a <tt>TemplatePreferencePage</tt> which uses a <tt>TemplateStore</tt> and <tt>ContextTypeRegistry</tt> as the
+underlying model to store templates. The <tt>org.eclipse.ui.editors.templates</tt>
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>
+templates to an editor. This is accomplished by using the <tt>ContributionTemplateStore</tt> and <tt>ContributionContextTypeRegistry</tt>
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
+Template variables are resolved by a <tt>TemplateVariableResolver.</tt> <tt>GlobalTemplateVariables</tt> 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
+ <li><tt>Template</tt> a template consists of name, context
+type identifier, and a pattern.</li>
+ <li><tt>TemplateTranslator</tt> and <tt>TemplateBuffer</tt> are used to
+parse the template grammar and don't need to be used usually.</li>
+ <li>A <tt>TemplateProposal </tt>can be
+offered in content assist, possibly created by a subclass of <tt>TemplateCompletionProcessor.</tt></li>
+ <li><tt>TemplateStore</tt> and <tt>ContextTypeRegistry</tt> 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>
+preferences or externally in XML streams via a <tt>TemplateReaderWriter</tt>.<br></li>
+ <li><tt>ContributionTemplateStore</tt> and <tt>ContributionContextTypeRegistry</tt>
+add awareness for the <tt>org.eclipse.ui.editors.templates</tt>
+extension point.</li>
+ <li><tt>TemplatePreferencePage</tt> allows
+the user to access the templates within a <tt>TemplateStore.</tt></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>
+See the Template Editor Example in the <strong>org.eclipse.ui.examples.javaeditor</strong> project.<br>
</body>
</html>

Back to the top