Generating the project
Procedure
- Open the Plug-in Development perspective.
- On the main menu of the workbench, click File > New > Project > Plug-in Development > Plug-in Project and click Next. The New Plug-in Project wizard opens.
- In the Project name field of the Plug-in Project page, enter a name for the new project and click Next.
- In the ID field of the Content page, enter an ID for the new project and click Next.
- On the Templates page, select Create a plug-in using one of the templates. Then, select Custom COBOL Code Review Rule or Custom PL/I Code Review Rule and click Next.
- On the COBOL Rule Template page or the PL/I Rule Template page, complete the following fields:
- Rule class
- Enter a fully qualified Java™ class name. The wizard
assigns this name to the class that it creates to implement the new rule. The default value for this
field is the Project ID followed by the character string
CobolRule
orPLIRule
.Tip: The Project ID is the character string that you specified in the ID field on the Content page of the wizard. - Rule label
- Enter a name for the new rule. This name is added to the list of available rules that are
displayed in the software analysis configuration window. The default value for this field is
for COBOL orMy custom COBOL rule
for PL/I.My custom PL/I rule
Note: This name is translatable. For information about internationalizing strings in a plug-in, see cac_customrule_pipwizard.html#translating. - Category
- You can create a rule category for the new rule, or you can add the new rule to an
existing built-in or custom rule category.
- To place the new rule into a new rule category, click Create a new category and enter a category ID and category name for the new category.
- To add the rule to an existing category, click Select an existing category, then expand the list and select the category to which you want to add the new rule.
- Category ID
- Enter a valid Eclipse ID for the category within which the user-written custom rule is displayed
in the software analysis configuration window. The default value is the Project ID followed by
the word
custom
.Tip: The Project ID is the character string that you specified in the ID field on the Content page of the wizard. - Category name
- Enter a name for the category within which the user-written rule is displayed in the software analysis configuration window. The default value is
Custom
.Note: This name is translatable. For information about internationalizing strings in a plug-in, see cac_customrule_pipwizard.html#translating.
- Expand the Program tree for COBOL , or the ProgramSourceFile tree for PL/I, and select the
language element or elements that the implementation code for the new rule must check for violations. The default is that no elements are selected. For an example of the Java code that is generated for selected elements, see the link at the end of the topic.
- Click Finish. The wizard creates a plug-in project for the new user-written rule, adds the project to the Package Explorer view, and opens the manifest file in the plug-in manifest editor.
- If you did not already open the Plug-in Development perspective, open it when prompted.
- Close the plug-in manifest editor.
Results
The wizard also generates a Java class for implementing a user-written rule. See the related links at the end of the topic.