Inside model editors it is necessary to evaluate validation rules against the model being edited. Editors built with e.g Xtext or GMF have a validation framework that allows us to easily add constraints to the editor and have them evaluated and displayed in the "problems" view.
Does Graphiti have such a validation framework? If not, are there any pointers on how to achieve this yourself?
Michael Wenz Messages: 1267 Registered: July 2009 Location: Walldorf, Germany
Senior Member
Graphiti itself does not offer such a validation framework. Instead we rely
on what Eclipse itself, EMF or other projects on top of EMF (I think Sphinx
will come with something like this) offer for marker support.
So in general you would use EMF OCL Validation for checking your model,
store the found issues as markers (define your own type if you want) and
have them visualized in the problems view.
What we offer in Graphiti, is a means to easily mark objects on the diagram
as having a bug. See the section about rendering decorators in the tutorial
for details on that
- Michael
"Jos Warmer" <jos.warmer@ordina.nl> wrote in message
news:i3ppp3$gke$1@build.eclipse.org...
> Inside model editors it is necessary to evaluate validation rules against
> the model being edited. Editors built with e.g Xtext or GMF have a
> validation framework that allows us to easily add constraints to the
> editor and have them evaluated and displayed in the "problems" view.
>
> Does Graphiti have such a validation framework? If not, are there any
> pointers on how to achieve this yourself?
>
> -- Jos
I was planning on using EMF OCL or Check or Java for defining constraints. For my current DSL's I have both Check and Java constraints, so I'd like to reuse these. I am looking for an easy way to connect these with the editor. I understand there is no default hookup mechanism, do I will do this myself.