|
|
Line 1: |
Line 1: |
− | First steps to create a basic addon for Capella.
| + | This page has been moved to https://github.com/eclipse/capella/wiki/Tutorials |
− | Capella is based on Eclipse, so create a basic addon for Capella is the same than creating a basic addon for Eclipse. There is many documentation and sample on internet for this.
| + | |
− | But this will help you a bit to start plugin developpement.
| + | |
− | | + | |
− | == Developement Platform ==
| + | |
− | Enable Capella development
| + | |
− | In a Capella,
| + | |
− | | + | |
− | * In the top left, click on “Open Perspective” > Show all > Debug, and enable activities as asked by Capella. It will enable Debug, development plugins, etc.
| + | |
− | | + | |
− | == How to create an basic addon adding a menu ==
| + | |
− | * Do File > New > "Plugin Project"
| + | |
− | * In the opened editor, Manifest.mf,
| + | |
− | ** in Dependencies, add for instance org.polarsys.capella.core.model.helpers org.polarsys.capella.core.model.handler
| + | |
− | ** in Extensions, click Add, and untick ‘show only extensions point from requiring plugin’
| + | |
− | *** add 'org.eclipse.ui.commands', 'org.eclipse.ui.handlers', 'org.eclipse.ui.menus'
| + | |
− | ** if you go to plugin.xml tab, you will see similar xml sections like : https://wiki.polarsys.org/Capella/Tutorials/Extensibility/Add_Menu
| + | |
− | ** based on these extensions points, you will create a command, a menu containing the command, then a handler, which is java code done when user click the command.
| + | |
− | *** The Command1Handler in the sample, it set the name of a System Function. In this class, you can manipulate capella model elements as you want.
| + | |
− | | + | |
− | == Test you addon in Capella as Debug ==
| + | |
− | * In the Run Menu, Debug As, Eclipse Application, then it will launch a Capella in debug mode, with you new menu in it.
| + | |
− | | + | |
− | == Deploy an addon ==
| + | |
− | * Create a new "Feature Project".
| + | |
− | * In the "Included Plugins", add the one you created
| + | |
− | * In the "Overview" tab, you can click on "Exporting" > Export Wizard.
| + | |
− | ** In the output folder, you will have all the files necessary.
| + | |
− | ** Embed the files in a Addon/eclipse/ folder, and your users will be able to install it in a dropin folder of capella, like any other addons.
| + | |
− | | + | |
− | == Automatic deployment ==
| + | |
− | * Of course, this is a first step, then you will have to create some automatic packaging, automatic tests, using Jenkins for instance
| + | |
− | ** You can inspire from existing addons to see how it can be done.
| + | |
− | git clone https://git.polarsys.org/r/capella/capella-filtering
| + | |
− | git clone https://git.polarsys.org/r/#/admin/projects/capella/capella-sss-transition
| + | |
− | git clone https://git.polarsys.org/r/capella/capella-requirements-vp
| + | |