<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML> | |
<HEAD> | |
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > | |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> | |
<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css"> | |
<title>Creating a PDE plug-in</title> | |
</head> | |
<BODY BGCOLOR="#ffffff"> | |
<h1>Creating a plug-in project</h1> | |
<p>In the workspace, a plug-in is represented by a single project that encapsulates | |
all the code and resources of the plug-in.</p> | |
<p>To create a plug-in project, bring up the New Plug-in Project creation wizard | |
via <b>File > New > Plug-in Project</b>.</p> | |
<p align="center"> | |
<img border="0" src="images/project-structure.png" alt="Plug-in Project Structure" ></p> | |
<p>It is a convention that plug-in project names are the same as plug-in IDs, | |
but they can be different. </p> | |
<p>The plug-in project can be created in one of two flavors: a Java project or a | |
simple project. Most plug-ins are meant to contain executable Java code | |
and must therefore be housed in a Java project. On the other hand, if, for | |
example, you are creating a documentation plug-in, then a simple project will | |
suffice.</p> | |
<p>A plug-in with an OSGi bundle manifest is the recommended plug-in format. In | |
addition to faster startup and classloading, it allows the plug-in to take advantage | |
to many new runtime capabilities.</p> | |
<p>Click <strong>Next</strong>.</p> | |
<p align="center"> <img border="0" src="images/default-codegen.png" alt="plug-in content page" ></p> | |
<p> </p> | |
<p> </p> | |
<p>On the Plug-in Content page, you set the data with which the plugin.xml file | |
will be initialized, including the plug-id, version and name.</p> | |
<p>The recommended deployed form of a plug-in is to be shipped as a single JAR | |
with all the classes and resources at the root of the JAR. For this format, | |
you may keep the <strong>Classpath</strong> field empty, or enter '.' (without | |
quotes). </p> | |
<p>The Plug-in class is a top-level Java class that represents the entire plug-in. | |
It will be used at runtime to control the plug-in's life cycle, i.e. its implementation | |
will determine what happens when the plug-in starts up or shuts down. | |
</p> | |
<p>Click <strong>Next</strong>.</p> | |
<p align="center"> | |
<img border="0" src="images/project-codegen.png" alt="Plug-in code generators" ></p> | |
<p> </p> | |
<p>The next page shows the various templates that PDE provides which generate | |
useful content such as views, editors, property pages etc. </p> | |
<p>In this example, we will create a plug-in with the "Hello, World" | |
template. You can read about the wizard in the area to the right of the wizard | |
list. </p> | |
<p>Click <b>Next</b>.</p> | |
<p align="center"> | |
<img border="0" src="images/hello-world-page.png" alt=""Sample Action Set" template page" ></p> | |
<p align="left"> </p> | |
<p align="left">The next page will let you customize the sample extension that | |
we are creating.</p> | |
<p align="left">When you press <b>Finish</b>, the wizard will create the new project, | |
all the specified folders and files, and the initial Java build path. The build | |
path is important for correct compilation of Java classes that are generated. | |
The wizard will also open the plug-in manifest editor. </p> | |
<p align="left"> After the wizard is | |
finished, the initial project structure should look like this:</p> | |
<p align="center"> | |
<img border="0" src="images/initial-structure.png" alt="Initial plug-in project structure" ></p> | |
</body> | |
</html> |