StyleAnnotationHandler.register(registries);
}
/** For testing purposes only. */
public static ContentDocument createTestDocument() {
ContentDocument doc = new ContentDocument(DocumentSchema.NO_SCHEMA_CONSTRAINTS);
Registries registries = Editor.ROOT_REGISTRIES.createExtension();
for (String t : new String[] {"q", "a", "b", "c", "x"}) {
final String tag = t;
registries.getElementHandlerRegistry().registerRenderer(tag,
new Renderer() {
@Override
public Element createDomImpl(Renderable element) {
return element.setAutoAppendContainer(Document.get().createElement(tag));
}
});
}
doc.setRegistries(registries);
Editor editor = getMinimalEditor();
editor.setContent(doc);
return doc;
}