Try OpenEdge Now
skip to main content
Application Developer's Guide
Using the Rule Wizard framework : How to write additional macros and editors
 

How to write additional macros and editors

You may add custom macros and editors to the Rule Wizard Framework by writing specific Java classes. Custom macro classes must implement the MacroDataIF interface. DefaultMacroData is an abstract class which implements some of the members of MacroDataIF is provided in order to speed up development. In addition, custom editor classes implement the EditorIF interface and derive from the JPanel swing class. Use DefaultEditor, an abstract class which derives from JPanel and implements some EditorIF members, as the base class for custom editors.
In order to use a custom macro, specify the fully qualified class name in the class attribute of the <macro> tag instead of using the type attribute.
Usually the Java class implementing an editor is inferred by examining the type of edited macro. The <editor> tag also supports a class attribute intended for use when you want to explicitly specify the Java class.
The next two sections provide sample macro and editor implementations for the boolean type.
* Sample macro implementation
* Sample editor implementation