Adding criteria to help content

This page will explain how to activate criteria. To enable criteria you need define which criteria are associated with each topic and also set preferences which tell the help system to show criteria. The association between criteria and topics can be either in a toc file or using a criteria provider class.

What are criteria?

Some topics of the plug-in might only be of interest to certain users, for example a topic may be specific to the linux platform. The document writer can define a criterion "platform" with values such as "linux", "windows" etc applied to different topics. The user can then filter the documentation to show only documents applicable to a specific platform.

How to define criteria in a table of contents file

When defining a table of contents file criteria information can be appended according to these steps:

For example:

 <toc href="tochref">
      <criteria  name="platform"  value="AIX"/>
      <criteria  name="platform"  value="Windows"/>
      <topic label="label1" href="href1">
          <criteria  name="platform" value="Windows"/>
      <topic label="label2" href="href2">
          <criteria name="platform" value="AIX"/>

Some rules to follow when adding criteria:

How to define criteria using a criteria provider

As an alternative to defining criteria in a table of contents file the extension point org.eclipse.criteriaProvider can be used to define a class which will associate criteria with topics. Criteria defined using this extension point will be merged with those defined in the table of contents and if multiple criteria providers are defined each will contribute to the criteria of an ITopic or IToc.

Criteria localization

The names and values of criteria can be localized. Follow these steps to add localization information for criteria:

How to set the preferences to enable criteria

Define the necessary preferences in your plugin customization file.

See Also:
The criteria definition extension point.
The criteria provider extension point.