<metaname="copyright"content="Copyright (c) IBM Corporation and others 2002, 2007. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.">
<p>To use any Eclipse extension point, including those defined by the Remote System Explorer, you must first create a plug-in project using the plug-in development environment (PDE), which you will do shortly. At its simplest, a plug-in project requires a <tt>MANIFEST.MF</tt> file describing the plugin and its dependencies and, if extending the workbench a <samp>plugin.xml</samp> file identifying the extension points being implemented, and a set of Java classes implementing those extension points. There is usually also a plug-in class file that is used as the overall manager of the project, and point of integration that other classes can rely on.</p>
<p><i>If you already have a plugin project, you will need to update it slightly to make it extend SystemBasePlugin and add the few methods it requires. You may wish to examine these steps to see what methods to add. The Eclipse environment will keep your classpaths and plugin dependecies in sync for you.</i></p>
<p>Eclipse supplies a number of plug-in project templates, which generate a number of project files that illustrate examples of various Eclipse extension points. While you are free to pick one of these, or indeed start with any existing plug-in project if you have one, in the RSE tutorials everything is created by hand so as to keep focused on the RSE-required classes and files.</p>
<p>The following tutorial uses numbered steps to indicate where you are required to do something as you follow along.</p>
<h2>Step By Step: Creating an RSE Plug-in Project</h2>
<ol>
<li>Select <b>File->New->Project.</b></li>
<li>In the dialog box select the <b>Plug-in Project</b> wizard. Click <b>Next ></b>.
<br/><imgsrc="pdeProj_1.png">
</li>
<li>In the first page of the wizard enter <b>"RSESamples"</b> for the project name (without the quotes). Click <b>Next ></b>.
<br/><imgsrc="pdeProj_wiz_page1.png">
</li>
<li>In the second page of the wizard enter your company for the <b>Plug-in Provider</b>, change the <b>Activator</b> to be "rsesamples.RSESamplesPlugin", and click <b>Next ></b>.
<br/><imgsrc="pdeProj_wiz_page2.png">
</li>
<li>In the third page of the wizard uncheck the "Create a plug-in using one of the templates" checkbox and click <b>Finish</b>.
<br/><imgsrc="pdeProj_wiz_page3.png">
</li>
<li>Your new plugin project is created and visible in the Package Explorer of the Plug-in Development perspective. Your new <samp>plugin.xml</samp> file is also open in the plug-in editor.</li>
<li>Go to the dependencies tab of the plug-in editor and add the following plugins to the list:
<ul>
<li>org.eclipse.core.resources</li>
<li>org.eclipse.rse.ui</li>
<li>org.eclipse.rse.services</li>
<li>org.eclipse.rse.files.ui</li>
<li>org.eclipse.rse.shells.ui</li>
<li>org.eclipse.rse.subsystems.files.core</li>
<li>org.eclipse.rse.subsystems.shells.core</li>
</ul>
Save the plugin.xml file.</li>
<li>Expand the <b>src</b> folder, then the <b>rsesamples</b> package folder, and double-click on <samp><b>RSESamplesPlugin.java</b></samp> to edit this class.
Change it as described below. Reference the source <ahref="RSESamplesPlugin.html">here</a> for the details.
<ul>
<li>Extend SystemBasePlugin instead of AbstractUIPlugin</li>
<li>Add the declaration for resourceBundle</li>
<li>Add the declaration for messageFile</li>
<li>Invoke the superclass constructor from this constructor</li>
<li>Add the initializeImageRegistry() method</li>
<li>Add the getMessageFile() method</li>
<li>Add the getResourceBundle() method</li>
<li>Add the static getWorkspace() method</li>
<li>Add the static getResourceString(String) method</li>
<li>Add the static getPluginMessageFile() method</li>
<li>Add the static getPluginMessage(String) method</li>
</ul>
</li>
<li>Create the project's resources file for translatable strings: right-click on the <b>RSESamples</b> project and select <b>New->File</b> to open the <b>New File</b> wizard. Enter <samp><b>rseSamplesResources.properties</b></samp> for the file name, as was specified in the call to <samp>loadResourceBundle</samp> in the plug-in class's constructor. Press <b>Finish</b> to create the file. You will populate as you go through the tutorials, so for now just <i>close</i> the editor opened for the file.</li>
<li>Create the project's RSE-style messages file for translatable messages: right-click on the <b>RSESamples</b> project and select <b>New->File</b> to get the <b>New File</b> wizard. Enter <samp><b>rseSamplesMessages.xml</b></samp> for the file name, as was specified in the call to <samp>loadMessageFile</samp> in the plug-in class's constructor. Press <b>Finish</b> to create the file. You will see the XML editor open for the new file. Press the <b>Source</b> tab at the bottom of the editor, and enter the following lines (so that you can add messages to the file later on):