<!ELEMENT extension (templateFactory* , templateDirectory* , category* , templateCategoryBinding* , activityTemplateBinding* , perspectiveBinding* , templateConfigurationPageGroup* , existingModelHandler*)+>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ELEMENT templateFactory EMPTY>
<!ATTLIST templateFactory
class CDATA #REQUIRED>
Template factories allows for the contribution of templates programmatically rather than through a static file.
<!ELEMENT templateDirectory EMPTY>
<!ATTLIST templateDirectory
path CDATA #REQUIRED
handler CDATA #IMPLIED>
Specifies the location of a directory containing template definition files (.tpdef).
<!ELEMENT category EMPTY>
<!ATTLIST category
id CDATA #REQUIRED
label CDATA #REQUIRED
parent CDATA #IMPLIED
displayable (true | false) >
Categories are strictly a UI feature used to categorize templates.
<!ELEMENT templateCategoryBinding (template+)+>
<!ATTLIST templateCategoryBinding
categoryRef CDATA #REQUIRED>
Binds templates to a category.
<!ELEMENT perspectiveBinding EMPTY>
<!ATTLIST perspectiveBinding
perspectiveRef CDATA #REQUIRED
categoryRef CDATA #REQUIRED
templateRef CDATA #REQUIRED>
Binds default template and category to a perspective.
<!ELEMENT activityTemplateBinding (template , activity+)+>
<!ATTLIST activityTemplateBinding
required (true | false) "false">
Binds activities to a category. Only those activities specified in the com.ibm.xtools.common.ui.reduction.editingCapabilities extension are valid.
<!ELEMENT templateConfigurationPageGroup (template+)+>
<!ATTLIST templateConfigurationPageGroup
id CDATA #REQUIRED
class CDATA #REQUIRED
afterRef CDATA #IMPLIED
afterMatch (equals|pattern) "equals">
Template configuration page groups allow for additional configuration of templates in the wizard. The group can produce 1 or more wizard pages and create a workflow between the pages.
<!ELEMENT existingModelHandler EMPTY>
<!ATTLIST existingModelHandler
class CDATA #REQUIRED
extensions CDATA #REQUIRED>
Specifies a handler to manage creating a new model from an existing model. The specified handler is invoked for creating models from existing models with the given file extensions.
<!ELEMENT template EMPTY>
<!ATTLIST template
ref CDATA #REQUIRED
match (equals|pattern) "equals">
<!ELEMENT activity EMPTY>
<!ATTLIST activity
ref CDATA #REQUIRED
match (equals|pattern) "equals">
<extension point="com.ibm.xtools.common.ui.wizards.newModelWizard"> <templateDirectory path="templates/" handler="com.ibm.xtools.common.ui.wizards.tests.internal.TestTemplateModelHandler"/> <templateFactory class="com.ibm.xtools.example.MyTemplateFactory"/> <category id="com.ibm.xtools.example.category1" label="My Category"/> <category id="com.ibm.xtools.example.category1_1" label="My Sub Category" parent="com.ibm.xtools.example.category1"/> <templateCategoryBinding categoryRef="com.ibm.xtools.example.category1"> <template ref="com.ibm.xtools.example.blankTemplate" match="equals"/> </templateCategoryBinding> <templateCategoryBinding categoryRef="com.ibm.xtools.example.category1_1"> <template ref="com\.ibm\.xtools\.example\.workingTemplates.*" match="pattern"/> </templateCategoryBinding> <activityTemplateBinding required="true"> <activity ref="com.ibm.xtools.example.activity1" match="equals"/> <template ref="com.ibm.xtools.example.blankTemplate" match="equals"/> </activityTemplateBinding> <templateConfigurationPageGroup afterMatch="equals" class="com.ibm.xtools.examples.MyTemplateConfigurationPageGroup1" id="com.ibm.xtools.examples.templateConfigurationPageGroup1"> <template ref="com\.ibm\.xtools\.example\.workingTemplates.*" match="pattern"/> </templateConfigurationPageGroup> <templateConfigurationPageGroup afterMatch="equals" afterRef="com.ibm.xtools.examples.templateConfigurationPageGroup1" class="com.ibm.xtools.examples.MyTemplateConfigurationPageGroup2" id="com.ibm.xtools.examples.templateConfigurationPageGroup2"> <template ref="com\.ibm\.xtools\.example\.workingTemplates.*" match="pattern"/> </templateConfigurationPageGroup> <existingModelHandler class="com.ibm.xtools.examples.MyExistingModelHandler" extensions="foo, bar"/> </extension>
Example directory containing a single template:
Example XML template definition file:
<templates> <template name="Test Template1" description="Create Template1." modelName="test1" id="com.ibm.xtools.common.ui.wizards.tests.template1" templateFile="template1.foo" icon="template1.gif"> </template> <template name="Test Template2" description="Create Template2." modelName="test2" id="com.ibm.xtools.common.ui.wizards.tests.template2" templateFile="template2.foo" icon="template2.gif"> </template> </templates>
Example properties template definition file:
name=Test Template3
description=Create Template3.
modelName=test3
id=com.ibm.xtools.common.ui.wizards.tests.template3
templateFile=template3.foo
icon=template3.gif
Particular product installs may contribute to the new model wizard as required.
Copyright (c) 2004, 2018 Model RealTime, HCL and others. All Rights Reserved.