Difference between revisions of "Creating a new plug-in using eclipse (How to extend Rodin Tutorial)"

From Event-B
Jump to navigationJump to search
imported>Tommy
imported>Pascal
Line 1: Line 1:
{{Navigation|Previous= [[Introduction_(How_to_extend_Rodin_Tutorial)|Introduction]] | Up= [[Plug-in_Tutorial|How to extend Rodin Tutorial (Index)]] | Next= [[Extend_Rodin_database_(How_to_extend_Rodin_Tutorial)|Extend the database]]}}
+
{{Navigation|Previous= [[Introduction_(How_to_extend_Rodin_Tutorial)|Introduction]] | Up= [[Plug-in_Tutorial|How to extend Rodin Tutorial (Index)]] | Next= [[Extend_Rodin_database_(How_to_extend_Rodin_Tutorial)|Extending the database]]}}
  
 
=== In this part ===
 
=== In this part ===
We will explain how to use Eclipse to easily create a plugin package structure for our implementation. Developers which are familiar with plugin building may skip this part and go to the next page of this tutorial.
+
We will explain how to use Eclipse to easily create a plug-in package structure for our implementation. Developers which are familiar with plug-in building may skip this part and go to the next page of this tutorial.
 
Before starting to perform the following step, you should have your development environment ready and open.
 
Before starting to perform the following step, you should have your development environment ready and open.
  
 
=== Step 1 ===
 
=== Step 1 ===
To create a plugin, go to "'''File > New > Other'''" and select  "'''Plug-in Project'''" either from the general list if it appears, or from the category "Plug-in Development".
+
To create a plug-in, go to "'''File > New > Other'''" and select  "'''Plug-in Project'''" either from the general list if it appears, or from the category "Plug-in Development".
 
Click on "'''Next'''".
 
Click on "'''Next'''".
  
Line 17: Line 17:
  
 
1. In project name, enter the name of the plugin package that must appear in the project hierarchy. We used <tt>fr.systerel.rodinextension.sample</tt> but the formalism used often corresponds to <tt>mydomain.mycompany.mypluginname</tt><br>
 
1. In project name, enter the name of the plugin package that must appear in the project hierarchy. We used <tt>fr.systerel.rodinextension.sample</tt> but the formalism used often corresponds to <tt>mydomain.mycompany.mypluginname</tt><br>
2. Verify that the plugin is targeted to run with Eclipse 3.6 and click on "'''Next'''".
+
2. Verify that the plug-in is targeted to run with Eclipse 3.6 and click on "'''Next'''".
  
 
=== Step 3 ===
 
=== Step 3 ===
 
[[Image:Extend_Rodin_Tuto_1_3_NewPlug-inProject_Content.png|400px]]
 
[[Image:Extend_Rodin_Tuto_1_3_NewPlug-inProject_Content.png|400px]]
  
1. In field ID, enter the unique id that will identify the plugin. Generally, we use the project name entered in the previous step : <tt>fr.systerel.rodinextension.sample</tt>,<br>
+
1. In field ID, enter the unique id that will identify the plug-in. Generally, we use the project name entered in the previous step : <tt>fr.systerel.rodinextension.sample</tt>,<br>
2. The version identify, the current plugin version. This field can be later updated via the MANIFEST file. We let the default value <tt>1.0.0.qualifier</tt>,<br>
+
2. The version identify, the current plug-in version. This field can be later updated via the MANIFEST file. We let the default value <tt>1.0.0.qualifier</tt>,<br>
3. In the field Name, put the name of the plugin, here Qualitative Probabilistic Reasoning Plugin,<br>
+
3. In the field Name, put the name of the plug-in, here Qualitative Probabilistic Reasoning Plug-in,<br>
4. In the provider field, you can put the name of your company or insitution,<br>
+
4. In the provider field, you can put the name of your company or institution,<br>
 
