[oXygen-sdk] Custom forms sample in Author development guide

Alex Jitianu alex_jitianu at sync.ro
Fri Feb 28 06:30:13 CST 2014


Hello,

The SimpleURLChooserEditor example in the SDF is the Java implementation 
of a sample form control. It is not used in the SDF project, however you 
can write a simple CSS file to add it on some element like this:

myElement {
     content: oxy_editor(
         rendererClassName, 
"ro.sync.ecss.extensions.commons.editor.SimpleURLChooserEditor",
         swingEditorClassName, 
"ro.sync.ecss.extensions.commons.editor.SimpleURLChooserEditor",
         edit, "@my_attr",
         columns, 20
     )
}

The SimpleURLChooserEditor is present in Oxygen's classpath and so the 
previous CSS is all you need. If you implement your own custom form 
control there is one additional step to be performed: you must pack it 
inside a JAR file and add it in the framework's classpath [1].

The steps required for a custom form controls are:
- download the authorSDK [2]
- implement the custom form control by extending 
ro.sync.ecss.extensions.api.editor.InplaceEditorRendererAdapter. You can 
also take a look at 
ro.sync.ecss.extensions.api.editor.AbstractInplaceEditor (it offers some 
default implementations and some listeners management)
- pack the previous implementation in a JAR
- go to Oxygen and add the JAR inside the Classpath tab of the framework [3]
- bind the form control in the CSS as described both in [4] and also above.

[1] 
http://www.oxygenxml.com/doc/ug-editor/index.html#topics/document-type-classpath-tab.html
[2] http://oxygenxml.com/download_sdk.html?file=oxygenAuthorSDK.zip
[3] 
http://www.oxygenxml.com/doc/ug-editor/index.html#topics/document-type-classpath-tab.html
[4] 
http://www.oxygenxml.com/doc/ug-editor/index.html#topics/implementing-custom-form-controls.html

Best regards,
Alex
-- 
Alex Jitianu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com  

On 27-Feb-14 8:00 PM, Nathan wrote:
> Hi,
>   I am trying to implement a custom form control and I see that the 
> samples of the SDF contains the java source of the 
> SimpleURLChooserEditor.
> However, I don't see anything in the SDF css calling it like it 
> mentions in the dev guide - 
> "http://www.oxygenxml.com/doc/ug-editor/topics/implementing-custom-form-controls.html". 
>
> I saw the blog post at "http://blog.oxygenxml.com/" but that did not 
> clarify things for me.
>   It would be great if I could get step-by-step instructions on how to 
> do this.
>
> Thanks,
> Nathan
>
>
> _______________________________________________
> oXygen-sdk mailing list
> oXygen-sdk at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-sdk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.oxygenxml.com/pipermail/oxygen-sdk/attachments/20140228/902a422c/attachment.html>


More information about the oXygen-sdk mailing list