Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Map and ecore
Map and ecore [message #421588] Mon, 11 August 2008 08:40 Go to next message
Guillaume SOLDERA is currently offline Guillaume SOLDERAFriend
Messages: 23
Registered: July 2009
Junior Member
Hi all !

I work on a EMF/GMF application.

I have an ecore file.
I have an Eclass with an attribute which have a Map type.


Which type must I put for my attribute to be able to add entries to this
map in my application ?
Re: Map and ecore [message #421594 is a reply to message #421588] Mon, 11 August 2008 10:50 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010906010705000009050206
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Guillaume,

You'll want to read the FAQ 2.29 How do I create a Map in EMF?
< http://wiki.eclipse.org/index.php/EMF-FAQ#How_do_I_create_a_ Map_in_EMF.3F>


Guillaume SOLDERA wrote:
> Hi all !
>
> I work on a EMF/GMF application.
>
> I have an ecore file.
> I have an Eclass with an attribute which have a Map type.
>
>
> Which type must I put for my attribute to be able to add entries to
> this map in my application ?
>

--------------010906010705000009050206
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Guillaume,<br>
<br>
You'll want to read the FAQ <a
href=" http://wiki.eclipse.org/index.php/EMF-FAQ#How_do_I_create_a_ Map_in_EMF.3F"><span
class="tocnumber">2.29</span> <span class="toctext">How do I create a
Map in EMF?</span></a><br>
<br>
<br>
Guillaume SOLDERA wrote:
<blockquote
cite="mid:20039c88836b21019eefbdfe3f095a66$1@www.eclipse.org"
type="cite">Hi all !
<br>
<br>
I work on a EMF/GMF application.
<br>
<br>
I have an ecore file.
<br>
I have an Eclass with an attribute which have a Map type.
<br>
<br>
<br>
Which type must I put for my attribute to be able to add entries to
this map in my application ?
<br>
<br>
</blockquote>
</body>
</html>

--------------010906010705000009050206--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Map and ecore [message #421597 is a reply to message #421594] Mon, 11 August 2008 11:17 Go to previous messageGo to next message
Guillaume SOLDERA is currently offline Guillaume SOLDERAFriend
Messages: 23
Registered: July 2009
Junior Member
Thanks for this answer !

I did these modifications.

But in my application, I have a problem to edit this map and add entries
to this map.

In 'Property' tabs, when I click on my attribute to edit this attribute, a
popup is opened. This popup contains 2 sets : 'Choices' and 'Feature'.
Theses sets are empty.

I would like add entries to the map by dint of a 'key' value and the value
matching with it.

Is it possible to do this ?

Thanks

Guillaume
Re: Map and ecore [message #421599 is a reply to message #421597] Mon, 11 August 2008 11:24 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Guillaume,

Comments below.

Guillaume SOLDERA wrote:
> Thanks for this answer !
>
> I did these modifications.
>
> But in my application, I have a problem to edit this map and add
> entries to this map.
You could look at EAnnotation's details EMap as an example and how the
Sample Ecore Editor supports editing it.
>
> In 'Property' tabs, when I click on my attribute to edit this
> attribute, a popup is opened. This popup contains 2 sets : 'Choices'
> and 'Feature'. Theses sets are empty.
Did you make your map feature a containment reference? I don't think
you should expect to be editing the map as a whole but rather be
creating new entries via the normal child creation approach and the
using the properties view to set the key and value (as in the Sample
Ecore Editor). Give you likely made a mistake, you'll probably need to
fiddle with the GenFeature properties for this feature to make sure
Children and Child Creation are enabled and to turn off the property
support for it.
>
> I would like add entries to the map by dint of a 'key' value and the
> value matching with it.
>
> Is it possible to do this ?
Yep. Creating an EAnnotation and then children for that in the Sample
Ecore Editor will be agood example to look at.
>
> Thanks
>
> Guillaume
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Map and ecore [message #421604 is a reply to message #421599] Mon, 11 August 2008 12:17 Go to previous messageGo to next message
Guillaume SOLDERA is currently offline Guillaume SOLDERAFriend
Messages: 23
Registered: July 2009
Junior Member
Ed Merks wrote:

> Guillaume,

> Comments below.


>> In 'Property' tabs, when I click on my attribute to edit this
>> attribute, a popup is opened. This popup contains 2 sets : 'Choices'
>> and 'Feature'. Theses sets are empty.
> Did you make your map feature a containment reference? I don't think
> you should expect to be editing the map as a whole but rather be
> creating new entries via the normal child creation approach and the
> using the properties view to set the key and value (as in the Sample
> Ecore Editor). Give you likely made a mistake, you'll probably need to
> fiddle with the GenFeature properties for this feature to make sure
> Children and Child Creation are enabled and to turn off the property
> support for it.

I did these modifications and generated 'editor code'. It works fine for
this application.

But I work on a RCP application and I don't have a 'tree' representation
but a diagram.

Ideally, when I click on the attribute in 'Properties view', I would like
to open a SWT window with the view of the Map inside.
An example could be that : in your Eclipse IDE, Windows/Preferences >
Run/Debug > String Substitution. You have two columns (variable and value)
and buttons 'New', 'Edit' and 'Remove'. Is it possible to do that or
something like that.

Thanks

Guillaume
Re: Map and ecore [message #421606 is a reply to message #421604] Mon, 11 August 2008 13:27 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Guillaume,

Comments below.

Guillaume SOLDERA wrote:
> Ed Merks wrote:
>
>> Guillaume,
>
>> Comments below.
>
>
>>> In 'Property' tabs, when I click on my attribute to edit this
>>> attribute, a popup is opened. This popup contains 2 sets : 'Choices'
>>> and 'Feature'. Theses sets are empty.
>> Did you make your map feature a containment reference? I don't
>> think you should expect to be editing the map as a whole but rather
>> be creating new entries via the normal child creation approach and
>> the using the properties view to set the key and value (as in the
>> Sample Ecore Editor). Give you likely made a mistake, you'll
>> probably need to fiddle with the GenFeature properties for this
>> feature to make sure Children and Child Creation are enabled and to
>> turn off the property support for it.
>
> I did these modifications and generated 'editor code'. It works fine
> for this application.
>
> But I work on a RCP application and I don't have a 'tree'
> representation but a diagram.
>
> Ideally, when I click on the attribute in 'Properties view', I would
> like to open a SWT window with the view of the Map inside.
It's certainly possible to create a specialized dialog cell editor for
that purpose; there was a recent GMF thread about how to do that for
GMF. There's an EMF recipe for this as well...
> An example could be that : in your Eclipse IDE, Windows/Preferences >
> Run/Debug > String Substitution. You have two columns (variable and
> value) and buttons 'New', 'Edit' and 'Remove'. Is it possible to do
> that or something like that.
Certainly, but you'd need to build this yourself. An EMap is
effectively a list of contained map entry instances; you might want to
use data binding for building something like this. You'd want the
dialog to be working with a copy of the list and its content and then
use a command to update the map as a whole when the user clicks OK.
>
> Thanks
>
> Guillaume
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Map and ecore [message #421707 is a reply to message #421606] Tue, 12 August 2008 09:19 Go to previous message
Guillaume SOLDERA is currently offline Guillaume SOLDERAFriend
Messages: 23
Registered: July 2009
Junior Member
Thanks a lot !

I found the thread :

http://www.eclipse.org/newsportal/article.php?id=14423&g roup=eclipse.modeling.gmf#14423

It's exactly what I'm looking for.

Guillaume
Previous Topic:substitution group revisited
Next Topic:[CDO] Development setup
Goto Forum:
  


Current Time: Fri Apr 26 22:53:41 GMT 2024

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

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

Back to the top