On Mon, 19 Aug 2024 05:05:08 GMT, Robert Lichtenberger <rlich...@openjdk.org> wrote:
>> Correct, this is just a demo. >> >> The information passed to the **SyntaxDecorator** interface should be >> sufficient to support any "real" syntax, at least I hope it is. We are >> passing the model to each method, so it can re/construct the syntax or cache >> it as needed. > > Consider this situation: When a user types some text into paragraph 2, it may > change the styling in paragraph 2, 3, 4, ... > Will the createRichParagraph - method be called for each paragraph after each > typed character? That would probably be inefficient; On the other hand, if it > is only called for the paragraph the user typed in, that may not be enough. In this case the model fires a change event which defines the affected area. The view (the skin) determines which visible elements need to be updated, by calling StyledTextModel::getParagraph(). I don't think there will be efficiency issues because 1. these visuals are likely to be updated anyway 2. the number of requested paragraphs is limited by the size of the sliding window (i.e. screen size + some margin) ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1722047884