Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2012-05-07 10:13:10 -0400
committerTom Schindl2012-05-07 10:13:10 -0400
commit9179c44ed4766582b330a6e9e3f8b682471ea450 (patch)
tree5ca5b7e0a0175106b8146d7df69d6596735dfe21
parent91ad0a19b056e0a07344f58497c4564a522496b5 (diff)
downloadorg.eclipse.e4.tools-9179c44ed4766582b330a6e9e3f8b682471ea450.tar.gz
org.eclipse.e4.tools-9179c44ed4766582b330a6e9e3f8b682471ea450.tar.xz
org.eclipse.e4.tools-9179c44ed4766582b330a6e9e3f8b682471ea450.zip
Bug 378602 - [Tooling] JavaProject not accepted as default container for
new Application model file
-rw-r--r--bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/model/NewModelFilePage.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/model/NewModelFilePage.java b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/model/NewModelFilePage.java
index 634ea30c..23f41632 100644
--- a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/model/NewModelFilePage.java
+++ b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/model/NewModelFilePage.java
@@ -14,6 +14,8 @@ import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.dialogs.IDialogPage;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -122,6 +124,7 @@ public class NewModelFilePage extends WizardPage {
if (ssel.size() > 1)
return;
Object obj = ssel.getFirstElement();
+
if (obj instanceof IResource) {
IContainer container;
if (obj instanceof IContainer)
@@ -129,6 +132,13 @@ public class NewModelFilePage extends WizardPage {
else
container = ((IResource) obj).getParent();
containerText.setText(container.getFullPath().toString());
+ } else if( obj instanceof IJavaProject ) {
+ IJavaProject container = (IJavaProject) obj;
+ try {
+ containerText.setText(container.getCorrespondingResource().getFullPath().toString());
+ } catch(JavaModelException e) {
+ e.printStackTrace();
+ }
}
}
fileText.setText(defaultFilename);

Back to the top