You can add a user-written rule to an
existing custom-rule project.
About this task
After you generate a plug-in project for a user-written rule,
you can add other user-written rules to the same project.
Procedure
To add a user-written rule to an existing plug-in project:
- Open the Plug-in Development perspective.
- In the Package Explorer view, expand
the user-written rule plug-in project to which you want to add a rule.
- Right-click plugin.xml and click .
- On the Extensions tab of the editor,
click Add. The New
Extension wizard opens.
- In the left pane of the Extension Wizards tab,
click Code Review Templates and then in the
right pane click Custom COBOL Code Review Rule or Custom PL/I Code
Review Rule.
- Click Next.
- In the Rule class field, enter a
rule class name for the new rule. Depending on your
plug-in, you might want the new rule class name to indicate how the
new class is related to existing classes in the plug-in. For example,
rule classes for the Data division might be named datadivision.rule0001 and datadivision.rule0002
- In the Rule label field, enter a
label for the new rule.
- 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.
- Expand the Program tree and select
the COBOL or PL/I language
elements that the implementation code for the new rule must check
for violations. The default is that no elements are selected.
- Click Finish. A
source code file is generated for the new class, and the plugin.xml file
is updated with an extension for the new rule. For more information
about the resources that are generated for a plug-in, see the links at the end of the topic.
- In the plug-in manifest editor, save the new state of the
plug-in.
What to do next
If the plug-in is installed into the development workbench
environment, then you must update the feature, the update site, and
the development workbench environment to install the new rule. For
information about these tasks, see
the links at
the end of the topic.