Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Check if an object has been already created
Check if an object has been already created [message #1273899] Thu, 20 March 2014 18:05 Go to next message
Simone Di Cola is currently offline Simone Di ColaFriend
Messages: 60
Registered: February 2014
Member
Hi all,
how can I check if an EClass has been already created? Is there anyway to enforce the rules I've created in the ecore model?


Thanks
Simone
Re: Check if an object has been already created [message #1274038 is a reply to message #1273899] Thu, 20 March 2014 23:06 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Is it possible to override your model factory's create(EClass) method? That's what comes to mind as a possible hook for tracking object creations...
Re: Check if an object has been already created [message #1274288 is a reply to message #1274038] Fri, 21 March 2014 08:35 Go to previous messageGo to next message
Simone Di Cola is currently offline Simone Di ColaFriend
Messages: 60
Registered: February 2014
Member
Yes I do, but I was just wondering if there was a simpler and more elegant solution. Nevertheless, EMF provides validation for my model, so it would be nice to invoke the validator and ask if an action is possible or not.

Any idea if my scenario is achievable?

Thanks
Simone
Re: Check if an object has been already created [message #1276247 is a reply to message #1274288] Mon, 24 March 2014 09:43 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Simone,

one idea might be to register a project builder, that calls your validator.
By doing that validation will be triggered each time you save.

Michael
Re: Check if an object has been already created [message #1276283 is a reply to message #1276247] Mon, 24 March 2014 10:38 Go to previous messageGo to next message
Simone Di Cola is currently offline Simone Di ColaFriend
Messages: 60
Registered: February 2014
Member
Thanks Micheal,
could please tell me a little bit more about your approach? I have no clue how to do it.

Simone
Re: Check if an object has been already created [message #1279075 is a reply to message #1276283] Fri, 28 March 2014 07:49 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Simone,

there's lots of information on this available in the web, just google for
"eclipse builder tutorial" and you'll find tutorials, docus and FAQs about
creating a builder.

Inside that builder you would then trigger the validation of your objects
and create markers for issues.

Michael
Previous Topic:CustomEditor not getting invoked in Graphiti *.ui.editors extension
Next Topic:Change DefaultpersistencyBehavior
Goto Forum:
  


Current Time: Thu Apr 25 16:43:44 GMT 2024

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

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

Back to the top