AnsweredAssumed Answered

Calling a validator once per change

Question asked by norberts on May 6, 2013
Latest reply on May 13, 2013 by norberts

so I wrote my own validator and since the extension point is deactivated right now I call it in the doSave method ActivitiDiagramEditor for testing purposes. However I want to call it now whenever a change occurs in the diagram of the editor. So every time the user moves/adds/deletes elements and the editor get's dirty, I want to call it.
I looked at the isDirty method but that is called by various eclipse and graphiti classes something like 5 times per change and that would be a pretty inefficient position.
I hoped also on the refresh method, but that is called not at all. Same for the updateDirtyState method of the DiagramEditor.

Any suggestions where I can call my validator once so it is  executed on every change in the diagram?

Also, is it possible to distinguish between the two options "just moved something" and "added or deleted something"? Since the graph doesn't change when the user just moves an element.

Thanks for your help.