Create Plug-in project in Eclipse

        In this post we will learn how to create a plug-in project in Eclipse using the plug-in development environment (PDE).

        At its simplest, a plug-in project requires a MANIFEST.MF file describing the plugin and its dependencies and, if extending the workbench a plugin.xml file identifying the extension points being implemented, and a set of Java classes implementing those extension points.

1. The first step involves opening your Eclipse workspace and creating a new Plug-in project.You can do it from Select File->New->Project. Then in the opening dialog box select the Plug-in Project wizard. Then Click Next.

2. Enter the project name of your choice. Leave the other options as default and click Next.


3. Again no changes to the default options and click Next.


4. In the next dialog  select the Hello World template and press the Finish button. This should automatically open the Plug-in Development perspective.

5. Your new plugin project is created with the Plug-in Development perspective. This is how our plug-in project will look in the Package Explorer.


        Now lets discuss about the plug-in related files we see in our Project explorer. If you have created a java project before then you would be knowing about the build.properties file. For those who are not familair with java project, the build.properties file declares the libraries where the plug-in code is packaged. At runtime, the class loader searches these libraries when loading the plug-in's classes.

        The manifest file describes the content of the plug-in to the Eclipse runtime. In addition to basic plug-in information such as plug-in identifier, version, etc., this file contains four main sections: Dependencies, Extensions, Runtime and Extension Points section.


        Dependencies section lists all the plug-ins required by the plug-in. A plug-in must list as dependencies all the plug-ins needed for its code to compile and all the plug-ins contributing extension points that it is using.
 

        The Extensions section declares all the functionalities that this plug-in contributes to the platform by extending other plug-ins' extension points.

        The plugin.xml specifies the extension. It is the central place for configuring the plugin being developed. This sample plugin’s extension point is org.eclipse.ui.actionSets.


        Your plugin is created and you are ready to go. Now you only need to add the code to implement the extension points.

In our coming tutorial we will learn how to create a working JDT plugin project using Eclipse.
Comments and Suggestions are appreciated.



0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
 

Copyright © 2012 | ScriptSplash | Powered by Blogger Templates