|
|
Re: Showing properties in compartment instead of properties view [message #214934 is a reply to message #214904] |
Fri, 09 January 2009 17:46 |
Eclipse User |
|
|
|
Originally posted by: marc.moser.me.com
Hi Alex,
Thanks for your reply! :-)
Comments below:
> Try reading GMF tutorials first. AFAIU all you need is LabelMapping for
> the name label
You are right, if I have a single attribute, I can show it as a label.
But assume that I have several different attributes. In this case, I
would like the representation of my objects (the nodes) to have a
single label, but all the other attributes displayed in the compartment.
> and link mapping to be able to connect two "A" instances with the link.
Yes, I could do that, but that's not quite what I want. I would like to
have it shown as an attribute of the node, not as a link between two
nodes.
I think I was not very clear in my explanations. Imagine it like this:
Current:
Right now, I have an editor that let's me draw nodes. I can then click
on a node, and all the attributes/features of the object represented by
this node are editable in the properties view.
Goal:
My goal would be to get rid of the properties view. Basically, I want
to have an editor that let's me draw nodes, and then these nodes should
have a collapsible compartment containing all attributes/features of
the object represented by this node, editable in the same way as
before. So for example, if my class has a many=false reference called
'ref', then I would want to have a compartment that has an entry called
'ref', and if I click on it a pull-down menu appears that let's me
select the target of the reference. Ideally, I would want to have the
properties view inside the compartment of the node.
I looked at all the information I could find, but I did not see
anything like this. Anyone has an idea?
Best Regards,
Marc
|
|
|
Re: Showing properties in compartment instead of properties view [message #215014 is a reply to message #214934] |
Mon, 12 January 2009 11:34 |
Alexander Shatalin Messages: 2928 Registered: July 2009 |
Senior Member |
|
|
Hello Marc,
> You are right, if I have a single attribute, I can show it as a label.
> But assume that I have several different attributes. In this case, I
If you have predefined number of String attributes then you can add LabelMapping
for each of them – NodeMapping can hold several LabelMappings. In case you
do not know a number of String attributes from the meta-model definition
(in meta-model you have a feature stringAttributes with multiplicity *) then
you have to use child NodeMapping(s) to model this situation (and it is not
possible to generate corresponding code for now – you have to modify generated
code manually).
> would like the representation of my objects (the nodes) to have a
> single label, but all the other attributes displayed in the
> compartment.
This can be implemented even with several LabelMappings – you just have to
define proper composite figure (a hierarchy of figures) in .gmfgraph model
and assign appropriate LabelMapping figure from this hierarchy to each of
LabelMappings.
> Yes, I could do that, but that's not quite what I want. I would like
> to have it shown as an attribute of the node, not as a link between
> two nodes.
For now I think you can do that with custom parser or (even better) by defining
+ implementing derive String attribute linkedElementName and using this attribute
in one more LabelMapping.
> the object represented by this node, editable in the same way as
> before. So for example, if my class has a many=false reference called
With string (and hopefully other primitive types) attributes you can use
LabelMapping for each attribute.
> 'ref', then I would want to have a compartment that has an entry
> called 'ref', and if I click on it a pull-down menu appears that let's me
> select the target of the reference. Ideally, I would want to have the
This control should be implemented manually. One of the option – try using
LabelMapping as much as it possible and modify generated code at the end.
-----------------
Alex Shatalin
|
|
|
Powered by
FUDForum. Page generated in 0.02997 seconds