Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse')
-rw-r--r--plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/componentcore/util/AppClientArtifactEdit.java362
-rw-r--r--plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/componentcore/util/package.xml19
-rw-r--r--plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientComponentCreationDataModelProvider.java155
-rw-r--r--plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientComponentCreationFacetOperation.java81
-rw-r--r--plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientComponentImportDataModelProvider.java69
-rw-r--r--plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientCreationResourceHandler.java31
-rw-r--r--plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientFacetProjectCreationDataModelProvider.java57
-rw-r--r--plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/IConfigurationConstants.java21
-rw-r--r--plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/modulecore/util/AppClientEditAdapterFactory.java38
-rw-r--r--plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetInstallDataModelProvider.java50
-rw-r--r--plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetInstallDelegate.java177
-rw-r--r--plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetPostInstallDelegate.java62
-rw-r--r--plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/IAppClientFacetInstallDataModelProperties.java21
13 files changed, 0 insertions, 1143 deletions
diff --git a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/componentcore/util/AppClientArtifactEdit.java b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/componentcore/util/AppClientArtifactEdit.java
deleted file mode 100644
index 79a84bf9b..000000000
--- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/componentcore/util/AppClientArtifactEdit.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.j2ee.applicationclient.componentcore.util;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jst.j2ee.application.ApplicationPackage;
-import org.eclipse.jst.j2ee.application.Module;
-import org.eclipse.jst.j2ee.client.ApplicationClient;
-import org.eclipse.jst.j2ee.client.ApplicationClientResource;
-import org.eclipse.jst.j2ee.client.ClientFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException;
-import org.eclipse.jst.j2ee.componentcore.EnterpriseArtifactEdit;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.internal.archive.operations.AppClientComponentLoadStrategyImpl;
-import org.eclipse.jst.j2ee.internal.common.XMLResource;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.wst.common.componentcore.ArtifactEdit;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.UnresolveableURIException;
-import org.eclipse.wst.common.componentcore.internal.ArtifactEditModel;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil;
-import org.eclipse.wst.common.componentcore.internal.util.IArtifactEditFactory;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-
-public class AppClientArtifactEdit extends EnterpriseArtifactEdit implements IArtifactEditFactory {
-
- /**
- * <p>
- * Identifier used to link AppClientArtifactEdit to a AppClientEditAdapterFactory {@see
- * AppClientEditAdapterFactory} stored in an AdapterManger (@see AdapterManager)
- * </p>
- */
-
- public static final Class ADAPTER_TYPE = AppClientArtifactEdit.class;
-
- /**
- *
- */
- public AppClientArtifactEdit() {
- super();
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @param aHandle
- * @param toAccessAsReadOnly
- * @throws IllegalArgumentException
- */
- public AppClientArtifactEdit(IProject aProject, boolean toAccessAsReadOnly) throws IllegalArgumentException {
- super(aProject, toAccessAsReadOnly);
- }
-
- public AppClientArtifactEdit(IProject aProject, boolean toAccessAsReadOnly, boolean forCreate) throws IllegalArgumentException {
- super(aProject, toAccessAsReadOnly, forCreate, J2EEProjectUtilities.APPLICATION_CLIENT);
- }
-
- public AppClientArtifactEdit(ArtifactEditModel anArtifactEditModel) {
- super(anArtifactEditModel);
- }
-
- /**
- * <p>Note: This method is for internal use only. Clients should not call this method.</p>
- * @param aNature
- * @param aModule
- * @param toAccessAsReadOnly
- */
- protected AppClientArtifactEdit(ModuleCoreNature aNature, IVirtualComponent aModule, boolean toAccessAsReadOnly) {
- super(aNature, aModule, toAccessAsReadOnly);
- }
-
- /**
- * <p>
- * Retrieves the underlying resource from the ArtifactEditModel using defined URI.
- * </p>
- *
- * @return Resource
- *
- */
-
- public Resource getDeploymentDescriptorResource() {
- return getArtifactEditModel().getResource(J2EEConstants.APP_CLIENT_DD_URI_OBJ);
- }
-
- /**
- * <p>
- * Obtains the ApplicationClient (@see ApplicationClient) root object from the ApplicationClientResource. If the root object does
- * not exist, then one is created (@link addAppClientJarIfNecessary(getAppClientXmiResource())).
- * The root object contains all other resource defined objects.
- * </p>
- *
- * @return EObject
- *
- */
- public EObject getDeploymentDescriptorRoot() {
- List contents = getDeploymentDescriptorResource().getContents();
- if (contents.size() > 0)
- return (EObject) contents.get(0);
- addAppClientIfNecessary(getApplicationClientXmiResource());
- return (EObject) contents.get(0);
- }
-
- /**
- *
- * @return ApplicationClientResource from (@link getDeploymentDescriptorResource())
- *
- */
-
- public ApplicationClientResource getApplicationClientXmiResource() {
- return (ApplicationClientResource) getDeploymentDescriptorResource();
- }
-
- /**
- * <p>
- * Creates a deployment descriptor root object (ApplicationClient) and populates with data. Adds the root
- * object to the deployment descriptor resource.
- * </p>
- *
- * <p>
- *
- * @param aModule
- * A non-null pointing to a {@see XMLResource}
- *
- * Note: This method is typically used for JUNIT - move?
- * </p>
- */
- protected void addAppClientIfNecessary(XMLResource aResource) {
-
- if (aResource != null && aResource.getContents().isEmpty()) {
- ApplicationClient appClient = ClientFactory.eINSTANCE.createApplicationClient();
- aResource.getContents().add(appClient);
- URI moduleURI = getArtifactEditModel().getModuleURI();
- try {
- appClient.setDisplayName(StructureEdit.getDeployedName(moduleURI));
- } catch (UnresolveableURIException e) {
- //Ignore
- }
- aResource.setID(appClient, J2EEConstants.APP_CLIENT_ID);
- //TODO add more mandatory elements
- }
- }
-
- /**
- * <p>
- * Method used for adding a j2ee project to an ear project; subclasses must override to create a
- * new instance of the correct kind of Module
- * </p>
- */
- public Module createNewModule() {
- return ((ApplicationPackage) EPackage.Registry.INSTANCE.getEPackage(ApplicationPackage.eNS_URI)).getApplicationFactory().createJavaClientModule();
- }
-
- /**
- *
- * @return ApplicationClient from (@link getDeploymentDescriptorRoot())
- *
- */
- public ApplicationClient getApplicationClient() {
- return (ApplicationClient) getDeploymentDescriptorRoot();
- }
-
- /**
- * <p>
- * Retrieves J2EE version information from ApplicationClientResource.
- * </p>
- *
- * @return an integer representation of a J2EE Spec version
- *
- */
-
- public int getJ2EEVersion() {
- return getApplicationClientXmiResource().getJ2EEVersionID();
- }
-
- /**
- * <p>
- * Returns an instance facade to manage the underlying edit model for the given
- * {@see WorkbenchComponent}. Instances of ArtifactEdit that are returned through this method
- * must be {@see #dispose()}ed of when no longer in use.
- * </p>
- * <p>
- * Use to acquire an ArtifactEdit facade for a specific {@see WorkbenchComponent}&nbsp;that
- * will not be used for editing. Invocations of any save*() API on an instance returned from
- * this method will throw exceptions.
- * </p>
- * <p>
- * <b>The following method may return null. </b>
- * </p>
- *
- * @param aModule
- * A valid {@see WorkbenchComponent}&nbsp;with a handle that resolves to an
- * accessible project in the workspace
- * @return An instance of ArtifactEdit that may only be used to read the underlying content
- * model
- */
- public static AppClientArtifactEdit getAppClientArtifactEditForRead(IProject aProject) {
- AppClientArtifactEdit artifactEdit = null;
- try {
- if (isValidApplicationClientModule(ComponentCore.createComponent(aProject)))
- artifactEdit = new AppClientArtifactEdit(aProject, true, false);
- } catch (Exception e) {
- artifactEdit = null;
- }
- return artifactEdit;
- }
- /**
- * <p>
- * Returns an instance facade to manage the underlying edit model for the given
- * {@see WorkbenchComponent}. Instances of ArtifactEdit that are returned through this method
- * must be {@see #dispose()}ed of when no longer in use.
- * </p>
- * <p>
- * Use to acquire an ArtifactEdit facade for a specific {@see WorkbenchComponent}&nbsp;that
- * will be used for editing.
- * </p>
- * <p>
- * <b>The following method may return null. </b>
- * </p>
- *
- * @param aModule
- * A valid {@see WorkbenchComponent}&nbsp;with a handle that resolves to an
- * accessible project in the workspace
- * @return An instance of ArtifactEdit that may be used to modify and persist changes to the
- * underlying content model
- */
- public static AppClientArtifactEdit getAppClientArtifactEditForWrite(IProject aProject) {
- AppClientArtifactEdit artifactEdit = null;
- try {
- if (isValidApplicationClientModule(ComponentCore.createComponent(aProject)))
- artifactEdit = new AppClientArtifactEdit(aProject, false, false);
- } catch (Exception e) {
- artifactEdit = null;
- }
- return artifactEdit;
- }
-
- /**
- * <p>
- * Returns an instance facade to manage the underlying edit model for the given
- * {@see WorkbenchComponent}. Instances of AppClientArtifactEdit that are returned through this method
- * must be {@see #dispose()}ed of when no longer in use.
- * </p>
- * <p>
- * Use to acquire an AppClientArtifactEdit facade for a specific {@see WorkbenchComponent}&nbsp;that will not
- * be used for editing. Invocations of any save*() API on an instance returned from this method
- * will throw exceptions.
- * </p>
- * <p>
- * <b>This method may return null. </b>
- * </p>
- * <p>Note: This method is for internal use only. Clients should not call this method.</p>
- * @param aModule
- * A valid {@see WorkbenchComponent}&nbsp;with a handle that resolves to an accessible
- * project in the workspace
- * @return An instance of AppClientArtifactEdit that may only be used to read the underlying content
- * model
- * @throws UnresolveableURIException
- * could not resolve uri.
- */
- public static AppClientArtifactEdit getAppClientArtifactEditForRead(IVirtualComponent aModule) {
- if (aModule == null)
- return null;
- return getAppClientArtifactEditForRead(aModule.getProject());
- }
-
- /**
- * <p>
- * Returns an instance facade to manage the underlying edit model for the given
- * {@see WorkbenchComponent}. Instances of AppClientArtifactEdit that are returned through this method
- * must be {@see #dispose()}ed of when no longer in use.
- * </p>
- * <p>
- * Use to acquire an AppClientArtifactEdit facade for a specific {@see WorkbenchComponent}&nbsp;that
- * will be used for editing.
- * </p>
- * <p>
- * <b>This method may return null. </b>
- * </p>
- * <p>Note: This method is for internal use only. Clients should not call this method.</p>
- * @param aModule
- * A valid {@see WorkbenchComponent}&nbsp;with a handle that resolves to an accessible
- * project in the workspace
- * @return An instance of AppClientArtifactEdit that may be used to modify and persist changes to the
- * underlying content model
- */
- public static AppClientArtifactEdit getAppClientArtifactEditForWrite(IVirtualComponent aModule) {
- if (aModule == null)
- return null;
- return getAppClientArtifactEditForWrite(aModule.getProject());
- }
-
- /**
- * <p>Note: This method is for internal use only. Clients should not call this method.</p>
- * @param module
- * A {@see WorkbenchComponent}
- * @return True if the supplied module
- * {@see ArtifactEdit#isValidEditableModule(WorkbenchComponent)}and the moduleTypeId is a
- * JST module
- */
- public static boolean isValidApplicationClientModule(IVirtualComponent aModule) throws UnresolveableURIException {
- if (!isValidEditableModule(aModule))
- return false;
- return J2EEProjectUtilities.isApplicationClientProject(aModule.getProject());
- }
-
- public EObject createModelRoot() {
- return createModelRoot(getJ2EEVersion());
- }
- /* (non-Javadoc)
- * @see org.eclipse.jst.j2ee.internal.modulecore.util.EnterpriseArtifactEdit#createModelRoot(java.lang.Integer)
- */
- public EObject createModelRoot(int version) {
- ApplicationClientResource res = (ApplicationClientResource)getDeploymentDescriptorResource();
- res.setModuleVersionID(version);
- addAppClientIfNecessary(res);
- return ((ApplicationClientResource)getDeploymentDescriptorResource()).getRootObject();
- }
-
- public ArtifactEdit createArtifactEditForRead(IVirtualComponent aComponent) {
-
- return getAppClientArtifactEditForRead(aComponent);
- }
-
- public ArtifactEdit createArtifactEditForWrite(IVirtualComponent aComponent) {
-
- return getAppClientArtifactEditForWrite(aComponent);
- }
-
- public Archive asArchive(boolean includeSource) throws OpenFailureException{
- AppClientComponentLoadStrategyImpl loader = new AppClientComponentLoadStrategyImpl(getComponent());
- loader.setExportSource(includeSource);
- String uri = ModuleURIUtil.getHandleString(getComponent());
- return CommonarchiveFactory.eINSTANCE.openApplicationClientFile(loader, uri);
- }
-
- public static void createDeploymentDescriptor(IProject project, int version) {
- AppClientArtifactEdit appClientEdit = new AppClientArtifactEdit(project,false,true);
- try {
- appClientEdit.createModelRoot(version);
- appClientEdit.save(null);
- } finally {
- appClientEdit.dispose();
- }
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/componentcore/util/package.xml b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/componentcore/util/package.xml
deleted file mode 100644
index 49e3e8c7c..000000000
--- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/componentcore/util/package.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
- <head>
- <meta
- name="root"
- content="../../../../../../../" />
- <title>EJB Artifact Edit api overview</title>
- </head>
-
- <body>
- <abstract>
- This package includes the AppClientArtifactEdit api. This api is used to work with the emf model
- of a flexible application client module. It contains api to read and serialize out the emf model for application client modules.
- </abstract>
-
- <a href="#top">top</a>
- </body>
-</html>
- \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientComponentCreationDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientComponentCreationDataModelProvider.java
deleted file mode 100644
index 56619a869..000000000
--- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientComponentCreationDataModelProvider.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.j2ee.applicationclient.internal.creation;
-
-import java.util.Set;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.jst.j2ee.application.internal.operations.J2EEComponentCreationDataModelProvider;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage;
-import org.eclipse.jst.j2ee.datamodel.properties.IAppClientComponentCreationDataModelProperties;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.internal.common.CreationConstants;
-import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15;
-
-/**
- * @deprecated
- * @see AppClientFacetProjectCreationDataModelProvider
- */
-
-/**
- * This has been slated for removal post WTP 1.5. Do not use this class/interface
- *
- * @deprecated
- *
- * @see AppClientFacetProjectCreationDataModelProvider
- */
-public class AppClientComponentCreationDataModelProvider extends J2EEComponentCreationDataModelProvider implements IAppClientComponentCreationDataModelProperties, DoNotUseMeThisWillBeDeletedPost15{
-
- public AppClientComponentCreationDataModelProvider() {
- super();
- }
-
- public Set getPropertyNames() {
- Set propertyNames = super.getPropertyNames();
- propertyNames.add(CREATE_DEFAULT_MAIN_CLASS);
- return propertyNames;
- }
-
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(CREATE_DEFAULT_MAIN_CLASS)) {
- return getProperty(CREATE_DEFAULT_FILES);
- } else if (propertyName.equals(ADD_TO_EAR)) {
- return Boolean.TRUE;
- } else if (propertyName.equals(MANIFEST_FOLDER)) {
- return IPath.SEPARATOR + CreationConstants.DEFAULT_APPCLIENT_SOURCE_FOLDER + IPath.SEPARATOR + J2EEConstants.META_INF;
- }
- if (propertyName.equals(DD_FOLDER)) {
- return IPath.SEPARATOR + CreationConstants.DEFAULT_APPCLIENT_SOURCE_FOLDER + IPath.SEPARATOR + J2EEConstants.META_INF;
- }
- if (propertyName.equals(JAVASOURCE_FOLDER)) {
- return CreationConstants.DEFAULT_APPCLIENT_SOURCE_FOLDER;
- } else if (propertyName.equals(MODULE_URI)) {
- return getProject().getName()+IJ2EEModuleConstants.JAR_EXT;
- }
- return super.getDefaultProperty(propertyName);
- }
-
- protected Integer getDefaultComponentVersion() {
- int highestJ2EEPref = J2EEPlugin.getDefault().getJ2EEPreferences().getHighestJ2EEVersionID();
- return new Integer(highestJ2EEPref);
- }
-
- protected DataModelPropertyDescriptor[] getValidComponentVersionDescriptors() {
- int highestJ2EEPref = J2EEPlugin.getDefault().getJ2EEPreferences().getHighestJ2EEVersionID();
- DataModelPropertyDescriptor[] descriptors = null;
- switch (highestJ2EEPref) {
- case J2EEVersionConstants.J2EE_1_2_ID :
- descriptors = new DataModelPropertyDescriptor[1];
- descriptors[0] = new DataModelPropertyDescriptor(new Integer(J2EEVersionConstants.J2EE_1_2_ID), J2EEVersionConstants.VERSION_1_2_TEXT);
- break;
- case J2EEVersionConstants.J2EE_1_3_ID :
- descriptors = new DataModelPropertyDescriptor[2];
- descriptors[0] = new DataModelPropertyDescriptor(new Integer(J2EEVersionConstants.J2EE_1_2_ID), J2EEVersionConstants.VERSION_1_2_TEXT);
- descriptors[1] = new DataModelPropertyDescriptor(new Integer(J2EEVersionConstants.J2EE_1_3_ID), J2EEVersionConstants.VERSION_1_3_TEXT);
- break;
- case J2EEVersionConstants.J2EE_1_4_ID :
- default :
- descriptors = new DataModelPropertyDescriptor[3];
- descriptors[0] = new DataModelPropertyDescriptor(new Integer(J2EEVersionConstants.J2EE_1_2_ID), J2EEVersionConstants.VERSION_1_2_TEXT);
- descriptors[1] = new DataModelPropertyDescriptor(new Integer(J2EEVersionConstants.J2EE_1_3_ID), J2EEVersionConstants.VERSION_1_3_TEXT);
- descriptors[2] = new DataModelPropertyDescriptor(new Integer(J2EEVersionConstants.J2EE_1_4_ID), J2EEVersionConstants.VERSION_1_4_TEXT);
- break;
- }
- return descriptors;
- }
-
- protected int convertModuleVersionToJ2EEVersion(int moduleVersion) {
- return moduleVersion;
- }
-
- protected EClass getComponentType() {
- return CommonarchivePackage.eINSTANCE.getApplicationClientFile();
- }
-
- protected String getComponentExtension() {
- return ".jar"; //$NON-NLS-1$
- }
-
- public IDataModelOperation getDefaultOperation() {
- //return new AppClientComponentCreationOperation(model);
- return new AppClientComponentCreationFacetOperation(model);
- }
-
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- return super.getValidPropertyDescriptors(propertyName);
- }
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean doSet = super.propertySet(propertyName, propertyValue);
- if (propertyName.equals(JAVASOURCE_FOLDER)){
- //unless MANIFEST folder is opened up, it is set as same as Java source folder
- setProperty(MANIFEST_FOLDER, getProperty(JAVASOURCE_FOLDER)+ "/" + J2EEConstants.META_INF); //$NON-NLS-1$
- }
- return doSet;
- }
-
- protected String getJ2EEProjectType() {
- return J2EEProjectUtilities.APPLICATION_CLIENT;
- }
-
- public DataModelPropertyDescriptor getPropertyDescriptor(String propertyName) {
- if (propertyName.equals(COMPONENT_VERSION)) {
- Integer propertyValue = (Integer) getProperty(propertyName);
- String description = null;
- switch (propertyValue.intValue()) {
- case J2EEVersionConstants.J2EE_1_2_ID :
- description = J2EEVersionConstants.VERSION_1_2_TEXT;
- break;
- case J2EEVersionConstants.J2EE_1_3_ID :
- description = J2EEVersionConstants.VERSION_1_3_TEXT;
- break;
- case J2EEVersionConstants.J2EE_1_4_ID :
- default :
- description = J2EEVersionConstants.VERSION_1_4_TEXT;
- break;
- }
- return new DataModelPropertyDescriptor(propertyValue, description);
- }
- return super.getPropertyDescriptor(propertyName);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientComponentCreationFacetOperation.java b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientComponentCreationFacetOperation.java
deleted file mode 100644
index 1ae788c1c..000000000
--- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientComponentCreationFacetOperation.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.j2ee.applicationclient.internal.creation;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentCreationDataModelProperties;
-import org.eclipse.jst.j2ee.datamodel.properties.IJavaComponentCreationDataModelProperties;
-import org.eclipse.jst.j2ee.project.facet.AppClientFacetInstallDataModelProvider;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEModuleFacetInstallDataModelProperties;
-import org.eclipse.jst.j2ee.project.facet.J2EEComponentCreationFacetOperation;
-import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IComponentCreationDataModelProperties;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15;
-
-/**
- * This has been slated for removal post WTP 1.5. Do not use this class/interface
- *
- * @deprecated
- *
- * @see AppClientFacetProjectCreationDataModelProvider
- */
-public class AppClientComponentCreationFacetOperation extends J2EEComponentCreationFacetOperation implements IFacetProjectCreationDataModelProperties, DoNotUseMeThisWillBeDeletedPost15{
-
- public AppClientComponentCreationFacetOperation(IDataModel model) {
- super(model);
- }
-
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IDataModel dm = DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider());
- String projectName = model.getStringProperty(IComponentCreationDataModelProperties.PROJECT_NAME);
- dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, projectName);
-
- FacetDataModelMap map = (FacetDataModelMap) dm.getProperty(FACET_DM_MAP);
- IDataModel javaDM = setupJavaInstallAction();
- map.add(javaDM);
- IDataModel newModel = setupAppClientFacetInstallAction();
- map.add(newModel);
- setRuntime(newModel, dm); // Setting runtime property
- setAddToEARFromWizard(newModel);
- IStatus stat = dm.getDefaultOperation().execute(monitor, info);
- if (stat.isOK()) {
- String earProjectName = (String) model.getProperty(IJ2EEComponentCreationDataModelProperties.EAR_COMPONENT_NAME);
- IProject earProject = ProjectUtilities.getProject(earProjectName);
- if (earProject != null && earProject.exists())
- stat = addtoEar(projectName, earProjectName);
- }
-
- return stat;
- }
-
- protected IDataModel setupAppClientFacetInstallAction() {
- String versionStr = model.getPropertyDescriptor(IJ2EEComponentCreationDataModelProperties.COMPONENT_VERSION).getPropertyDescription();
- IDataModel facetInstallDataModel = DataModelFactory.createDataModel(new AppClientFacetInstallDataModelProvider());
- facetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, model.getStringProperty(IComponentCreationDataModelProperties.PROJECT_NAME));
- facetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, versionStr);
- facetInstallDataModel.setProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER, model.getStringProperty(IJavaComponentCreationDataModelProperties.JAVASOURCE_FOLDER));
- facetInstallDataModel.setBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR,model.getBooleanProperty(IJ2EEComponentCreationDataModelProperties.ADD_TO_EAR));
- if (model.getBooleanProperty(IJ2EEComponentCreationDataModelProperties.ADD_TO_EAR))
- facetInstallDataModel.setProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME, model.getProperty(IJ2EEComponentCreationDataModelProperties.EAR_COMPONENT_NAME));
- facetInstallDataModel.setProperty(IJ2EEModuleFacetInstallDataModelProperties.MODULE_URI, model.getProperty(IJ2EEComponentCreationDataModelProperties.MODULE_URI));
- facetInstallDataModel.setProperty(IJ2EEModuleFacetInstallDataModelProperties.RUNTIME_TARGET_ID, model.getProperty(IJ2EEComponentCreationDataModelProperties.RUNTIME_TARGET_ID));
- return facetInstallDataModel;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientComponentImportDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientComponentImportDataModelProvider.java
deleted file mode 100644
index faedb7ebd..000000000
--- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientComponentImportDataModelProvider.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.j2ee.applicationclient.internal.creation;
-
-import org.eclipse.jst.j2ee.application.internal.operations.J2EEComponentImportDataModelProvider;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException;
-import org.eclipse.jst.j2ee.datamodel.properties.IAppClientComponentImportDataModelProperties;
-import org.eclipse.jst.j2ee.internal.archive.operations.AppClientComponentImportOperation;
-import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil;
-import org.eclipse.jst.j2ee.internal.common.XMLResource;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties.FacetDataModelMap;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-
-
-public final class AppClientComponentImportDataModelProvider extends J2EEComponentImportDataModelProvider implements IAppClientComponentImportDataModelProperties {
-
- public AppClientComponentImportDataModelProvider() {
- super();
- }
-
- protected int getType() {
- return XMLResource.APP_CLIENT_TYPE;
- }
-
- protected Archive openArchive(String uri) throws OpenFailureException {
- return CommonarchiveFactory.eINSTANCE.openApplicationClientFile(getArchiveOptions(), uri);
- }
-
- public IDataModelOperation getDefaultOperation() {
- return new AppClientComponentImportOperation(model);
- }
-
- protected IDataModel createJ2EEComponentCreationDataModel() {
- return DataModelFactory.createDataModel(new AppClientFacetProjectCreationDataModelProvider());
-
- }
-
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean set = super.propertySet(propertyName, propertyValue);
- if (propertyName.equals(FILE)) {
- IDataModel moduleDM = model.getNestedModel(NESTED_MODEL_J2EE_COMPONENT_CREATION);
- if (getModuleFile() != null) {
- FacetDataModelMap map = (FacetDataModelMap) moduleDM.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
- IDataModel appClientFacetDataModel = map.getFacetDataModel( J2EEProjectUtilities.APPLICATION_CLIENT );
-
- int version = getModuleSpecVersion();
- String versionText = J2EEVersionUtil.getJ2EETextVersion( version );
- appClientFacetDataModel.setStringProperty(IFacetDataModelProperties.FACET_VERSION_STR, versionText);
- model.notifyPropertyChange(PROJECT_NAME, IDataModel.VALID_VALUES_CHG);
- }
- }
- return set;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientCreationResourceHandler.java b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientCreationResourceHandler.java
deleted file mode 100644
index c35ede999..000000000
--- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientCreationResourceHandler.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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.j2ee.applicationclient.internal.creation;
-
-import org.eclipse.osgi.util.NLS;
-
-public final class AppClientCreationResourceHandler extends NLS {
-
- private static final String BUNDLE_NAME = "appclientcreation";//$NON-NLS-1$
-
- private AppClientCreationResourceHandler() {
- // Do not instantiate
- }
-
- public static String Error_occured_getting_appl_ERROR_;
- public static String Creating_Application_Clien_UI_;
- public static String Error_occured_loading_appl_UI_;
- public static String Not_an_Application_Client_project_ERROR_;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, AppClientCreationResourceHandler.class);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientFacetProjectCreationDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientFacetProjectCreationDataModelProvider.java
deleted file mode 100644
index 6b4d837dc..000000000
--- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/AppClientFacetProjectCreationDataModelProvider.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.j2ee.applicationclient.internal.creation;
-
-import org.eclipse.jst.common.project.facet.IJavaFacetInstallDataModelProperties;
-import org.eclipse.jst.common.project.facet.JavaFacetInstallDataModelProvider;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.project.facet.AppClientFacetInstallDataModelProvider;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEModuleFacetInstallDataModelProperties;
-import org.eclipse.jst.j2ee.project.facet.J2EEFacetProjectCreationDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
-
-public class AppClientFacetProjectCreationDataModelProvider extends J2EEFacetProjectCreationDataModelProvider {
-
- public AppClientFacetProjectCreationDataModelProvider() {
- super();
- }
-
- public void init() {
- super.init();
- FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP);
- IDataModel javaFacet = DataModelFactory.createDataModel(new JavaFacetInstallDataModelProvider());
- map.add(javaFacet);
- IDataModel appClientFacet = DataModelFactory.createDataModel(new AppClientFacetInstallDataModelProvider());
- map.add(appClientFacet);
- javaFacet.setProperty(IJavaFacetInstallDataModelProperties.SOURCE_FOLDER_NAME,appClientFacet.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER));
- appClientFacet.addListener(new IDataModelListener() {
- public void propertyChanged(DataModelEvent event) {
- if (IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME.equals(event.getPropertyName())) {
- setProperty(EAR_PROJECT_NAME, (String)event.getProperty());
- }else if (IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR.equals(event.getPropertyName())) {
- setProperty(ADD_TO_EAR, event.getProperty());
- }
- }
- });
- }
-
- public boolean propertySet(String propertyName, Object propertyValue) {
- if( propertyName.equals( MODULE_URI )){
- FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP);
- IDataModel appFacet = map.getFacetDataModel( J2EEProjectUtilities.APPLICATION_CLIENT );
- appFacet.setProperty( IJ2EEModuleFacetInstallDataModelProperties.MODULE_URI, propertyValue );
- }
- return super.propertySet(propertyName, propertyValue);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/IConfigurationConstants.java b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/IConfigurationConstants.java
deleted file mode 100644
index 8848cf02b..000000000
--- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/creation/IConfigurationConstants.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.j2ee.applicationclient.internal.creation;
-
-
-/**
- * Insert the type's description here. Creation date: (4/4/2001 10:05:24 AM)
- *
- * @author: Administrator
- */
-public interface IConfigurationConstants {
- final String PLUG_IN_ID = "org.eclipse.jst.j2ee"; //$NON-NLS-1$
-}
diff --git a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/modulecore/util/AppClientEditAdapterFactory.java b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/modulecore/util/AppClientEditAdapterFactory.java
deleted file mode 100644
index f3f5095bf..000000000
--- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/applicationclient/internal/modulecore/util/AppClientEditAdapterFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.j2ee.applicationclient.internal.modulecore.util;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jst.j2ee.applicationclient.componentcore.util.AppClientArtifactEdit;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.wst.common.componentcore.ArtifactEdit;
-import org.eclipse.wst.common.componentcore.internal.ArtifactEditModel;
-
-public class AppClientEditAdapterFactory implements IAdapterFactory {
-
- public AppClientEditAdapterFactory() {
- super();
- }
-
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adapterType == AppClientArtifactEdit.ADAPTER_TYPE || adapterType == ArtifactEdit.ADAPTER_TYPE) {
- ArtifactEditModel editModel = (ArtifactEditModel) adaptableObject;
- if (J2EEProjectUtilities.isApplicationClientProject(editModel.getProject()))
- return new AppClientArtifactEdit((ArtifactEditModel) adaptableObject);
- }
- return null;
- }
-
- public Class[] getAdapterList() {
- return new Class[]{ArtifactEdit.class, AppClientArtifactEdit.class};
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetInstallDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetInstallDataModelProvider.java
deleted file mode 100644
index 81e10f1fc..000000000
--- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetInstallDataModelProvider.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.j2ee.project.facet;
-
-import java.util.Set;
-
-import org.eclipse.jst.j2ee.internal.common.CreationConstants;
-import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil;
-import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-public class AppClientFacetInstallDataModelProvider extends J2EEModuleFacetInstallDataModelProvider implements IAppClientFacetInstallDataModelProperties {
-
- public AppClientFacetInstallDataModelProvider() {
- super();
- }
-
- public Set getPropertyNames() {
- Set names = super.getPropertyNames();
- names.add(CREATE_DEFAULT_MAIN_CLASS);
- return names;
- }
-
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(FACET_ID))
- return J2EEProjectUtilities.APPLICATION_CLIENT;
- else if (propertyName.equals(CREATE_DEFAULT_MAIN_CLASS))
- return Boolean.TRUE;
- else if (propertyName.equals(CONFIG_FOLDER))
- return CreationConstants.DEFAULT_APPCLIENT_SOURCE_FOLDER;
- else if (propertyName.equals(MODULE_URI)) {
- String projectName = model.getStringProperty(FACET_PROJECT_NAME);
- return projectName + IJ2EEModuleConstants.JAR_EXT;
- }
- return super.getDefaultProperty(propertyName);
- }
-
- protected int convertFacetVersionToJ2EEVersion(IProjectFacetVersion version) {
- return J2EEVersionUtil.convertAppClientVersionStringToJ2EEVersionID(version.getVersionString());
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetInstallDelegate.java b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetInstallDelegate.java
deleted file mode 100644
index 997ad8a32..000000000
--- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetInstallDelegate.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.j2ee.project.facet;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jem.workbench.utility.JemProjectUtilities;
-import org.eclipse.jst.common.project.facet.WtpUtils;
-import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
-import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProperties;
-import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProvider;
-import org.eclipse.jst.j2ee.applicationclient.componentcore.util.AppClientArtifactEdit;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil;
-import org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties;
-import org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModelProvider;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.datamodel.FacetDataModelProvider;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.project.facet.IProductConstants;
-import org.eclipse.wst.project.facet.ProductManager;
-
-public class AppClientFacetInstallDelegate extends J2EEFacetInstallDelegate implements IDelegate {
-
- public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor) throws CoreException {
- if (monitor != null)
- monitor.beginTask("", 1); //$NON-NLS-1$
- try {
- IDataModel model = (IDataModel) config;
- final IJavaProject jproj = JavaCore.create(project);
-
- // Add WTP natures.
- WtpUtils.addNatures(project);
-
- // Setup the flexible project structure.
- final IVirtualComponent c = createFlexibleProject(monitor, project, model, jproj);
-
- // Setup the classpath.
- ClasspathHelper.removeClasspathEntries(project, fv);
- if (!ClasspathHelper.addClasspathEntries(project, fv)) {
- // TODO: Support the no runtime case.
- // ClasspathHelper.addClasspathEntries( project, fv, <something> );
- }
-
-
- // Add main class if necessary
- if (model.getBooleanProperty(IAppClientFacetInstallDataModelProperties.CREATE_DEFAULT_MAIN_CLASS))
- addMainClass(monitor, model, project);
-
- try {
- ((IDataModelOperation) model.getProperty(FacetDataModelProvider.NOTIFICATION_OPERATION)).execute(monitor, null);
- } catch (ExecutionException e) {
- Logger.getLogger().logError(e);
- }
-
- if (monitor != null)
- monitor.worked(1);
- } catch (Exception e) {
- Logger.getLogger().logError(e);
- } finally {
- if (monitor != null)
- monitor.done();
- }
- }
-
- protected IVirtualComponent createFlexibleProject(IProgressMonitor monitor, IProject project, IDataModel model, IJavaProject jproj) throws Exception {
- // Create the directory structure.
- final IWorkspace ws = ResourcesPlugin.getWorkspace();
- final IPath pjpath = project.getFullPath();
-
- final IVirtualComponent c = ComponentCore.createComponent(project);
- c.create(0, null);
- c.setMetaProperty("java-output-path", ProductManager.getProperty(IProductConstants.OUTPUT_FOLDER)); //$NON-NLS-1$
- final IVirtualFolder root = c.getRootFolder();
-
- IFolder sourceFolder = null;
- String configFolder = null;
- configFolder = model.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER);
- root.createLink(new Path("/" + configFolder), 0, null); //$NON-NLS-1$
- String configFolderName = model.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER);
- IPath configFolderpath = pjpath.append(configFolderName);
- sourceFolder = ws.getRoot().getFolder(configFolderpath);
-
- if (!sourceFolder.getFile(J2EEConstants.APP_CLIENT_DD_URI).exists()) {
- String ver = model.getStringProperty(IFacetDataModelProperties.FACET_VERSION_STR);
- int nVer = J2EEVersionUtil.convertVersionStringToInt(ver);
- AppClientArtifactEdit.createDeploymentDescriptor(project, nVer);
- }
-
- // add source folder maps
- final IClasspathEntry[] cp = jproj.getRawClasspath();
- for (int i = 0; i < cp.length; i++) {
- final IClasspathEntry cpe = cp[i];
- if (cpe.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
- root.createLink(cpe.getPath().removeFirstSegments(1), 0, null);
- }
- }
- return c;
- }
-
- private void addMainClass(IProgressMonitor monitor, IDataModel model, IProject project) {
- try {
- IDataModel mainClassDataModel = DataModelFactory.createDataModel(NewJavaClassDataModelProvider.class);
- mainClassDataModel.setProperty(IArtifactEditOperationDataModelProperties.PROJECT_NAME, project.getName());
- mainClassDataModel.setProperty(INewJavaClassDataModelProperties.CLASS_NAME, "Main"); //$NON-NLS-1$
- mainClassDataModel.setBooleanProperty(INewJavaClassDataModelProperties.MAIN_METHOD, true);
- String projRelativeSourcePath = IPath.SEPARATOR + project.getName() + IPath.SEPARATOR + model.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER);
- mainClassDataModel.setProperty(INewJavaClassDataModelProperties.SOURCE_FOLDER, projRelativeSourcePath);
- IJavaProject javaProject = JemProjectUtilities.getJavaProject(project);
- mainClassDataModel.setProperty(INewJavaClassDataModelProperties.JAVA_PACKAGE_FRAGMENT_ROOT, javaProject.getPackageFragmentRoots()[0]);
- mainClassDataModel.getDefaultOperation().execute(monitor, null);
- createManifestEntryForMainClass(monitor, model, project);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- protected void createManifestEntryForMainClass(IProgressMonitor monitor, IDataModel model, IProject project) throws CoreException, InvocationTargetException, InterruptedException {
- IVirtualComponent appClientComponent = ComponentCore.createComponent(project);
- IVirtualFile vf = appClientComponent.getRootFolder().getFile(new Path(J2EEConstants.MANIFEST_URI));
- IFile manifestmf = vf.getUnderlyingFile();
- if (manifestmf == null || !manifestmf.exists()) {
- try {
- createManifest(project, appClientComponent.getRootFolder().getUnderlyingFolder(), monitor);
- } catch (Exception e) {
- Logger.getLogger().logError(e);
- }
- String manifestFolder = IPath.SEPARATOR + model.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER) + IPath.SEPARATOR + J2EEConstants.META_INF;
- IContainer container = project.getFolder(manifestFolder);
- manifestmf = container.getFile(new Path(J2EEConstants.MANIFEST_SHORT_NAME));
- }
- if (model.getBooleanProperty(IAppClientFacetInstallDataModelProperties.CREATE_DEFAULT_MAIN_CLASS)) {
- IDataModel dm = DataModelFactory.createDataModel(UpdateManifestDataModelProvider.class);
- dm.setProperty(UpdateManifestDataModelProperties.PROJECT_NAME, project.getName());
- dm.setBooleanProperty(UpdateManifestDataModelProperties.MERGE, false);
- dm.setProperty(UpdateManifestDataModelProperties.MANIFEST_FILE, manifestmf);
- dm.setProperty(UpdateManifestDataModelProperties.MAIN_CLASS, "Main"); //$NON-NLS-1$
- try {
- dm.getDefaultOperation().execute(monitor, null);
- } catch (Exception e) {
- // Ignore
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetPostInstallDelegate.java b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetPostInstallDelegate.java
deleted file mode 100644
index bc520c379..000000000
--- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/AppClientFacetPostInstallDelegate.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.j2ee.project.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-
-public class AppClientFacetPostInstallDelegate extends J2EEFacetInstallDelegate implements IDelegate {
-
- public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor) throws CoreException {
- if (monitor != null)
- monitor.beginTask("", 1); //$NON-NLS-1$
- try {
- IDataModel model = (IDataModel) config;
-
- final IVirtualComponent c = ComponentCore.createComponent(project);
-
- // Associate with an EAR, if necessary.
- final String earProjectName = (String) model.getProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME);
- if (model.getBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR)) {
- if (earProjectName != null && !earProjectName.equals("")) { //$NON-NLS-1$
- String ver = fv.getVersionString();
-
- String j2eeVersionText = ver;
- installEARFacet(j2eeVersionText, earProjectName, (IRuntime) model.getProperty(IJ2EEFacetInstallDataModelProperties.FACET_RUNTIME), monitor);
- final String moduleURI = model.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.MODULE_URI);
- installAndAddModuletoEAR( j2eeVersionText,
- earProjectName,
- (IRuntime) model.getProperty(IJ2EEFacetInstallDataModelProperties.FACET_RUNTIME),
- project,
- moduleURI,
- monitor );
-
- }
- }
-
- if (monitor != null)
- monitor.worked(1);
- } catch (Exception e) {
- Logger.getLogger().logError(e);
- } finally {
- if (monitor != null)
- monitor.done();
- }
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/IAppClientFacetInstallDataModelProperties.java b/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/IAppClientFacetInstallDataModelProperties.java
deleted file mode 100644
index 3436004d3..000000000
--- a/plugins/org.eclipse.jst.j2ee/appclientcreation/org/eclipse/jst/j2ee/project/facet/IAppClientFacetInstallDataModelProperties.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.j2ee.project.facet;
-
-public interface IAppClientFacetInstallDataModelProperties extends IJ2EEModuleFacetInstallDataModelProperties {
-
- /**
- * Optional, type Boolean. the default value is <code>Boolean.TRUE</code>.If this is true and CREATE_DEFAULT_FILES is true, then a default main
- * class will be generated during component creation.
- */
- public static final String CREATE_DEFAULT_MAIN_CLASS = "IAppClientComponentCreationDataModelProperties.CREATE_DEFAULT_MAIN_CLASS"; //$NON-NLS-1$
-
-}

Back to the top