Styled Text for EMF generated editors? [message #622292] |
Tue, 09 March 2010 10:19  |
Eclipse User |
|
|
|
Hi guys,
Is it possible to somehow use StyledText for the labels in the EMF generated editors. I would like to have different colors for the different labels and/or different parts of the labels (e.g. like in the OutlineView for a Java file, one can see:
getText(Object): String
where getText(Object) is in black color and String is in grey color)
I searched a lot and could not find any information about it, neither any example which had this feature. So I guess the answer is no, but as I believe that would significantly improve the visual representation of information, I decided to ask just in case.
Cheers,
Atanas
|
|
|
|
Re: Styled Text for EMF generated editors? [message #622302 is a reply to message #622292] |
Wed, 10 March 2010 04:25  |
Eclipse User |
|
|
|
Hi Atanas,
you simply need to provide a "StyledLabelProvider" wrapping/extending
the generated AdapterFactory based one. There you have the freedom to
implement the IFontProvider, IColorProvider and what else interfaces as
your controls requires/supports. This styled label provider may know its
usage (e.g. outline, editor etc.). You can combine this strategie as
well with the CommonNavigators decoration technique.
Sven
PS: (advertising)
We did this way in the emft.mtf project (former flowr.org) and provided
an extension point allowing the style customization for dedicated items
or usages (we named this usecase).
|
|
|
Powered by
FUDForum. Page generated in 0.26621 seconds