Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Attribute problems
Attribute problems [message #230711] Mon, 18 May 2009 18:49 Go to next message
Arij is currently offline ArijFriend
Messages: 40
Registered: July 2009
Member
Hello everybody
I have two problems:

1) In my model ecore, I have 2 classes which have both attribute
LevelNumber (integer type) and which are interconnected with an
aggregation.
I want that the second class attribute LevelNumber is equal automatically
to the first class attribute LevelNumber.

2) We can increment automatically an attribute (integer type), that is
when we add an element, the value of its attribute = value of the
attribute of the last one élément+1
Re: Attribute problems [message #230750 is a reply to message #230711] Tue, 19 May 2009 11:00 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Arij,

> 1) In my model ecore, I have 2 classes which have both attribute
> LevelNumber (integer type) and which are interconnected with an
> aggregation.
> I want that the second class attribute LevelNumber is equal
> automatically
> to the first class attribute LevelNumber.
You can try using derived attributes so the getter of attribute for 2-nd
class will be just return a value of this attribute from 1-st class.

> 2) We can increment automatically an attribute (integer type), that is
> when we add an element, the value of its attribute = value of the
> attribute of the last one élément+1
You can modify EMF-generated fectory class to assign proper values for the
newly created model elements.

-----------------
Alex Shatalin
Previous Topic:Fixed new node in the Diagram
Next Topic:Prevent deletion of subnode but allow deletion of parent
Goto Forum:
  


Current Time: Thu Apr 25 00:51:13 GMT 2024

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

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

Back to the top