[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: Object multiplicity in the diagram

Hi Marcin,

Cardinalities defined in the ecore model are not translated by GMF into validations automatically. You have to take further manual steps for that.

If you want to automatically create a B if A ist created, you can modify doDefaultElementCreation() in your ACreateCommand class to programmatically add a B object to the newly created A object.

To validate the cardinalities you can use GMF's validation functionality which is introduced here: http://wiki.eclipse.org/GMF_Tutorial_Part_2#Validation

Adrian

Marcin Cylke schrieb:
Hello
I'm generating a GMF editor from an ecore model. I have some parent object that should be placed on the diagram - lets call it A. It can have one object B and 0..* objects B. I've specified that condition in Ecore model, but generated diagram does not obey that, and I have to place object B by myself. Moreover, I'm able to place more B-objects than one.


How can I force such object's multiplicity?

Marcin