Exemple #1
0
  /**
   * @param monitor the progress monitor to use for reporting progress to the user. It is the
   *     caller's responsibility to call done() on the given monitor. Accepts null, indicating that
   *     no progress should be reported and that the operation cannot be cancelled.
   */
  protected void doClean(ToBeBuilt toBeBuilt, IProgressMonitor monitor) throws CoreException {
    SubMonitor progress = SubMonitor.convert(monitor, 2);
    ImmutableList<Delta> deltas =
        builderState.clean(toBeBuilt.getToBeDeleted(), progress.newChild(1));
    if (participant != null) {
      Set<URI> sourceURIs =
          new SourceLevelURICache()
              .getSourcesFrom(toBeBuilt.getToBeDeleted(), resourceServiceProvideRegistry);

      participant.build(
          new BuildContext(
              this,
              getResourceSetProvider().get(getProject()),
              deltas,
              sourceURIs,
              BuildType.CLEAN),
          progress.newChild(1));
    } else {
      progress.worked(1);
    }
  }