Package org.eclipse.emf.common.util

Examples of org.eclipse.emf.common.util.BasicDiagnostic$EclipseHelper


   * <!-- end-user-doc -->
   * @generated
   */
  public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
    if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
      BasicDiagnostic basicDiagnostic =
        new BasicDiagnostic
          (Diagnostic.ERROR,
           "eu.admire.dispel.editor",
           0,
           getString("_UI_CreateModelError_message", resource.getURI()),
           new Object [] { exception == null ? (Object)resource : exception });
      basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
      return basicDiagnostic;
    }
    else if (exception != null) {
      return
        new BasicDiagnostic
          (Diagnostic.ERROR,
           "eu.admire.dispel.editor",
           0,
           getString("_UI_CreateModelError_message", resource.getURI()),
           new Object[] { exception });
View Full Code Here


   * <!-- end-user-doc -->
   * @generated
   */
  protected void updateProblemIndication() {
    if (updateProblemIndication) {
      BasicDiagnostic diagnostic =
        new BasicDiagnostic
          (Diagnostic.OK,
           "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;
      if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
        ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
        if (diagnostic.getSeverity() != Diagnostic.OK) {
          setActivePage(lastEditorPage);
        }
      }
      else if (diagnostic.getSeverity() != Diagnostic.OK) {
        ProblemEditorPart problemEditorPart = new ProblemEditorPart();
        problemEditorPart.setDiagnostic(diagnostic);
        problemEditorPart.setMarkerHelper(markerHelper);
        try {
          addPage(++lastEditorPage, problemEditorPart, getEditorInput());
          setPageText(lastEditorPage, problemEditorPart.getPartName());
          setActivePage(lastEditorPage);
          showTabs();
        }
        catch (PartInitException exception) {
          TraceEditorPlugin.INSTANCE.log(exception);
        }
      }

      if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
        markerHelper.deleteMarkers(editingDomain.getResourceSet());
        if (diagnostic.getSeverity() != Diagnostic.OK) {
          try {
            markerHelper.createMarkers(diagnostic);
          }
          catch (CoreException exception) {
            TraceEditorPlugin.INSTANCE.log(exception);
View Full Code Here

   * <!-- end-user-doc -->
   * @generated
   */
  public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
    if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
      BasicDiagnostic basicDiagnostic =
        new BasicDiagnostic
          (Diagnostic.ERROR,
           "fr.tm.elibel.smartqvt.trace.editor",
           0,
           getString("_UI_CreateModelError_message", resource.getURI()),
           new Object [] { exception == null ? (Object)resource : exception });
      basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
      return basicDiagnostic;
    }
    else if (exception != null) {
      return
        new BasicDiagnostic
          (Diagnostic.ERROR,
           "fr.tm.elibel.smartqvt.trace.editor",
           0,
           getString("_UI_CreateModelError_message", resource.getURI()),
           new Object[] { exception });
View Full Code Here

   * <!-- end-user-doc -->
   * @generated
   */
  protected void updateProblemIndication() {
    if (updateProblemIndication) {
      BasicDiagnostic diagnostic =
        new BasicDiagnostic
          (Diagnostic.OK,
           "fr.tm.elibel.smartqvt.smartgen.emfimplem.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;
      if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
        ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
        if (diagnostic.getSeverity() != Diagnostic.OK) {
          setActivePage(lastEditorPage);
        }
      }
      else if (diagnostic.getSeverity() != Diagnostic.OK) {
        ProblemEditorPart problemEditorPart = new ProblemEditorPart();
        problemEditorPart.setDiagnostic(diagnostic);
        problemEditorPart.setMarkerHelper(markerHelper);
        try {
          addPage(++lastEditorPage, problemEditorPart, getEditorInput());
          setPageText(lastEditorPage, problemEditorPart.getPartName());
          setActivePage(lastEditorPage);
          showTabs();
        }
        catch (PartInitException exception) {
          SmartGenEditorPlugin.INSTANCE.log(exception);
        }
      }

      if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
        markerHelper.deleteMarkers(editingDomain.getResourceSet());
        if (diagnostic.getSeverity() != Diagnostic.OK) {
          try {
            markerHelper.createMarkers(diagnostic);
          }
          catch (CoreException exception) {
            SmartGenEditorPlugin.INSTANCE.log(exception);
View Full Code Here

   * <!-- end-user-doc -->
   * @generated
   */
  public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
    if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
      BasicDiagnostic basicDiagnostic =
        new BasicDiagnostic
          (Diagnostic.ERROR,
           "fr.tm.elibel.smartqvt.smartgen.emfimplem.editor",
           0,
           getString("_UI_CreateModelError_message", resource.getURI()),
           new Object [] { exception == null ? (Object)resource : exception });
      basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
      return basicDiagnostic;
    }
    else if (exception != null) {
      return
        new BasicDiagnostic
          (Diagnostic.ERROR,
           "fr.tm.elibel.smartqvt.smartgen.emfimplem.editor",
           0,
           getString("_UI_CreateModelError_message", resource.getURI()),
           new Object[] { exception });
View Full Code Here

        // -> specify the condition that violates the invariant
        // -> verify the details of the diagnostic, including severity and message
        // Ensure that you remove @generated or mark it @generated NOT
        if (false) {
            if (diagnostics != null) {
                diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR,
                        DiValidator.DIAGNOSTIC_SOURCE, DiValidator.PLANE__PLANE_ELEMENT_TYPE,
                        EcorePlugin.INSTANCE.getString(
                                "_UI_GenericInvariant_diagnostic",
                                new Object[] { "plane_element_type",
                                        EObjectValidator.getObjectLabel(this, context) }),
View Full Code Here

        result = false;
      }
    }
    if (diagnostics != null && !result)
    {
      BasicDiagnostic diagnostic =
        createDiagnostic
         (Diagnostic.ERROR,
          DIAGNOSTIC_SOURCE,
          VALID_LOWER_BOUND,
          "_UI_EStructuralFeatureValidDefaultValueLiteral_diagnostic",
View Full Code Here

  protected void report(DiagnosticChain diagnostics, String key, Object[] substitutions, int index, Map<Object, Object> context)
  {
    if (diagnostics != null)
    {
      diagnostics.add
        (new BasicDiagnostic
           (Diagnostic.ERROR,
            DIAGNOSTIC_SOURCE,
            WELL_FORMED_INSTANCE_TYPE_NAME,
            getString(key, substitutions),
            new Object [] { index }));
View Full Code Here

     * @param instanceTypeName an instance type name.
     * @return the diagnostic result of the analysis.
     */
    public Diagnostic parseInstanceTypeName(final String instanceTypeName)
    {
      BasicDiagnostic placeholder = new BasicDiagnostic();
      char [] instanceTypeNameCharacterArray = instanceTypeName == null ? NO_CHARS: instanceTypeName.toCharArray();
      EGenericType eGenericType = handleInstanceTypeName(instanceTypeNameCharacterArray, 0, instanceTypeNameCharacterArray.length, placeholder);
      BasicDiagnostic result =
        createDiagnostic
          (placeholder.getSeverity(),
           DIAGNOSTIC_SOURCE,
           WELL_FORMED_INSTANCE_TYPE_NAME,
           "_UI_EClassifierInstanceTypeNameAnalysisResult_diagnostic",
           new Object [] { instanceTypeName },
           new Object [] { eGenericType, instanceTypeName });
      result.addAll(placeholder);
      return result;
    }
View Full Code Here

     * @param typeParameterList a comma separated list of type parameters delimited by '&lt;' and '>'.
     * @return the diagnostic result of the analysis.
     */
    public Diagnostic parseTypeParameterList(final String typeParameterList)
    {
      BasicDiagnostic placeholder = new BasicDiagnostic();
      char [] instanceTypeNameCharacterArray = typeParameterList == null ? NO_CHARS : typeParameterList.toCharArray();
      List<ETypeParameter> eTypeParameters = handleTypeParameters(instanceTypeNameCharacterArray, 0, instanceTypeNameCharacterArray.length, placeholder);
      BasicDiagnostic result =
        createDiagnostic
          (placeholder.getSeverity(),
           DIAGNOSTIC_SOURCE,
           WELL_FORMED_INSTANCE_TYPE_NAME,
           "_UI_EClassifierInstanceTypeNameAnalysisResult_diagnostic",
           new Object [] { typeParameterList },
           new Object [] { eTypeParameters, typeParameterList });
      result.addAll(placeholder);
      return result;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.common.util.BasicDiagnostic$EclipseHelper

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.