Creating custom form controls

Post here questions and problems related to oXygen frameworks/document types.
DirkDubois
Posts: 22
Joined: Thu Jan 30, 2014 11:53 pm
Contact:

Creating custom form controls

Post by DirkDubois »

Hello,

I have been investigating the built in form controls that can be provided via css to the Oxygen Author users. However, I wish to replace an entire set of elements by a custom form that my users can fill out. The nature of the data being selected makes it impossible to do just with CSS. Consequently, I want to create a customr form control as described here: https://www.oxygenxml.com/doc/versions/ ... trols.html

I already have a development environment setup in eclipse and have a plugin that provides toolbar functionality available for debugging.

After reading the section and looking at other examples on the forum, I realize I need to create two classes: ro.sync.ecss.extensions.api.editor.InplaceRenderer and a ro.sync.ecss.extensions.api.editor.InplaceEditor. I don't understand what the difference is between these two classes and what they are supposed to be doing. I know that the InplaceEditor provides the custom form object that the user interacts with, as seen in this example: http://www.oxygenxml.com/forum/post3053 ... ols#p30533.

However, what is the purpose of the InplaceRenderer? How would I go about setting up a custom form control that would fill out an entire structure? Are there any examples that show how a more complex custom form is created? Thank you for all your help.

Sincerely,
Dirk
XML Programmer, Technical Writing
Matrox Imaging
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Creating custom form controls

Post by Radu »

Hi Dirk,

Indeed you need two java implementations, one for the editor and one for the renderer.
When you open the XML document and you just scroll through it or work without interacting with any form control in the page, the renderers will be used to visually present the form control in the document.
The renderer needs to be Java Swing based.
When you click inside a form control or you use TAB to give focus to it, the renderer for that form control is replaced with the editor which is actually added there and interacts with you until you click in another location in the document to stop the editing. The editor needs to be SWT based.

If you email us (support@oxygenxml.com) I could try to give you some sample Java sources for a renderer and SWT-based editor to get you started.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply