Package org.eclipse.emf.common.util

Examples of org.eclipse.emf.common.util.BasicDiagnostic.merge()


            ((InstallableUnit)unit).setVersion(Version.create("0.0.0"));
          }
          resolvedIUs.add(unit);
        } else {
          String msg = "Error occured during resolution of '" + uri.toString() + "'. The IU '" + iu.getID() + "' with range constraint '" + iu.getVersionRange() + "' can not be found.";
          diag.merge(new BasicDiagnostic(Diagnostic.ERROR, TargetPlatformBundleActivator.PLUGIN_ID, -1, msg, new Object[]{this, iu,}));
        }
      }
    } catch (ProvisionException e) {
      diag.merge(BasicDiagnostic.toDiagnostic(e));
    }
View Full Code Here


          String msg = "Error occured during resolution of '" + uri.toString() + "'. The IU '" + iu.getID() + "' with range constraint '" + iu.getVersionRange() + "' can not be found.";
          diag.merge(new BasicDiagnostic(Diagnostic.ERROR, TargetPlatformBundleActivator.PLUGIN_ID, -1, msg, new Object[]{this, iu,}));
        }
      }
    } catch (ProvisionException e) {
      diag.merge(BasicDiagnostic.toDiagnostic(e));
    }
   
    return diag;
  }
 
View Full Code Here

  public Diagnostic resolve(IMetadataRepositoryManager metadataRepositoryManager, IProgressMonitor monitor) {
    BasicDiagnostic ret = new BasicDiagnostic();
    SubMonitor subMonitor = SubMonitor.convert(monitor, getLocations().size());
    for (ResolvedLocation location : getLocations()) {
      if(subMonitor.isCanceled()) {
        ret.merge(BasicDiagnostic.CANCEL_INSTANCE);
        break;
      }
      Diagnostic diagnostic = location.resolve(metadataRepositoryManager, subMonitor);
      if (diagnostic.getSeverity() >= Diagnostic.WARNING) {
        ret.merge(diagnostic);
View Full Code Here

        ret.merge(BasicDiagnostic.CANCEL_INSTANCE);
        break;
      }
      Diagnostic diagnostic = location.resolve(metadataRepositoryManager, subMonitor);
      if (diagnostic.getSeverity() >= Diagnostic.WARNING) {
        ret.merge(diagnostic);
      }
      subMonitor.worked(1);
    }
    return ret;
  }
View Full Code Here

  private IProvisioningAgent agent;
 
  public Diagnostic generateTargetDefinitionFile(URI uri, IProgressMonitor monitor) {
    BasicDiagnostic ret = new BasicDiagnostic(TargetPlatformBundleActivator.PLUGIN_ID, 0, "Diagnostic of the generation of the target platform.", null);
    if (!"targetplatform".equals(uri.fileExtension()) && !"tpd".equals(uri.fileExtension())) {
      ret.merge(new BasicDiagnostic(Diagnostic.ERROR, TargetPlatformBundleActivator.PLUGIN_ID, -1, "The target platform file '" + uri + "' must ends with '.tpd' or '.targetplatform' extensions.", null));
    } else {
      Diagnostic diagnostic = doGenerateTargetDefinitionFile(uri, monitor);
      if (diagnostic.getSeverity() >= Diagnostic.WARNING) {
        ret.merge(diagnostic);
      }
View Full Code Here

    if (!"targetplatform".equals(uri.fileExtension()) && !"tpd".equals(uri.fileExtension())) {
      ret.merge(new BasicDiagnostic(Diagnostic.ERROR, TargetPlatformBundleActivator.PLUGIN_ID, -1, "The target platform file '" + uri + "' must ends with '.tpd' or '.targetplatform' extensions.", null));
    } else {
      Diagnostic diagnostic = doGenerateTargetDefinitionFile(uri, monitor);
      if (diagnostic.getSeverity() >= Diagnostic.WARNING) {
        ret.merge(diagnostic);
      }
    }
    return ret;
  }
View Full Code Here

      Resource resource = loadTargetPlatform(uri);
      subMonitor.worked(2);
     
      Diagnostic resourceDiagnostic = EcoreUtil.computeDiagnostic(resource, true);
      if (resourceDiagnostic.getSeverity() >= Diagnostic.WARNING) {
        ret.merge(resourceDiagnostic);
      }

      if (resourceDiagnostic.getSeverity() < Diagnostic.ERROR) {
        TargetPlatform targetPlatform = null;
        if (resource != null && !resource.getContents().isEmpty()) {
View Full Code Here

        TargetPlatform targetPlatform = null;
        if (resource != null && !resource.getContents().isEmpty()) {
          targetPlatform = (TargetPlatform) resource.getContents().get(0);
        }
        if (targetPlatform == null) {
          ret.merge(new BasicDiagnostic(Diagnostic.ERROR, TargetPlatformBundleActivator.PLUGIN_ID, -1, "Error occured while loading the file " + uri + ".", null));
        } else if (subMonitor.isCanceled()) {
          ret.merge(Diagnostic.CANCEL_INSTANCE);
        } else {
          SubMonitor diagnosticianMonitor = subMonitor.newChild(90).setWorkRemaining(targetPlatform.getLocations().size());
          Diagnostic validation = new CustomDiagnostician(diagnosticianMonitor).validate(targetPlatform);
View Full Code Here

          targetPlatform = (TargetPlatform) resource.getContents().get(0);
        }
        if (targetPlatform == null) {
          ret.merge(new BasicDiagnostic(Diagnostic.ERROR, TargetPlatformBundleActivator.PLUGIN_ID, -1, "Error occured while loading the file " + uri + ".", null));
        } else if (subMonitor.isCanceled()) {
          ret.merge(Diagnostic.CANCEL_INSTANCE);
        } else {
          SubMonitor diagnosticianMonitor = subMonitor.newChild(90).setWorkRemaining(targetPlatform.getLocations().size());
          Diagnostic validation = new CustomDiagnostician(diagnosticianMonitor).validate(targetPlatform);
          if (validation.getSeverity() >= Diagnostic.WARNING) {
            ret.merge(validation);
View Full Code Here

          ret.merge(Diagnostic.CANCEL_INSTANCE);
        } else {
          SubMonitor diagnosticianMonitor = subMonitor.newChild(90).setWorkRemaining(targetPlatform.getLocations().size());
          Diagnostic validation = new CustomDiagnostician(diagnosticianMonitor).validate(targetPlatform);
          if (validation.getSeverity() >= Diagnostic.WARNING) {
            ret.merge(validation);
          } else if (subMonitor.isCanceled()) {
            ret.merge(Diagnostic.CANCEL_INSTANCE);
          }
         
          if (validation.getSeverity() < Diagnostic.ERROR) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.