views:

98

answers:

1

Example. I have an XML document:

<document>
<region type="type1">text of region1
</region>
some simple text
<region type="type2">text of region2
</region>

And I want it to be presented as

text of region1
some simple text
text of region2

The basic Eclipse coloring works independent from folding, as I know. But I need text to be colored depending on the xml info. Or maybe I need something other, than folding? It's probably easier to just manipulate StyledText, but I need other Eclipse Editor functions to continue working.

=========
upd: Still no suggestions? Is it at least possible?
I've looked at projection, but... does text attributes directly accessible from this branch of editor?
upd: Maybe at least some thoughts/articles about custom projections?

A: 

I've implementet it via document listener service, ProjectionDocument.removeMasterDocumentRange and ProjectionDocument.getDocumentInformationMapping(). Coloring by SourceViewer.getTextWidget().setStyleRange(). There is a little problem if PresentationReconciler will be added, but since I know it, its safe.

Imaskar