Author: vyemialyanchyk
Date: 2009-01-27 15:16:56 -0500 (Tue, 27 Jan 2009)
New Revision: 13296
Modified:
branches/jbosstools-3.0.0.CR2/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java
Log:
JBIDE-3645
Modified:
branches/jbosstools-3.0.0.CR2/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java
===================================================================
---
branches/jbosstools-3.0.0.CR2/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java 2009-01-27
19:03:43 UTC (rev 13295)
+++
branches/jbosstools-3.0.0.CR2/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java 2009-01-27
20:16:56 UTC (rev 13296)
@@ -68,7 +68,13 @@
}
public boolean isCUSelected() {
IWorkbench workbench = Activator.getDefault().getWorkbench();
+ if (workbench == null || workbench.getActiveWorkbenchWindow() == null) {
+ return false;
+ }
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
+ if (page == null) {
+ return false;
+ }
IEditorPart editor = page.getActiveEditor();
if (editor instanceof CompilationUnitEditor) {
return true;