Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Commit

Permalink
Removed duplicate code for calling save prompt. related to #1275
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Rudi committed Sep 19, 2017
1 parent 1bbaeee commit ead9e7e
Showing 1 changed file with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.IStatusHandler;
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
import org.eclipse.debug.core.model.LaunchConfigurationDelegate;
import org.eclipse.emf.common.util.URI;
Expand Down Expand Up @@ -89,23 +87,15 @@ public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, I
return false;
}

@Override
protected IProject[] getBuildOrder(ILaunchConfiguration configuration, String mode) throws CoreException {
return getProjectsForProblemSearch(configuration, mode);
}

@Override
protected boolean saveBeforeLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
throws CoreException {
monitor.beginTask("", 1);
try {
IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(promptStatus);
if (prompter != null) {
// load the projects for which the save prompt should appear
IProject[] buildOrder = getProjectsForProblemSearch(configuration, mode);
if (!((Boolean) prompter.handleStatus(saveScopedDirtyEditors, new Object[]{configuration, buildOrder}))
.booleanValue()) {
return false;
}
}
return true;
} finally {
monitor.done();
}
return super.saveBeforeLaunch(configuration, mode, monitor);
}

}

0 comments on commit ead9e7e

Please sign in to comment.