diff options
Diffstat (limited to 'plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/Web25ModelProvider.java')
-rw-r--r-- | plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/Web25ModelProvider.java | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/Web25ModelProvider.java b/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/Web25ModelProvider.java deleted file mode 100644 index e55cdd67c..000000000 --- a/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/Web25ModelProvider.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.jee.model.internal; - - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.javaee.core.DisplayName; -import org.eclipse.jst.javaee.core.JavaeeFactory; -import org.eclipse.jst.javaee.web.WebApp; -import org.eclipse.jst.javaee.web.WebAppDeploymentDescriptor; -import org.eclipse.jst.javaee.web.WebAppVersionType; -import org.eclipse.jst.javaee.web.WebFactory; -import org.eclipse.jst.javaee.web.internal.util.WebResourceImpl; - -public class Web25ModelProvider extends JEE5ModelProvider { - - private WebResourceImpl webResource = null; - private static final String WAR25_CONTENT_TYPE = "org.eclipse.jst.jee.ee5webDD"; //$NON-NLS-1$ - public Web25ModelProvider(IProject proj) { - super(); - this.proj = proj; - setDefaultResourcePath(new Path(J2EEConstants.WEBAPP_DD_URI)); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.model.IModelProvider#getModelObject(org.eclipse.core.runtime.IPath) - */ - public Object getModelObject(IPath modelPath) { - WebResourceImpl webRes = (WebResourceImpl)getModelResource(modelPath); - if (webRes != null && webRes.getContents().size() > 0) - return webRes.getWebApp(); - return null; - } - protected String getContentTypeDescriber() { - return WAR25_CONTENT_TYPE; - } - public void populateRoot(XMLResourceImpl res, String name) { - WebAppDeploymentDescriptor dd = WebFactory.eINSTANCE.createWebAppDeploymentDescriptor(); - dd.getXMLNSPrefixMap().put("", J2EEConstants.JAVAEE_NS_URL); //$NON-NLS-1$ - dd.getXMLNSPrefixMap().put("xsi", J2EEConstants.XSI_NS_URL); //$NON-NLS-1$ - dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE_NS_URL, J2EEConstants.WEB_APP_SCHEMA_LOC_2_5); - WebApp war = WebFactory.eINSTANCE.createWebApp(); - DisplayName dn = JavaeeFactory.eINSTANCE.createDisplayName(); - dn.setValue(name); - war.getDisplayNames().add(dn); - dd.setWebApp(war); - war.setVersion(WebAppVersionType._25_LITERAL); - res.getContents().add((EObject) dd); - } - -} |