@Override
 public void init(IEditorSite site, IEditorInput input) throws PartInitException {
   super.init(site, input);
   getEditingDomain().addResourceSetListener(validationListener);
   checkXtextNature();
   initValidationJob();
 }
  @Override
  public void init(IEditorSite site, IEditorInput input) throws PartInitException {
    super.init(site, input);

    getEditingDomain()
        .addResourceSetListener(
            new ResourceSetListenerImpl() {
              @Override
              public void resourceSetChanged(ResourceSetChangeEvent event) {
                Display.getDefault()
                    .asyncExec(
                        new Runnable() {
                          public void run() {
                            if (getDiagram() != null) {
                              ValidationAction.validate(getDiagramEditPart(), getDiagram());
                            }
                          }
                        });
              }
            });
  }
 @Override
 public void init(IEditorSite site, IEditorInput input) throws PartInitException {
   super.init(site, input);
   createDirtyResources();
 }