Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Initialize EMF node with default name
Initialize EMF node with default name [message #1052076] Mon, 29 April 2013 15:27 Go to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
Hi,

I followed this article (http://www.eclipse.org/articles/article.php?file=Article-Integrating-EMF-GMF-Editors/index.html) and integrated EMF and GMF.

I'm wondering if it's possible to define that elements get initially attributes when they are added to the diagram.
For example I'm adding a new child element to my diagram. At the moment all attributes like a name are empty by default.

Are there any places in the code which allows me to define initial attributes?
Re: Initialize EMF node with default name [message #1052151 is a reply to message #1052076] Mon, 29 April 2013 17:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Phil,

Comments below.

On 29/04/2013 5:27 PM, Phil H wrote:
> Hi,
>
> I followed this article
> (http://www.eclipse.org/articles/article.php?file=Article-Integrating-EMF-GMF-Editors/index.html)
> and integrated EMF and GMF.
>
> I'm wondering if it's possible to define that elements get initially
> attributes when they are added to the diagram.
You can define default values for attributes...
> For example I'm adding a new child element to my diagram. At the
> moment all attributes like a name are empty by default.
You might specialize the tool that creates them (or the
CreateCreateChildCommand) to initial them with some type of generated
names, but you don't generally do that direct in the model; there you
can only default defaults.
>
> Are there any places in the code which allows me to define initial
> attributes?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Initialize EMF node with default name [message #1052997 is a reply to message #1052151] Wed, 01 May 2013 19:45 Go to previous message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
Thanks for your answer Ed.

I assignded an Default Value Literal to my node (see image), but it didn't worked in the selection editor.

index.php/fa/14600/0/

Is it because of the integration of GMF and EMF? Normally it should be working?!
Another problem will be that I use Eugenia for generating my ecore etc. So I think that I have to solve this programmatically. Which class host the CreateCreateChildCommand? Couldn't find it yet.. sry but I'm really new to EMF.

Cheers,
Phil
Previous Topic:[XCore] default value
Next Topic:Customizing Outline View
Goto Forum:
  


Current Time: Thu Mar 28 12:12:49 GMT 2024

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

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

Back to the top