To support checker configuration from GUI, an editor is required. We are going to create a simple editor with three radio buttons to set the preferred behavior. The options will be "Reactant Side", "Product Side", and "Both Sides" respectively. The class is placed to the same package as the checker class is.
Extend the DefaultCheckerEditor
class, create a JPanel
with some JRadioButton
instances, and bind the radio buttons to the Checker
instance.
Overriding getCustomComponent
method will add the JPanel
to the editor, while getEditorComponent
sets up the editor to represent the passed Checker’s state. Changing the radio buttons will alter the state of the Checker.
Download the example and find "DuplicateAtomMapCheckerEditor.java".
The new editor can be attached to the checker by adding a new option to the @CheckerInfo
annotation in DuplicateAtomMapChecker
class.
Create a new JAR file, and export both DuplicateAtomMapChecker
and DuplicateAtomMapCheckerEditor
classes. Replace the previously generated JAR file with this one. Overwrite the duplicateatommapchecker.jar in home/MyCustomCheckers folder.
The new editor is available and works in all Structure Checker related Chemaxon products.