StyledText.setStyleRanges

Sets styles to be used for rendering the widget content. All styles in the widget will be replaced with the given set of styles. <p> Note: Because a StyleRange includes the start and length, the same instance cannot occur multiple times in the array of styles. If the same style attributes, such as font and color, occur in multiple StyleRanges, <code>setStyleRanges(int[], StyleRange[])</code> can be used to share styles and reduce memory usage. </p><p> Should not be called if a LineStyleListener has been set since the listener maintains the styles. </p>

@param ranges StyleRange objects containing the style information. The ranges should not overlap. The style rendering is undefined if the ranges do overlap. Must not be null. The styles need to be in order. @exception SWTException <ul> <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> </ul> @exception IllegalArgumentException <ul> <li>ERROR_INVALID_RANGE when the last of the style ranges is outside the valid range (> getCharCount())</li> </ul>

@see #setStyleRanges(int[], StyleRange[])

Meta