eclipse plugin: let's return the first Workbench Window...

...if we have any rather then the active one that might be 'null'
This commit is contained in:
Timotei Dolean 2010-05-26 11:40:18 +00:00
parent 2272449226
commit 074b7771a3

View file

@ -54,6 +54,8 @@ public class WorkspaceUtils
}
public static IWorkbenchWindow getWorkbenchWindow()
{
return Activator.getDefault().getWorkbench().getActiveWorkbenchWindow();
if (Activator.getDefault().getWorkbench().getWorkbenchWindowCount() == 0)
return null;
return Activator.getDefault().getWorkbench().getWorkbenchWindows()[0];
}
}