| <?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
| <title>integration-modeler_description_file_deployment</title> |
| <link type="text/css" rel="stylesheet" href="../resources/bootstrap.css"/> |
| <link type="text/css" rel="stylesheet" href="../resources/custom.css"/> |
| </head> |
| <body> |
| <h1 id="SiriusDeployaModelerdescriptionfile">Sirius – Deploy a Modeler description file</h1> |
| <p>This document describes how to deploy a modeler description file as an Eclipse plug-in through the available APIs.</p> |
| <h2 id="CreateanewEclipseplugin">Create a new Eclipse plug-in</h2> |
| <ul> |
| <li>Select |
| <strong>File -> New -> Plug-in project</strong> |
| </li> |
| <li>Choose a name; for instance |
| <code>com.yourcompany.yourproject.mymodeler</code> |
| </li> |
| <li>Select |
| <em>Generate an activator</em> and uncheck the checkbox labelled |
| <em>This plug-in will make contributions to the UI</em> |
| </li> |
| <li>Create a new folder named "description" in the created project’s root</li> |
| <li>Activate to true the option "Activate this plug-in when one of its classes is loaded" of your plugin.xml</li> |
| </ul> |
| <h2 id="Importyourmodeler">Import your modeler</h2> |
| <ul> |
| <li>Select |
| <strong>File -> Import... -> File System</strong> |
| </li> |
| <li>Select the directory where your modeler description file is located.</li> |
| <li>Check that the modeler description file is checked as file to import.</li> |
| <li>import it in the previously created project</li> |
| </ul> |
| <h2 id="Contributetoorg.eclipse.sirius.componentization">Contribute to |
| <code>org.eclipse.sirius.componentization</code> |
| </h2> |
| <ul> |
| <li>Open the |
| <em>META-INF/MANIFEST.MF</em> file. |
| </li> |
| <li>In the |
| <em>Extensions</em> tab, add a new extensions based on the |
| <code>org.eclipse.sirius.componentization</code> extension point |
| </li> |
| <li>Fill the properties with the following values : |
| <ul> |
| <li>id: an identifier string</li> |
| <li>name: a name string</li> |
| <li>class: the activator of the previously created plug-in</li> |
| </ul> |
| </li> |
| </ul> |
| <p>Here is an example :</p> |
| <pre> id="com.mycompany.yourproject.mymodeler.modeler" |
| name="com.mycompany.yourproject.mymodeler.modeler" |
| class="com.mycompany.yourproject.mymodeler.modeler.MyActivator" |
| </pre> |
| <h2 id="Registeryourviewpointsatthestartofyourplugin">Register your viewpoints at the start of your plug-in</h2> |
| <ul> |
| <li>Add your viewpoints in the function start of the activator of your plug-in:</li> |
| </ul> |
| <pre>viewpoints = new HashSet&lt;Viewpoint&gt;(); |
| viewpoints.addAll(ViewpointRegistry.getInstance().registerFromPlugin(PLUGIN&#95;ID+&quot;/&lt;path&#95;from&#95;the&#95;plugin&#95;project&gt;/&lt;myModeler&gt;.odesign&quot;)); |
| </pre> |
| <ul> |
| <li>Suppress your viewpoints in the function stop of the activator of your plug-in</li> |
| </ul> |
| <pre>if (viewpoints != null) { |
| for (Viewpoint viewpoint : viewpoints) { |
| ViewpointRegistry.getInstance().disposeFromPlugin(viewpoint); |
| } |
| viewpoints.clear(); |
| } |
| </pre> |
| </body> |
| </html> |