this.cajoleService = service;
this.cajaFrame = cajaFrame;
}
private void appendToDocument(HTML target, PluginContext pluginContext, CajolerResponse response) {
DivElement domitaVdocElement = Document.get().createDivElement();
domitaVdocElement.setClassName("innerHull");
target.getElement().setInnerHTML("");
target.getElement().setClassName("outerHull");
target.getElement().appendChild(domitaVdocElement);
initializeDoodadEnvironment(
cajaFrame, domitaVdocElement, pluginContext.getJSOInterface());
// Render HTML
domitaVdocElement.setInnerHTML(response.getHtml());
// Inject JS
Document cajaFrameDoc = cajaFrame.getContentDocument();
cajaFrameDoc.getBody().appendChild(cajaFrameDoc.createScriptElement(response.getJs()));
}