use of org.w3c.dom.html.HTMLDocument in project Gargoyle by callakrsos.
the class WebViewConsole method exec.
private void exec() {
try {
WebEngine engine = wb.getEngine();
Object obj = engine.executeScript(txtCommand.getText());
// JSObject obj = (JSObject)
if (obj instanceof String) {
txtResult.appendText(obj.toString());
} else if (obj instanceof HTMLDocument) {
txtResult.appendText(toHtmlElement((HTMLDocument) obj));
} else if (obj instanceof Node) {
Node n = (Node) obj;
txtResult.appendText(toNodeInfo(n));
} else {
txtResult.appendText(obj.toString());
}
txtResult.appendText("\n");
} catch (NullPointerException e) {
txtResult.appendText("undefinded");
txtResult.appendText("\n");
} catch (Exception e) {
txtResult.appendText(e.getMessage());
txtResult.appendText("\n");
}
}
Aggregations