I know how add new button to HTMLEditor, and I want set to my button action to paste some text in the current cursor position.
//HTMLEditor html;
//String IMAGE_URL = "http://...";
Node node = html.lookup(".top-toolbar");
if (node instanceof ToolBar) {
ToolBar bar = (ToolBar) node;
ImageView graphic = new ImageView(new Image(IMAGE_URL, 32, 32, true, true));
Button myButton = new Button("", graphic);
bar.getItems().add(myButton);
myButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent arg0) {
//needs code
}
});
}