Author: scabanovich
Date: 2009-09-25 12:04:52 -0400 (Fri, 25 Sep 2009)
New Revision: 17756
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropUtils.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4950
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropUtils.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropUtils.java 2009-09-25
15:59:22 UTC (rev 17755)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropUtils.java 2009-09-25
16:04:52 UTC (rev 17756)
@@ -18,6 +18,7 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
import org.jboss.tools.common.model.XModelObject;
@@ -25,8 +26,6 @@
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.editors.dnd.composite.TagAttributesComposite;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.jst.web.tld.IWebProject;
-import org.jboss.tools.jst.web.tld.WebProjectFactory;
/**
*
@@ -94,8 +93,10 @@
container = (IContainer)EclipseResourceUtil.getResource(o);
}
if(container == null) {
- IWebProject p = WebProjectFactory.instance.getWebProject(modelNature.getModel());
- container = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(new
Path(p.getWebRootLocation()));
+ IResource r = EclipseResourceUtil.getFirstWebContentResource(project);
+ if(r instanceof IContainer) {
+ container = (IContainer)r;
+ }
}
return container;
}