Hi Tomas,
I am trying to implement a highlighting of a selection. so I get the stylespans of a styledDocument, then append to it another css piece of information.
like this:
originalStyleSpans=styledDoc.getStyleSpans(0);
modifiedHighlightSpans=styledDoc.getStyleSpans(0).mapStyles(css -> css + "-fx-effect: dropshadow(gaussian, red, 3, 1, 0, 0);");
so when I toggle, I use this or that stylespan by:
richTextArea.setStyleSpans(range.getStart(), modifiedHighlightSpans);
However, after I apply the modified style, I can get back to the original one. Does the mapStyles method create a new copy of the StyleSpan or alter it? How can I copy a stylespan?
Hi Tomas,
I am trying to implement a highlighting of a selection. so I get the stylespans of a styledDocument, then append to it another css piece of information.
like this:
so when I toggle, I use this or that stylespan by:
However, after I apply the modified style, I can get back to the original one. Does the mapStyles method create a new copy of the StyleSpan or alter it? How can I copy a stylespan?