If the built-in form controls are not sufficient for your needs, you can implement custom form controls in Java.
The following is a sample Java code for implementing a custom combo box form control that inserts an XML element in the content when the editing stops:
public class ComboBoxEditor extends AbstractInplaceEditor {
/**
* @see ro.sync.ecss.extensions.api.editor.InplaceEditor#stopEditing()
*/
@Override
public void stopEditing() {
Runnable customCommit = new Runnable() {
@Override
public void run() {
AuthorDocumentController documentController = context.getAuthorAccess().getDocumentController();
documentController.insertXMLFragment( "<custom/>", offset);
}
};
EditingEvent event = new EditingEvent(customCommit, true);
fireEditingStopped(event);
}
The custom form controls can use any of the predefined properties of the built-in form controls, as well as specified custom properties.
This following is an example of how to specify a custom form control in the CSS:myElement {
content: oxy_editor(
rendererClassName, "com.custom.editors.CustomRenderer",
swingEditorClassName, "com.custom.editors.SwingCustomEditor",
swtEditorClassName, "com.custom.editors.SwtCustomEditor",
edit, "@my_attr",
customProperty1, "customValue1",
customProperty2, "customValue2"
)
}