Package org.eclipse.emf.common.util

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


            final IStructuredDocumentContext context,
            final Node node,
            final TagIdentifier missingParent)
    {

      Diagnostic diagnostic = null;
      if (missingParent.equals(IJSFConstants.TAG_IDENTIFIER_VIEW)) {
        diagnostic = DiagnosticFactory.create_CONTAINMENT_ERROR_MISSING_VIEW(node.getNodeName());
      }
      else if (missingParent.equals(IJSFConstants.TAG_IDENTIFIER_FORM)) {
        diagnostic = DiagnosticFactory.create_CONTAINMENT_ERROR_MISSING_FORM(node.getNodeName());
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

   */
  private static void validate(DiagramEditPart diagramEditPart, View view) {
    View target = view;
    OntoUML.diagram.part.ValidationMarker.removeAllMarkers(diagramEditPart
        .getViewer());
    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(View target,
      Diagnostic emfValidationStatus, DiagramEditPart diagramEditPart) {
    if (emfValidationStatus.getSeverity() == Diagnostic.OK) {
      return;
    }
    final Diagnostic rootStatus = emfValidationStatus;
    List allDiagnostics = new ArrayList();
    OntoUML.diagram.part.OntoUMLDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new OntoUML.diagram.part.OntoUMLDiagramEditorUtil.LazyElement2ViewMap(
        diagramEditPart.getDiagramView(), collectTargetElements(
            rootStatus, new HashSet(), 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 = OntoUML.diagram.part.OntoUMLDiagramEditorUtil
            .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


    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, "");
      }
    }
  }
View Full Code Here


    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, "");
      }
    }
  }
View Full Code Here

    Status hasNonProto2Import = Status.OK;
    for (EObject element : resource.getContents()) {
      if (monitor.isCanceled()) {
        return Status.CANCELED;
      }
      Diagnostic diagnostic = getDiagnostician().validate(element, validationOptions(resource, mode, monitor));
      if (convertIssuesToMarkers(acceptor, diagnostic) == Status.PROTO1_IMPORTS_FOUND) {
        hasNonProto2Import = Status.PROTO1_IMPORTS_FOUND;
      }
    }
    return hasNonProto2Import;
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

          System.out.println("Loaded " + uri);

          // Validate the contents of the loaded resource.
          //
          for (EObject eObject : resource.getContents()) {
            Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject);
            if (diagnostic.getSeverity() != Diagnostic.OK) {
              printDiagnostic(diagnostic, "");
            }
          }
        }
        catch (RuntimeException exception) {
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.