Author: DartPeng
Date: 2008-10-16 23:01:17 -0400 (Thu, 16 Oct 2008)
New Revision: 10907
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java
Log:
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java 2008-10-17
02:43:26 UTC (rev 10906)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java 2008-10-17
03:01:17 UTC (rev 10907)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.core.JavaProject;
@@ -95,6 +96,14 @@
IProject project = ((IResource)obj).getProject();
this.project = JavaCore.create(project);
}
+
+ if(project == null){
+ if(obj instanceof IAdaptable){
+ IResource relateResource =(IResource)
((IAdaptable)obj).getAdapter(IResource.class);
+ IProject project = relateResource.getProject();
+ this.project = JavaCore.create(project);
+ }
+ }
}
}
}
Show replies by date