View RSS Feed

My Java Tips

Creating a Simple Plug-in using PDE

Rate this Entry
by , 11-17-2011 at 08:01 PM (689 Views)
To get a better idea of how to develop plug-ins using PDE, you will create a simple workbench view. In this post, Ill give you some basic understanding.


To get started, launch your Eclipse SDK and choose an empty workspace. When you close the Welcome page, you should find yourself in the Java perspective, by default (however, it is not required that you are in the Java perspective in order to proceed). First, you will use the New Plug-in wizard to create the plug-in. Then, you will edit its descriptor using the Plug-in Manifest Editor, and implement a Java class using JDT. Lastly, you will launch our plug-in in a run-time workbench to see the results. Now, get started:

1. In the main menu, click File -> New -> Project, then select Plug-in Project and click Next.

2. On the next wizard page, enter com.plugindemo.SimplePDEplugin as the Project name. Click Next.

3. On this page, leave all fields with their default values and just click Finish. Answer yes when asked whether to switch to the Plug-in

Development perspective. At this point, the plug-in has been created and you should see the Overview page of the Plug-in Manifest Editor.



The Overview page contains some general properties, such as the ID of your plug-in, its version, name, provider, plug-in class, and platform filter. It also provides links to pages for specifying plug-in content, its build configuration, as well as links for test-running and exporting the plug-in (all with brief descriptions). The ID is required and must uniquely identify your plug-in, globally. The Version is typically a three- or four-part, dot-separated version identifier (major.minor.service{.qualifier}). Plug-in versioning is documented in detail in your Platform Plug-in Developer Guide; in this exercise, you will settle for the default 1.0.0. The Name and Provider are optional and are only used as display labels in product configuration. The Class property is also optional, and for now it'll suffice to say that it represents a singleton instance of the plug-in at run-time, typically used as a single point of access to various plug-in-specific data. In this example, the wizard generates a default implementation of this class for you, but you will not reference it from any code developed in this example. Platform filter can be used to restrict the plug-in's platform applicability.

Submit "Creating a Simple Plug-in using PDE" to Facebook Submit "Creating a Simple Plug-in using PDE" to Digg Submit "Creating a Simple Plug-in using PDE" to del.icio.us Submit "Creating a Simple Plug-in using PDE" to StumbleUpon Submit "Creating a Simple Plug-in using PDE" to Google

Categories
Eclipse

Comments