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: