| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//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> |
| The plug-in class |
| </TITLE> |
| |
| <link rel="stylesheet" type="text/css" HREF="../book.css"> |
| </HEAD> |
| <BODY BGCOLOR="#ffffff"> |
| <H2> |
| The plug-in class</H2> |
| <P > |
| So far, we've been looking at the different extensions that are provided by the readme tool. Let's look at the general |
| definition of the readme tool plug-in.</P> |
| |
| <H3> |
| Plug-in definition</H3> |
| <P > |
| The readme tool plug-in is defined in the <b>MANIFEST.MF</b> file.</P> |
| <pre> |
| Manifest-Version: 1.0 |
| Bundle-ManifestVersion: 2 |
| Bundle-Name: %Plugin.name |
| Bundle-SymbolicName: org.eclipse.ui.examples.readmetool; singleton:=true |
| Bundle-Version: 3.3.0.qualifier |
| Bundle-ClassPath: readmetool.jar |
| Bundle-Activator: org.eclipse.ui.examples.readmetool.ReadmePlugin |
| Bundle-Vendor: %Plugin.providerName |
| Bundle-Localization: plugin |
| Require-Bundle: org.eclipse.ui, |
| org.eclipse.core.resources, |
| org.eclipse.core.runtime, |
| org.eclipse.ui.views, |
| org.eclipse.ui.ide, |
| org.eclipse.jface.text, |
| org.eclipse.text, |
| org.eclipse.ui.workbench.texteditor, |
| org.eclipse.ui.editors |
| Eclipse-AutoStart: true |
| Eclipse-AutoStart-comment: Use Eclipse-AutoStart instead of Eclipse-LazyStart because the readme example should run against 3.1 as well as 3.2. |
| </pre> |
| <P > |
| The plug-in definition includes the <b>Bundle-Name</b>, <b>Bundle-SymbolicName</b> (plug-in id), |
| <b>Bundle-Version</b>, and <b>Bundle-Vendor</b> of the plug-in. We |
| saw most of these parameters before in our hello world plug-in. The readme tool also defines a specialized plug-in class, |
| <b>ReadmePlugin</b>. </P> |
| <P > |
| The name of the jar file is also provided. File names specified in <b>Bundle-ClassPath</b> are relative to the |
| plug-in's directory, so the readme tool's jar file should be located directly in the plug-in's directory.</P> |
| <P > |
| The <b>Require-Bundle</b> element informs the platform of the readme tool's dependencies. |
| The workbench UI plug-ins are listed as required plug-ins, along with the various core, jface, and text plug-ins. </P> |
| |
| <H3> |
| AbstractUIPlugin</H3> |
| <P > |
| The<b> ReadmePlugin</b> class represents the readme |
| tool plug-in and manages the life cycle of the plug-in. As we saw in the |
| Hello World example, you don't have to specify a plug-in class. The |
| platform will provide one for you. In this case, our plug-in needs to |
| initialize UI related data when it starts up. The platform class <a href="../reference/api/org/eclipse/ui/plugin/AbstractUIPlugin.html"><b>AbstractUIPlugin</b></a> |
| provides a structure for managing UI resources and is extended by <b> |
| ReadmePlugin</b>.</P> |
| <P > |
| <a href="../reference/api/org/eclipse/ui/plugin/AbstractUIPlugin.html"><b>AbstractUIPlugin</b></a> |
| uses the generic startup and shutdown methods to manage images, dialog settings, and a preference store during the lifetime of the plug-in. |
| We'll look at the specifics of the <b>ReadmePlugin</b> class when we work with dialogs and preferences.</P> |
| |
| |
| |
| </BODY> |
| </HTML> |