5. Ensure that the Execution Environment used is Java 1.6 (the one used by the Rodin Platform v.2.0),<br>
 
5. Ensure that the Execution Environment used is Java 1.6 (the one used by the Rodin Platform v.2.0),<br>
6. Enter the class name of the plugin activator, preceded by its containing package. The activator is the static class responsible of the plugin lifecycle (start, stop, etc.).<br>
+
6. Enter the class name of the plug-in activator, preceded by its containing package. The activator is the static class responsible of the plug-in lifecycle (start, stop, etc.).<br>
 
Deselect "This plug-in will make contributions to the UI" as we will contribute to the UI with another dedicated plugin.
 
Deselect "This plug-in will make contributions to the UI" as we will contribute to the UI with another dedicated plugin.
 
Ensure that <tt>Rich Client Application</tt> is set to <tt>No</tt><br>
 
Ensure that <tt>Rich Client Application</tt> is set to <tt>No</tt><br>
Line 35: Line 35:
 
[[Image:Extend_Rodin_Tuto_1_4_ProjectExplorer1.png]]
 
[[Image:Extend_Rodin_Tuto_1_4_ProjectExplorer1.png]]
  
Eclipse created the plugin structure that we will be able to use to extend Rodin.
+
Eclipse created the plug-in structure that we will be able to use to extend Rodin.
  
 
{{Navigation|Previous= [[Introduction_(How_to_extend_Rodin_Tutorial)|Introduction]] | Up= [[Plug-in_Tutorial|How to extend Rodin Tutorial (Index)]] | Next= [[Extend_Rodin_database_(How_to_extend_Rodin_Tutorial)|Extend the database]]}}
 
{{Navigation|Previous= [[Introduction_(How_to_extend_Rodin_Tutorial)|Introduction]] | Up= [[Plug-in_Tutorial|How to extend Rodin Tutorial (Index)]] | Next= [[Extend_Rodin_database_(How_to_extend_Rodin_Tutorial)|Extend the database]]}}

Revision as of 14:15, 20 August 2010

In this part

We will explain how to use Eclipse to easily create a plug-in package structure for our implementation. Developers which are familiar with plug-in building may skip this part and go to the next page of this tutorial. Before starting to perform the following step, you should have your development environment ready and open.

Step 1

To create a plug-in, go to "File > New > Other" and select "Plug-in Project" either from the general list if it appears, or from the category "Plug-in Development". Click on "Next".

Extend Rodin Tuto 1 1 File new plugin.png

Step 2

The following wizard page appears:

Extend Rodin Tuto 1 2 NewPlug-inProject.png

1. In project name, enter the name of the plugin package that must appear in the project hierarchy. We used fr.systerel.rodinextension.sample but the formalism used often corresponds to mydomain.mycompany.mypluginname
2. Verify that the plug-in is targeted to run with Eclipse 3.6 and click on "Next".

Step 3

Extend Rodin Tuto 1 3 NewPlug-inProject Content.png

1. In field ID, enter the unique id that will identify the plug-in. Generally, we use the project name entered in the previous step : fr.systerel.rodinextension.sample,
2. The version identify, the current plug-in version. This field can be later updated via the MANIFEST file. We let the default value 1.0.0.qualifier,
3. In the field Name, put the name of the plug-in, here Qualitative Probabilistic Reasoning Plug-in,
4. In the provider field, you can put the name of your company or institution,
5. Ensure that the Execution Environment used is Java 1.6 (the one used by the Rodin Platform v.2.0),
6. Enter the class name of the plug-in activator, preceded by its containing package. The activator is the static class responsible of the plug-in lifecycle (start, stop, etc.).
Deselect "This plug-in will make contributions to the UI" as we will contribute to the UI with another dedicated plugin. Ensure that Rich Client Application is set to No
7. Click on "Finish"

What we got

Extend Rodin Tuto 1 4 ProjectExplorer1.png

Eclipse created the plug-in structure that we will be able to use to extend Rodin.