Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Papyrus for Real Time » Eclipse Extension Point(Extension point for registering a model as a template)
Eclipse Extension Point [message #1775176] Wed, 25 October 2017 18:50 Go to next message
Sudharshan Gopikrishnan is currently offline Sudharshan GopikrishnanFriend
Messages: 15
Registered: April 2017
Junior Member
Hello all,

I need to know how to use an extension point for registering model as a template. I am new to using Eclipse Extension Points. Any help will be greatly appreciated !

Regards,
Sudharshan
Re: Eclipse Extension Point [message #1775242 is a reply to message #1775176] Thu, 26 October 2017 16:15 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
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

Re: Eclipse Extension Point [message #1775541 is a reply to message #1775242] Tue, 31 October 2017 18:16 Go to previous message
Sudharshan Gopikrishnan is currently offline Sudharshan GopikrishnanFriend
Messages: 15
Registered: April 2017
Junior Member
Thank you for the help Ernesto !!

Regards,
Sudharshan
Previous Topic:.cpp extension in codegen
Next Topic:Can't Even Start Papyrus-RT Windows Install -- Java Error
Goto Forum:
  


Current Time: Fri Mar 29 12:23:07 GMT 2024

Powered by FUDForum. Page generated in 0.02978 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top