Form controls on (simple)table elements.

We are writing a plugin based addon for oXygen that uses custom form controls to provide a set of alternatives for specified element, text, and attribute nodes. Here, a form control button is associated with each element or text node that has alternative versions, where as attribute change form control buttons are associated with their containing element. The initial testing of this form control approach is producing reasonable results, however when we associate a button with a DITA simpletable element no form control appears. I have looked to see if there is any documentation on the interaction between table elements and form controls, but found nothing that discusses this. Does anybody else have experience with associating custom form controls with table elements? Any insights welcome. Best regards, Anthony. PS: Note that due to a form-control/StyleFilter interaction issue with oXygen Editor 15.1 and 15.2, which will be fixed in the next release, we are currently developing our plugin using oXygen 15.0. -- Michael Anthony Smith Senior Software Engineer DeltaXML Ltd "Experts in information change" T: +44 1684 532 140 E: anthony.smith@deltaxml.com W: http://www.deltaxml.com Malvern Hills Science Park, Malvern, Worcs, WR14 3SZ, UK Registered in England 02528681 Reg. Office: Monsell House, WR8 0QN, UK

Hello, The table layout imposes a few restrictions. You must put the button (actually any static content) on a BEFORE/AFTER pseudo element and also very important, the "display" property for the element must be set to "block": @Override public Styles filter(Styles styles, AuthorNode authorNode) { if (authorNode.getType() == AuthorNode.NODE_TYPE_PSEUDO_ELEMENT && PseudoElementInterface.BEFORE.equals(authorNode.getName())) { AuthorElement realElement = (AuthorElement) authorNode.getParent(); AttrValue attribute = realElement.getAttribute("class"); if (attribute.getValue().contains(" topic/simpletable ")) { // The Before element of a simple table. It must be a block if it is to be rendered. styles.setProperty(Styles.KEY_DISPLAY, "block"); Map<String, Object> properties = new HashMap<String, Object>(); properties.put(InplaceEditorCSSConstants.PROPERTY_TYPE, InplaceEditorCSSConstants.TYPE_BUTTON); properties.put(InplaceEditorCSSConstants.PROPERTY_ACTION_ID, "insert.table"); StaticContent editorContent = new EditorContent(properties); styles.setProperty(Styles.KEY_MIXED_CONTENT, new StaticContent[] {editorContent}); } } return styles; } Best regards, Alex -- Alex Jitianu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 07-Apr-14 12:19 PM, Michael Anthony Smith wrote:
We are writing a plugin based addon for oXygen that uses custom form controls to provide a set of alternatives for specified element, text, and attribute nodes. Here, a form control button is associated with each element or text node that has alternative versions, where as attribute change form control buttons are associated with their containing element.
The initial testing of this form control approach is producing reasonable results, however when we associate a button with a DITA simpletable element no form control appears. I have looked to see if there is any documentation on the interaction between table elements and form controls, but found nothing that discusses this. Does anybody else have experience with associating custom form controls with table elements? Any insights welcome.
Best regards, Anthony.
PS: Note that due to a form-control/StyleFilter interaction issue with oXygen Editor 15.1 and 15.2, which will be fixed in the next release, we are currently developing our plugin using oXygen 15.0. *--* *Michael Anthony Smith* Senior Software Engineer
*DeltaXML Ltd*/"Experts in information change"/ * * *T*:+44 1684 532 140 *E*:anthony.smith@deltaxml.com <mailto:anthony.smith@deltaxml.com> *W*:http://www.deltaxml.com <http://www.deltaxml.com/> Malvern Hills Science Park, Malvern, Worcs, WR14 3SZ, UK Registered in England 02528681 Reg. Office: Monsell House, WR8 0QN, UK
_______________________________________________ oXygen-sdk mailing list oXygen-sdk@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-sdk

Hi Alex, Thanks for the sample code, I was able to successfully adapt it for my more complex use-case (involving retrieval of information from custom processing instructions that were associated with the table element). Best regards, Anthony. -- Michael Anthony Smith Senior Software Engineer DeltaXML Ltd "Experts in information change" T: +44 1684 532 140 E: anthony.smith@deltaxml.com W: http://www.deltaxml.com Malvern Hills Science Park, Malvern, Worcs, WR14 3SZ, UK Registered in England 02528681 Reg. Office: Monsell House, WR8 0QN, UK On 7 Apr 2014, at 12:00, Alex Jitianu <alex_jitianu@sync.ro> wrote:
Hello,
The table layout imposes a few restrictions. You must put the button (actually any static content) on a BEFORE/AFTER pseudo element and also very important, the "display" property for the element must be set to "block":
@Override public Styles filter(Styles styles, AuthorNode authorNode) { if (authorNode.getType() == AuthorNode.NODE_TYPE_PSEUDO_ELEMENT && PseudoElementInterface.BEFORE.equals(authorNode.getName())) { AuthorElement realElement = (AuthorElement) authorNode.getParent(); AttrValue attribute = realElement.getAttribute("class"); if (attribute.getValue().contains(" topic/simpletable ")) { // The Before element of a simple table. It must be a block if it is to be rendered. styles.setProperty(Styles.KEY_DISPLAY, "block");
Map<String, Object> properties = new HashMap<String, Object>(); properties.put(InplaceEditorCSSConstants.PROPERTY_TYPE, InplaceEditorCSSConstants.TYPE_BUTTON); properties.put(InplaceEditorCSSConstants.PROPERTY_ACTION_ID, "insert.table"); StaticContent editorContent = new EditorContent(properties);
styles.setProperty(Styles.KEY_MIXED_CONTENT, new StaticContent[] {editorContent}); } } return styles; } Best regards, Alex -- Alex Jitianu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 07-Apr-14 12:19 PM, Michael Anthony Smith wrote:
We are writing a plugin based addon for oXygen that uses custom form controls to provide a set of alternatives for specified element, text, and attribute nodes. Here, a form control button is associated with each element or text node that has alternative versions, where as attribute change form control buttons are associated with their containing element.
The initial testing of this form control approach is producing reasonable results, however when we associate a button with a DITA simpletable element no form control appears. I have looked to see if there is any documentation on the interaction between table elements and form controls, but found nothing that discusses this. Does anybody else have experience with associating custom form controls with table elements? Any insights welcome.
Best regards, Anthony.
PS: Note that due to a form-control/StyleFilter interaction issue with oXygen Editor 15.1 and 15.2, which will be fixed in the next release, we are currently developing our plugin using oXygen 15.0. -- Michael Anthony Smith Senior Software Engineer
DeltaXML Ltd "Experts in information change"
T: +44 1684 532 140 E: anthony.smith@deltaxml.com W: http://www.deltaxml.com Malvern Hills Science Park, Malvern, Worcs, WR14 3SZ, UK Registered in England 02528681 Reg. Office: Monsell House, WR8 0QN, UK
_______________________________________________ oXygen-sdk mailing list oXygen-sdk@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-sdk
_______________________________________________ oXygen-sdk mailing list oXygen-sdk@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-sdk
participants (2)
-
Alex Jitianu
-
Michael Anthony Smith