Author: dgolovin
Date: 2012-08-21 19:20:02 -0400 (Tue, 21 Aug 2012)
New Revision: 43140
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/DirtyEditorTracker.java
Log:
added check for PlatforUI.isWorkbenchIsRunning() to avoid problems during core tests
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/DirtyEditorTracker.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/DirtyEditorTracker.java 2012-08-21
23:07:21 UTC (rev 43139)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/DirtyEditorTracker.java 2012-08-21
23:20:02 UTC (rev 43140)
@@ -28,6 +28,7 @@
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
import org.jboss.tools.common.CommonPlugin;
/**
@@ -53,13 +54,15 @@
}
private void init() {
- IWorkbench workbench = CommonPlugin.getDefault().getWorkbench();
- if(workbench != null) {
- IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
- for (IWorkbenchWindow window: windows) {
- windowOpened(window);
+ if( PlatformUI.isWorkbenchRunning() ) {
+ IWorkbench workbench = CommonPlugin.getDefault().getWorkbench();
+ if(workbench != null) {
+ IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
+ for (IWorkbenchWindow window: windows) {
+ windowOpened(window);
+ }
+ CommonPlugin.getDefault().getWorkbench().addWindowListener(this);
}
- CommonPlugin.getDefault().getWorkbench().addWindowListener(this);
}
}
Show replies by date