Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Problems with published StyledText API & documentation

Knut Radloff wrote:
Michael,
the default line styler that you use when you manage styles using the StyledText API maintains styles relative to the text vs. fixed to the range that was given in the style. This is in fact important information

Thank you for the detailed response. You answered all of my questions perfectly.

Have you considered implementing your own LineStyleListener instead of using API to update the styles in the StyledText widget? Styles that are derived from dynamic data suggest investigating a custom LineStyleListener implemention. Since you need to update styles based on syntax changes you may gain performance and save memory by not storing any styles but instead generating them whenever they are requested in the LineStyleListener. This decision depends on how cheap it is to generate styles for a given line based on your syntax tree.

Good advice. This is, indeed, the direction I am taking. The only problem is that JFace seems to have been designed mostly with the setStyleRange() API in mind rather than the LineStyleListener API, but I'm working through it. :)

Michael



Back to the top