public int getIndex() { return index.get(); }
public ParagraphBox(int index, Paragraph<S> par, BiConsumer<Text, S> applyStyle) {
this.getStyleClass().add("paragraph-box");
this.text = new ParagraphText<>(par, applyStyle);
this.index = new SimpleIntegerProperty(index);
getChildren().add(text);
graphic = EasyBind.combine(graphicFactory, this.index, (f, i) -> f != null ? f.apply(i.intValue()) : null);
graphic.addListener((obs, oldG, newG) -> {
if(oldG != null) {
getChildren().remove(oldG);