Creating a Plug-in Project

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 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. 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.

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.

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.

The following tutorial uses numbered steps to indicate where you are required to do something as you follow along.

Step By Step: Creating an RSE Plug-in Project

  1. Select File->New->Project.
  2. On the left of the dialog box, select Plug-in Development category, and on the right, select the Plug-in Project wizard. Press Next >.
  3. In the first page of the wizard (Plug-in Project Name), enter "RSESamples" for the project name (without the quotes). Press Next >.
  4. In the second page of the wizard (Plug-in Project Structure), just take the defaults, and press Next >.
  5. In the third page of the wizard (Plug-in Code Generators), select "Default Plug-in Structure", and press Next >.
  6. In the fourth page of the wizard (Simple Plug-in Content), enter your company for the Provider Name, and press Finish.
  7. Your new plugin project is created and visible in the Package Explorer of the Plug-in Development perspective. Your new plugin.xml file is also open in the plug-in editor. Close this editor, as you will not be using it in this tutorial.
  8. Select the plugin.xml file, right click and select Open. Go to the dependencies tab and add the following plugins to the list:
  9. Expand the src folder, then the RSESamples package folder, and double-click on RSESamplesPlugin.java to edit this class to make it look like this.
  10. Create the project's resources file for translatable strings: right-click on the RSESamples project and select New->File to open the New File wizard. Enter rseSamplesResources.properties for the file name, as was specified in the call to loadResourceBundle in the plug-in class's constructor. Press Finish to create the file. You will populate as you go through the tutorials, so for now just close the editor opened for the file.
  11. Create the project's RSE-style messages file for translatable messages: right-click on the RSESamples project and select New->File to get the New File wizard. Enter rseSamplesMessages.xml for the file name, as was specified in the call to loadMessageFile in the plug-in class's constructor. Press Finish to create the file. You will see the XML editor open for the new file. Press the Source tab at the bottom of the editor, and enter the following lines (so that you can add messages to the file later on):
    
    <?xml version="1.0" encoding='UTF-8'?>
    <!DOCTYPE MessageFile SYSTEM "../org.eclipse.rse.ui/messageFile.dtd">
    <!-- This is a message file used by SystemMessage and SystemMessageDialog -->
    <MessageFile Version="1.0">
         <Component Name="RSE Samples" Abbr="RSS">
              <Subcomponent Name="General" Abbr="G">
                    <MessageList>
                        <Message ID="1001" Indicator="E">
                              <LevelOne>Sample message</LevelOne>		
                              <LevelTwo>This is a sample with one substution variable: %1</LevelTwo>
                        </Message>
                    </MessageList>
              </Subcomponent>
         </Component>
    </MessageFile>
    
    Save and close the file.
  12. That's it! Your plugin is created and you are ready to go. Now you only need to add code, to implement the extension points.