문제

In an editor created with EMF, one can validate a model by right-clicking on any modeled element and choosing "Validate" from the context menu. I want to call this functionality programmatically. My use case is that I want to validate the model when the user attempts to open a wizard. Based on the validation outcome, the wizard will either open (validation succeeded) or the found errors will be displayed.

Does anyone know how to achieve this programmatically?

도움이 되었습니까?

해결책

You should be able to trigger the validation thanks to org.eclipse.emf.ecore.util.Diagnostician (call Diagnostician.INSTANCE.validate(...)). You can have a look at its javadoc.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top