Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/support/UiTestUtil.java')
-rw-r--r--org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/support/UiTestUtil.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/support/UiTestUtil.java b/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/support/UiTestUtil.java
index 86ad29fa..5ca92b94 100644
--- a/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/support/UiTestUtil.java
+++ b/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/support/UiTestUtil.java
@@ -19,6 +19,8 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
@@ -76,7 +78,12 @@ public class UiTestUtil {
}
public static void closeAllEditors() {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
+ for (IWorkbenchWindow window : PlatformUI.getWorkbench().getWorkbenchWindows()) {
+ IWorkbenchPage page = window.getActivePage();
+ if (page != null) {
+ page.closeAllEditors(false);
+ }
+ }
}
}

Back to the top