| h1. Sirius - Deploy a Modeler description file |
| |
| This document describes how to deploy a modeler description file as an Eclipse plug-in through the available APIs. |
| |
| h2. Create a new Eclipse plug-in |
| |
| * Select *File -> New -> Plug-in project* |
| * Choose a name; for instance @com.yourcompany.yourproject.mymodeler@ |
| * Select _Generate an activator_ and uncheck the checkbox labelled _This plug-in will make contributions to the UI_ |
| * Create a new folder named "description" in the created project's root |
| * Activate to true the option "Activate this plug-in when one of its classes is loaded" of your plugin.xml |
| |
| h2. Import your modeler |
| |
| * Select *File -> Import... -> File System* |
| * Select the directory where your modeler description file is located. |
| * Check that the modeler description file is checked as file to import. |
| * import it in the previously created project |
| |
| h2. Contribute to @org.eclipse.sirius.componentization@ |
| |
| * Open the _META-INF/MANIFEST.MF_ file. |
| * In the _Extensions_ tab, add a new extensions based on the @org.eclipse.sirius.componentization@ extension point |
| * Fill the properties with the following values : |
| ** id: an identifier string |
| ** name: a name string |
| ** class: the activator of the previously created plug-in |
| |
| Here is an example : |
| |
| pre. |
| id="com.mycompany.yourproject.mymodeler.modeler" |
| name="com.mycompany.yourproject.mymodeler.modeler" |
| class="com.mycompany.yourproject.mymodeler.modeler.MyActivator" |
| |
| h2. Register your viewpoints at the start of your plug-in |
| |
| * Add your viewpoints in the function start of the activator of your plug-in: |
| |
| pre. |
| viewpoints = new HashSet<Viewpoint>(); |
| viewpoints.addAll(ViewpointRegistry.getInstance().registerFromPlugin(PLUGIN_ID+"/<path_from_the_plugin_project>/<myModeler>.odesign")); |
| |
| * Suppress your viewpoints in the function stop of the activator of your plug-in |
| |
| pre. |
| if (viewpoints != null) { |
| for (Viewpoint viewpoint : viewpoints) { |
| ViewpointRegistry.getInstance().disposeFromPlugin(viewpoint); |
| } |
| viewpoints.clear(); |
| } |
| |
| |