See information about the latest product version
Java interfaces for user-defined editors
Use Java™ interfaces to write code for user-defined editors in your user-defined patterns.
PatternPropertyEditor interface
The PatternPropertyEditor interface implements the methods shown in the following table:Method | Description |
---|---|
void configureEditor(PatternPropertyEditorSite site, boolean required, String configurationValues) | Is called automatically when an instance of
the user-defined pattern is opened for editing. This method takes
the following parameters, which are passed automatically by the main
pattern instance editor:
|
createControls(Object parent) | Is called automatically when an instance of
the user-defined pattern is opened for editing. This method takes
the parameter, parent, which is passed from the
pattern instance editor. Write code for this method to create the controls and layout of your user-defined editor. |
void setEnabled(boolean enabled) | Is called automatically when the pattern parameter
is enabled or disabled by an enabling XPath expression. This method
takes the parameter, enabled, which is passed from
the pattern instance editor. The parameter is set to true if
the pattern parameter is enabled and false if the
pattern parameter is disabled. Write code for this method to enable or disable the controls of your user-defined editor, depending on the value passed from the pattern instance editor. |
String getValue() | Is called automatically after your user-defined
editor code calls valueChanged(). This method returns
a value from the user-defined editor to the main pattern instance
editor. The returned value is stored as the value of the pattern parameter. Write code for this method to return the current value of the pattern parameter from the user-defined editor. |
void setValue(String value) | Is called automatically when an instance of
the user-defined pattern is opened for editing. This method takes
the parameter, value, which is the value of the
pattern parameter that is stored in the pattern instance editor. This
is the default value of the parameter, or the value that was saved
after the pattern instance is configured. Write code for this method to initialize values in the user-defined editor, based on the value of the pattern parameter that is stored in the pattern instance editor. |
String isValid() | Is called automatically after your user-defined
editor code calls valueChanged(). Write code for this method to validate the value of the pattern parameter and return null if the value is valid or an error message if the value is not valid. The error message is displayed in the pattern instance editor. |
void notifyChanged(String parameterId, String value) | Is called automatically when the value of a
pattern parameter that is set to send change notifications changes.
For more information about setting a pattern parameter to send change
notifications to your user-defined editor, see Configuring a user-defined editor.
This method takes the following parameters, which are passed automatically
by the main pattern instance editor:
Write code for this method to modify the behavior of your editor or to update the value of the pattern parameter to which the user-defined editor is assigned, if required. |
PatternPropertyEditorSite interface
The PatternPropertyEditorSite interface implements the method shown in the following table:Method | Description |
---|---|
void valueChanged() | Sends a notification to the pattern instance
editor when the value of the pattern parameter that uses the user-defined
editor changes. The new value is then used to update any XPath expressions
or user-defined editors that use this pattern parameter. Call this method from within a listener on the controls of your user-defined editor. Call this method on the PatternPropertyEditorSite object, site, that is passed to the configureEditor() method. |