Sample tags for editor extensions

Use the sample tags for preprocessor, category, and proposal computer extensions to add extensions to plugin.xml.

Preprocessor extension

The com.ibm.systemz.editor.preprocessorBehavior extension point supports the contribution of an editor preprocessor behavior that is capable of analyzing an IDocument and identifying the location and translation of preprocessor statements in it. The following code sample shows the tags for a preprocessor extension:
<extension
      id="extensionIdentifier"
      name="extensionName"
      point="com.ibm.systemz.editor.preprocessorBehavior">
   <preprocessorBehavior
         class="className">
      <language
         type="language">
      </language>
   </preprocessorBehavior>
</extension>
id="extensionIdentifier"
An optional identifier of the extension instance.
name="extensionName"
The name of the preprocessor behavior to be displayed in the user interface. This name is displayed in the Preprocessor Extension list of the Editor Configurations page in the property group editor.
point="com.ibm.systemz.editor.preprocessorBehavior"
The fully qualified identifier of the target extension point.
class="className"
A preprocessor behavior that is capable of analyzing an IDocument and identifying the location and translation of preprocessor statements in it. Specify the name of a class that implements the com.ibm.systemz.common.editor.extensionpoints.preprocessor.IPreprocessorBehavior extension point.
type="language"
A programming language that is supported by a preprocessorBehavior. A single preprocessor behavior can support COBOL or PL/I. Specify either COBOL or PLI. To register an extension that supports both COBOL and PL/I create two entries in plugin.xml for the extension: one that specifies type="COBOL" and one that specifies type="PLI".
The following code sample shows an example of a preprocessor extension:
<extension
        id="cobol.xml.preprocessor"
        name="COBOL XML Preprocessor"
        point="com.ibm.systemz.editor.preprocessorBehavior">
    <preprocessorBehavior
            class="com.ibm.example.ExampleCobolXMLPreprocessor">
        <language
            type="COBOL">
        </language>
    </preprocessorBehavior>
</extension>

Category extension

The com.ibm.systemz.editor.completionProposalComputer extension point supports the contribution of completion proposal categories and computers to participate in the content assist process for the COBOL, PL/I, and JCL languages. The following code sample shows the tags for a category extension:
<extension
    id="categoryIdentifier"
    name="categoryName"
    point="com.ibm.systemz.editor.completionProposalComputer">
    <proposalCategory
        icon="filePath"
        contributesToDefault="true | false">
        <language type="language">
        </language>
    </proposalCategory>
</extension> 
id="categoryIdentifier"
An optional identifier of the extension instance.
name="categoryName"
The name of the category to be displayed in the user interface. This name is displayed in the status area of the content assist window.
point="com.ibm.systemz.editor.completionProposalComputer"
The fully qualified identifier of the target extension point.
icon="filePath"
The icon to be displayed display for the category.
contributesToDefault="true | false">
If true, the proposals are added to the Default Proposals list and to this category.
type="language"
A programming language that is supported by the category. Specify either COBOL, JCL, or PLI.
The following code sample shows an example of a category extension:
<extension
    id="COBOL.XML.CATEGORY"
    name="XML Proposals"
    point="com.ibm.systemz.editor.completionProposalComputer">
    <proposalCategory
        icon="icons/xml_ext.gif"
        contributesToDefault="true">
        <language type="COBOL">
        </language>
    </proposalCategory>
</extension> 

Proposal computer extension

The com.ibm.systemz.editor.completionProposalComputer extension point supports the contribution of completion proposal categories and computers to participate in the content assist process for the COBOL, PL/I, and JCL languages. The following code sample shows the tags for a proposal computer extension:
<extension
    id="computerIdentifier"
    name="computerName"
    point="com.ibm.systemz.editor.completionProposalComputer">
    <completionProposalComputer
        categoryId="categoryIdentifier"
        class="className">
    </completionProposalComputer>
</extension>
id="computerIdentifier"
An optional identifier of the extension instance.
name="computerName"
The name of the proposal computer.
point="com.ibm.systemz.editor.completionProposalComputer"
The fully qualified identifier of the target extension point.
categoryId="categoryIdentifier"
The fully qualified identifier of a proposalCategory. A proposal computer can contribute to a defined category or to six built-in categories:
  • com.ibm.systemz.editor.cobol.defaultProposalCategory: Default Proposals for COBOL files.
  • com.ibm.systemz.editor.cobol.templateProposalCategory: Template Proposals for COBOL files.
  • com.ibm.systemz.editor.pli.defaultProposalCategory: Default Proposals for PL/I files.
  • com.ibm.systemz.editor.pli.templateProposalCategory: Template Proposals for PL/I files.
  • com.ibm.systemz.editor.jcl.defaultProposalCategory: Default Proposals for JCL files.
  • com.ibm.systemz.editor.jcl.templateProposalCategory: Template Proposals for JCL files.
class="className"
The name of the class that implements the contributed proposal computer. The class must be public and implement com.ibm.systemz.common.editor.extensionpoints.ICompletionProposalComputer. It must have a public 0-argument constructor.
The following code sample shows an example of a proposal computer extension:
<extension
    id="COBOL.XML.COMPUTER"
    name="XML Proposal Computer"
    point="com.ibm.systemz.editor.completionProposalComputer">
    <completionProposalComputer
        categoryId="com.example.extensions.COBOL.XML.CATEGORY"
        class="com.example.extensions.CobolXMLProposalComputer">
    </completionProposalComputer>
</extension>

Feedback