|
Re: Howto create a reference to an attribute? [message #1067084 is a reply to message #1067078] |
Fri, 05 July 2013 18:03 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Daniel,
Comments below.
On 05/07/2013 7:32 PM, Daniel Golesny wrote:
> Hi, I have an EClass "Person" that has several attributes (like name,
> age, etc.).
> And another EClass "PDFTemplate" (same model) has EClass children like
> HLine, VLine, Box, etc.
>
> I want a template sub-element "TextReference" that has a reference to
> one attribute of the Person.
You don't reference an attribute...
> My goal is to print the attribute to a PDF.
> I can't imagine how I can create such a reference with EMF and I
> couldn't find a documentation for this.
You can reference a Person, or you can reference any old EObject, but
you can't reference just one feature of such a thing...
> For the user in my ECP application I would like to have a combobox or
> popup with all available attributes (tree or list).
eObject.eClass().getEAllAttributes lists all the attributes of some object.
>
> What is the best way to create something like that in an ECore-Model?
It's not so clear what exactly you're trying to do. If you really want
something that specifies a particular feature of some object, you'd need
two things: the reference to the object, and a reference to some
feature of that object (or an attribute with the name of that feature)...
>
> Thanks,
> Daniel
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
Re: Howto create a reference to an attribute? [message #1067198 is a reply to message #1067194] |
Sun, 07 July 2013 13:41 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Daniel,
Comments below.
On 07/07/2013 3:00 PM, Daniel Golesny wrote:
> Thank you very much, your explanation helped me a lot.
You're welcome.
> The reference to the Person was easy. I did it with a marker-interface
> "Referencable", so I could select all the entities I've marked.
I'm not exactly sure what you mean...
> The rest I will check later ... while playing around I'm sure that
> modelling a PDF by using a non-graphical editor is pain in the a**.
I can imagine.
> Perhaps GEF would be better for that.
Yes, though project's like Graphiti and GMF are likely a better choice;
they make it easy to build a graphical editor for an EMF model...
>
> But I think I need some basics first before using GEF ...
Personally I'd start with Graphiti; it's being quite actively developed
further: http://www.eclipse.org/graphiti/
> Is there any up-to-date book or PDF about GEF?
This isn't the GEF forum. :-P
> (or EMF with GEF)?
There's a redbook, but yes, it's quite old, and you probably don't want
to use GEF directly but rather reuse Graphiti or GMF.
> All EMF books are many years old ...
EMF has evolved in a completely binary compatible way, so everything in
the EMF book is still valid today.
>
> Thanks,
> Daniel
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03609 seconds