If the built-in form controls are not sufficient for your needs, you can implement custom form controls in Java.
Sample Java code for a custom combo box form control implementation 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);
}
If the custom form control is intended to work in the Oxygen XML Editor standalone distribution, the declaration of swtEditorClassName is not required. The renderer (the class that draws the value) and the editor (the class that edits the value) have different properties because you can present a value in one way and edit it in another.
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"
)
}
The oxy_editor function can receive other functions as parameters for obtaining complex behaviors.
link:before{
content: "Managed by:"
oxy_editor(
type, combo,
edit, "@manager",
values, oxy_xpath('string-join(//@id , ",") '));