Package org.eclipse.emf.common.util

Examples of org.eclipse.emf.common.util.Diagnostic


    catch (Exception e) {
      exception = e;
      resource = editingDomain.getResourceSet().getResource(resourceURI, false);
    }

    Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
    if (diagnostic.getSeverity() != Diagnostic.OK) {
      resourceToDiagnosticMap.put(resource,  analyzeResourceProblems(resource, exception));
    }
    editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
  }
View Full Code Here


    catch (Exception e) {
      exception = e;
      resource = editingDomain.getResourceSet().getResource(resourceURI, false);
    }

    Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
    if (diagnostic.getSeverity() != Diagnostic.OK) {
      resourceToDiagnosticMap.put(resource,  analyzeResourceProblems(resource, exception));
    }
    editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
  }
View Full Code Here

    IFile target = view.eResource() != null ? WorkspaceSynchronizer
        .getFile(view.eResource()) : null;
    if (target != null) {
      DispelMarkerNavigationProvider.deleteMarkers(target);
    }
    Diagnostic diagnostic = runEMFValidator(view);
    createMarkers(target, diagnostic, diagramEditPart);
    IBatchValidator validator = (IBatchValidator) ModelValidationService
        .getInstance().newValidator(EvaluationMode.BATCH);
    validator.setIncludeLiveConstraints(true);
    if (view.isSetElement() && view.getElement() != null) {
View Full Code Here

  private static void createMarkers(IFile target,
      Diagnostic emfValidationStatus, DiagramEditPart diagramEditPart) {
    if (emfValidationStatus.getSeverity() == Diagnostic.OK) {
      return;
    }
    final Diagnostic rootStatus = emfValidationStatus;
    List allDiagnostics = new ArrayList();
    DispelDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new DispelDiagramEditorUtil.LazyElement2ViewMap(
        diagramEditPart.getDiagramView(), collectTargetElements(
            rootStatus, new HashSet<EObject>(), allDiagnostics));
    for (Iterator it = emfValidationStatus.getChildren().iterator(); it
        .hasNext();) {
      Diagnostic nextDiagnostic = (Diagnostic) it.next();
      List data = nextDiagnostic.getData();
      if (data != null && !data.isEmpty()
          && data.get(0) instanceof EObject) {
        EObject element = (EObject) data.get(0);
        View view = DispelDiagramEditorUtil.findView(diagramEditPart,
            element, element2ViewMap);
        addMarker(
            diagramEditPart.getViewer(),
            target,
            view.eResource().getURIFragment(view),
            EMFCoreUtil.getQualifiedName(element, true),
            nextDiagnostic.getMessage(),
            diagnosticToStatusSeverity(nextDiagnostic.getSeverity()));
      }
    }
  }
View Full Code Here

    catch (Exception e) {
      exception = e;
      resource = editingDomain.getResourceSet().getResource(resourceURI, false);
    }

    Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
    if (diagnostic.getSeverity() != Diagnostic.OK) {
      resourceToDiagnosticMap.put(resource,  analyzeResourceProblems(resource, exception));
    }
    editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
  }
View Full Code Here

    catch (Exception e) {
      exception = e;
      resource = editingDomain.getResourceSet().getResource(resourceURI, false);
    }

    Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
    if (diagnostic.getSeverity() != Diagnostic.OK) {
      resourceToDiagnosticMap.put(resource,  analyzeResourceProblems(resource, exception));
    }
    editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
  }
View Full Code Here

    catch (Exception e) {
      exception = e;
      resource = editingDomain.getResourceSet().getResource(resourceURI, false);
    }

    Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
    if (diagnostic.getSeverity() != Diagnostic.OK) {
      resourceToDiagnosticMap.put(resource,  analyzeResourceProblems(resource, exception));
    }
    editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
  }
View Full Code Here

          // Validate the contents of the loaded resource.
          //
          for (Iterator j = resource.getContents().iterator(); j.hasNext(); ) {
            EObject eObject = (EObject)j.next();
            Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject);
            if (diagnostic.getSeverity() != Diagnostic.OK) {
              printDiagnostic(diagnostic, "");
            }
          }
        }
        catch (RuntimeException exception) {
View Full Code Here

           "fr.tm.elibel.smartqvt.trace.editor",
           0,
           null,
           new Object [] { editingDomain.getResourceSet() });
      for (Iterator i = resourceToDiagnosticMap.values().iterator(); i.hasNext(); ) {
        Diagnostic childDiagnostic = (Diagnostic)i.next();
        if (childDiagnostic.getSeverity() != Diagnostic.OK) {
          diagnostic.add(childDiagnostic);
        }
      }

      int lastEditorPage = getPageCount() - 1;
View Full Code Here

    catch (Exception e) {
      exception = e;
      resource = editingDomain.getResourceSet().getResource(resourceURI, false);
    }

    Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
    if (diagnostic.getSeverity() != Diagnostic.OK) {
      resourceToDiagnosticMap.put(resource,  analyzeResourceProblems(resource, exception));
    }
    editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.common.util.Diagnostic

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.