IWorkbench wb = PlatformUI.getWorkbench();
IProgressService ps = wb.getProgressService();
ps.busyCursorWhile(new IRunnableWithProgress() {
public void run(IProgressMonitor progressMonitor) {
try {
IProgress progress = new SwtProgressImpl(
progressMonitor);
ProjectUtils.updateProjectLocations(progress);
List<IJavaProject> dependentProjects = BuildUtils
.getDependentProjects(javaProject, progress);
progress.setRange(0, dependentProjects.size());
int index = 0;
for (IJavaProject project : dependentProjects) {
progress.increment(1, "Building "
+ project.getProject().getName());
BuildUtils.buildJavaProjectInteractively0(project,
progress, buildKind, problems);
progress.setRange(0, dependentProjects.size());
for (int i = 0; i < index; i++) {
progress.increment(1, "");
}
index++;
}
BuildUtils.buildJavaProjectInteractively0(javaProject,
progress, buildKind, problems);