In the previous lessons you configured the extension points;
now, you will create the Java™ classes
needed to handle the validation of the parameters and actions.
Tip: As you create these Java classes, they will each have to implement
or extend certain interfaces or classes respectively. To determine
what classes or interfaces need to be included, you can right click
on the extension in the Plug-in Editor and
select Show Description. The description of
the extension will open in the editor. If you scroll down to the API
Information heading, you will find the classes or interfaces
the class needs to use in conjunction with the extension point.
- Start by creating the class that will be used with the parameterValidator extension
point. This class will be responsible for checking to make sure the
value entered into the value parameter follows the
specifications outlined in this sample. In the Package
Explorer view right click on the com.ibm.carma.plugin.howto plug-in
project, and select New > Package.
- In the New Java Package dialog box
that opens, enter com.ibm.carma.plugin.howto.action as
the name for the package. Click Finish. You
should see the package created under your Eclipse plug-in project.
- Now, right click on the com.ibm.carma.plugin.howto.action package
you just created, and select New > Class.
The New Java Class dialog box will open.
- Enter ValueParamValidator in the Name text
field.
- To the right of the Interfaces click
the Add button. In the Implemented
Interfaces Selection dialog box that opens, filter for
the interface IParameterValidator. Click Finish to
close the New Java Class dialog box and open
the class in the editor.
- Now, you will create the second Java class that will be responsible for handling
the verification of the HowTo action. Right click on the com.ibm.carma.plugin.howto.action package
and select New > Java Class.
- In the New Java Class dialog box
that opens enter the name of the class to be, ActionValidator and
add the interface IActionValidator. Click Finish to
close the dialog box and create the class.
- Finally, create the last Java class
following the above steps and by defining a name of CheckboxOptionControl.
Click on the Browse button to the right of
the Superclass text field. The Superclass
Selection Dialog Box should open. Filter for the class,AbstractCustomParameterControl,
select it, and click OK.
- Click Finish to close the New
Java Class dialog box and open the class in the editor.
You have now created the classes that will handle the verification
features offered by the extension points.