Pluglet Template
Identifier:
com.ibm.xtools.pluglets.ui.plugletTemplate
Since:
1.5.0
Description:
Allows plug-ins to register pluglet templates. These templates can be discovered in the "New pluglet..." dialog.
Pluglet creation templates appear as choices within the "New Pluglet" dialog. In the dialog, templates are organized into categories which usually reflect a particular problem domain. The categories defined by one plug-in can be referenced by other plug-ins using the category attribute. Uncategorized templates, as well as templates with invalid category paths, will end up in an "Other" category.
A template file contains the Java source that will be placed in the new pluglet after undergoing template expansion. The template file can contain references to template variables such as "${package_declaration}" and "${type_name}".
It is recommended that templates be written such that the resulting expansion compiles without error (e.g. has all the necessary import statements).
Configuration Markup:
<!ELEMENT extension (category | template)*>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
- point - A fully qualified identifier of the target extension point.
- id - An optional identifier of the extension instance.
- name - An optional name of the extension instance.
<!ELEMENT category EMPTY>
<!ATTLIST category
id CDATA #REQUIRED
name CDATA #REQUIRED
parentCategory CDATA #IMPLIED>
- id - A unique name that can be used to identify this category.
- name - A translatable name of the category that will be used in the dialog box.
- parentCategory - A path to another category if this category should be added as a child.
<!ELEMENT template EMPTY>
<!ATTLIST template
id CDATA #REQUIRED
name CDATA #REQUIRED
file CDATA #REQUIRED
encoding CDATA #IMPLIED
icon CDATA #IMPLIED
category CDATA #IMPLIED
description CDATA #IMPLIED
requiredPlugins CDATA #IMPLIED>
- id - A unique name that can be used to identify this template.
- name - A translatable name of the template that will be used in the dialog box.
- file - A relative path of a template file.
- encoding - Optional charset encoding. If not specified, the template file is assumed to be encoded using UTF-8.
- icon - A relative path of an icon that will be used together with the name to represent the template as one of the choices in the pluglet creation dialog box.
- category - A slash-delimited path ('/') of category IDs. Each token in the
path must represent a valid category ID previously defined
by this or some other plug-in. If omitted, the template will be
added to the "Other" category.
- description - A translatable description of the template that will be used in the dialog box.
- requiredPlugins - A relative path of a pluglets.xml file that specifies the plug-ins required by this pluglet template. If this attribute is omitted the plugin which contributed the template is assumed to be the only required plug-in.
Examples:
<extension point="com.ibm.xtools.pluglets.ui.plugletTemplate">
<category
id="com.abc.xyz"
name="XYZ Templates">
</category>
<category
id="com.abc.xyz.easy"
name="Easy Templates"
parentCategory="com.abc.xyz">
</category>
<template
id="com.abc.xyz.easy.template"
name="EasyTemplate"
file="pluglet_templates/EasyTemplate.txt"
icon="icons/EasyTemplate.gif"
category="com.abc.xyz/com.abc.xyz.easy"
description="%EasyTemplate.description">
</template>
</extension>
© Copyright Model RealTime Corp. 2003, 2004. All Rights Reserved