Home » Modeling » TMF (Xtext) » a string representation for program elements (EObjects)
| |
Re: a string representation for program elements (EObjects) [message #649967 is a reply to message #649829] |
Fri, 21 January 2011 08:40 |
|
On 01/20/2011 06:02 PM, Christian Dietrich wrote:
> Hi,
>
> i am not quite sure if this is what you need but you could give
>
> org.eclipse.xtend.typesystem.emf.EObjectType.toString(EObjec t)
>
>
I'll try
but is that injectable?
as I said in my first post, I'd like to have something similar to
LabelProvider, say, e.g., StringRepresentationProvider, to be used in
the non-ui plugin, that users can customize.
Of course, it's quite easy to implement it (and I already have
something), but I was wondering whether xtext already had something
similar, which already uses, like LabelProvider, just not to re-invent
the wheel ;)
thanks
Lore
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| |
Re: a string representation for program elements (EObjects) [message #649976 is a reply to message #649800] |
Fri, 21 January 2011 09:24 |
Jan Koehnlein Messages: 760 Registered: July 2009 Location: Hamburg |
Senior Member |
|
|
EmfFormatter dumps EObject trees in a readable way.
We don't have a non-UI service for configurable textual representations
of EObjects. But it should be easy to implement (PolymorphicDispatch or
EmfSwitch). If you create an interface for that you can easily bind
whatever implementation you want by means of Guice.
Am 20.01.11 16:33, schrieb Lorenzo Bettini:
> Hi
>
> xtext already relies on customizable representations of a program
> element (EObject) for the ui, such as the label provider and the content
> outline that can be customized and injected...
>
> is there something similar for simple string representations of EObjects
> of the program? Something to be used not in the ui, but just to have a
> string representation of a program element?
>
> E.g., to print something on the console, or to generate proper error
> strings in the validator?
>
> thanks in advance
> Lorenzo
>
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
---
Get professional support from the Xtext committers at www.typefox.io
|
|
|
Goto Forum:
Current Time: Thu Apr 25 18:54:52 GMT 2024
Powered by FUDForum. Page generated in 0.02942 seconds
|