Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » newcomer question: automatic live validation
newcomer question: automatic live validation [message #1775800] Mon, 06 November 2017 15:41 Go to next message
Stephan Mielke is currently offline Stephan MielkeFriend
Messages: 2
Registered: February 2016
Junior Member
I'm a newcomer to EMF validation.

I would like to create a live validation of the EMF model and have worked on the tutorial.

Resource r = (Resource);

if (!resourceHasAdapter(r)) {
	EContentAdapter liveValidationContentAdapter = new LiveValidationContentAdapter();

I know I need to register the LiveValidationContentAdapter. Unfortunately, I don't know how to get the EMF resource object. Anybody have any idea how to do that? At Google or Stackoverflow I hadn't found any suitable answers yet.

At the end, an editor should be created in which live validation is always activated. This is not like in the example, where it has to be activated via the context menu.

Thank you so much for your help.

Greeting Stephan
Re: newcomer question: automatic live validation [message #1775935 is a reply to message #1775800] Wed, 08 November 2017 12:13 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 390
Registered: December 2015
Senior Member
Maybe you should also read the EMF Introduction or the EMF Book? Usually, you enter a model via a ResourceSet, which itself has Resources which contains your EObjects. On top/around the ResourceSet there is another facility, the EditingDomain. If you have an EditingDomain, you can get its associated ResourceSet. You can see all this in the generated editor code.
Previous Topic:Deleting Model Elements of an Dynamic Xcore Instance with Sample Reflective Ecore Model Editor
Next Topic:eStructuralFeatureList not returning new added feature
Goto Forum:

Current Time: Sat Mar 06 12:23:12 GMT 2021

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

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

Back to the top