Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Styled Text for EMF generated editors?
Styled Text for EMF generated editors? [message #622292] Tue, 09 March 2010 15:19 Go to next message
Atanas Pavlov is currently offline Atanas PavlovFriend
Messages: 10
Registered: October 2009
Junior Member
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 #622298 is a reply to message #622292] Tue, 09 March 2010 19:21 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Xtext supports StyledText all over the place. But I guess that's not
what you were asking for :-)

Sven

Atanas Pavlov schrieb:
> 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


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: Styled Text for EMF generated editors? [message #622302 is a reply to message #622292] Wed, 10 March 2010 09:25 Go to previous message
Sven Krause is currently offline Sven KrauseFriend
Messages: 119
Registered: July 2009
Senior Member
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).
Previous Topic:Styled Text for EMF generated editors?
Next Topic:xpand2::Type
Goto Forum:
  


Current Time: Tue Apr 23 09:56:00 GMT 2024

Powered by FUDForum. Page generated in 0.03482 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top