See: Description
| Interface | Description |
|---|---|
| IlrSWTValueEditorComposite |
This interface should be implemented by Value Editors that provides a UI as a SWT Composite
|
| IlrSWTValueEditorDialog |
This interface should be implemented by Value Editors whose UI is a SWT Dialog.
|
| IlrValueEditor |
IlrValueEditor provides a mechanism to edit a lexical value in
rule editors. |
| IlrValueEditorComponent |
Provides the mechanism to edit a value with a graphical user interface.
|
| IlrValueEditorExtension |
An interface extension for a value editor that gives the editor access to the node (in the current syntax tree) when editing a value.
|
| IlrValueEditorListener |
Defines the interface for an object that listens for changes in an IlrValueEditor.
|
| Class | Description |
|---|---|
| IlrAbstractValueEditor |
IlrAbstractValueEditor provides a part of the implementation
of the IlrValueEditor interface. |
| IlrValueEditorEvent |
The value editor event class.
|
| IlrValueEditorFactory |
Provides the mechanism to retrieve a value editor with a unique key that represents the value editor.
|
| IlrValueEditorFactory.UIPlatform |
Represents an user interface platform
|
A value editor is a Java class that defines how to enter and display values of a particular type in a business rule. It allows you to edit a value and, if required, to specify a default value. It edits an object that represents the value, not the text. You can use a value editor with all types of rule editors (Intellirule Editor, Guided Editor, Web Guided Editor).
A value editor is associated with a value descriptor because, after editing the value, you must insert the text representing the value into the edited rule.
When you have created a value descriptor, you should then integrate it into Rule Studio,
Rule Team Server or Rule Solutions for Office, as appropriate. For more information,
see The following list shows the base class used to create a custom value
editor for the different products.
Customizing JRules > Customizing Rule Authoring > Tasks > Managing BOM
value types > Implementing a value editor > Integrating a value editor.
Code Example
The following code example shows a custom value editor:
public class ValueColorEditor extends IlrAWTValueEditor implements
ChangeListener {
private AbstractColorChooserPanel chooser;
public IlrValueDateEditor(IlrValueDescriptor valueDescriptor) {
super(valueDescriptor);
chooser = ColorChooserComponentFactory.getDefaultChooserPanels()[0];
// Gets the default chooser color panel
// Registers this as a color model listener
chooser.getColorSelectionModel().addChangeListener(this);
// Register a key listener to cancel editing when ESC is pressed
editor.registerKeyboardAction(new ActionListener() {
public void actionPerformed(ActionEvent e) {
fireEditionCanceled();
}
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
JComponent.WHEN_IN_FOCUSED_WINDOW);
}
// Returns the edited value
public Object getValue() {
return chooser.getColorSelectionModel().getSelectedColor();
}
// Sets the value to edit
public void setValue(Object value) {
chooser.getColorSelectionModel().setSelectedColor((Color) value);
}
// When the state has changed, stops the value editing
// to validate the new selection
public void stateChanged(ChangeEvent e) {
if (chooser.isShowing())
fireEditionStopped();
}
// Returns the user interface for editing the value
public Object getEditorComponent(IlrBRLRuleEditingContext context) {
Locale locale = context.getVocabulary().getLocale();
if (!locale.equals(editor.getLocale()))
chooser.setLocale(locale);
return chooser;
}
}
© Copyright IBM Corp. 1987, 2017