|
Re: Eclipse Extension Point [message #1775242 is a reply to message #1775176] |
Thu, 26 October 2017 16:15 |
Ernesto Posse Messages: 438 Registered: March 2011 |
Senior Member |
|
|
Hi. I assume that you want to add your model as a template available in the "New Papyrus Model" wizard, is that correct?
Basically to do this, in the plugin project that provides your template you have to create an extension to the "org.eclipse.papyrus.uml.diagram.wizards.templates" extension point.
You can do this by using the MANIFEST.MF editor or directly editing the "plugin.xml" file of your plugin project. For example, in Papyrus-RT we provide a number of templates in the "/org.eclipse.papyrusrt.umlrt.tooling.wizards" plugin, and its plugin.xml file contains the following:
<plugin>
<extension
point="org.eclipse.papyrus.uml.diagram.wizards.templates">
<template
di_file="resources/templates/rt-template.di"
file="resources/templates/rt-template.uml"
id="org.eclipse.papyrusrt.umlrt.tooling.wizards.template"
language="org.eclipse.papyrusrt.umlrt.architecture"
name="UML-RT for structural modelling"
notation_file="resources/templates/rt-template.notation">
</template>
<template
di_file="resources/templates/rtsm-template.di"
file="resources/templates/rtsm-template.uml"
id="org.eclipse.papyrusrt.umlrt.tooling.wizards.smtemplate"
language="org.eclipse.papyrusrt.umlrt.architecture"
name="UML-RT basic"
notation_file="resources/templates/rtsm-template.notation">
</template>
<template
di_file="resources/templates/rtsmcpp-template.di"
file="resources/templates/rtsmcpp-template.uml"
id="org.eclipse.papyrusrt.umlrt.tooling.wizards.smcpptemplate"
language="org.eclipse.papyrusrt.umlrt.architecture"
name="UML-RT for C++"
notation_file="resources/templates/rtsmcpp-template.notation">
</template>
</extension>
</plugin>
The templates themselves are stored in the "resource/templates" folder inside that same plugin.
As you see in this example, you have to provide an id, a name and three files: file (points to the .uml file) di_file (points to the .di file), and notation_file (points to the .notation file). The "language" field points to "org.eclipse.papyrusrt.umlrt.architecture".
If you use the MANIFEST editor, then:
1. double-click in the MANIFEST.MF file of your plugin project,
2. go to the "Extensions" tab,
3. click "Add...",
4. type "org.eclipse.papyrus.uml.diagram.wizards.templates" in the "Extension Points filter" field,
5. select the "org.eclipse.papyrus.uml.diagram.wizards.templates" extension point,
6. click [OK],
7. select the "org.eclipse.papyrus.uml.diagram.wizards.templates" and right-click on it,
8. in the pop-up menu, select "New > template",
9. fill out the details as above: (id, name, file, di_file, notation_file and language)
HTH
|
|
|
|
Powered by
FUDForum. Page generated in 0.03388 seconds