Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Clearing the line style cache when using LineStyleListener

Hi All,

I am working on a source code editor in which I need to manage a large amount of bullets.  I've been experimenting with using a LineStyleListener to manage the styles and bullets for this use case, as it seems to scale better for this particular use case as i only need to detect, draw, and manage bullets on a lazy, line by line basis.

The one issue I have remaining is supporting re-styling lines as Annotations are added and removed from the source code editor.   For example, if a feature like Highlight Occurrences adds annotations to 100 lines in  a large file, the only mechanism i can find to trigger invalidating the presentation of those lines is to call getTextWidget().redrawRange() from the first annotated line to the last annotated line.   The problem with using this method is that it bypasses the scalability benefits of only calculating the styling needed for the lines visible in the viewer, and in large files can cause a UI freeze.

What I really want to do is repaint the lines that are visible in the viewer and clear out the cached line styles affected by the annotation changes.  Just calling redraw() on its own will update the presentation of the visible lines, but scrolling down may re-display stale annotation text styles or not display annotation text styles that should be there.  

Anyone have ideas on how i can clear out the cached line styles that i want re-calculated the next time they are scrolled into the viewers? (without using the non-visible methods in StyledTextRenderer?)

    thanks,

    Jeremy Flicker
    Rational Developer for System z Development
    IBM Software Group, Durham, NC

Back to the top