Skip to content

Commit

Permalink
Show the view using sync and don't activate
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Kutscha committed Aug 30, 2021
1 parent 3b8b3ba commit 9ff5fa0
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.pitest.pitclipse.core.extension.point.ResultNotifier;
Expand Down Expand Up @@ -102,11 +100,10 @@ public class PitclipseMutantMarkerFactory implements ResultNotifier<MutationsMod
public void handleResults(MutationsModel results) {
createMarkers(results);
// open and show tasks view after the marker are created
Display.getDefault().asyncExec(() -> {
Display.getDefault().syncExec(() -> {
try {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IViewPart view = page.showView(TASKS_VIEW_ID);
page.activate(view);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.showView(TASKS_VIEW_ID);
} catch (PartInitException e) {
throw new RuntimeException("Could not show task view.", e);
}
Expand Down

0 comments on commit 9ff5fa0

Please sign in to comment.