/**
* @param result
* @return
*/
private StyleRange[] convertReadOnlyRegions(StyleRange[] result, int start, int length) {
IStructuredDocument structuredDocument = getDocument();
/**
* (dmw) For client/provider simplicity (and consistent look and feel)
* we'll handle readonly regions in one spot, here in the Highlighter.
* Currently it is a fair assumption that each readonly region will be
* on an ITextRegion boundary, so we combine consecutive styles when
* found to be equivalent. Plus, for now, we'll just adjust
* foreground. Eventually will use a "dimming" algrorithm to adjust
* color's satuation/brightness.
*/
if (structuredDocument.containsReadOnly(start, length)) {
// something is read-only in the line, so go through each style,
// and adjust
for (int i = 0; i < result.length; i++) {
StyleRange styleRange = result[i];
if (structuredDocument.containsReadOnly(styleRange.start, styleRange.length)) {
adjustForeground(styleRange);
}
}
}
return result;