Skip to content

Coping style spans #52

@ghost

Description

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions