Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.emf.eson.ui/src/org/eclipse/emf/eson/ui/wizard/EFactoryNewFileWizardPage.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.eson.ui/src/org/eclipse/emf/eson/ui/wizard/EFactoryNewFileWizardPage.java b/plugins/org.eclipse.emf.eson.ui/src/org/eclipse/emf/eson/ui/wizard/EFactoryNewFileWizardPage.java
index d368b54..ab2d51d 100644
--- a/plugins/org.eclipse.emf.eson.ui/src/org/eclipse/emf/eson/ui/wizard/EFactoryNewFileWizardPage.java
+++ b/plugins/org.eclipse.emf.eson.ui/src/org/eclipse/emf/eson/ui/wizard/EFactoryNewFileWizardPage.java
@@ -26,7 +26,9 @@ import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.eson.ui.EFactoryLog;
import org.eclipse.emf.eson.ui.internal.EFactoryActivator;
import org.eclipse.emf.eson.util.EPackageRegistry;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -134,11 +136,11 @@ public class EFactoryNewFileWizardPage extends WizardPage {
Object obj = ssel.getFirstElement();
if (obj instanceof IResource) {
setContainerText((IResource) obj);
- } else if (obj instanceof IPackageFragment) {
- IPackageFragment packageFragment = (IPackageFragment) obj;
+ } else if (obj instanceof IPackageFragment || obj instanceof IPackageFragmentRoot) {
+ IJavaElement packageFragment = (IJavaElement) obj;
try {
setContainerText(packageFragment.getCorrespondingResource());
- } catch (JavaModelException e) {
+ } catch (JavaModelException e) {
EFactoryLog.logError(e);
}
}

Back to the top