Creating a plug-in for the rule

To create your own quality control rule, you must first create a plug-in that contains all the components of the rule. Templates are supplied for rules specific to Rational Programming Patterns.

Procedure

  1. Open the Plug-in Development perspective.
  2. Select File > New > Project.
    In the window that opens, select Plug-in Project in the section Plug-in Development. Then, click Next to open the creation wizard.
    Figure 1. Selecting the Plug-in Project
    Selecting the Plug-in Project
  3. In the Plug-in Project page of the wizard, enter a Project name and click Next until you get to the Templates page.
    Figure 2. Plug-in Project wizard
    Plug-in Project wizard

    The Templates page displays all the available templates. The templates that are specific to Rational Programming Patterns start with RPP. You can select a template for a rule or a template for a rule template.

    Explanations about the template and the extension are available when you click a template in the list.

    Figure 3. Plug-in templates
    Plug-in templates
  4. Select a template and click Next.

    The next page contains the properties of the rule. You can modify the fields to customize the rule. The content of this page varies depending on the template

    Figure 4. Properties of the rule
    Properties of the rule
    At first, you can keep the default values to get used to the tool. Click Finish.
    Note: If you are familiar with Eclipse, you can modify the properties of the rule. For example, you can indicate a new Java Class name that corresponds to your control and adapt the other parameters. You will also have to modify the Java class to implement the control you want.

Results

When the plug-in project is created, its components are added in the Package Explorer view and the plug-in editor opens.

In the Extensions tab (corresponding to the content of the plugin.xml file), you can see the extension you need to extend to add a rule to your workspace. The tab also displays the properties of the rule with the default values that are set in the plug-in creation wizard.

Figure 5. Extensions of the Plug-in
Extensions of the Plug-in

In the plug-in components, you can see the Java class that runs the quality control. The code is simple and gives an example of how to use the Rational Programming Patterns application programming interface. You can use this class to start. If you are experienced, you can modify the code and customize it to create your own rules.

Figure 6. Plug-in components
Plug-in components

For more information on how to create a plug-in, see the sections Reference > Wizards and Dialogs > New Project Creation Wizards and Reference > Editors in the Plug-in Development Environment (PDE) User Guide of the Eclipse documentation.


Feedback