final int result = ErrorDialog.openError (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), EMFEditUIPlugin.INSTANCE.getString("_UI_ValidationProblems_title"), EMFEditUIPlugin.INSTANCE.getString("_UI_ValidationProblems_message"), BasicDiagnostic.toIStatus(diagnostic));
  protected void handleDiagnostic(final Diagnostic diagnostic)  {    if (diagnostic.getSeverity() == Diagnostic.OK)    {      MessageDialog.openInformation        (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),         EMFEditUIPlugin.INSTANCE.getString("_UI_ValidationOK_title"),         EMFEditUIPlugin.INSTANCE.getString("_UI_ValidationOK_message"));      return;    }    final int result =       ErrorDialog.openError        (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),         EMFEditUIPlugin.INSTANCE.getString("_UI_ValidationProblems_title"),         EMFEditUIPlugin.INSTANCE.getString("_UI_ValidationProblems_message"),         BasicDiagnostic.toIStatus(diagnostic));    if (Platform.getBundle("org.eclipse.core.resources") != null)    {      final IFile file = getFile();        try      {        file.deleteMarkers(EValidator.MARKER, true, IResource.DEPTH_ZERO);      }      catch (CoreException exception)      {        EMFEditUIPlugin.INSTANCE.log(exception);      }          if (result == Dialog.OK)      {        if (!diagnostic.getChildren().isEmpty())        {          List data = ((Diagnostic)diagnostic.getChildren().get(0)).getData();          if (!data.isEmpty() && data.get(0) instanceof EObject)          {            Object part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();            if (part instanceof ISetSelectionTarget)            {              ((ISetSelectionTarget)part).selectReveal(new StructuredSelection(data.get(0)));            }            else if (part instanceof IViewerProvider)            {              Viewer viewer = ((IViewerProvider)part).getViewer();              if (viewer != null)              {                viewer.setSelection(new StructuredSelection(data.get(0)), true);              }            }          }        }            for (Iterator i = diagnostic.getChildren().iterator(); i.hasNext(); )        {          Diagnostic childDiagnostic = (Diagnostic)i.next();          createMarkers(file, childDiagnostic);        }      }    }  }